@pisell/pisellos 0.0.321 → 0.0.325
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/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 +9 -10
- package/dist/modules/Discount/index.js +1 -1
- package/dist/modules/Guests/index.js +9 -9
- package/dist/modules/Payment/index.js +18 -18
- package/dist/modules/Payment/walletpass.js +4 -1
- package/dist/modules/ProductList/index.js +4 -4
- package/dist/modules/Resource/index.js +1 -1
- package/dist/modules/Rules/index.js +2 -3
- package/dist/solution/BookingByStep/index.js +2 -2
- package/dist/solution/BookingTicket/index.js +7 -7
- package/dist/solution/BuyTickets/index.js +7 -8
- package/dist/solution/Checkout/index.js +29 -29
- package/dist/solution/ShopDiscount/index.js +1 -1
- 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 +9 -10
- package/lib/modules/Discount/index.js +1 -1
- package/lib/modules/Guests/index.js +9 -9
- package/lib/modules/Payment/index.js +17 -17
- package/lib/modules/Payment/walletpass.js +3 -1
- package/lib/modules/ProductList/index.js +4 -4
- package/lib/modules/Resource/index.js +1 -1
- package/lib/modules/Rules/index.js +2 -3
- package/lib/solution/BookingByStep/index.js +1 -1
- package/lib/solution/BookingTicket/index.js +6 -6
- package/lib/solution/BuyTickets/index.js +7 -8
- package/lib/solution/Checkout/index.js +28 -28
- package/lib/solution/ShopDiscount/index.js +1 -1
- package/package.json +1 -1
|
@@ -18,7 +18,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
20
|
import { BaseModule } from "../BaseModule";
|
|
21
|
-
import { AccountHooks } from "./types";
|
|
22
21
|
export * from "./types";
|
|
23
22
|
export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
24
23
|
_inherits(AccountModule, _BaseModule);
|
|
@@ -85,7 +84,7 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
85
84
|
this.store.accountInfo = account;
|
|
86
85
|
this.store.isLoggedIn = true;
|
|
87
86
|
_context2.next = 5;
|
|
88
|
-
return this.core.effects.emit(
|
|
87
|
+
return this.core.effects.emit("".concat(this.name, ":onLogin"), account);
|
|
89
88
|
case 5:
|
|
90
89
|
case "end":
|
|
91
90
|
return _context2.stop();
|
|
@@ -117,7 +116,7 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
117
116
|
case 2:
|
|
118
117
|
this.store.accountInfo = _objectSpread(_objectSpread({}, this.store.accountInfo), updates);
|
|
119
118
|
_context3.next = 5;
|
|
120
|
-
return this.core.effects.emit(
|
|
119
|
+
return this.core.effects.emit("".concat(this.name, ":onProfileUpdate"), this.store.accountInfo);
|
|
121
120
|
case 5:
|
|
122
121
|
case "end":
|
|
123
122
|
return _context3.stop();
|
|
@@ -14,4 +14,7 @@ export declare class BaseModule {
|
|
|
14
14
|
store: any;
|
|
15
15
|
cacheKey: string[];
|
|
16
16
|
}): void;
|
|
17
|
+
effectsOn(eventType: string, callback: (payload: any) => void): void;
|
|
18
|
+
effectsOff(eventType: string, callback: (payload: any) => void): void;
|
|
19
|
+
effectsOnce(eventType: string, callback: (payload: any) => void): void;
|
|
17
20
|
}
|
|
@@ -66,6 +66,21 @@ export var BaseModule = /*#__PURE__*/function () {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "effectsOn",
|
|
71
|
+
value: function effectsOn(eventType, callback) {
|
|
72
|
+
this.core.effects.on("".concat(this.name, ":").concat(eventType), callback);
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "effectsOff",
|
|
76
|
+
value: function effectsOff(eventType, callback) {
|
|
77
|
+
this.core.effects.off("".concat(this.name, ":").concat(eventType), callback);
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "effectsOnce",
|
|
81
|
+
value: function effectsOnce(eventType, callback) {
|
|
82
|
+
this.core.effects.once("".concat(this.name, ":").concat(eventType), callback);
|
|
83
|
+
}
|
|
69
84
|
}]);
|
|
70
85
|
return BaseModule;
|
|
71
86
|
}();
|
|
@@ -29,7 +29,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
29
29
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
30
|
import { cloneDeep } from 'lodash-es';
|
|
31
31
|
import { BaseModule } from "../BaseModule";
|
|
32
|
-
import { CustomerHooks } from "./types";
|
|
33
32
|
import { DEFAULT_CUSTOMER, DEFAULT_PAGE_SIZE, SORT_BY } from "./constants";
|
|
34
33
|
export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
35
34
|
_inherits(CustomerModule, _BaseModule);
|
|
@@ -203,7 +202,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
203
202
|
console.error("Failed to ".concat(operation, ":"), error);
|
|
204
203
|
this.store.error = error instanceof Error ? error.message : "Failed to ".concat(operation);
|
|
205
204
|
_context3.next = 4;
|
|
206
|
-
return this.core.effects.emit(
|
|
205
|
+
return this.core.effects.emit("".concat(this.name, ":onCustomerListError"), this.store.error);
|
|
207
206
|
case 4:
|
|
208
207
|
case "end":
|
|
209
208
|
return _context3.stop();
|
|
@@ -266,7 +265,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
266
265
|
// 设置客户列表(替换模式)
|
|
267
266
|
this.store.customerList = cloneDeep(customerList);
|
|
268
267
|
_context4.next = 20;
|
|
269
|
-
return this.core.effects.emit(
|
|
268
|
+
return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
270
269
|
case 20:
|
|
271
270
|
// 触发分页变化事件
|
|
272
271
|
this.triggerPaginationChange({
|
|
@@ -329,7 +328,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
329
328
|
key: "setSelectedCustomer",
|
|
330
329
|
value: function setSelectedCustomer(customer) {
|
|
331
330
|
this.store.selectedCustomer = !customer ? DEFAULT_CUSTOMER : cloneDeep(customer);
|
|
332
|
-
this.core.effects.emit(
|
|
331
|
+
this.core.effects.emit("".concat(this.name, ":onCustomerSelected"), this.store.selectedCustomer);
|
|
333
332
|
this.storeChange();
|
|
334
333
|
}
|
|
335
334
|
|
|
@@ -380,7 +379,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
380
379
|
this.store.hasMore = true;
|
|
381
380
|
this.store.loadingMore = false;
|
|
382
381
|
this.store.searchParams = {};
|
|
383
|
-
this.core.effects.emit(
|
|
382
|
+
this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
384
383
|
this.storeChange();
|
|
385
384
|
}
|
|
386
385
|
|
|
@@ -401,7 +400,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
401
400
|
this.store.total += 1;
|
|
402
401
|
|
|
403
402
|
// 触发客户列表更新事件
|
|
404
|
-
this.core.effects.emit(
|
|
403
|
+
this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
405
404
|
|
|
406
405
|
// 保存状态变化
|
|
407
406
|
this.storeChange();
|
|
@@ -439,7 +438,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
439
438
|
}, {
|
|
440
439
|
key: "triggerPaginationChange",
|
|
441
440
|
value: function triggerPaginationChange(pagination) {
|
|
442
|
-
this.core.effects.emit(
|
|
441
|
+
this.core.effects.emit("".concat(this.name, ":onPaginationChange"), pagination);
|
|
443
442
|
}
|
|
444
443
|
|
|
445
444
|
/**
|
|
@@ -552,7 +551,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
552
551
|
|
|
553
552
|
// 触发滚动加载特定事件
|
|
554
553
|
_context6.next = 20;
|
|
555
|
-
return this.core.effects.emit(
|
|
554
|
+
return this.core.effects.emit("".concat(this.name, ":onScrollLoadMore"), {
|
|
556
555
|
newCustomers: newCustomers,
|
|
557
556
|
allCustomers: this.store.customerList,
|
|
558
557
|
currentPage: page,
|
|
@@ -560,7 +559,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
560
559
|
});
|
|
561
560
|
case 20:
|
|
562
561
|
_context6.next = 22;
|
|
563
|
-
return this.core.effects.emit(
|
|
562
|
+
return this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), this.store);
|
|
564
563
|
case 22:
|
|
565
564
|
// 触发分页变化事件
|
|
566
565
|
this.triggerPaginationChange({
|
|
@@ -634,7 +633,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
634
633
|
case 8:
|
|
635
634
|
response = _context7.sent;
|
|
636
635
|
_context7.next = 11;
|
|
637
|
-
return this.core.effects.emit(
|
|
636
|
+
return this.core.effects.emit("".concat(this.name, ":onScrollLoadComplete"), {
|
|
638
637
|
customers: this.store.customerList,
|
|
639
638
|
total: this.store.total,
|
|
640
639
|
hasMore: this.store.hasMore
|
|
@@ -314,7 +314,7 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
314
314
|
this.store.discountList = [];
|
|
315
315
|
this.core.effects.offByModuleDestroy(this.name);
|
|
316
316
|
_context6.next = 4;
|
|
317
|
-
return this.core.effects.emit(
|
|
317
|
+
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
318
318
|
case 4:
|
|
319
319
|
console.log('[Discount] 已销毁');
|
|
320
320
|
case 5:
|
|
@@ -70,10 +70,10 @@ export var GuestListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
70
70
|
case 0:
|
|
71
71
|
this.state.list.push(guest);
|
|
72
72
|
_context2.next = 3;
|
|
73
|
-
return this.core.effects.emit(
|
|
73
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestAdd"), guest);
|
|
74
74
|
case 3:
|
|
75
75
|
_context2.next = 5;
|
|
76
|
-
return this.core.effects.emit(
|
|
76
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestChange"), this.state.list);
|
|
77
77
|
case 5:
|
|
78
78
|
case "end":
|
|
79
79
|
return _context2.stop();
|
|
@@ -107,7 +107,7 @@ export var GuestListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
107
107
|
return this.core.effects.emit(GuestHooks.OnGuestUpdate, this.state.list[index]);
|
|
108
108
|
case 6:
|
|
109
109
|
_context3.next = 8;
|
|
110
|
-
return this.core.effects.emit(
|
|
110
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestChange"), this.state.list);
|
|
111
111
|
case 8:
|
|
112
112
|
case "end":
|
|
113
113
|
return _context3.stop();
|
|
@@ -138,10 +138,10 @@ export var GuestListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
138
138
|
case 3:
|
|
139
139
|
_this$state$list$spli = this.state.list.splice(index, 1), _this$state$list$spli2 = _slicedToArray(_this$state$list$spli, 1), removed = _this$state$list$spli2[0];
|
|
140
140
|
_context4.next = 6;
|
|
141
|
-
return this.core.effects.emit(
|
|
141
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestRemove"), removed);
|
|
142
142
|
case 6:
|
|
143
143
|
_context4.next = 8;
|
|
144
|
-
return this.core.effects.emit(
|
|
144
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestChange"), this.state.list);
|
|
145
145
|
case 8:
|
|
146
146
|
case "end":
|
|
147
147
|
return _context4.stop();
|
|
@@ -196,10 +196,10 @@ export var GuestListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
196
196
|
case 3:
|
|
197
197
|
guest.items.push(item);
|
|
198
198
|
_context6.next = 6;
|
|
199
|
-
return this.core.effects.emit(
|
|
199
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestUpdate"), guest);
|
|
200
200
|
case 6:
|
|
201
201
|
_context6.next = 8;
|
|
202
|
-
return this.core.effects.emit(
|
|
202
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestChange"), this.state.list);
|
|
203
203
|
case 8:
|
|
204
204
|
case "end":
|
|
205
205
|
return _context6.stop();
|
|
@@ -239,10 +239,10 @@ export var GuestListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
239
239
|
case 6:
|
|
240
240
|
guest.items.splice(index, 1);
|
|
241
241
|
_context7.next = 9;
|
|
242
|
-
return this.core.effects.emit(
|
|
242
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestUpdate"), guest);
|
|
243
243
|
case 9:
|
|
244
244
|
_context7.next = 11;
|
|
245
|
-
return this.core.effects.emit(
|
|
245
|
+
return this.core.effects.emit("".concat(this.name, ":onGuestChange"), this.state.list);
|
|
246
246
|
case 11:
|
|
247
247
|
case "end":
|
|
248
248
|
return _context7.stop();
|
|
@@ -21,7 +21,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
21
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
22
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
23
|
import { BaseModule } from "../BaseModule";
|
|
24
|
-
import { PaymentStatus,
|
|
24
|
+
import { PaymentStatus, PaymentMethodType, RoundingRule } from "./types";
|
|
25
25
|
import { getUniqueId } from "../Cart/utils";
|
|
26
26
|
import { CashPaymentImpl } from "./cash";
|
|
27
27
|
import { EftposPaymentImpl } from "./eftpos";
|
|
@@ -334,7 +334,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
334
334
|
console.warn('[PaymentModule] 无法缓存支付方式,pay_method 表不存在');
|
|
335
335
|
case 43:
|
|
336
336
|
_context3.next = 45;
|
|
337
|
-
return this.core.effects.emit(
|
|
337
|
+
return this.core.effects.emit("".concat(this.name, ":onPaymentMethodsLoaded"), payMethods);
|
|
338
338
|
case 45:
|
|
339
339
|
this.logInfo('getPayMethodListAsync completed successfully', {
|
|
340
340
|
methodCount: payMethods.length,
|
|
@@ -465,7 +465,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
465
465
|
newMethods: newPayMethods
|
|
466
466
|
};
|
|
467
467
|
_context4.next = 54;
|
|
468
|
-
return this.core.effects.emit(
|
|
468
|
+
return this.core.effects.emit("".concat(this.name, ":onPaymentMethodsChanged"), eventData);
|
|
469
469
|
case 54:
|
|
470
470
|
_context4.next = 57;
|
|
471
471
|
break;
|
|
@@ -697,7 +697,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
697
697
|
return this.dbManager.update('order', existingOrder);
|
|
698
698
|
case 15:
|
|
699
699
|
_context7.next = 17;
|
|
700
|
-
return this.core.effects.emit(
|
|
700
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderUpdated"), existingOrder);
|
|
701
701
|
case 17:
|
|
702
702
|
return _context7.abrupt("return", existingOrder);
|
|
703
703
|
case 20:
|
|
@@ -719,7 +719,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
719
719
|
_context7.next = 23;
|
|
720
720
|
return this.dbManager.add('order', newOrder);
|
|
721
721
|
case 23:
|
|
722
|
-
this.core.effects.emit(
|
|
722
|
+
this.core.effects.emit("".concat(this.name, ":onOrderAdded"), newOrder);
|
|
723
723
|
this.logInfo('createPaymentOrderAsync completed - new payment order created', {
|
|
724
724
|
orderUuid: newOrder.uuid,
|
|
725
725
|
orderId: newOrder.id
|
|
@@ -772,7 +772,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
772
772
|
return this.dbManager.delete('order', orderUuid);
|
|
773
773
|
case 7:
|
|
774
774
|
_context8.next = 9;
|
|
775
|
-
return this.core.effects.emit(
|
|
775
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderDeleted"), order);
|
|
776
776
|
case 9:
|
|
777
777
|
console.log('[PaymentModule] 支付订单删除成功:', orderUuid);
|
|
778
778
|
case 10:
|
|
@@ -821,10 +821,10 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
821
821
|
return this.dbManager.update('order', updatedOrder);
|
|
822
822
|
case 9:
|
|
823
823
|
_context9.next = 11;
|
|
824
|
-
return this.core.effects.emit(
|
|
824
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderUpdated"), updatedOrder);
|
|
825
825
|
case 11:
|
|
826
826
|
_context9.next = 13;
|
|
827
|
-
return this.core.effects.emit(
|
|
827
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderChanged"), {
|
|
828
828
|
action: 'update',
|
|
829
829
|
order: updatedOrder,
|
|
830
830
|
originalOrder: order
|
|
@@ -919,10 +919,10 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
919
919
|
return this.dbManager.update('order', updatedOrder);
|
|
920
920
|
case 19:
|
|
921
921
|
_context10.next = 21;
|
|
922
|
-
return this.core.effects.emit(
|
|
922
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderUpdated"), updatedOrder);
|
|
923
923
|
case 21:
|
|
924
924
|
_context10.next = 23;
|
|
925
|
-
return this.core.effects.emit(
|
|
925
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderChanged"), {
|
|
926
926
|
action: 'order_id_replaced',
|
|
927
927
|
order: updatedOrder,
|
|
928
928
|
originalOrder: existingOrder,
|
|
@@ -1119,7 +1119,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1119
1119
|
return this.dbManager.update('order', order);
|
|
1120
1120
|
case 21:
|
|
1121
1121
|
_context13.next = 23;
|
|
1122
|
-
return this.core.effects.emit(
|
|
1122
|
+
return this.core.effects.emit("".concat(this.name, ":onPaymentAdded"), {
|
|
1123
1123
|
orderUuid: orderUuid,
|
|
1124
1124
|
payment: newPaymentItem
|
|
1125
1125
|
});
|
|
@@ -1221,13 +1221,13 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1221
1221
|
return this.dbManager.update('order', order);
|
|
1222
1222
|
case 20:
|
|
1223
1223
|
_context14.next = 22;
|
|
1224
|
-
return this.core.effects.emit(
|
|
1224
|
+
return this.core.effects.emit("".concat(this.name, ":onPaymentDeleted"), {
|
|
1225
1225
|
order: order,
|
|
1226
1226
|
paymentItem: paymentItem
|
|
1227
1227
|
});
|
|
1228
1228
|
case 22:
|
|
1229
1229
|
_context14.next = 24;
|
|
1230
|
-
return this.core.effects.emit(
|
|
1230
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderChanged"), {
|
|
1231
1231
|
action: 'payment_delete',
|
|
1232
1232
|
order: order,
|
|
1233
1233
|
paymentItem: paymentItem
|
|
@@ -1394,7 +1394,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1394
1394
|
case 50:
|
|
1395
1395
|
updatedOrder = _context15.sent;
|
|
1396
1396
|
_context15.next = 53;
|
|
1397
|
-
return this.core.effects.emit(
|
|
1397
|
+
return this.core.effects.emit("".concat(this.name, ":onPaymentAdded"), {
|
|
1398
1398
|
orderUuid: orderUuid,
|
|
1399
1399
|
order: updatedOrder,
|
|
1400
1400
|
payment: null // 批量操作不提供单个支付项
|
|
@@ -1473,13 +1473,13 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1473
1473
|
return this.dbManager.update('order', order);
|
|
1474
1474
|
case 14:
|
|
1475
1475
|
_context16.next = 16;
|
|
1476
|
-
return this.core.effects.emit(
|
|
1476
|
+
return this.core.effects.emit("".concat(this.name, ":onPaymentUpdated"), {
|
|
1477
1477
|
order: order,
|
|
1478
1478
|
paymentItem: paymentItem
|
|
1479
1479
|
});
|
|
1480
1480
|
case 16:
|
|
1481
1481
|
_context16.next = 18;
|
|
1482
|
-
return this.core.effects.emit(
|
|
1482
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderChanged"), {
|
|
1483
1483
|
action: 'payment_update',
|
|
1484
1484
|
order: order,
|
|
1485
1485
|
paymentItem: paymentItem
|
|
@@ -1658,10 +1658,10 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1658
1658
|
return _context18.abrupt("return");
|
|
1659
1659
|
case 12:
|
|
1660
1660
|
_context18.next = 14;
|
|
1661
|
-
return this.core.effects.emit(
|
|
1661
|
+
return this.core.effects.emit("".concat(this.name, ":onPaymentSubmitted"), order);
|
|
1662
1662
|
case 14:
|
|
1663
1663
|
_context18.next = 16;
|
|
1664
|
-
return this.core.effects.emit(
|
|
1664
|
+
return this.core.effects.emit("".concat(this.name, ":onOrderChanged"), {
|
|
1665
1665
|
action: 'submit',
|
|
1666
1666
|
order: order
|
|
1667
1667
|
});
|
|
@@ -40,7 +40,10 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
40
40
|
key: "emitEvent",
|
|
41
41
|
value: function emitEvent(hook, data) {
|
|
42
42
|
try {
|
|
43
|
-
|
|
43
|
+
// 提取事件名称,去掉模块前缀
|
|
44
|
+
var eventName = hook.split(':')[1] || hook.replace(/^[A-Z][a-z]+/, '').replace(/^On/, '').toLowerCase();
|
|
45
|
+
var fullEventName = "".concat(this.paymentModule.name, ":").concat(eventName);
|
|
46
|
+
this.paymentModule.core.effects.emit(fullEventName, data);
|
|
44
47
|
} catch (error) {
|
|
45
48
|
this.paymentModule.logError('[WalletPass] 发送事件失败', error, {
|
|
46
49
|
hook: hook
|
|
@@ -16,7 +16,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
18
|
import { BaseModule } from "../BaseModule";
|
|
19
|
-
import { ProductListHooks } from "./types";
|
|
20
19
|
import { cloneDeep } from 'lodash-es';
|
|
21
20
|
export * from "./types";
|
|
22
21
|
export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
@@ -132,7 +131,8 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
132
131
|
schedule_date: schedule_date,
|
|
133
132
|
with_schedule: with_schedule,
|
|
134
133
|
schedule_datetime: schedule_datetime,
|
|
135
|
-
application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel
|
|
134
|
+
application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel,
|
|
135
|
+
is_eject: 1
|
|
136
136
|
}, {
|
|
137
137
|
useCache: true
|
|
138
138
|
});
|
|
@@ -194,7 +194,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
194
194
|
while (1) switch (_context5.prev = _context5.next) {
|
|
195
195
|
case 0:
|
|
196
196
|
_context5.next = 2;
|
|
197
|
-
return this.core.effects.emit(
|
|
197
|
+
return this.core.effects.emit("".concat(this.name, ":onGetProducts"), this.store.list);
|
|
198
198
|
case 2:
|
|
199
199
|
return _context5.abrupt("return", cloneDeep(this.store.list));
|
|
200
200
|
case 3:
|
|
@@ -217,7 +217,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
217
217
|
while (1) switch (_context6.prev = _context6.next) {
|
|
218
218
|
case 0:
|
|
219
219
|
_context6.next = 2;
|
|
220
|
-
return this.core.effects.emit(
|
|
220
|
+
return this.core.effects.emit("".concat(this.name, ":onGetProduct"), this.store.list);
|
|
221
221
|
case 2:
|
|
222
222
|
product = this.store.list.find(function (product) {
|
|
223
223
|
return product.id === id;
|
|
@@ -89,7 +89,7 @@ export var ResourceListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
89
89
|
case 3:
|
|
90
90
|
this.store.selectedResource = resource;
|
|
91
91
|
_context3.next = 6;
|
|
92
|
-
return this.core.effects.emit(
|
|
92
|
+
return this.core.effects.emit("".concat(this.name, ":onResourceSelect"), resource);
|
|
93
93
|
case 6:
|
|
94
94
|
case "end":
|
|
95
95
|
return _context3.stop();
|
|
@@ -24,7 +24,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
24
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
25
25
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
26
|
import { BaseModule } from "../BaseModule";
|
|
27
|
-
import { RulesHooks } from "./types";
|
|
28
27
|
import { uniqueById, getDiscountAmount } from "../../solution/ShopDiscount/utils";
|
|
29
28
|
import { getProductOriginTotalPrice, getProductTotalPrice } from "../Cart/utils";
|
|
30
29
|
import Decimal from 'decimal.js';
|
|
@@ -73,7 +72,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
73
72
|
case 0:
|
|
74
73
|
this.store.rulesList = rulesList;
|
|
75
74
|
_context2.next = 3;
|
|
76
|
-
return this.core.effects.emit(
|
|
75
|
+
return this.core.effects.emit("".concat(this.name, ":onRulesListChange"), rulesList);
|
|
77
76
|
case 3:
|
|
78
77
|
case "end":
|
|
79
78
|
return _context2.stop();
|
|
@@ -665,7 +664,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
665
664
|
case 0:
|
|
666
665
|
this.core.effects.offByModuleDestroy(this.name);
|
|
667
666
|
_context3.next = 3;
|
|
668
|
-
return this.core.effects.emit(
|
|
667
|
+
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
669
668
|
case 3:
|
|
670
669
|
console.log('[Rules] 已销毁');
|
|
671
670
|
case 4:
|
|
@@ -29,7 +29,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
29
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
30
30
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
31
31
|
import { BaseModule } from "../../modules/BaseModule";
|
|
32
|
-
import {
|
|
32
|
+
import { createModule } from "./types";
|
|
33
33
|
import { getAvailableProductResources } from "./utils/products";
|
|
34
34
|
import { getResourcesByProduct, getTimeSlicesByResource, getTimeSlicesByResources, getIsUsableByTimeItem, getOthersSelectedResources, getOthersCartSelectedResources, filterScheduleByDateRange, checkSessionProductLeadTime, sortCombinedResources, filterResourcesByFormItem, checkTwoResourcesIntersection, isConflict } from "./utils/resources";
|
|
35
35
|
import dayjs from 'dayjs';
|
|
@@ -136,7 +136,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
this.store.schedule.loadAllSchedule();
|
|
139
|
-
this.core.effects.emit(
|
|
139
|
+
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
140
140
|
case 19:
|
|
141
141
|
case "end":
|
|
142
142
|
return _context.stop();
|
|
@@ -18,7 +18,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
20
|
import { BaseModule } from "../../modules/BaseModule";
|
|
21
|
-
import {
|
|
21
|
+
import { createModule } from "./types";
|
|
22
22
|
import Scan from "./utils/scan";
|
|
23
23
|
import { handleGlobalScan, handleCustomerScan, handleUniversalScan } from "./utils/scan/handleScan";
|
|
24
24
|
import scanCache from "./utils/scan/scanCache";
|
|
@@ -109,7 +109,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
109
109
|
throw new Error("\u6A21\u5757 ".concat(step, " \u4E0D\u5B58\u5728"));
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
this.core.effects.emit(
|
|
112
|
+
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
113
113
|
case 19:
|
|
114
114
|
case "end":
|
|
115
115
|
return _context.stop();
|
|
@@ -152,7 +152,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
152
152
|
}));
|
|
153
153
|
case 5:
|
|
154
154
|
result = _context2.sent;
|
|
155
|
-
this.core.effects.emit(
|
|
155
|
+
this.core.effects.emit("".concat(this.name, ":onProductsLoaded"), result);
|
|
156
156
|
return _context2.abrupt("return", result);
|
|
157
157
|
case 10:
|
|
158
158
|
_context2.prev = 10;
|
|
@@ -242,7 +242,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
242
242
|
key: "setActiveCustomer",
|
|
243
243
|
value: function setActiveCustomer(customer) {
|
|
244
244
|
this.store.customer.setSelectedCustomer(customer);
|
|
245
|
-
this.core.effects.emit(
|
|
245
|
+
this.core.effects.emit("".concat(this.name, ":onCustomerSelected"), {
|
|
246
246
|
customer: customer
|
|
247
247
|
});
|
|
248
248
|
}
|
|
@@ -267,7 +267,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
267
267
|
var customer = this.store.customer.getCustomerById(customerId);
|
|
268
268
|
if (customer) {
|
|
269
269
|
this.store.customer.setSelectedCustomer(customer);
|
|
270
|
-
this.core.effects.emit(
|
|
270
|
+
this.core.effects.emit("".concat(this.name, ":onCustomerSelected"), {
|
|
271
271
|
customer: customer
|
|
272
272
|
});
|
|
273
273
|
}
|
|
@@ -398,7 +398,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
398
398
|
return this.store.customer.loadMoreCustomers();
|
|
399
399
|
case 3:
|
|
400
400
|
result = _context6.sent;
|
|
401
|
-
this.core.effects.emit(
|
|
401
|
+
this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), result);
|
|
402
402
|
return _context6.abrupt("return", result);
|
|
403
403
|
case 8:
|
|
404
404
|
_context6.prev = 8;
|
|
@@ -438,7 +438,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
438
438
|
return this.store.customer.resetAndLoadCustomers(params);
|
|
439
439
|
case 4:
|
|
440
440
|
result = _context7.sent;
|
|
441
|
-
this.core.effects.emit(
|
|
441
|
+
this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), result);
|
|
442
442
|
return _context7.abrupt("return", result);
|
|
443
443
|
case 9:
|
|
444
444
|
_context7.prev = 9;
|
|
@@ -24,7 +24,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
24
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
25
25
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
26
|
import { ProductList } from "../../modules/";
|
|
27
|
-
import { BuyTicketsHooks } from "./types";
|
|
28
27
|
import { BaseModule } from "../../modules/BaseModule";
|
|
29
28
|
export * from "./types";
|
|
30
29
|
export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
@@ -72,7 +71,7 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
72
71
|
return this.loadProductsByIds(this.otherParams.prodctIds);
|
|
73
72
|
case 11:
|
|
74
73
|
_context.next = 13;
|
|
75
|
-
return this.core.effects.emit(
|
|
74
|
+
return this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
76
75
|
case 13:
|
|
77
76
|
case "end":
|
|
78
77
|
return _context.stop();
|
|
@@ -112,7 +111,7 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
112
111
|
});
|
|
113
112
|
this.store.mainProducts = mainProducts;
|
|
114
113
|
_context2.next = 8;
|
|
115
|
-
return this.core.effects.emit(
|
|
114
|
+
return this.core.effects.emit("".concat(this.name, ":onMainProductsLoaded"), {});
|
|
116
115
|
case 8:
|
|
117
116
|
case "end":
|
|
118
117
|
return _context2.stop();
|
|
@@ -149,7 +148,7 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
149
148
|
while (1) switch (_context4.prev = _context4.next) {
|
|
150
149
|
case 0:
|
|
151
150
|
_context4.next = 2;
|
|
152
|
-
return this.core.effects.emit(
|
|
151
|
+
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
153
152
|
case 2:
|
|
154
153
|
console.log('[BuyTickets] 已销毁');
|
|
155
154
|
case 3:
|
|
@@ -195,7 +194,7 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
195
194
|
case 11:
|
|
196
195
|
otherData = _context5.t1;
|
|
197
196
|
_context5.next = 14;
|
|
198
|
-
return this.core.effects.emit(
|
|
197
|
+
return this.core.effects.emit("".concat(this.name, ":onGetProducts"), [].concat(_toConsumableArray(mainData), _toConsumableArray(otherData)));
|
|
199
198
|
case 14:
|
|
200
199
|
return _context5.abrupt("return", [].concat(_toConsumableArray(mainData), _toConsumableArray(otherData)));
|
|
201
200
|
case 15:
|
|
@@ -259,7 +258,7 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
259
258
|
while (1) switch (_context7.prev = _context7.next) {
|
|
260
259
|
case 0:
|
|
261
260
|
_context7.next = 2;
|
|
262
|
-
return this.core.effects.emit(
|
|
261
|
+
return this.core.effects.emit("".concat(this.name, ":onListSubmit"), _objectSpread(_objectSpread({}, data), {}, {
|
|
263
262
|
products: this.getProducts()
|
|
264
263
|
}));
|
|
265
264
|
case 2:
|
|
@@ -298,7 +297,7 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
298
297
|
while (1) switch (_context8.prev = _context8.next) {
|
|
299
298
|
case 0:
|
|
300
299
|
_context8.next = 2;
|
|
301
|
-
return this.core.effects.emit(
|
|
300
|
+
return this.core.effects.emit("".concat(this.name, ":onCartSubmit"), _objectSpread(_objectSpread({}, data), {}, {
|
|
302
301
|
products: this.getProducts()
|
|
303
302
|
}));
|
|
304
303
|
case 2:
|
|
@@ -320,7 +319,7 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
320
319
|
while (1) switch (_context9.prev = _context9.next) {
|
|
321
320
|
case 0:
|
|
322
321
|
_context9.next = 2;
|
|
323
|
-
return this.core.effects.emit(
|
|
322
|
+
return this.core.effects.emit("".concat(this.name, ":onCheckoutSubmit"), _objectSpread(_objectSpread({}, data), {}, {
|
|
324
323
|
products: this.getProducts()
|
|
325
324
|
}));
|
|
326
325
|
case 2:
|