@pisell/pisellos 3.0.76 → 3.0.78
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/core/index.js +1 -2
- package/dist/effects/index.d.ts +3 -5
- package/dist/effects/index.js +8 -40
- package/dist/modules/Account/index.js +3 -2
- package/dist/modules/AccountList/index.d.ts +1 -7
- package/dist/modules/AccountList/index.js +14 -81
- package/dist/modules/AccountList/types.d.ts +0 -28
- package/dist/modules/AccountList/types.js +0 -8
- package/dist/modules/BaseModule.d.ts +0 -3
- package/dist/modules/BaseModule.js +0 -15
- package/dist/modules/Cart/index.d.ts +0 -1
- package/dist/modules/Cart/index.js +1 -2
- package/dist/modules/Date/types.d.ts +3 -1
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +1 -1
- package/dist/modules/Guests/index.js +9 -9
- package/dist/modules/Order/index.d.ts +1 -25
- package/dist/modules/Order/index.js +3 -224
- package/dist/modules/Order/types.d.ts +0 -45
- package/dist/modules/Order/types.js +0 -8
- package/dist/modules/Order/utils.js +1 -1
- package/dist/modules/Payment/index.d.ts +9 -184
- package/dist/modules/Payment/index.js +109 -2084
- package/dist/modules/Payment/types.d.ts +30 -772
- package/dist/modules/Payment/types.js +12 -236
- package/dist/modules/ProductList/index.d.ts +1 -12
- package/dist/modules/ProductList/index.js +6 -29
- package/dist/modules/Resource/index.js +1 -1
- package/dist/modules/Rules/index.d.ts +4 -3
- package/dist/modules/Rules/index.js +121 -78
- package/dist/modules/Rules/types.d.ts +6 -1
- package/dist/modules/Rules/types.js +8 -0
- package/dist/modules/Schedule/index.d.ts +0 -9
- package/dist/modules/Schedule/index.js +0 -77
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.js +0 -1
- package/dist/plugins/window.d.ts +0 -1
- package/dist/solution/BookingByStep/index.d.ts +17 -0
- package/dist/solution/BookingByStep/index.js +525 -190
- package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
- package/dist/solution/BookingByStep/utils/products.js +0 -10
- package/dist/solution/BookingByStep/utils/resources.js +4 -0
- package/dist/solution/BuyTickets/index.js +8 -7
- package/dist/solution/ShopDiscount/index.d.ts +12 -10
- package/dist/solution/ShopDiscount/index.js +64 -110
- package/dist/solution/ShopDiscount/types.d.ts +0 -8
- package/dist/solution/ShopDiscount/utils.js +1 -0
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/dist/types/index.d.ts +1 -4
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +3 -5
- package/lib/effects/index.js +1 -17
- package/lib/modules/Account/index.js +3 -2
- package/lib/modules/AccountList/index.d.ts +1 -7
- package/lib/modules/AccountList/index.js +0 -27
- package/lib/modules/AccountList/types.d.ts +0 -28
- package/lib/modules/BaseModule.d.ts +0 -3
- package/lib/modules/BaseModule.js +0 -9
- package/lib/modules/Cart/index.d.ts +0 -1
- package/lib/modules/Cart/index.js +2 -5
- package/lib/modules/Date/types.d.ts +3 -1
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +1 -1
- package/lib/modules/Guests/index.js +9 -9
- package/lib/modules/Order/index.d.ts +1 -25
- package/lib/modules/Order/index.js +1 -186
- package/lib/modules/Order/types.d.ts +0 -45
- package/lib/modules/Order/utils.js +1 -1
- package/lib/modules/Payment/index.d.ts +9 -184
- package/lib/modules/Payment/index.js +51 -1084
- package/lib/modules/Payment/types.d.ts +30 -772
- package/lib/modules/Payment/types.js +6 -79
- package/lib/modules/ProductList/index.d.ts +1 -12
- package/lib/modules/ProductList/index.js +5 -31
- package/lib/modules/Resource/index.js +1 -1
- package/lib/modules/Rules/index.d.ts +4 -3
- package/lib/modules/Rules/index.js +64 -43
- package/lib/modules/Rules/types.d.ts +6 -1
- package/lib/modules/Rules/types.js +11 -2
- package/lib/modules/Schedule/index.d.ts +0 -9
- package/lib/modules/Schedule/index.js +0 -60
- package/lib/modules/index.d.ts +0 -1
- package/lib/modules/index.js +0 -2
- package/lib/plugins/window.d.ts +0 -1
- package/lib/solution/BookingByStep/index.d.ts +17 -0
- package/lib/solution/BookingByStep/index.js +325 -60
- package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
- package/lib/solution/BookingByStep/utils/products.js +2 -8
- package/lib/solution/BookingByStep/utils/resources.js +4 -1
- package/lib/solution/BuyTickets/index.js +8 -7
- package/lib/solution/ShopDiscount/index.d.ts +12 -10
- package/lib/solution/ShopDiscount/index.js +30 -51
- package/lib/solution/ShopDiscount/types.d.ts +0 -8
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/lib/types/index.d.ts +1 -4
- package/package.json +1 -3
- package/dist/modules/Customer/constants.d.ts +0 -7
- package/dist/modules/Customer/constants.js +0 -12
- package/dist/modules/Customer/index.d.ts +0 -122
- package/dist/modules/Customer/index.js +0 -696
- package/dist/modules/Customer/types.d.ts +0 -146
- package/dist/modules/Customer/types.js +0 -41
- package/dist/modules/Payment/cash.d.ts +0 -19
- package/dist/modules/Payment/cash.js +0 -97
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
- package/dist/modules/Payment/eftpos.d.ts +0 -11
- package/dist/modules/Payment/eftpos.js +0 -80
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/utils.d.ts +0 -17
- package/dist/modules/Payment/utils.js +0 -62
- package/dist/modules/Payment/walletpass.d.ts +0 -99
- package/dist/modules/Payment/walletpass.js +0 -711
- package/dist/plugins/app-types/app/app.d.ts +0 -83
- package/dist/plugins/app-types/app/const.d.ts +0 -4
- package/dist/plugins/app-types/app/index.d.ts +0 -14
- package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
- package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
- package/dist/plugins/app-types/config.d.ts +0 -3
- package/dist/plugins/app-types/cookie/index.d.ts +0 -13
- package/dist/plugins/app-types/data/index.d.ts +0 -8
- package/dist/plugins/app-types/history/config.d.ts +0 -24
- package/dist/plugins/app-types/history/index.d.ts +0 -20
- package/dist/plugins/app-types/history/type.d.ts +0 -2
- package/dist/plugins/app-types/hooks/index.d.ts +0 -12
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
- package/dist/plugins/app-types/index.d.ts +0 -6
- package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
- package/dist/plugins/app-types/locales/en.d.ts +0 -3
- package/dist/plugins/app-types/locales/index.d.ts +0 -37
- package/dist/plugins/app-types/locales/original.d.ts +0 -3
- package/dist/plugins/app-types/locales/type.d.ts +0 -19
- package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
- package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
- package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
- package/dist/plugins/app-types/logger/index.d.ts +0 -122
- package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
- package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
- package/dist/plugins/app-types/models/global.d.ts +0 -32
- package/dist/plugins/app-types/models/index.d.ts +0 -45
- package/dist/plugins/app-types/models/type.d.ts +0 -2
- package/dist/plugins/app-types/package.json +0 -15
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
- package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
- package/dist/plugins/app-types/request/cache.d.ts +0 -46
- package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
- package/dist/plugins/app-types/request/config.d.ts +0 -3
- package/dist/plugins/app-types/request/constants.d.ts +0 -2
- package/dist/plugins/app-types/request/index.d.ts +0 -24
- package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
- package/dist/plugins/app-types/request/type.d.ts +0 -41
- package/dist/plugins/app-types/request/utils.d.ts +0 -46
- package/dist/plugins/app-types/routes/config.d.ts +0 -7
- package/dist/plugins/app-types/routes/index.d.ts +0 -28
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
- package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
- package/dist/plugins/app-types/socket/constants.d.ts +0 -33
- package/dist/plugins/app-types/socket/events.d.ts +0 -31
- package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
- package/dist/plugins/app-types/socket/index.d.ts +0 -61
- package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
- package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
- package/dist/plugins/app-types/socket/socket.d.ts +0 -129
- package/dist/plugins/app-types/socket/types.d.ts +0 -85
- package/dist/plugins/app-types/storage/index.d.ts +0 -17
- package/dist/plugins/app-types/tasks/index.d.ts +0 -77
- package/dist/plugins/app-types/tasks/type.d.ts +0 -62
- package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
- package/dist/plugins/app-types/type.d.ts +0 -2
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
- package/dist/plugins/app-types/variables/config.d.ts +0 -3
- package/dist/plugins/app-types/variables/index.d.ts +0 -6
- package/dist/plugins/app-types/variables/type.d.ts +0 -2
- package/dist/plugins/app-types/website/index.d.ts +0 -6
- package/dist/plugins/app.d.ts +0 -8
- package/dist/plugins/app.js +0 -1
- package/dist/solution/BookingTicket/index.d.ts +0 -184
- package/dist/solution/BookingTicket/index.js +0 -698
- package/dist/solution/BookingTicket/types.d.ts +0 -68
- package/dist/solution/BookingTicket/types.js +0 -43
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
- package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/dist/solution/Checkout/index.d.ts +0 -432
- package/dist/solution/Checkout/index.js +0 -4452
- package/dist/solution/Checkout/types.d.ts +0 -727
- package/dist/solution/Checkout/types.js +0 -104
- package/dist/solution/Checkout/utils/index.d.ts +0 -121
- package/dist/solution/Checkout/utils/index.js +0 -511
- package/dist/utils/task.d.ts +0 -40
- package/dist/utils/task.js +0 -171
- package/dist/utils/watch.d.ts +0 -102
- package/dist/utils/watch.js +0 -294
- package/lib/modules/Customer/constants.d.ts +0 -7
- package/lib/modules/Customer/constants.js +0 -39
- package/lib/modules/Customer/index.d.ts +0 -122
- package/lib/modules/Customer/index.js +0 -439
- package/lib/modules/Customer/types.d.ts +0 -146
- package/lib/modules/Customer/types.js +0 -37
- package/lib/modules/Payment/cash.d.ts +0 -19
- package/lib/modules/Payment/cash.js +0 -64
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
- package/lib/modules/Payment/eftpos.d.ts +0 -11
- package/lib/modules/Payment/eftpos.js +0 -51
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/utils.d.ts +0 -17
- package/lib/modules/Payment/utils.js +0 -67
- package/lib/modules/Payment/walletpass.d.ts +0 -99
- package/lib/modules/Payment/walletpass.js +0 -484
- package/lib/plugins/app-types/app/app.d.ts +0 -83
- package/lib/plugins/app-types/app/const.d.ts +0 -4
- package/lib/plugins/app-types/app/index.d.ts +0 -14
- package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
- package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
- package/lib/plugins/app-types/config.d.ts +0 -3
- package/lib/plugins/app-types/cookie/index.d.ts +0 -13
- package/lib/plugins/app-types/data/index.d.ts +0 -8
- package/lib/plugins/app-types/history/config.d.ts +0 -24
- package/lib/plugins/app-types/history/index.d.ts +0 -20
- package/lib/plugins/app-types/history/type.d.ts +0 -2
- package/lib/plugins/app-types/hooks/index.d.ts +0 -12
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
- package/lib/plugins/app-types/index.d.ts +0 -6
- package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
- package/lib/plugins/app-types/locales/en.d.ts +0 -3
- package/lib/plugins/app-types/locales/index.d.ts +0 -37
- package/lib/plugins/app-types/locales/original.d.ts +0 -3
- package/lib/plugins/app-types/locales/type.d.ts +0 -19
- package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
- package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
- package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
- package/lib/plugins/app-types/logger/index.d.ts +0 -122
- package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
- package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
- package/lib/plugins/app-types/models/global.d.ts +0 -32
- package/lib/plugins/app-types/models/index.d.ts +0 -45
- package/lib/plugins/app-types/models/type.d.ts +0 -2
- package/lib/plugins/app-types/package.json +0 -15
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
- package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
- package/lib/plugins/app-types/request/cache.d.ts +0 -46
- package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
- package/lib/plugins/app-types/request/config.d.ts +0 -3
- package/lib/plugins/app-types/request/constants.d.ts +0 -2
- package/lib/plugins/app-types/request/index.d.ts +0 -24
- package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
- package/lib/plugins/app-types/request/type.d.ts +0 -41
- package/lib/plugins/app-types/request/utils.d.ts +0 -46
- package/lib/plugins/app-types/routes/config.d.ts +0 -7
- package/lib/plugins/app-types/routes/index.d.ts +0 -28
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
- package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
- package/lib/plugins/app-types/socket/constants.d.ts +0 -33
- package/lib/plugins/app-types/socket/events.d.ts +0 -31
- package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
- package/lib/plugins/app-types/socket/index.d.ts +0 -61
- package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
- package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
- package/lib/plugins/app-types/socket/socket.d.ts +0 -129
- package/lib/plugins/app-types/socket/types.d.ts +0 -85
- package/lib/plugins/app-types/storage/index.d.ts +0 -17
- package/lib/plugins/app-types/tasks/index.d.ts +0 -77
- package/lib/plugins/app-types/tasks/type.d.ts +0 -62
- package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
- package/lib/plugins/app-types/type.d.ts +0 -2
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
- package/lib/plugins/app-types/variables/config.d.ts +0 -3
- package/lib/plugins/app-types/variables/index.d.ts +0 -6
- package/lib/plugins/app-types/variables/type.d.ts +0 -2
- package/lib/plugins/app-types/website/index.d.ts +0 -6
- package/lib/plugins/app.d.ts +0 -8
- package/lib/plugins/app.js +0 -17
- package/lib/solution/BookingTicket/index.d.ts +0 -184
- package/lib/solution/BookingTicket/index.js +0 -426
- package/lib/solution/BookingTicket/types.d.ts +0 -68
- package/lib/solution/BookingTicket/types.js +0 -72
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
- package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/index.d.ts +0 -432
- package/lib/solution/Checkout/index.js +0 -2776
- package/lib/solution/Checkout/types.d.ts +0 -727
- package/lib/solution/Checkout/types.js +0 -63
- package/lib/solution/Checkout/utils/index.d.ts +0 -121
- package/lib/solution/Checkout/utils/index.js +0 -362
- package/lib/utils/task.d.ts +0 -40
- package/lib/utils/task.js +0 -109
- package/lib/utils/watch.d.ts +0 -102
- package/lib/utils/watch.js +0 -217
package/dist/core/index.js
CHANGED
|
@@ -67,8 +67,7 @@ var PisellOSCore = /*#__PURE__*/function () {
|
|
|
67
67
|
console.log("".concat(prefix, " ").concat(message));
|
|
68
68
|
break;
|
|
69
69
|
case 'warn':
|
|
70
|
-
|
|
71
|
-
console.log("%c".concat(prefix, "%c ").concat(message), 'color: #f59e0b; font-weight: bold;', 'color: #f59e0b;');
|
|
70
|
+
console.warn("".concat(prefix, " ").concat(message));
|
|
72
71
|
break;
|
|
73
72
|
case 'error':
|
|
74
73
|
console.error("".concat(prefix, " ").concat(message));
|
package/dist/effects/index.d.ts
CHANGED
|
@@ -2,18 +2,16 @@ type EffectCallback = (payload: any) => void | Promise<void | {
|
|
|
2
2
|
status: boolean;
|
|
3
3
|
message?: string;
|
|
4
4
|
}>;
|
|
5
|
-
type UnsubscribeFunction = () => void;
|
|
6
5
|
declare class EffectsManager {
|
|
7
6
|
private listeners;
|
|
8
|
-
on(event: string, callback: EffectCallback):
|
|
9
|
-
only(event: string, callback: EffectCallback): UnsubscribeFunction;
|
|
7
|
+
on(event: string, callback: EffectCallback): void;
|
|
10
8
|
off(event: string, callback: EffectCallback): void;
|
|
11
9
|
offByModuleDestroy(module: string): void;
|
|
12
|
-
once(event: string, callback: EffectCallback):
|
|
10
|
+
once(event: string, callback: EffectCallback): void;
|
|
13
11
|
emit(event: string, payload: any): Promise<{
|
|
14
12
|
status: boolean;
|
|
15
13
|
data: any;
|
|
16
14
|
}>;
|
|
17
15
|
clear(): void;
|
|
18
16
|
}
|
|
19
|
-
export { EffectsManager
|
|
17
|
+
export { EffectsManager };
|
package/dist/effects/index.js
CHANGED
|
@@ -11,7 +11,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
11
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
13
|
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); }
|
|
14
|
-
// 取消监听函数类型
|
|
15
14
|
var EffectsManager = /*#__PURE__*/function () {
|
|
16
15
|
function EffectsManager() {
|
|
17
16
|
_classCallCheck(this, EffectsManager);
|
|
@@ -20,61 +19,32 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
20
19
|
_createClass(EffectsManager, [{
|
|
21
20
|
key: "on",
|
|
22
21
|
value: function on(event, callback) {
|
|
23
|
-
var _this$listeners$get
|
|
24
|
-
_this = this;
|
|
22
|
+
var _this$listeners$get;
|
|
25
23
|
if (!this.listeners.has(event)) this.listeners.set(event, new Set());
|
|
26
24
|
(_this$listeners$get = this.listeners.get(event)) === null || _this$listeners$get === void 0 || _this$listeners$get.add(callback);
|
|
27
|
-
|
|
28
|
-
// 返回取消函数
|
|
29
|
-
return function () {
|
|
30
|
-
_this.off(event, callback);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 设置单例监听器,只能存在一个,新的会替换旧的
|
|
35
|
-
}, {
|
|
36
|
-
key: "only",
|
|
37
|
-
value: function only(event, callback) {
|
|
38
|
-
var _this$listeners$get3,
|
|
39
|
-
_this2 = this;
|
|
40
|
-
// 清除该事件的所有现有监听器
|
|
41
|
-
if (this.listeners.has(event)) {
|
|
42
|
-
var _this$listeners$get2;
|
|
43
|
-
(_this$listeners$get2 = this.listeners.get(event)) === null || _this$listeners$get2 === void 0 || _this$listeners$get2.clear();
|
|
44
|
-
} else {
|
|
45
|
-
this.listeners.set(event, new Set());
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// 添加新的监听器
|
|
49
|
-
(_this$listeners$get3 = this.listeners.get(event)) === null || _this$listeners$get3 === void 0 || _this$listeners$get3.add(callback);
|
|
50
|
-
|
|
51
|
-
// 返回取消函数
|
|
52
|
-
return function () {
|
|
53
|
-
_this2.off(event, callback);
|
|
54
|
-
};
|
|
55
25
|
}
|
|
56
26
|
}, {
|
|
57
27
|
key: "off",
|
|
58
28
|
value: function off(event, callback) {
|
|
59
|
-
var _this$listeners$
|
|
60
|
-
(_this$listeners$
|
|
29
|
+
var _this$listeners$get2;
|
|
30
|
+
(_this$listeners$get2 = this.listeners.get(event)) === null || _this$listeners$get2 === void 0 || _this$listeners$get2.delete(callback);
|
|
61
31
|
}
|
|
62
32
|
|
|
63
33
|
// 模块销毁时,删除所有以模块名开头的监听
|
|
64
34
|
}, {
|
|
65
35
|
key: "offByModuleDestroy",
|
|
66
36
|
value: function offByModuleDestroy(module) {
|
|
67
|
-
var
|
|
37
|
+
var _this = this;
|
|
68
38
|
Array.from(this.listeners.keys()).forEach(function (item) {
|
|
69
39
|
if (item.startsWith(module)) {
|
|
70
|
-
|
|
40
|
+
_this.listeners.delete(item);
|
|
71
41
|
}
|
|
72
42
|
});
|
|
73
43
|
}
|
|
74
44
|
}, {
|
|
75
45
|
key: "once",
|
|
76
46
|
value: function once(event, callback) {
|
|
77
|
-
var
|
|
47
|
+
var _this2 = this;
|
|
78
48
|
var wrapper = /*#__PURE__*/function () {
|
|
79
49
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(payload) {
|
|
80
50
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -83,7 +53,7 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
83
53
|
_context.next = 2;
|
|
84
54
|
return callback(payload);
|
|
85
55
|
case 2:
|
|
86
|
-
|
|
56
|
+
_this2.off(event, wrapper);
|
|
87
57
|
case 3:
|
|
88
58
|
case "end":
|
|
89
59
|
return _context.stop();
|
|
@@ -94,9 +64,7 @@ var EffectsManager = /*#__PURE__*/function () {
|
|
|
94
64
|
return _ref.apply(this, arguments);
|
|
95
65
|
};
|
|
96
66
|
}();
|
|
97
|
-
|
|
98
|
-
// 调用修改后的on方法,它会返回取消函数
|
|
99
|
-
return this.on(event, wrapper);
|
|
67
|
+
this.on(event, wrapper);
|
|
100
68
|
}
|
|
101
69
|
}, {
|
|
102
70
|
key: "emit",
|
|
@@ -18,6 +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 "../BaseModule";
|
|
21
|
+
import { AccountHooks } from "./types";
|
|
21
22
|
export * from "./types";
|
|
22
23
|
export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
23
24
|
_inherits(AccountModule, _BaseModule);
|
|
@@ -84,7 +85,7 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
84
85
|
this.store.accountInfo = account;
|
|
85
86
|
this.store.isLoggedIn = true;
|
|
86
87
|
_context2.next = 5;
|
|
87
|
-
return this.core.effects.emit(
|
|
88
|
+
return this.core.effects.emit(AccountHooks.OnLogin, account);
|
|
88
89
|
case 5:
|
|
89
90
|
case "end":
|
|
90
91
|
return _context2.stop();
|
|
@@ -116,7 +117,7 @@ export var AccountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
116
117
|
case 2:
|
|
117
118
|
this.store.accountInfo = _objectSpread(_objectSpread({}, this.store.accountInfo), updates);
|
|
118
119
|
_context3.next = 5;
|
|
119
|
-
return this.core.effects.emit(
|
|
120
|
+
return this.core.effects.emit(AccountHooks.OnProfileUpdate, this.store.accountInfo);
|
|
120
121
|
case 5:
|
|
121
122
|
case "end":
|
|
122
123
|
return _context3.stop();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { AccountModule, Account } from '../Account';
|
|
3
3
|
import { BaseModule } from '../BaseModule';
|
|
4
|
-
import { IFetchHolderAccountsParams, IHolder
|
|
4
|
+
import { IFetchHolderAccountsParams, IHolder } from './types';
|
|
5
5
|
export declare class AccountListModule extends BaseModule implements Module {
|
|
6
6
|
protected defaultName: string;
|
|
7
7
|
protected defaultVersion: string;
|
|
@@ -37,12 +37,6 @@ export declare class AccountListModule extends BaseModule implements Module {
|
|
|
37
37
|
customerId: number;
|
|
38
38
|
type?: 'unshift' | 'push';
|
|
39
39
|
}): Promise<AccountModule[]>;
|
|
40
|
-
/**
|
|
41
|
-
* 获取客户列表
|
|
42
|
-
* @param params 查询参数
|
|
43
|
-
* @returns 客户列表
|
|
44
|
-
*/
|
|
45
|
-
getCustomerList(params?: IGetCustomerListParams): Promise<any>;
|
|
46
40
|
/**
|
|
47
41
|
* 获取holder类型账户列表
|
|
48
42
|
* @param params
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
var _excluded = ["page", "pageSize", "keyword"];
|
|
2
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
2
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
8
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
9
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -509,68 +504,6 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
509
504
|
}
|
|
510
505
|
return addHolderAccounts;
|
|
511
506
|
}()
|
|
512
|
-
/**
|
|
513
|
-
* 获取客户列表
|
|
514
|
-
* @param params 查询参数
|
|
515
|
-
* @returns 客户列表
|
|
516
|
-
*/
|
|
517
|
-
)
|
|
518
|
-
}, {
|
|
519
|
-
key: "getCustomerList",
|
|
520
|
-
value: (function () {
|
|
521
|
-
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
522
|
-
var params,
|
|
523
|
-
url,
|
|
524
|
-
_params$page,
|
|
525
|
-
page,
|
|
526
|
-
_params$pageSize,
|
|
527
|
-
pageSize,
|
|
528
|
-
keyword,
|
|
529
|
-
otherParams,
|
|
530
|
-
queryParams,
|
|
531
|
-
res,
|
|
532
|
-
_args9 = arguments;
|
|
533
|
-
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
534
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
535
|
-
case 0:
|
|
536
|
-
params = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
|
|
537
|
-
url = '/customer/es/data';
|
|
538
|
-
_params$page = params.page, page = _params$page === void 0 ? 1 : _params$page, _params$pageSize = params.pageSize, pageSize = _params$pageSize === void 0 ? 20 : _params$pageSize, keyword = params.keyword, otherParams = _objectWithoutProperties(params, _excluded);
|
|
539
|
-
_context9.prev = 3;
|
|
540
|
-
this.store.isLoading = true;
|
|
541
|
-
this.store.error = null;
|
|
542
|
-
queryParams = _objectSpread(_objectSpread({
|
|
543
|
-
page: page,
|
|
544
|
-
pageSize: pageSize
|
|
545
|
-
}, keyword && {
|
|
546
|
-
keyword: keyword
|
|
547
|
-
}), otherParams);
|
|
548
|
-
_context9.next = 9;
|
|
549
|
-
return this.request.get(url, queryParams);
|
|
550
|
-
case 9:
|
|
551
|
-
res = _context9.sent;
|
|
552
|
-
return _context9.abrupt("return", (res === null || res === void 0 ? void 0 : res.data) || []);
|
|
553
|
-
case 13:
|
|
554
|
-
_context9.prev = 13;
|
|
555
|
-
_context9.t0 = _context9["catch"](3);
|
|
556
|
-
console.error('Failed to fetch customer list:', _context9.t0);
|
|
557
|
-
this.store.error = _context9.t0 instanceof Error ? _context9.t0.message : 'Failed to fetch customer list';
|
|
558
|
-
throw _context9.t0;
|
|
559
|
-
case 18:
|
|
560
|
-
_context9.prev = 18;
|
|
561
|
-
this.store.isLoading = false;
|
|
562
|
-
return _context9.finish(18);
|
|
563
|
-
case 21:
|
|
564
|
-
case "end":
|
|
565
|
-
return _context9.stop();
|
|
566
|
-
}
|
|
567
|
-
}, _callee9, this, [[3, 13, 18, 21]]);
|
|
568
|
-
}));
|
|
569
|
-
function getCustomerList() {
|
|
570
|
-
return _getCustomerList.apply(this, arguments);
|
|
571
|
-
}
|
|
572
|
-
return getCustomerList;
|
|
573
|
-
}()
|
|
574
507
|
/**
|
|
575
508
|
* 获取holder类型账户列表
|
|
576
509
|
* @param params
|
|
@@ -579,15 +512,15 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
579
512
|
}, {
|
|
580
513
|
key: "fetchHolderAccounts",
|
|
581
514
|
value: (function () {
|
|
582
|
-
var _fetchHolderAccounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
515
|
+
var _fetchHolderAccounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(params) {
|
|
583
516
|
var url, _ref, form_id, shop_id, num, skip, customer_id, _res$data, res;
|
|
584
|
-
return _regeneratorRuntime().wrap(function
|
|
585
|
-
while (1) switch (
|
|
517
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
518
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
586
519
|
case 0:
|
|
587
520
|
url = params.url || '/account/holder';
|
|
588
521
|
_ref = (params === null || params === void 0 ? void 0 : params.query) || {}, form_id = _ref.form_id, shop_id = _ref.shop_id, num = _ref.num, skip = _ref.skip, customer_id = _ref.customer_id;
|
|
589
|
-
|
|
590
|
-
|
|
522
|
+
_context9.prev = 2;
|
|
523
|
+
_context9.next = 5;
|
|
591
524
|
return this.request.get(url, {
|
|
592
525
|
customer_id: customer_id,
|
|
593
526
|
form_id: form_id,
|
|
@@ -596,30 +529,30 @@ export var AccountListModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
596
529
|
skip: skip || 1
|
|
597
530
|
});
|
|
598
531
|
case 5:
|
|
599
|
-
res =
|
|
532
|
+
res = _context9.sent;
|
|
600
533
|
this.store.accountList = [];
|
|
601
534
|
this.store.accounts = [];
|
|
602
535
|
if (!(res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && (_res$data = _res$data.list) !== null && _res$data !== void 0 && _res$data.length)) {
|
|
603
|
-
|
|
536
|
+
_context9.next = 11;
|
|
604
537
|
break;
|
|
605
538
|
}
|
|
606
|
-
|
|
539
|
+
_context9.next = 11;
|
|
607
540
|
return this.addHolderAccounts({
|
|
608
541
|
holders: res.data.list,
|
|
609
542
|
customerId: customer_id
|
|
610
543
|
});
|
|
611
544
|
case 11:
|
|
612
|
-
|
|
545
|
+
_context9.next = 16;
|
|
613
546
|
break;
|
|
614
547
|
case 13:
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
console.error(
|
|
548
|
+
_context9.prev = 13;
|
|
549
|
+
_context9.t0 = _context9["catch"](2);
|
|
550
|
+
console.error(_context9.t0);
|
|
618
551
|
case 16:
|
|
619
552
|
case "end":
|
|
620
|
-
return
|
|
553
|
+
return _context9.stop();
|
|
621
554
|
}
|
|
622
|
-
},
|
|
555
|
+
}, _callee9, this, [[2, 13]]);
|
|
623
556
|
}));
|
|
624
557
|
function fetchHolderAccounts(_x11) {
|
|
625
558
|
return _fetchHolderAccounts.apply(this, arguments);
|
|
@@ -67,31 +67,3 @@ export interface IHolder {
|
|
|
67
67
|
main_field: string;
|
|
68
68
|
customer_cover?: string;
|
|
69
69
|
}
|
|
70
|
-
/**
|
|
71
|
-
* 获取客户列表参数
|
|
72
|
-
*/
|
|
73
|
-
export interface IGetCustomerListParams {
|
|
74
|
-
/** 页码 */
|
|
75
|
-
page?: number;
|
|
76
|
-
/** 每页数量 */
|
|
77
|
-
pageSize?: number;
|
|
78
|
-
/** 搜索关键词 */
|
|
79
|
-
keyword?: string;
|
|
80
|
-
/** 其他筛选参数 */
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* 客户数据
|
|
85
|
-
*/
|
|
86
|
-
export interface ICustomer {
|
|
87
|
-
/** 客户ID */
|
|
88
|
-
id: string | number;
|
|
89
|
-
/** 客户姓名 */
|
|
90
|
-
name: string;
|
|
91
|
-
/** 客户电话 */
|
|
92
|
-
phone?: string;
|
|
93
|
-
/** 客户邮箱 */
|
|
94
|
-
email?: string;
|
|
95
|
-
/** 其他客户信息 */
|
|
96
|
-
[key: string]: any;
|
|
97
|
-
}
|
|
@@ -14,7 +14,4 @@ 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;
|
|
20
17
|
}
|
|
@@ -64,21 +64,6 @@ export var BaseModule = /*#__PURE__*/function () {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
}, {
|
|
68
|
-
key: "effectsOn",
|
|
69
|
-
value: function effectsOn(eventType, callback) {
|
|
70
|
-
return this.core.effects.on("".concat(this.name, ":").concat(eventType), callback);
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "effectsOff",
|
|
74
|
-
value: function effectsOff(eventType, callback) {
|
|
75
|
-
return this.core.effects.off("".concat(this.name, ":").concat(eventType), callback);
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
key: "effectsOnce",
|
|
79
|
-
value: function effectsOnce(eventType, callback) {
|
|
80
|
-
return this.core.effects.once("".concat(this.name, ":").concat(eventType), callback);
|
|
81
|
-
}
|
|
82
67
|
}]);
|
|
83
68
|
return BaseModule;
|
|
84
69
|
}();
|
|
@@ -3,7 +3,6 @@ import { BaseModule } from '../BaseModule';
|
|
|
3
3
|
import { CartItem, CartModuleAPI, ECartItemCheckType, ECartItemInfoType, IAddItemParams, IUpdateItemParams } from './types';
|
|
4
4
|
import { Account } from '../Account';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export { getProductDeposit } from './utils';
|
|
7
6
|
/**
|
|
8
7
|
* 购物车模块实现
|
|
9
8
|
*/
|
|
@@ -29,7 +29,6 @@ import { createCartItemOrigin, deleteHolderFromCartItem, deleteRelationFormsFrom
|
|
|
29
29
|
import { cloneDeep } from 'lodash-es';
|
|
30
30
|
import { isNormalProduct } from "../Product/utils";
|
|
31
31
|
export * from "./types";
|
|
32
|
-
export { getProductDeposit } from "./utils";
|
|
33
32
|
|
|
34
33
|
/**
|
|
35
34
|
* 购物车模块实现
|
|
@@ -40,7 +39,7 @@ export var CartModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
40
39
|
function CartModule(name, version) {
|
|
41
40
|
var _this;
|
|
42
41
|
_classCallCheck(this, CartModule);
|
|
43
|
-
_this = _super.call(this, name
|
|
42
|
+
_this = _super.call(this, name, version);
|
|
44
43
|
// 提供给 baseModule 用的默认名称 和 默认版本
|
|
45
44
|
_defineProperty(_assertThisInitialized(_this), "defaultName", 'cart');
|
|
46
45
|
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
@@ -20,7 +20,9 @@ export interface ITime {
|
|
|
20
20
|
date: string;
|
|
21
21
|
week: string;
|
|
22
22
|
weekNum: number;
|
|
23
|
-
status: 'unavailable' | 'available';
|
|
23
|
+
status: 'unavailable' | 'available' | 'lots_of_space' | 'filling_up_fast' | 'sold_out';
|
|
24
|
+
summaryCount?: number;
|
|
25
|
+
availableCount?: number;
|
|
24
26
|
resource?: any[];
|
|
25
27
|
color?: string[];
|
|
26
28
|
}
|
|
@@ -315,7 +315,7 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
315
315
|
this.store.discountList = [];
|
|
316
316
|
this.core.effects.offByModuleDestroy(this.name);
|
|
317
317
|
_context6.next = 4;
|
|
318
|
-
return this.core.effects.emit(
|
|
318
|
+
return this.core.effects.emit(DiscountHooks.OnDestroy, {});
|
|
319
319
|
case 4:
|
|
320
320
|
console.log('[Discount] 已销毁');
|
|
321
321
|
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(GuestHooks.OnGuestAdd, guest);
|
|
74
74
|
case 3:
|
|
75
75
|
_context2.next = 5;
|
|
76
|
-
return this.core.effects.emit(
|
|
76
|
+
return this.core.effects.emit(GuestHooks.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(GuestHooks.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(GuestHooks.OnGuestRemove, removed);
|
|
142
142
|
case 6:
|
|
143
143
|
_context4.next = 8;
|
|
144
|
-
return this.core.effects.emit(
|
|
144
|
+
return this.core.effects.emit(GuestHooks.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(GuestHooks.OnGuestUpdate, guest);
|
|
200
200
|
case 6:
|
|
201
201
|
_context6.next = 8;
|
|
202
|
-
return this.core.effects.emit(
|
|
202
|
+
return this.core.effects.emit(GuestHooks.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(GuestHooks.OnGuestUpdate, guest);
|
|
243
243
|
case 9:
|
|
244
244
|
_context7.next = 11;
|
|
245
|
-
return this.core.effects.emit(
|
|
245
|
+
return this.core.effects.emit(GuestHooks.OnGuestChange, this.state.list);
|
|
246
246
|
case 11:
|
|
247
247
|
case "end":
|
|
248
248
|
return _context7.stop();
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { OrderModuleAPI, CommitOrderParams
|
|
3
|
+
import { OrderModuleAPI, CommitOrderParams } from './types';
|
|
4
4
|
import { CartItem } from '../Cart/types';
|
|
5
5
|
export declare class OrderModule extends BaseModule implements Module, OrderModuleAPI {
|
|
6
6
|
protected defaultName: string;
|
|
7
7
|
protected defaultVersion: string;
|
|
8
8
|
private store;
|
|
9
9
|
private request;
|
|
10
|
-
private logger;
|
|
11
10
|
constructor(name?: string, version?: string);
|
|
12
11
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* 记录信息日志
|
|
15
|
-
*/
|
|
16
|
-
private logInfo;
|
|
17
|
-
/**
|
|
18
|
-
* 记录警告日志
|
|
19
|
-
*/
|
|
20
|
-
private logWarning;
|
|
21
|
-
/**
|
|
22
|
-
* 记录错误日志
|
|
23
|
-
*/
|
|
24
|
-
private logError;
|
|
25
12
|
createOrder(params: CommitOrderParams['query']): {
|
|
26
13
|
type: "virtual" | "appointment_booking";
|
|
27
14
|
platform: string;
|
|
@@ -39,15 +26,4 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
39
26
|
type: 'holder' | 'account';
|
|
40
27
|
}): boolean;
|
|
41
28
|
submitOrder(order: CommitOrderParams): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Checkout 专用:创建订单到后端
|
|
44
|
-
*
|
|
45
|
-
* 专门为 Checkout 模块设计的订单创建方法,
|
|
46
|
-
* 直接调用 /order/checkout 接口创建订单
|
|
47
|
-
* 接收已经处理好的订单数据,无需再处理购物车
|
|
48
|
-
*
|
|
49
|
-
* @param params Checkout 订单参数(已处理的订单数据)
|
|
50
|
-
* @returns 后端返回的订单数据(包含订单ID等)
|
|
51
|
-
*/
|
|
52
|
-
createOrderByCheckout(params: CheckoutOrderParams): Promise<any>;
|
|
53
29
|
}
|