@pisell/pisellos 3.0.76 → 3.0.77
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/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 +15 -37
- package/dist/modules/Resource/index.js +1 -1
- package/dist/modules/Rules/index.d.ts +1 -2
- package/dist/modules/Rules/index.js +26 -66
- package/dist/modules/Rules/types.d.ts +0 -1
- 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.js +13 -43
- package/dist/solution/BookingByStep/utils/capacity.js +1 -1
- package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
- package/dist/solution/BookingByStep/utils/products.js +0 -10
- package/dist/solution/BuyTickets/index.js +8 -7
- package/dist/solution/ShopDiscount/index.d.ts +10 -10
- package/dist/solution/ShopDiscount/index.js +57 -107
- 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/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 +12 -31
- package/lib/modules/Resource/index.js +1 -1
- package/lib/modules/Rules/index.d.ts +1 -2
- package/lib/modules/Rules/index.js +24 -41
- package/lib/modules/Rules/types.d.ts +0 -1
- 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.js +6 -18
- package/lib/solution/BookingByStep/utils/capacity.js +1 -1
- package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
- package/lib/solution/BookingByStep/utils/products.js +2 -8
- package/lib/solution/BuyTickets/index.js +8 -7
- package/lib/solution/ShopDiscount/index.d.ts +10 -10
- package/lib/solution/ShopDiscount/index.js +21 -47
- 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
|
@@ -1,257 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
* 支付相关类型定义
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 支付方式枚举
|
|
7
|
-
*/
|
|
8
|
-
export var PaymentMethodType = /*#__PURE__*/function (PaymentMethodType) {
|
|
9
|
-
PaymentMethodType["Cash"] = "CASHMANUAL";
|
|
10
|
-
PaymentMethodType["Eftpos"] = "EFTPOS";
|
|
11
|
-
PaymentMethodType["Wallet"] = "WALLET";
|
|
12
|
-
return PaymentMethodType;
|
|
13
|
-
}({});
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 支付状态枚举
|
|
17
|
-
*/
|
|
18
|
-
export var PaymentStatus = /*#__PURE__*/function (PaymentStatus) {
|
|
19
|
-
PaymentStatus["Processing"] = "payment_processing";
|
|
20
|
-
PaymentStatus["Sync"] = "sync";
|
|
21
|
-
PaymentStatus["PartiallyPaid"] = "partially_paid";
|
|
22
|
-
PaymentStatus["Finished"] = "finish";
|
|
23
|
-
return PaymentStatus;
|
|
24
|
-
}({});
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 任务状态枚举
|
|
28
|
-
*/
|
|
29
|
-
export var TaskRunStatus = /*#__PURE__*/function (TaskRunStatus) {
|
|
30
|
-
TaskRunStatus["Pending"] = "pending";
|
|
31
|
-
TaskRunStatus["Running"] = "running";
|
|
32
|
-
TaskRunStatus["Success"] = "success";
|
|
33
|
-
TaskRunStatus["Failed"] = "failed";
|
|
34
|
-
return TaskRunStatus;
|
|
35
|
-
}({});
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 舍入规则枚举
|
|
39
|
-
*/
|
|
40
|
-
export var RoundingRule = /*#__PURE__*/function (RoundingRule) {
|
|
41
|
-
RoundingRule["Standard"] = "standard_rounding";
|
|
42
|
-
RoundingRule["StandardDown"] = "standard_down";
|
|
43
|
-
RoundingRule["AlwaysUp"] = "always_up";
|
|
44
|
-
RoundingRule["AlwaysDown"] = "always_down";
|
|
45
|
-
return RoundingRule;
|
|
46
|
-
}({});
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 舍入结果
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* 舍入间隔枚举
|
|
54
|
-
*/
|
|
55
|
-
export var RoundingInterval = /*#__PURE__*/function (RoundingInterval) {
|
|
56
|
-
RoundingInterval[RoundingInterval["Interval005"] = 0.05] = "Interval005";
|
|
57
|
-
RoundingInterval[RoundingInterval["Interval01"] = 0.1] = "Interval01";
|
|
58
|
-
RoundingInterval[RoundingInterval["Interval05"] = 0.5] = "Interval05";
|
|
59
|
-
RoundingInterval[RoundingInterval["Interval1"] = 1] = "Interval1";
|
|
60
|
-
return RoundingInterval;
|
|
61
|
-
}({});
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 支付方式信息
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* 支付项
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 订单信息
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* 支付订单(简化版,仅保留支付相关信息)
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* 支付状态
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 推送订单参数(简化版)
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 更新订单参数
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* 支付项输入类型(允许 amount 为数字)
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* 推送支付项参数
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 更新支付项参数中的字段类型(允许 amount 为数字)
|
|
101
|
-
*/
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* 更新支付项参数
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* 删除支付项参数
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* 现金支付接口
|
|
113
|
-
*/
|
|
1
|
+
// import { Order } from '../Order/types'
|
|
114
2
|
|
|
115
|
-
/**
|
|
116
|
-
* Eftpos支付接口
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* 钱包支付接口
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* 支付模块API接口
|
|
125
|
-
*/
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* 订单变化事件数据
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* 支付方式变化事件数据
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* 支付同步错误事件数据
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* 支付同步成功事件数据
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* 钱包推荐列表更新事件数据
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* 用户识别码列表更新事件数据
|
|
149
|
-
*/
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* 钱包缓存清除事件数据
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* 搜索识别码完成事件数据
|
|
157
|
-
*/
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* 钱包初始化开始事件数据
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* 钱包初始化完成事件数据
|
|
165
|
-
*/
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 钱包初始化失败事件数据
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* 钱包支付事件枚举
|
|
173
|
-
*/
|
|
174
|
-
export var WalletPassHooks = /*#__PURE__*/function (WalletPassHooks) {
|
|
175
|
-
WalletPassHooks["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
|
|
176
|
-
WalletPassHooks["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
|
|
177
|
-
WalletPassHooks["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
|
|
178
|
-
WalletPassHooks["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
|
|
179
|
-
WalletPassHooks["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
|
|
180
|
-
WalletPassHooks["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
|
|
181
|
-
WalletPassHooks["OnWalletInitializationStarted"] = "wallet:onWalletInitializationStarted";
|
|
182
|
-
WalletPassHooks["OnWalletInitializationCompleted"] = "wallet:onWalletInitializationCompleted";
|
|
183
|
-
WalletPassHooks["OnWalletInitializationFailed"] = "wallet:onWalletInitializationFailed";
|
|
184
|
-
return WalletPassHooks;
|
|
185
|
-
}({});
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* 支付钩子事件(统一接口)
|
|
189
|
-
*/
|
|
190
3
|
export var PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
|
|
191
|
-
PaymentHooks["
|
|
192
|
-
PaymentHooks["
|
|
193
|
-
PaymentHooks["
|
|
194
|
-
PaymentHooks["
|
|
195
|
-
PaymentHooks["OnOrderUpdated"] = "payment:onOrderUpdated";
|
|
196
|
-
PaymentHooks["OnOrderDeleted"] = "payment:onOrderDeleted";
|
|
197
|
-
PaymentHooks["OnPaymentAdded"] = "payment:onPaymentAdded";
|
|
198
|
-
PaymentHooks["OnPaymentUpdated"] = "payment:onPaymentUpdated";
|
|
199
|
-
PaymentHooks["OnPaymentDeleted"] = "payment:onPaymentDeleted";
|
|
200
|
-
PaymentHooks["OnPaymentSubmitted"] = "payment:onPaymentSubmitted";
|
|
201
|
-
PaymentHooks["OnOrderAmountChanged"] = "payment:onOrderAmountChanged";
|
|
202
|
-
PaymentHooks["OnPaymentSyncError"] = "payment:onPaymentSyncError";
|
|
203
|
-
PaymentHooks["OnPaymentSyncSuccess"] = "payment:onPaymentSyncSuccess";
|
|
204
|
-
PaymentHooks["OnWalletRecommendListUpdated"] = "wallet:onWalletRecommendListUpdated";
|
|
205
|
-
PaymentHooks["OnWalletRecommendListCleared"] = "wallet:onWalletRecommendListCleared";
|
|
206
|
-
PaymentHooks["OnUserIdentificationCodesUpdated"] = "wallet:onUserIdentificationCodesUpdated";
|
|
207
|
-
PaymentHooks["OnUserIdentificationCodesCleared"] = "wallet:onUserIdentificationCodesCleared";
|
|
208
|
-
PaymentHooks["OnWalletCacheCleared"] = "wallet:onWalletCacheCleared";
|
|
209
|
-
PaymentHooks["OnSearchIdentificationCodeCompleted"] = "wallet:onSearchIdentificationCodeCompleted";
|
|
4
|
+
PaymentHooks["OnPaymentInit"] = "payment:onPaymentInit";
|
|
5
|
+
PaymentHooks["OnPaymentSuccess"] = "payment:onPaymentSuccess";
|
|
6
|
+
PaymentHooks["OnPaymentFailure"] = "payment:onPaymentFailure";
|
|
7
|
+
PaymentHooks["OnPaymentRefund"] = "payment:onPaymentRefund";
|
|
210
8
|
return PaymentHooks;
|
|
211
9
|
}({});
|
|
212
10
|
|
|
213
11
|
/**
|
|
214
|
-
*
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* 钱包初始化业务数据接口
|
|
219
|
-
* 用于生成钱包API参数的必要业务信息
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* 查询用户识别码列表请求参数
|
|
224
|
-
*/
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* 钱包推荐扣款响应数据
|
|
12
|
+
* 支付方式
|
|
228
13
|
*/
|
|
229
14
|
|
|
230
|
-
|
|
231
|
-
* 用户识别码列表响应数据
|
|
232
|
-
*/
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* 用户识别码项目
|
|
236
|
-
*/
|
|
15
|
+
// 银行转账
|
|
237
16
|
|
|
238
17
|
/**
|
|
239
|
-
*
|
|
240
|
-
* 基于 WalletDeductionRecommendParams 并增加 code 字段
|
|
18
|
+
* 支付状态
|
|
241
19
|
*/
|
|
242
20
|
|
|
243
|
-
|
|
244
|
-
* 搜索识别码响应数据
|
|
245
|
-
*/
|
|
21
|
+
// 已退款
|
|
246
22
|
|
|
247
23
|
/**
|
|
248
|
-
*
|
|
24
|
+
* 支付信息
|
|
249
25
|
*/
|
|
250
26
|
|
|
251
27
|
/**
|
|
252
|
-
*
|
|
28
|
+
* 支付模块状态
|
|
253
29
|
*/
|
|
254
30
|
|
|
255
31
|
/**
|
|
256
|
-
*
|
|
32
|
+
* 支付模块 API
|
|
257
33
|
*/
|
|
@@ -11,17 +11,12 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
11
11
|
constructor(name?: string, version?: string);
|
|
12
12
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
13
13
|
storeChange(path?: string, value?: any): Promise<void>;
|
|
14
|
-
loadProducts({ category_ids, product_ids, collection,
|
|
14
|
+
loadProducts({ category_ids, product_ids, collection, schedule_date, cacheId }: {
|
|
15
15
|
category_ids?: number[];
|
|
16
16
|
product_ids?: number[];
|
|
17
17
|
collection?: number | string[];
|
|
18
18
|
schedule_date?: string;
|
|
19
19
|
cacheId?: string;
|
|
20
|
-
customer_id?: number;
|
|
21
|
-
menu_list_ids?: number[];
|
|
22
|
-
schedule_datetime?: string;
|
|
23
|
-
with_count?: string[];
|
|
24
|
-
with_schedule?: number;
|
|
25
20
|
}): Promise<any>;
|
|
26
21
|
loadProductsPrice({ ids, customer_id, schedule_date, channel, }: {
|
|
27
22
|
ids?: number[];
|
|
@@ -33,10 +28,4 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
33
28
|
getProduct(id: number): Promise<ProductData | undefined>;
|
|
34
29
|
addProduct(products: ProductData[]): Promise<void>;
|
|
35
30
|
selectProducts(products: ProductData[]): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* 根据商品编码或条码搜索商品
|
|
38
|
-
* @param code 商品编码或条码
|
|
39
|
-
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
40
|
-
*/
|
|
41
|
-
findProductsByCodeOrBarcode(code: string): ProductData[];
|
|
42
31
|
}
|
|
@@ -16,6 +16,7 @@ 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";
|
|
19
20
|
import { cloneDeep } from 'lodash-es';
|
|
20
21
|
export * from "./types";
|
|
21
22
|
export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
@@ -86,11 +87,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
86
87
|
value: function () {
|
|
87
88
|
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
|
|
88
89
|
var _this$otherParams;
|
|
89
|
-
var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection,
|
|
90
|
+
var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, schedule_date, cacheId, userPlugin, customer_id, _userPlugin$get, productsData, sortedList;
|
|
90
91
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
91
92
|
while (1) switch (_context3.prev = _context3.next) {
|
|
92
93
|
case 0:
|
|
93
|
-
_ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection,
|
|
94
|
+
_ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId;
|
|
94
95
|
// // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
|
|
95
96
|
// if (!schedule_ids?.length) {
|
|
96
97
|
// const schedule_ids_data = this.store.schedule
|
|
@@ -106,7 +107,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
106
107
|
userPlugin = this.core.getPlugin('user');
|
|
107
108
|
customer_id = undefined;
|
|
108
109
|
try {
|
|
109
|
-
customer_id =
|
|
110
|
+
customer_id = userPlugin === null || userPlugin === void 0 || (_userPlugin$get = userPlugin.get()) === null || _userPlugin$get === void 0 ? void 0 : _userPlugin$get.id;
|
|
110
111
|
} catch (error) {
|
|
111
112
|
console.error(error);
|
|
112
113
|
}
|
|
@@ -125,13 +126,9 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
125
126
|
ids: product_ids,
|
|
126
127
|
collection: collection,
|
|
127
128
|
front_end_cache_id: cacheId,
|
|
128
|
-
menu_list_ids: menu_list_ids,
|
|
129
|
-
with_count: with_count,
|
|
130
129
|
// client_schedule_ids: schedule_ids,
|
|
131
130
|
schedule_date: schedule_date,
|
|
132
131
|
application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel,
|
|
133
|
-
with_schedule: with_schedule,
|
|
134
|
-
schedule_datetime: schedule_datetime,
|
|
135
132
|
is_eject: 1
|
|
136
133
|
}, {
|
|
137
134
|
useCache: true
|
|
@@ -140,16 +137,17 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
140
137
|
productsData = _context3.sent;
|
|
141
138
|
sortedList = (productsData.data.list || []).slice().sort(function (a, b) {
|
|
142
139
|
return Number(b.sort) - Number(a.sort);
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
140
|
+
});
|
|
141
|
+
if (sortedList.length) {
|
|
142
|
+
sortedList.forEach(function (n) {
|
|
143
|
+
if (n.is_eject !== 1 && n['schedule.ids'] && n['schedule.ids'].length) {
|
|
144
|
+
n.is_eject = 1;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
150
148
|
this.addProduct(sortedList);
|
|
151
149
|
return _context3.abrupt("return", sortedList);
|
|
152
|
-
case
|
|
150
|
+
case 11:
|
|
153
151
|
case "end":
|
|
154
152
|
return _context3.stop();
|
|
155
153
|
}
|
|
@@ -200,7 +198,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
200
198
|
while (1) switch (_context5.prev = _context5.next) {
|
|
201
199
|
case 0:
|
|
202
200
|
_context5.next = 2;
|
|
203
|
-
return this.core.effects.emit(
|
|
201
|
+
return this.core.effects.emit(ProductListHooks.onGetProducts, this.store.list);
|
|
204
202
|
case 2:
|
|
205
203
|
return _context5.abrupt("return", cloneDeep(this.store.list));
|
|
206
204
|
case 3:
|
|
@@ -223,7 +221,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
223
221
|
while (1) switch (_context6.prev = _context6.next) {
|
|
224
222
|
case 0:
|
|
225
223
|
_context6.next = 2;
|
|
226
|
-
return this.core.effects.emit(
|
|
224
|
+
return this.core.effects.emit(ProductListHooks.onGetProduct, this.store.list);
|
|
227
225
|
case 2:
|
|
228
226
|
product = this.store.list.find(function (product) {
|
|
229
227
|
return product.id === id;
|
|
@@ -297,26 +295,6 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
297
295
|
}
|
|
298
296
|
return selectProducts;
|
|
299
297
|
}()
|
|
300
|
-
/**
|
|
301
|
-
* 根据商品编码或条码搜索商品
|
|
302
|
-
* @param code 商品编码或条码
|
|
303
|
-
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
304
|
-
*/
|
|
305
|
-
}, {
|
|
306
|
-
key: "findProductsByCodeOrBarcode",
|
|
307
|
-
value: function findProductsByCodeOrBarcode(code) {
|
|
308
|
-
if (!code || typeof code !== 'string') {
|
|
309
|
-
return [];
|
|
310
|
-
}
|
|
311
|
-
var trimmedCode = code.trim();
|
|
312
|
-
if (!trimmedCode) {
|
|
313
|
-
return [];
|
|
314
|
-
}
|
|
315
|
-
var matchingProducts = this.store.list.filter(function (product) {
|
|
316
|
-
return product.code && product.code.trim() === trimmedCode || product.barcode && product.barcode.trim() === trimmedCode;
|
|
317
|
-
});
|
|
318
|
-
return cloneDeep(matchingProducts);
|
|
319
|
-
}
|
|
320
298
|
}]);
|
|
321
299
|
return ProductList;
|
|
322
300
|
}(BaseModule);
|
|
@@ -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(ResourceHooks.OnResourceSelect, resource);
|
|
93
93
|
case 6:
|
|
94
94
|
case "end":
|
|
95
95
|
return _context3.stop();
|
|
@@ -2,7 +2,6 @@ import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
3
|
import { Rules, RulesModuleAPI, DiscountResult } from './types';
|
|
4
4
|
import { Discount } from "../Discount/types";
|
|
5
|
-
import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
|
|
6
5
|
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
|
|
7
6
|
protected defaultName: string;
|
|
8
7
|
protected defaultVersion: string;
|
|
@@ -36,7 +35,7 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
36
35
|
}, options?: {
|
|
37
36
|
isSelected?: boolean;
|
|
38
37
|
discountId?: number;
|
|
39
|
-
selectedList?:
|
|
38
|
+
selectedList?: any[];
|
|
40
39
|
scan?: boolean;
|
|
41
40
|
}): DiscountResult;
|
|
42
41
|
/**
|
|
@@ -24,14 +24,12 @@ 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";
|
|
27
28
|
import { uniqueById, getDiscountAmount, getDiscountListAmountTotal, getDiscountListAmount, filterDiscountListByBookingTime, isOrderLevelFixedAmountDiscount, calculateOrderLevelDiscountAllocation } from "../../solution/ShopDiscount/utils";
|
|
28
29
|
import { getProductOriginTotalPrice, getProductTotalPrice } from "../Cart/utils";
|
|
29
30
|
import Decimal from 'decimal.js';
|
|
30
31
|
import { isBoolean } from 'lodash-es';
|
|
31
32
|
import dayjs from 'dayjs';
|
|
32
|
-
|
|
33
|
-
// 临时变量
|
|
34
|
-
var flatItem;
|
|
35
33
|
export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
36
34
|
_inherits(RulesModule, _BaseModule);
|
|
37
35
|
var _super = _createSuper(RulesModule);
|
|
@@ -76,7 +74,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
76
74
|
case 0:
|
|
77
75
|
this.store.rulesList = rulesList;
|
|
78
76
|
_context2.next = 3;
|
|
79
|
-
return this.core.effects.emit(
|
|
77
|
+
return this.core.effects.emit(RulesHooks.OnRulesListChange, rulesList);
|
|
80
78
|
case 3:
|
|
81
79
|
case "end":
|
|
82
80
|
return _context2.stop();
|
|
@@ -454,7 +452,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
454
452
|
const priceB = new Decimal((bProduct.price as string) || '0');
|
|
455
453
|
if (priceA.toNumber() === priceB.toNumber()) {
|
|
456
454
|
if (aProduct.quantity === bProduct.quantity) {
|
|
457
|
-
return bProduct.discount_list?.length
|
|
455
|
+
return bProduct.discount_list?.length - aProduct.discount_list?.length;
|
|
458
456
|
}
|
|
459
457
|
return aProduct.quantity - bProduct.quantity;
|
|
460
458
|
}
|
|
@@ -696,6 +694,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
696
694
|
addModeDiscount.forEach(function (discount) {
|
|
697
695
|
var _product5, _product6, _product7, _product8, _flatItem$bundleItem3, _flatItem$bundleItem4;
|
|
698
696
|
var limitedData = discount === null || discount === void 0 ? void 0 : discount.limited_relation_product_data;
|
|
697
|
+
|
|
699
698
|
// 拿到discount配置的holder信息 product信息 product.holder 加在 isLimitedProduct
|
|
700
699
|
var _tempVar = (flatItem === null || flatItem === void 0 ? void 0 : flatItem.type) === 'bundle' ? flatItem === null || flatItem === void 0 ? void 0 : flatItem.parentProduct : flatItem === null || flatItem === void 0 ? void 0 : flatItem.product;
|
|
701
700
|
var isHolderMatch = _this3.checkHolderMatch(discount, {
|
|
@@ -718,7 +717,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
718
717
|
var isBundleAvailable = _this3.checkPackageSubItemUsageRules(discount, flatItem);
|
|
719
718
|
|
|
720
719
|
// 判断优惠券是否适用于该商品
|
|
721
|
-
if (isAvailableProduct && isLimitedProduct &&
|
|
720
|
+
if (isAvailableProduct && isLimitedProduct && isBundleAvailable && timeLimit) {
|
|
722
721
|
var _discountApplicabilit, _discount$metadata4, _discount$metadata5;
|
|
723
722
|
// 记录此优惠券适用的商品
|
|
724
723
|
(_discountApplicabilit = discountApplicability.get(discount.id)) === null || _discountApplicabilit === void 0 || _discountApplicabilit.push(product.id);
|
|
@@ -807,7 +806,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
807
806
|
if ((Number(product.price) <= 0 || !product.price) && !((_product$discount_lis3 = product.discount_list) !== null && _product$discount_lis3 !== void 0 && _product$discount_lis3.length) && (discount.tag || discount.type) === 'good_pass') return false;
|
|
808
807
|
|
|
809
808
|
// 折扣卡商品价格为0时不可用
|
|
810
|
-
if ((Number(product.price)
|
|
809
|
+
if ((Number(product.price) === 0 || !product.price) && !((_product$discount_lis4 = product.discount_list) !== null && _product$discount_lis4 !== void 0 && _product$discount_lis4.find(function (n) {
|
|
811
810
|
var _n$discount;
|
|
812
811
|
return ((_n$discount = n.discount) === null || _n$discount === void 0 ? void 0 : _n$discount.resource_id) === discount.id;
|
|
813
812
|
})) && (discount.tag || discount.type) !== 'good_pass') return false;
|
|
@@ -938,7 +937,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
938
937
|
}
|
|
939
938
|
|
|
940
939
|
// 如果没有适用的优惠券,或者手动折扣,则不适用优惠券
|
|
941
|
-
if (applicableDiscounts.length === 0 || isManualDiscount
|
|
940
|
+
if (applicableDiscounts.length === 0 || isManualDiscount) {
|
|
942
941
|
if (flatItem.type === 'main') {
|
|
943
942
|
// 主商品:保持原有逻辑
|
|
944
943
|
if (product.isClient) {
|
|
@@ -964,10 +963,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
964
963
|
discount_list: []
|
|
965
964
|
}))]);
|
|
966
965
|
} else {
|
|
967
|
-
processedProductsMap.set(product._id, [_this3.hooks.setProduct(originProduct, _objectSpread(_objectSpread({}, isManualDiscount ? {
|
|
968
|
-
price: product.price,
|
|
969
|
-
main_product_selling_price: product.price
|
|
970
|
-
} : {
|
|
966
|
+
processedProductsMap.set(product._id, [_this3.hooks.setProduct(originProduct, _objectSpread(_objectSpread({}, isManualDiscount ? {} : {
|
|
971
967
|
_id: product._id.split('___')[0] + '___' + index,
|
|
972
968
|
total: product.origin_total || product.total,
|
|
973
969
|
price: product.price,
|
|
@@ -980,7 +976,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
980
976
|
// bundle子商品:保存到扁平化Map
|
|
981
977
|
processedFlatItemsMap.set(flatItem._id, [_objectSpread(_objectSpread({}, flatItem), {}, {
|
|
982
978
|
discount_list: [],
|
|
983
|
-
price:
|
|
979
|
+
price: flatItem.bundleItem.original_price,
|
|
984
980
|
processed: true
|
|
985
981
|
})]);
|
|
986
982
|
}
|
|
@@ -1420,18 +1416,14 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1420
1416
|
var allDiscountAmount = getDiscountListAmountTotal(mainDiscountList);
|
|
1421
1417
|
newTotalWithDiscount = (_Decimal$minus$toNumb = new Decimal(mainProductData.price || 0).minus(allDiscountAmount).toNumber()) !== null && _Decimal$minus$toNumb !== void 0 ? _Decimal$minus$toNumb : newTotalWithDiscount;
|
|
1422
1418
|
newOriginTotalWithDiscount = (_mainProductData$orig = mainProductData.origin_total) !== null && _mainProductData$orig !== void 0 ? _mainProductData$orig : newOriginTotalWithDiscount;
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
var _item$discount_list2;
|
|
1432
|
-
var originalPrice = ((_item$discount_list2 = item.discount_list) === null || _item$discount_list2 === void 0 || (_item$discount_list2 = _item$discount_list2[0]) === null || _item$discount_list2 === void 0 || (_item$discount_list2 = _item$discount_list2.discount) === null || _item$discount_list2 === void 0 ? void 0 : _item$discount_list2.original_amount) || item.price;
|
|
1433
|
-
newOriginTotalWithDiscount += Number(originalPrice) * Number(item.num);
|
|
1434
|
-
});
|
|
1419
|
+
if (newBundleWithDiscount.length > 0) {
|
|
1420
|
+
newBundleWithDiscount.forEach(function (item) {
|
|
1421
|
+
var _item$discount_list2;
|
|
1422
|
+
newTotalWithDiscount += Number(item.price) * Number(item.num);
|
|
1423
|
+
var originalPrice = ((_item$discount_list2 = item.discount_list) === null || _item$discount_list2 === void 0 || (_item$discount_list2 = _item$discount_list2[0]) === null || _item$discount_list2 === void 0 || (_item$discount_list2 = _item$discount_list2.discount) === null || _item$discount_list2 === void 0 ? void 0 : _item$discount_list2.original_amount) || item.price;
|
|
1424
|
+
newOriginTotalWithDiscount += Number(originalPrice) * Number(item.num);
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1435
1427
|
}
|
|
1436
1428
|
|
|
1437
1429
|
// 累加options的价格(options不参与折扣,在最终设置total时处理)
|
|
@@ -1494,14 +1486,12 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1494
1486
|
var _allDiscountAmount = getDiscountListAmount(mainDiscountListOriginal);
|
|
1495
1487
|
newTotalOriginal = (_Decimal$minus$toNumb2 = new Decimal(mainProductData.price || 0).minus(_allDiscountAmount).toNumber()) !== null && _Decimal$minus$toNumb2 !== void 0 ? _Decimal$minus$toNumb2 : newTotalOriginal;
|
|
1496
1488
|
newOriginTotalOriginal = (_mainProductData$orig2 = mainProductData.origin_total) !== null && _mainProductData$orig2 !== void 0 ? _mainProductData$orig2 : newOriginTotalOriginal;
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
newOriginTotalOriginal += Number(item.price) * Number(item.num);
|
|
1504
|
-
});
|
|
1489
|
+
if (newBundleOriginal.length > 0) {
|
|
1490
|
+
newBundleOriginal.forEach(function (item) {
|
|
1491
|
+
newTotalOriginal += Number(item.price) * Number(item.num);
|
|
1492
|
+
newOriginTotalOriginal += Number(item.price) * Number(item.num);
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1505
1495
|
}
|
|
1506
1496
|
|
|
1507
1497
|
// 累加options的价格(options不参与折扣,在最终设置total时处理)
|
|
@@ -1595,13 +1585,9 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1595
1585
|
|
|
1596
1586
|
// 累加bundle的价格(只累加一次)
|
|
1597
1587
|
if (newBundle.length > 0) {
|
|
1598
|
-
newBundle.forEach(function (item) {
|
|
1599
|
-
newTotal += Number(item.price) * Number(item.num);
|
|
1600
|
-
});
|
|
1601
|
-
|
|
1602
|
-
// 计算原始总价(不考虑折扣)
|
|
1603
1588
|
newBundle.forEach(function (item) {
|
|
1604
1589
|
var _item$discount_list3;
|
|
1590
|
+
newTotal += Number(item.price) * Number(item.num);
|
|
1605
1591
|
var originalPrice = ((_item$discount_list3 = item.discount_list) === null || _item$discount_list3 === void 0 || (_item$discount_list3 = _item$discount_list3[0]) === null || _item$discount_list3 === void 0 || (_item$discount_list3 = _item$discount_list3.discount) === null || _item$discount_list3 === void 0 ? void 0 : _item$discount_list3.original_amount) || item.price;
|
|
1606
1592
|
newOriginTotal += Number(originalPrice) * Number(item.num);
|
|
1607
1593
|
});
|
|
@@ -1780,34 +1766,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1780
1766
|
// 套餐中购买时,判断是否为原价
|
|
1781
1767
|
var _priceType = (_flatItem$bundleItem10 = flatItem.bundleItem) === null || _flatItem$bundleItem10 === void 0 ? void 0 : _flatItem$bundleItem10.price_type;
|
|
1782
1768
|
var _priceTypeExt = (_flatItem$bundleItem11 = flatItem.bundleItem) === null || _flatItem$bundleItem11 === void 0 ? void 0 : _flatItem$bundleItem11.price_type_ext;
|
|
1783
|
-
|
|
1784
|
-
// original_price 对应:
|
|
1785
|
-
// 1. price_type: "markup" && price_type_ext: "product_price"
|
|
1786
|
-
// markup_price 对应:
|
|
1787
|
-
// price_type: "markup" && price_type_ext: ""
|
|
1788
|
-
/** 原价 */
|
|
1789
|
-
var _isOriginalPrice = _priceType === 'markup' && _priceTypeExt === 'product_price';
|
|
1790
|
-
/** 加价 */
|
|
1791
|
-
var _isMarkupPrice = _priceType === 'markup' && (_priceTypeExt === '' || !_priceTypeExt);
|
|
1792
|
-
|
|
1793
|
-
// 检查 rules
|
|
1794
|
-
if (rules.length > 0) {
|
|
1795
|
-
// 检查原价
|
|
1796
|
-
if (_isOriginalPrice && rules.includes('original_price')) {
|
|
1797
|
-
return true;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
// 检查加价
|
|
1801
|
-
if (_isMarkupPrice && rules.includes('markup_price')) {
|
|
1802
|
-
return true;
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
// 如果都不匹配,则不可用
|
|
1806
|
-
return false;
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
1769
|
// 原价包括:price_type: "markup" && price_type_ext: "product_price"
|
|
1810
|
-
return
|
|
1770
|
+
return _priceType === 'markup' && _priceTypeExt === 'product_price';
|
|
1811
1771
|
}
|
|
1812
1772
|
return false;
|
|
1813
1773
|
}
|
|
@@ -1876,7 +1836,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
1876
1836
|
case 0:
|
|
1877
1837
|
this.core.effects.offByModuleDestroy(this.name);
|
|
1878
1838
|
_context3.next = 3;
|
|
1879
|
-
return this.core.effects.emit(
|
|
1839
|
+
return this.core.effects.emit(RulesHooks.OnDestroy, {});
|
|
1880
1840
|
case 3:
|
|
1881
1841
|
console.log('[Rules] 已销毁');
|
|
1882
1842
|
case 4:
|
|
@@ -25,13 +25,4 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
|
|
|
25
25
|
setOtherProductsIds(ids: number[]): void;
|
|
26
26
|
getOtherProductsIds(): number[];
|
|
27
27
|
storeChange(): void;
|
|
28
|
-
/**
|
|
29
|
-
* 传入一个时间, 判断改时间是否在schedule 内
|
|
30
|
-
* @param param0 { date: string, schedule: any } date: 日期, schedule: schedule
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
static isInScheduleByDate({ date, schedule, }: {
|
|
34
|
-
date: string;
|
|
35
|
-
schedule: any;
|
|
36
|
-
}): boolean | undefined;
|
|
37
28
|
}
|