@pisell/pisellos 2.1.38 → 2.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/effects/index.d.ts +1 -0
- package/dist/effects/index.js +29 -6
- package/dist/modules/Account/index.js +2 -3
- package/dist/modules/BaseModule.d.ts +3 -0
- package/dist/modules/BaseModule.js +15 -0
- package/dist/modules/Customer/index.js +10 -11
- package/dist/modules/Customer/types.d.ts +2 -2
- package/dist/modules/Customer/types.js +2 -2
- package/dist/modules/Discount/index.js +1 -1
- package/dist/modules/Guests/index.js +9 -9
- package/dist/modules/Order/index.js +5 -5
- package/dist/modules/Order/types.d.ts +1 -0
- package/dist/modules/Payment/index.js +17 -17
- package/dist/modules/Payment/walletpass.js +4 -1
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +2 -3
- package/dist/modules/Resource/index.js +1 -1
- package/dist/modules/Rules/index.js +2 -3
- package/dist/plugins/request.d.ts +1 -0
- package/dist/solution/BookingByStep/index.d.ts +6 -2
- package/dist/solution/BookingByStep/index.js +33 -9
- package/dist/solution/BookingTicket/index.d.ts +4 -0
- package/dist/solution/BookingTicket/index.js +17 -8
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +25 -16
- package/dist/solution/BuyTickets/index.js +7 -8
- package/dist/solution/Checkout/index.js +35 -35
- package/dist/solution/RegisterAndLogin/config.d.ts +87 -0
- package/dist/solution/RegisterAndLogin/config.js +792 -0
- package/dist/solution/RegisterAndLogin/index.d.ts +189 -0
- package/dist/solution/RegisterAndLogin/index.js +2667 -0
- package/dist/solution/RegisterAndLogin/types.d.ts +444 -0
- package/dist/solution/RegisterAndLogin/types.js +231 -0
- package/dist/solution/RegisterAndLogin/utils.d.ts +95 -0
- package/dist/solution/RegisterAndLogin/utils.js +322 -0
- package/dist/solution/ShopDiscount/index.js +36 -19
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/lib/effects/index.d.ts +1 -0
- package/lib/effects/index.js +13 -0
- package/lib/modules/Account/index.js +2 -3
- package/lib/modules/BaseModule.d.ts +3 -0
- package/lib/modules/BaseModule.js +9 -0
- package/lib/modules/Customer/index.js +10 -11
- package/lib/modules/Customer/types.d.ts +2 -2
- package/lib/modules/Customer/types.js +2 -2
- package/lib/modules/Discount/index.js +1 -1
- package/lib/modules/Guests/index.js +9 -9
- package/lib/modules/Order/index.js +6 -3
- package/lib/modules/Order/types.d.ts +1 -0
- package/lib/modules/Payment/index.js +16 -16
- package/lib/modules/Payment/walletpass.js +3 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +2 -3
- package/lib/modules/Resource/index.js +1 -1
- package/lib/modules/Rules/index.js +2 -3
- package/lib/plugins/request.d.ts +1 -0
- package/lib/solution/BookingByStep/index.d.ts +6 -2
- package/lib/solution/BookingByStep/index.js +10 -3
- package/lib/solution/BookingTicket/index.d.ts +4 -0
- package/lib/solution/BookingTicket/index.js +12 -6
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +7 -1
- package/lib/solution/BuyTickets/index.js +7 -8
- package/lib/solution/Checkout/index.js +34 -34
- package/lib/solution/RegisterAndLogin/config.d.ts +87 -0
- package/lib/solution/RegisterAndLogin/config.js +594 -0
- package/lib/solution/RegisterAndLogin/index.d.ts +189 -0
- package/lib/solution/RegisterAndLogin/index.js +1593 -0
- package/lib/solution/RegisterAndLogin/types.d.ts +444 -0
- package/lib/solution/RegisterAndLogin/types.js +78 -0
- package/lib/solution/RegisterAndLogin/utils.d.ts +95 -0
- package/lib/solution/RegisterAndLogin/utils.js +279 -0
- package/lib/solution/ShopDiscount/index.js +19 -11
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +2 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -25,7 +25,6 @@ __export(Customer_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(Customer_exports);
|
|
26
26
|
var import_lodash_es = require("lodash-es");
|
|
27
27
|
var import_BaseModule = require("../BaseModule");
|
|
28
|
-
var import_types = require("./types");
|
|
29
28
|
var import_constants = require("./constants");
|
|
30
29
|
__reExport(Customer_exports, require("./types"), module.exports);
|
|
31
30
|
var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
@@ -102,7 +101,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
102
101
|
skip,
|
|
103
102
|
num,
|
|
104
103
|
sort_by: import_constants.SORT_BY,
|
|
105
|
-
with: ["latestWalletDetail.wallet"],
|
|
104
|
+
with: ["latestWalletDetail.wallet", "contactsInfo"],
|
|
106
105
|
search_wallet_flag: 1,
|
|
107
106
|
search_wallet_pass_flag: 1,
|
|
108
107
|
...search && { search },
|
|
@@ -128,7 +127,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
128
127
|
console.error(`Failed to ${operation}:`, error);
|
|
129
128
|
this.store.error = error instanceof Error ? error.message : `Failed to ${operation}`;
|
|
130
129
|
await this.core.effects.emit(
|
|
131
|
-
|
|
130
|
+
`${this.name}:onCustomerListError`,
|
|
132
131
|
this.store.error
|
|
133
132
|
);
|
|
134
133
|
}
|
|
@@ -150,7 +149,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
150
149
|
this.store.hasMore = page * pageSize < total;
|
|
151
150
|
this.store.customerList = (0, import_lodash_es.cloneDeep)(customerList);
|
|
152
151
|
await this.core.effects.emit(
|
|
153
|
-
|
|
152
|
+
`${this.name}:onCustomerListUpdate`,
|
|
154
153
|
this.store
|
|
155
154
|
);
|
|
156
155
|
this.triggerPaginationChange({
|
|
@@ -193,7 +192,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
193
192
|
setSelectedCustomer(customer) {
|
|
194
193
|
this.store.selectedCustomer = !customer ? import_constants.DEFAULT_CUSTOMER : (0, import_lodash_es.cloneDeep)(customer);
|
|
195
194
|
this.core.effects.emit(
|
|
196
|
-
|
|
195
|
+
`${this.name}:onCustomerSelected`,
|
|
197
196
|
this.store.selectedCustomer
|
|
198
197
|
);
|
|
199
198
|
this.storeChange();
|
|
@@ -233,7 +232,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
233
232
|
this.store.loadingMore = false;
|
|
234
233
|
this.store.searchParams = {};
|
|
235
234
|
this.core.effects.emit(
|
|
236
|
-
|
|
235
|
+
`${this.name}:onCustomerListUpdate`,
|
|
237
236
|
this.store
|
|
238
237
|
);
|
|
239
238
|
this.storeChange();
|
|
@@ -247,7 +246,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
247
246
|
this.store.customerList = [newCustomer, ...this.store.customerList];
|
|
248
247
|
this.store.total += 1;
|
|
249
248
|
this.core.effects.emit(
|
|
250
|
-
|
|
249
|
+
`${this.name}:onCustomerListUpdate`,
|
|
251
250
|
this.store
|
|
252
251
|
);
|
|
253
252
|
this.storeChange();
|
|
@@ -277,7 +276,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
277
276
|
*/
|
|
278
277
|
triggerPaginationChange(pagination) {
|
|
279
278
|
this.core.effects.emit(
|
|
280
|
-
|
|
279
|
+
`${this.name}:onPaginationChange`,
|
|
281
280
|
pagination
|
|
282
281
|
);
|
|
283
282
|
}
|
|
@@ -344,7 +343,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
344
343
|
this.store.total = total;
|
|
345
344
|
this.store.hasMore = page * pageSize < total;
|
|
346
345
|
await this.core.effects.emit(
|
|
347
|
-
|
|
346
|
+
`${this.name}:onScrollLoadMore`,
|
|
348
347
|
{
|
|
349
348
|
newCustomers,
|
|
350
349
|
allCustomers: this.store.customerList,
|
|
@@ -353,7 +352,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
353
352
|
}
|
|
354
353
|
);
|
|
355
354
|
await this.core.effects.emit(
|
|
356
|
-
|
|
355
|
+
`${this.name}:onCustomerListUpdate`,
|
|
357
356
|
this.store
|
|
358
357
|
);
|
|
359
358
|
this.triggerPaginationChange({
|
|
@@ -395,7 +394,7 @@ var CustomerModule = class extends import_BaseModule.BaseModule {
|
|
|
395
394
|
};
|
|
396
395
|
const response = await this.getCustomerList(resetParams);
|
|
397
396
|
await this.core.effects.emit(
|
|
398
|
-
|
|
397
|
+
`${this.name}:onScrollLoadComplete`,
|
|
399
398
|
{
|
|
400
399
|
customers: this.store.customerList,
|
|
401
400
|
total: this.store.total,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ICustomer } from "../AccountList/types";
|
|
2
2
|
export declare enum CustomerHooks {
|
|
3
|
-
OnCustomerListUpdate = "customer:
|
|
3
|
+
OnCustomerListUpdate = "customer:onCustomerListUpdate",
|
|
4
4
|
OnCustomerListError = "customer:onError",
|
|
5
|
-
OnCustomerSelected = "customer:
|
|
5
|
+
OnCustomerSelected = "customer:onCustomerSelected",
|
|
6
6
|
OnPaginationChange = "customer:onPaginationChange",
|
|
7
7
|
OnScrollLoadMore = "customer:onScrollLoadMore",
|
|
8
8
|
OnScrollLoadComplete = "customer:onScrollLoadComplete"
|
|
@@ -23,9 +23,9 @@ __export(types_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(types_exports);
|
|
25
25
|
var CustomerHooks = /* @__PURE__ */ ((CustomerHooks2) => {
|
|
26
|
-
CustomerHooks2["OnCustomerListUpdate"] = "customer:
|
|
26
|
+
CustomerHooks2["OnCustomerListUpdate"] = "customer:onCustomerListUpdate";
|
|
27
27
|
CustomerHooks2["OnCustomerListError"] = "customer:onError";
|
|
28
|
-
CustomerHooks2["OnCustomerSelected"] = "customer:
|
|
28
|
+
CustomerHooks2["OnCustomerSelected"] = "customer:onCustomerSelected";
|
|
29
29
|
CustomerHooks2["OnPaginationChange"] = "customer:onPaginationChange";
|
|
30
30
|
CustomerHooks2["OnScrollLoadMore"] = "customer:onScrollLoadMore";
|
|
31
31
|
CustomerHooks2["OnScrollLoadComplete"] = "customer:onScrollLoadComplete";
|
|
@@ -171,7 +171,7 @@ var DiscountModule = class extends import_BaseModule.BaseModule {
|
|
|
171
171
|
async destroy() {
|
|
172
172
|
this.store.discountList = [];
|
|
173
173
|
this.core.effects.offByModuleDestroy(this.name);
|
|
174
|
-
await this.core.effects.emit(
|
|
174
|
+
await this.core.effects.emit(`${this.name}:onDestroy`, {});
|
|
175
175
|
console.log("[Discount] 已销毁");
|
|
176
176
|
}
|
|
177
177
|
async clear() {
|
|
@@ -41,8 +41,8 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
|
|
|
41
41
|
}
|
|
42
42
|
async addGuest(guest) {
|
|
43
43
|
this.state.list.push(guest);
|
|
44
|
-
await this.core.effects.emit(
|
|
45
|
-
await this.core.effects.emit(
|
|
44
|
+
await this.core.effects.emit(`${this.name}:onGuestAdd`, guest);
|
|
45
|
+
await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
|
|
46
46
|
}
|
|
47
47
|
async updateGuest(id, updates) {
|
|
48
48
|
const index = this.state.list.findIndex((g) => g.id === id);
|
|
@@ -56,15 +56,15 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
|
|
|
56
56
|
import_types.GuestHooks.OnGuestUpdate,
|
|
57
57
|
this.state.list[index]
|
|
58
58
|
);
|
|
59
|
-
await this.core.effects.emit(
|
|
59
|
+
await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
|
|
60
60
|
}
|
|
61
61
|
async removeGuest(id) {
|
|
62
62
|
const index = this.state.list.findIndex((g) => g.id === id);
|
|
63
63
|
if (index === -1)
|
|
64
64
|
return;
|
|
65
65
|
const [removed] = this.state.list.splice(index, 1);
|
|
66
|
-
await this.core.effects.emit(
|
|
67
|
-
await this.core.effects.emit(
|
|
66
|
+
await this.core.effects.emit(`${this.name}:onGuestRemove`, removed);
|
|
67
|
+
await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
|
|
68
68
|
}
|
|
69
69
|
async getGuests() {
|
|
70
70
|
return this.state.list;
|
|
@@ -77,8 +77,8 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
|
|
|
77
77
|
if (!guest)
|
|
78
78
|
return;
|
|
79
79
|
guest.items.push(item);
|
|
80
|
-
await this.core.effects.emit(
|
|
81
|
-
await this.core.effects.emit(
|
|
80
|
+
await this.core.effects.emit(`${this.name}:onGuestUpdate`, guest);
|
|
81
|
+
await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
|
|
82
82
|
}
|
|
83
83
|
async removeItemFromGuest(guestId, itemId) {
|
|
84
84
|
const guest = this.state.list.find((g) => g.id === guestId);
|
|
@@ -88,8 +88,8 @@ var GuestListModule = class extends import_BaseModule.BaseModule {
|
|
|
88
88
|
if (index === -1)
|
|
89
89
|
return;
|
|
90
90
|
guest.items.splice(index, 1);
|
|
91
|
-
await this.core.effects.emit(
|
|
92
|
-
await this.core.effects.emit(
|
|
91
|
+
await this.core.effects.emit(`${this.name}:onGuestUpdate`, guest);
|
|
92
|
+
await this.core.effects.emit(`${this.name}:onGuestChange`, this.state.list);
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -39,7 +39,7 @@ var import_dayjs = __toESM(require("dayjs"));
|
|
|
39
39
|
var OrderModule = class extends import_BaseModule.BaseModule {
|
|
40
40
|
// LoggerManager 实例
|
|
41
41
|
constructor(name, version) {
|
|
42
|
-
super(name, version);
|
|
42
|
+
super(name || "order", version);
|
|
43
43
|
this.defaultName = "order";
|
|
44
44
|
this.defaultVersion = "1.0.0";
|
|
45
45
|
}
|
|
@@ -104,7 +104,8 @@ var OrderModule = class extends import_BaseModule.BaseModule {
|
|
|
104
104
|
schedule_date: "",
|
|
105
105
|
is_deposit: 0,
|
|
106
106
|
relation_products: [],
|
|
107
|
-
relation_forms: []
|
|
107
|
+
relation_forms: [],
|
|
108
|
+
...(params == null ? void 0 : params.extraData) || {}
|
|
108
109
|
};
|
|
109
110
|
let is_deposit = 0;
|
|
110
111
|
if (params.cartItems.length > 0) {
|
|
@@ -120,7 +121,9 @@ var OrderModule = class extends import_BaseModule.BaseModule {
|
|
|
120
121
|
order.relation_forms.push(...relationForms);
|
|
121
122
|
delete item._origin.relation_forms;
|
|
122
123
|
} else {
|
|
123
|
-
const relationForms = (0, import_utils.mergeRelationForms)(
|
|
124
|
+
const relationForms = (0, import_utils.mergeRelationForms)(
|
|
125
|
+
item._origin.relation_forms || []
|
|
126
|
+
);
|
|
124
127
|
item._origin.relation_forms = relationForms;
|
|
125
128
|
order.bookings.push(item._origin);
|
|
126
129
|
}
|
|
@@ -55,7 +55,7 @@ function generateRequestUniqueId() {
|
|
|
55
55
|
}
|
|
56
56
|
var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
57
57
|
constructor(name, version) {
|
|
58
|
-
super(name, version);
|
|
58
|
+
super(name || "payment", version);
|
|
59
59
|
this.defaultName = "pay";
|
|
60
60
|
this.defaultVersion = "1.0.0";
|
|
61
61
|
// LoggerManager 实例
|
|
@@ -193,7 +193,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
193
193
|
console.warn("[PaymentModule] 无法缓存支付方式,pay_method 表不存在");
|
|
194
194
|
}
|
|
195
195
|
await this.core.effects.emit(
|
|
196
|
-
|
|
196
|
+
`${this.name}:onPaymentMethodsLoaded`,
|
|
197
197
|
payMethods
|
|
198
198
|
);
|
|
199
199
|
this.logInfo("getPayMethodListAsync completed successfully", {
|
|
@@ -243,7 +243,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
243
243
|
newMethods: newPayMethods
|
|
244
244
|
};
|
|
245
245
|
await this.core.effects.emit(
|
|
246
|
-
|
|
246
|
+
`${this.name}:onPaymentMethodsChanged`,
|
|
247
247
|
eventData
|
|
248
248
|
);
|
|
249
249
|
} else {
|
|
@@ -368,7 +368,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
368
368
|
const order = await this.dbManager.get("order", orderUuid);
|
|
369
369
|
if (order) {
|
|
370
370
|
await this.dbManager.delete("order", orderUuid);
|
|
371
|
-
await this.core.effects.emit(
|
|
371
|
+
await this.core.effects.emit(`${this.name}:onOrderDeleted`, order);
|
|
372
372
|
console.log("[PaymentModule] 支付订单删除成功:", orderUuid);
|
|
373
373
|
}
|
|
374
374
|
} catch (error) {
|
|
@@ -386,8 +386,8 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
386
386
|
const updatedOrder = { ...order, ...params };
|
|
387
387
|
this.recalculateOrderAmount(updatedOrder);
|
|
388
388
|
await this.dbManager.update("order", updatedOrder);
|
|
389
|
-
await this.core.effects.emit(
|
|
390
|
-
await this.core.effects.emit(
|
|
389
|
+
await this.core.effects.emit(`${this.name}:onOrderUpdated`, updatedOrder);
|
|
390
|
+
await this.core.effects.emit(`${this.name}:onOrderChanged`, {
|
|
391
391
|
action: "update",
|
|
392
392
|
order: updatedOrder,
|
|
393
393
|
originalOrder: order
|
|
@@ -445,8 +445,8 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
445
445
|
}
|
|
446
446
|
};
|
|
447
447
|
await this.dbManager.update("order", updatedOrder);
|
|
448
|
-
await this.core.effects.emit(
|
|
449
|
-
await this.core.effects.emit(
|
|
448
|
+
await this.core.effects.emit(`${this.name}:onOrderUpdated`, updatedOrder);
|
|
449
|
+
await this.core.effects.emit(`${this.name}:onOrderChanged`, {
|
|
450
450
|
action: "order_id_replaced",
|
|
451
451
|
order: updatedOrder,
|
|
452
452
|
originalOrder: existingOrder,
|
|
@@ -563,7 +563,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
563
563
|
order.payment.push(newPaymentItem);
|
|
564
564
|
this.recalculateOrderAmount(order);
|
|
565
565
|
await this.dbManager.update("order", order);
|
|
566
|
-
await this.core.effects.emit(
|
|
566
|
+
await this.core.effects.emit(`${this.name}:onPaymentAdded`, {
|
|
567
567
|
orderUuid,
|
|
568
568
|
payment: newPaymentItem
|
|
569
569
|
});
|
|
@@ -619,11 +619,11 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
619
619
|
});
|
|
620
620
|
this.recalculateOrderAmount(order);
|
|
621
621
|
await this.dbManager.update("order", order);
|
|
622
|
-
await this.core.effects.emit(
|
|
622
|
+
await this.core.effects.emit(`${this.name}:onPaymentDeleted`, {
|
|
623
623
|
order,
|
|
624
624
|
paymentItem
|
|
625
625
|
});
|
|
626
|
-
await this.core.effects.emit(
|
|
626
|
+
await this.core.effects.emit(`${this.name}:onOrderChanged`, {
|
|
627
627
|
action: "payment_delete",
|
|
628
628
|
order,
|
|
629
629
|
paymentItem
|
|
@@ -700,7 +700,7 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
700
700
|
await this.addPaymentItemAsync(orderUuid, voucherItem);
|
|
701
701
|
}
|
|
702
702
|
const updatedOrder = await this.getPaymentOrderByUuidAsync(orderUuid);
|
|
703
|
-
await this.core.effects.emit(
|
|
703
|
+
await this.core.effects.emit(`${this.name}:onPaymentAdded`, {
|
|
704
704
|
orderUuid,
|
|
705
705
|
order: updatedOrder,
|
|
706
706
|
payment: null
|
|
@@ -741,11 +741,11 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
741
741
|
Object.assign(paymentItem, formattedParams);
|
|
742
742
|
this.recalculateOrderAmount(order);
|
|
743
743
|
await this.dbManager.update("order", order);
|
|
744
|
-
await this.core.effects.emit(
|
|
744
|
+
await this.core.effects.emit(`${this.name}:onPaymentUpdated`, {
|
|
745
745
|
order,
|
|
746
746
|
paymentItem
|
|
747
747
|
});
|
|
748
|
-
await this.core.effects.emit(
|
|
748
|
+
await this.core.effects.emit(`${this.name}:onOrderChanged`, {
|
|
749
749
|
action: "payment_update",
|
|
750
750
|
order,
|
|
751
751
|
paymentItem
|
|
@@ -833,8 +833,8 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
|
|
|
833
833
|
});
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
|
-
await this.core.effects.emit(
|
|
837
|
-
await this.core.effects.emit(
|
|
836
|
+
await this.core.effects.emit(`${this.name}:onPaymentSubmitted`, order);
|
|
837
|
+
await this.core.effects.emit(`${this.name}:onOrderChanged`, {
|
|
838
838
|
action: "submit",
|
|
839
839
|
order
|
|
840
840
|
});
|
|
@@ -38,7 +38,9 @@ var WalletPassPaymentImpl = class {
|
|
|
38
38
|
*/
|
|
39
39
|
emitEvent(hook, data) {
|
|
40
40
|
try {
|
|
41
|
-
|
|
41
|
+
const eventName = hook.split(":")[1] || hook.replace(/^[A-Z][a-z]+/, "").replace(/^On/, "").toLowerCase();
|
|
42
|
+
const fullEventName = `${this.paymentModule.name}:${eventName}`;
|
|
43
|
+
this.paymentModule.core.effects.emit(fullEventName, data);
|
|
42
44
|
} catch (error) {
|
|
43
45
|
this.paymentModule.logError("[WalletPass] 发送事件失败", error, { hook });
|
|
44
46
|
}
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "normal" | "duration" | "session";
|
|
53
53
|
}
|
|
@@ -24,7 +24,6 @@ __export(ProductList_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(ProductList_exports);
|
|
26
26
|
var import_BaseModule = require("../BaseModule");
|
|
27
|
-
var import_types = require("./types");
|
|
28
27
|
var import_lodash_es = require("lodash-es");
|
|
29
28
|
__reExport(ProductList_exports, require("./types"), module.exports);
|
|
30
29
|
var ProductList = class extends import_BaseModule.BaseModule {
|
|
@@ -134,14 +133,14 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
134
133
|
}
|
|
135
134
|
async getProducts() {
|
|
136
135
|
await this.core.effects.emit(
|
|
137
|
-
|
|
136
|
+
`${this.name}:onGetProducts`,
|
|
138
137
|
this.store.list
|
|
139
138
|
);
|
|
140
139
|
return (0, import_lodash_es.cloneDeep)(this.store.list);
|
|
141
140
|
}
|
|
142
141
|
async getProduct(id) {
|
|
143
142
|
await this.core.effects.emit(
|
|
144
|
-
|
|
143
|
+
`${this.name}:onGetProduct`,
|
|
145
144
|
this.store.list
|
|
146
145
|
);
|
|
147
146
|
const product = this.store.list.find((product2) => product2.id === id);
|
|
@@ -42,7 +42,7 @@ var ResourceListModule = class extends import_BaseModule.BaseModule {
|
|
|
42
42
|
if (!resource)
|
|
43
43
|
return;
|
|
44
44
|
this.store.selectedResource = resource;
|
|
45
|
-
await this.core.effects.emit(
|
|
45
|
+
await this.core.effects.emit(`${this.name}:onResourceSelect`, resource);
|
|
46
46
|
}
|
|
47
47
|
getSelectedResource() {
|
|
48
48
|
return this.store.selectedResource;
|
|
@@ -33,7 +33,6 @@ __export(Rules_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Rules_exports);
|
|
35
35
|
var import_BaseModule = require("../BaseModule");
|
|
36
|
-
var import_types = require("./types");
|
|
37
36
|
var import_utils = require("../../solution/ShopDiscount/utils");
|
|
38
37
|
var import_utils2 = require("../Cart/utils");
|
|
39
38
|
var import_decimal = __toESM(require("decimal.js"));
|
|
@@ -52,7 +51,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
52
51
|
}
|
|
53
52
|
async setRulesList(rulesList) {
|
|
54
53
|
this.store.rulesList = rulesList;
|
|
55
|
-
await this.core.effects.emit(
|
|
54
|
+
await this.core.effects.emit(`${this.name}:onRulesListChange`, rulesList);
|
|
56
55
|
}
|
|
57
56
|
getRulesList() {
|
|
58
57
|
return this.store.rulesList;
|
|
@@ -489,7 +488,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
|
|
|
489
488
|
}
|
|
490
489
|
async destroy() {
|
|
491
490
|
this.core.effects.offByModuleDestroy(this.name);
|
|
492
|
-
await this.core.effects.emit(
|
|
491
|
+
await this.core.effects.emit(`${this.name}:onDestroy`, {});
|
|
493
492
|
console.log("[Rules] 已销毁");
|
|
494
493
|
}
|
|
495
494
|
async clear() {
|
package/lib/plugins/request.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
166
166
|
* @returns boolean
|
|
167
167
|
*/
|
|
168
168
|
checkBeforeSubmitOrder(type: 'holder' | 'account'): boolean;
|
|
169
|
-
submitOrder(): Promise<void>;
|
|
169
|
+
submitOrder(extraData?: Record<string, any>): Promise<void>;
|
|
170
170
|
pay(): Promise<void>;
|
|
171
171
|
getPayInfo(): Promise<void>;
|
|
172
172
|
setOtherParams(params: Record<string, any>, { cover }?: {
|
|
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
342
342
|
};
|
|
343
343
|
setOtherData(key: string, value: any): void;
|
|
344
344
|
getOtherData(key: string): any;
|
|
345
|
-
getProductTypeById(id: number): Promise<"
|
|
345
|
+
getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
|
|
346
346
|
/**
|
|
347
347
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
348
348
|
*
|
|
@@ -374,4 +374,8 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
374
374
|
isCartHasDurationProduct(): boolean;
|
|
375
375
|
isTargetNormalProduct(product: ProductData): boolean;
|
|
376
376
|
isTargetCartIdNormalProduct(id: string): boolean | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* 获取联系信息
|
|
379
|
+
*/
|
|
380
|
+
getContactInfo(params: any): Promise<any>;
|
|
377
381
|
}
|
|
@@ -116,7 +116,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
this.store.schedule.loadAllSchedule();
|
|
119
|
-
this.core.effects.emit(
|
|
119
|
+
this.core.effects.emit(`${this.name}:onInited`, {});
|
|
120
120
|
}
|
|
121
121
|
// 初始化step
|
|
122
122
|
initStep(stepList) {
|
|
@@ -504,7 +504,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
504
504
|
});
|
|
505
505
|
}
|
|
506
506
|
// 购物车提交订单
|
|
507
|
-
async submitOrder() {
|
|
507
|
+
async submitOrder(extraData) {
|
|
508
508
|
const cartItems = this.store.cart.getItems();
|
|
509
509
|
const newCartItems = (0, import_lodash_es.cloneDeep)(cartItems);
|
|
510
510
|
newCartItems.forEach((item) => {
|
|
@@ -535,7 +535,8 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
535
535
|
query: {
|
|
536
536
|
cartItems: newCartItems,
|
|
537
537
|
type,
|
|
538
|
-
platform: this.platform
|
|
538
|
+
platform: this.platform,
|
|
539
|
+
extraData
|
|
539
540
|
}
|
|
540
541
|
});
|
|
541
542
|
}
|
|
@@ -2748,6 +2749,12 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
2748
2749
|
const cartItem = this.store.cart.getItems().find((n) => n._id === id);
|
|
2749
2750
|
return cartItem && (0, import_utils5.isNormalProduct)(cartItem._productOrigin);
|
|
2750
2751
|
}
|
|
2752
|
+
/**
|
|
2753
|
+
* 获取联系信息
|
|
2754
|
+
*/
|
|
2755
|
+
async getContactInfo(params) {
|
|
2756
|
+
return this.request.get("/customer/metadata", params);
|
|
2757
|
+
}
|
|
2751
2758
|
};
|
|
2752
2759
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2753
2760
|
0 && (module.exports = {
|
|
@@ -22,6 +22,10 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
22
22
|
* @returns 商品列表
|
|
23
23
|
*/
|
|
24
24
|
loadProducts(params?: ILoadProductsParams): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* 初始化外设扫码结果监听
|
|
27
|
+
*/
|
|
28
|
+
initPeripheralsListener(): void;
|
|
25
29
|
/**
|
|
26
30
|
* 获取商品列表(不加载到模块中)
|
|
27
31
|
* @returns 商品列表
|
|
@@ -99,7 +99,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
99
99
|
throw new Error(`模块 ${step} 不存在`);
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
-
this.core.effects.emit(
|
|
102
|
+
this.core.effects.emit(`${this.name}:onInited`, {});
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* 获取商品列表
|
|
@@ -115,13 +115,19 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
115
115
|
...params,
|
|
116
116
|
cacheId: this.cacheId
|
|
117
117
|
});
|
|
118
|
-
this.core.effects.emit(
|
|
118
|
+
this.core.effects.emit(`${this.name}:onProductsLoaded`, result);
|
|
119
119
|
return result;
|
|
120
120
|
} catch (error) {
|
|
121
121
|
console.error("Failed to load products:", error);
|
|
122
122
|
throw error;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* 初始化外设扫码结果监听
|
|
127
|
+
*/
|
|
128
|
+
initPeripheralsListener() {
|
|
129
|
+
this.scan.initPeripheralsListener();
|
|
130
|
+
}
|
|
125
131
|
/**
|
|
126
132
|
* 获取商品列表(不加载到模块中)
|
|
127
133
|
* @returns 商品列表
|
|
@@ -149,7 +155,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
149
155
|
*/
|
|
150
156
|
setActiveCustomer(customer) {
|
|
151
157
|
this.store.customer.setSelectedCustomer(customer);
|
|
152
|
-
this.core.effects.emit(
|
|
158
|
+
this.core.effects.emit(`${this.name}:onCustomerSelected`, {
|
|
153
159
|
customer
|
|
154
160
|
});
|
|
155
161
|
}
|
|
@@ -168,7 +174,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
168
174
|
const customer = this.store.customer.getCustomerById(customerId);
|
|
169
175
|
if (customer) {
|
|
170
176
|
this.store.customer.setSelectedCustomer(customer);
|
|
171
|
-
this.core.effects.emit(
|
|
177
|
+
this.core.effects.emit(`${this.name}:onCustomerSelected`, {
|
|
172
178
|
customer
|
|
173
179
|
});
|
|
174
180
|
}
|
|
@@ -248,7 +254,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
248
254
|
async loadMoreCustomers() {
|
|
249
255
|
try {
|
|
250
256
|
const result = await this.store.customer.loadMoreCustomers();
|
|
251
|
-
this.core.effects.emit(
|
|
257
|
+
this.core.effects.emit(`${this.name}:onCustomerListUpdate`, result);
|
|
252
258
|
return result;
|
|
253
259
|
} catch (error) {
|
|
254
260
|
console.error("Failed to load more customers:", error);
|
|
@@ -263,7 +269,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
|
|
|
263
269
|
async resetAndLoadCustomers(params = {}) {
|
|
264
270
|
try {
|
|
265
271
|
const result = await this.store.customer.resetAndLoadCustomers(params);
|
|
266
|
-
this.core.effects.emit(
|
|
272
|
+
this.core.effects.emit(`${this.name}:onCustomerListReset`, result);
|
|
267
273
|
return result;
|
|
268
274
|
} catch (error) {
|
|
269
275
|
console.error("Failed to reset and load customers:", error);
|
|
@@ -37,9 +37,15 @@ var import_task = __toESM(require("../../../../utils/task"));
|
|
|
37
37
|
var Scan = class {
|
|
38
38
|
constructor(solution, watchKey) {
|
|
39
39
|
this.listenerConfig = /* @__PURE__ */ new Map();
|
|
40
|
-
var _a, _b, _c, _d, _e;
|
|
41
40
|
this.solution = solution;
|
|
42
41
|
this.watchKey = watchKey;
|
|
42
|
+
this.initPeripheralsListener();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 初始化外设扫码结果监听
|
|
46
|
+
*/
|
|
47
|
+
initPeripheralsListener() {
|
|
48
|
+
var _a, _b, _c, _d, _e;
|
|
43
49
|
(_e = (_d = (_c = (_b = (_a = this.solution) == null ? void 0 : _a.window) == null ? void 0 : _b.interaction) == null ? void 0 : _c.utils) == null ? void 0 : _d.mountFunction) == null ? void 0 : _e.call(
|
|
44
50
|
_d,
|
|
45
51
|
"global",
|