@pisell/pisellos 2.1.4 → 2.1.6
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 +2 -1
- package/dist/effects/index.d.ts +4 -3
- package/dist/effects/index.js +15 -6
- package/dist/modules/AccountList/index.d.ts +7 -1
- package/dist/modules/AccountList/index.js +81 -14
- package/dist/modules/AccountList/types.d.ts +28 -0
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/Cart/index.js +1 -1
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Customer/constants.js +12 -0
- package/dist/modules/Customer/index.d.ts +122 -0
- package/dist/modules/Customer/index.js +697 -0
- package/dist/modules/Customer/types.d.ts +146 -0
- package/dist/modules/Customer/types.js +41 -0
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +25 -1
- package/dist/modules/Order/index.js +224 -2
- package/dist/modules/Order/types.d.ts +45 -0
- package/dist/modules/Order/types.js +8 -0
- package/dist/modules/Payment/cash.d.ts +19 -0
- package/dist/modules/Payment/cash.js +97 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
- package/dist/modules/Payment/eftpos.d.ts +11 -0
- package/dist/modules/Payment/eftpos.js +80 -0
- package/dist/modules/Payment/index.d.ts +184 -9
- package/dist/modules/Payment/index.js +2012 -108
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/types.d.ts +750 -30
- package/dist/modules/Payment/types.js +236 -12
- package/dist/modules/Payment/utils.d.ts +17 -0
- package/dist/modules/Payment/utils.js +62 -0
- package/dist/modules/Payment/walletpass.d.ts +99 -0
- package/dist/modules/Payment/walletpass.js +701 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.d.ts +12 -1
- package/dist/modules/ProductList/index.js +27 -3
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +39 -17
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +9 -0
- package/dist/modules/Schedule/index.js +77 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/app-types/app/app.d.ts +83 -0
- package/dist/plugins/app-types/app/const.d.ts +4 -0
- package/dist/plugins/app-types/app/index.d.ts +14 -0
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/dist/plugins/app-types/config.d.ts +3 -0
- package/dist/plugins/app-types/cookie/index.d.ts +13 -0
- package/dist/plugins/app-types/data/index.d.ts +8 -0
- package/dist/plugins/app-types/history/config.d.ts +24 -0
- package/dist/plugins/app-types/history/index.d.ts +20 -0
- package/dist/plugins/app-types/history/type.d.ts +2 -0
- package/dist/plugins/app-types/hooks/index.d.ts +12 -0
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/dist/plugins/app-types/index.d.ts +6 -0
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
- package/dist/plugins/app-types/locales/en.d.ts +3 -0
- package/dist/plugins/app-types/locales/index.d.ts +37 -0
- package/dist/plugins/app-types/locales/original.d.ts +3 -0
- package/dist/plugins/app-types/locales/type.d.ts +19 -0
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
- package/dist/plugins/app-types/logger/index.d.ts +122 -0
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
- package/dist/plugins/app-types/models/global.d.ts +32 -0
- package/dist/plugins/app-types/models/index.d.ts +45 -0
- package/dist/plugins/app-types/models/type.d.ts +2 -0
- package/dist/plugins/app-types/package.json +15 -0
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
- package/dist/plugins/app-types/request/cache.d.ts +46 -0
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/dist/plugins/app-types/request/config.d.ts +3 -0
- package/dist/plugins/app-types/request/constants.d.ts +2 -0
- package/dist/plugins/app-types/request/index.d.ts +24 -0
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/dist/plugins/app-types/request/type.d.ts +41 -0
- package/dist/plugins/app-types/request/utils.d.ts +46 -0
- package/dist/plugins/app-types/routes/config.d.ts +7 -0
- package/dist/plugins/app-types/routes/index.d.ts +28 -0
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
- package/dist/plugins/app-types/socket/constants.d.ts +33 -0
- package/dist/plugins/app-types/socket/events.d.ts +31 -0
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/dist/plugins/app-types/socket/index.d.ts +61 -0
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/dist/plugins/app-types/socket/socket.d.ts +129 -0
- package/dist/plugins/app-types/socket/types.d.ts +85 -0
- package/dist/plugins/app-types/storage/index.d.ts +17 -0
- package/dist/plugins/app-types/tasks/index.d.ts +77 -0
- package/dist/plugins/app-types/tasks/type.d.ts +62 -0
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/dist/plugins/app-types/type.d.ts +2 -0
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/dist/plugins/app-types/variables/config.d.ts +3 -0
- package/dist/plugins/app-types/variables/index.d.ts +6 -0
- package/dist/plugins/app-types/variables/type.d.ts +2 -0
- package/dist/plugins/app-types/website/index.d.ts +6 -0
- package/dist/plugins/app.d.ts +8 -0
- package/dist/plugins/app.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +1 -1
- package/dist/solution/BookingTicket/index.d.ts +180 -0
- package/dist/solution/BookingTicket/index.js +689 -0
- package/dist/solution/BookingTicket/types.d.ts +68 -0
- package/dist/solution/BookingTicket/types.js +43 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +189 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +509 -0
- package/dist/solution/Checkout/index.js +4874 -0
- package/dist/solution/Checkout/types.d.ts +923 -0
- package/dist/solution/Checkout/types.js +148 -0
- package/dist/solution/Checkout/utils/index.d.ts +117 -0
- package/dist/solution/Checkout/utils/index.js +549 -0
- package/dist/solution/ShopDiscount/index.d.ts +4 -9
- package/dist/solution/ShopDiscount/index.js +106 -54
- package/dist/solution/ShopDiscount/types.d.ts +10 -1
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/task.js +171 -0
- package/dist/utils/watch.d.ts +102 -0
- package/dist/utils/watch.js +294 -0
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +4 -3
- package/lib/effects/index.js +4 -1
- package/lib/modules/AccountList/index.d.ts +7 -1
- package/lib/modules/AccountList/index.js +27 -0
- package/lib/modules/AccountList/types.d.ts +28 -0
- package/lib/modules/Cart/index.js +1 -1
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Customer/constants.js +39 -0
- package/lib/modules/Customer/index.d.ts +122 -0
- package/lib/modules/Customer/index.js +440 -0
- package/lib/modules/Customer/types.d.ts +146 -0
- package/lib/modules/Customer/types.js +37 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +25 -1
- package/lib/modules/Order/index.js +182 -0
- package/lib/modules/Order/types.d.ts +45 -0
- package/lib/modules/Payment/cash.d.ts +19 -0
- package/lib/modules/Payment/cash.js +64 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
- package/lib/modules/Payment/eftpos.d.ts +11 -0
- package/lib/modules/Payment/eftpos.js +51 -0
- package/lib/modules/Payment/index.d.ts +184 -9
- package/lib/modules/Payment/index.js +1044 -50
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/types.d.ts +750 -30
- package/lib/modules/Payment/types.js +79 -6
- package/lib/modules/Payment/utils.d.ts +17 -0
- package/lib/modules/Payment/utils.js +67 -0
- package/lib/modules/Payment/walletpass.d.ts +99 -0
- package/lib/modules/Payment/walletpass.js +468 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.d.ts +12 -1
- package/lib/modules/ProductList/index.js +29 -2
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +32 -15
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +9 -0
- package/lib/modules/Schedule/index.js +60 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/app-types/app/app.d.ts +83 -0
- package/lib/plugins/app-types/app/const.d.ts +4 -0
- package/lib/plugins/app-types/app/index.d.ts +14 -0
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/lib/plugins/app-types/config.d.ts +3 -0
- package/lib/plugins/app-types/cookie/index.d.ts +13 -0
- package/lib/plugins/app-types/data/index.d.ts +8 -0
- package/lib/plugins/app-types/history/config.d.ts +24 -0
- package/lib/plugins/app-types/history/index.d.ts +20 -0
- package/lib/plugins/app-types/history/type.d.ts +2 -0
- package/lib/plugins/app-types/hooks/index.d.ts +12 -0
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/lib/plugins/app-types/index.d.ts +6 -0
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
- package/lib/plugins/app-types/locales/en.d.ts +3 -0
- package/lib/plugins/app-types/locales/index.d.ts +37 -0
- package/lib/plugins/app-types/locales/original.d.ts +3 -0
- package/lib/plugins/app-types/locales/type.d.ts +19 -0
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
- package/lib/plugins/app-types/logger/index.d.ts +122 -0
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
- package/lib/plugins/app-types/models/global.d.ts +32 -0
- package/lib/plugins/app-types/models/index.d.ts +45 -0
- package/lib/plugins/app-types/models/type.d.ts +2 -0
- package/lib/plugins/app-types/package.json +15 -0
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
- package/lib/plugins/app-types/request/cache.d.ts +46 -0
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/lib/plugins/app-types/request/config.d.ts +3 -0
- package/lib/plugins/app-types/request/constants.d.ts +2 -0
- package/lib/plugins/app-types/request/index.d.ts +24 -0
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/lib/plugins/app-types/request/type.d.ts +41 -0
- package/lib/plugins/app-types/request/utils.d.ts +46 -0
- package/lib/plugins/app-types/routes/config.d.ts +7 -0
- package/lib/plugins/app-types/routes/index.d.ts +28 -0
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
- package/lib/plugins/app-types/socket/constants.d.ts +33 -0
- package/lib/plugins/app-types/socket/events.d.ts +31 -0
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/lib/plugins/app-types/socket/index.d.ts +61 -0
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/lib/plugins/app-types/socket/socket.d.ts +129 -0
- package/lib/plugins/app-types/socket/types.d.ts +85 -0
- package/lib/plugins/app-types/storage/index.d.ts +17 -0
- package/lib/plugins/app-types/tasks/index.d.ts +77 -0
- package/lib/plugins/app-types/tasks/type.d.ts +62 -0
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/lib/plugins/app-types/type.d.ts +2 -0
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/lib/plugins/app-types/variables/config.d.ts +3 -0
- package/lib/plugins/app-types/variables/index.d.ts +6 -0
- package/lib/plugins/app-types/variables/type.d.ts +2 -0
- package/lib/plugins/app-types/website/index.d.ts +6 -0
- package/lib/plugins/app.d.ts +8 -0
- package/lib/plugins/app.js +17 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1 -2
- package/lib/solution/BookingTicket/index.d.ts +180 -0
- package/lib/solution/BookingTicket/index.js +420 -0
- package/lib/solution/BookingTicket/types.d.ts +68 -0
- package/lib/solution/BookingTicket/types.js +72 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +132 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +509 -0
- package/lib/solution/Checkout/index.js +3002 -0
- package/lib/solution/Checkout/types.d.ts +923 -0
- package/lib/solution/Checkout/types.js +87 -0
- package/lib/solution/Checkout/utils/index.d.ts +117 -0
- package/lib/solution/Checkout/utils/index.js +403 -0
- package/lib/solution/ShopDiscount/index.d.ts +4 -9
- package/lib/solution/ShopDiscount/index.js +41 -13
- package/lib/solution/ShopDiscount/types.d.ts +10 -1
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/task.js +109 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +4 -2
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 结账状态枚举
|
|
3
|
+
*/
|
|
4
|
+
export var CheckoutStatus = /*#__PURE__*/function (CheckoutStatus) {
|
|
5
|
+
CheckoutStatus["Initializing"] = "initializing";
|
|
6
|
+
CheckoutStatus["Ready"] = "ready";
|
|
7
|
+
CheckoutStatus["CreatingOrder"] = "creating_order";
|
|
8
|
+
CheckoutStatus["OrderCreated"] = "order_created";
|
|
9
|
+
CheckoutStatus["ProcessingPayment"] = "processing_payment";
|
|
10
|
+
CheckoutStatus["PaymentCompleted"] = "payment_completed";
|
|
11
|
+
CheckoutStatus["Completed"] = "completed";
|
|
12
|
+
CheckoutStatus["Cancelled"] = "cancelled";
|
|
13
|
+
CheckoutStatus["Error"] = "error";
|
|
14
|
+
return CheckoutStatus;
|
|
15
|
+
}({});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 结账步骤枚举
|
|
19
|
+
*/
|
|
20
|
+
export var CheckoutStep = /*#__PURE__*/function (CheckoutStep) {
|
|
21
|
+
CheckoutStep["OrderConfirmation"] = "order_confirmation";
|
|
22
|
+
CheckoutStep["PaymentMethod"] = "payment_method";
|
|
23
|
+
CheckoutStep["PaymentProcessing"] = "payment_processing";
|
|
24
|
+
CheckoutStep["Complete"] = "complete";
|
|
25
|
+
return CheckoutStep;
|
|
26
|
+
}({});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 结账错误类型
|
|
30
|
+
*/
|
|
31
|
+
export var CheckoutErrorType = /*#__PURE__*/function (CheckoutErrorType) {
|
|
32
|
+
CheckoutErrorType["OrderCreationFailed"] = "order_creation_failed";
|
|
33
|
+
CheckoutErrorType["PaymentFailed"] = "payment_failed";
|
|
34
|
+
CheckoutErrorType["ValidationFailed"] = "validation_failed";
|
|
35
|
+
CheckoutErrorType["NetworkError"] = "network_error";
|
|
36
|
+
CheckoutErrorType["UnknownError"] = "unknown_error";
|
|
37
|
+
return CheckoutErrorType;
|
|
38
|
+
}({});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 结账错误信息
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 结账初始化参数
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 购物车小计项
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 从购物车小计提取的金额信息
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 本地订单创建参数
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 手动下单参数
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 本地订单数据结构 (基于 appointmentDemo.json)
|
|
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
|
+
/**
|
|
93
|
+
* 结账状态信息
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 结账摘要信息
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 结账事件钩子
|
|
102
|
+
*/
|
|
103
|
+
export var CheckoutHooks = /*#__PURE__*/function (CheckoutHooks) {
|
|
104
|
+
CheckoutHooks["OnCheckoutInitialized"] = "checkout:onInitialized";
|
|
105
|
+
CheckoutHooks["OnStatusChanged"] = "checkout:onStatusChanged";
|
|
106
|
+
CheckoutHooks["OnStepChanged"] = "checkout:onStepChanged";
|
|
107
|
+
CheckoutHooks["OnOrderCreated"] = "checkout:onOrderCreated";
|
|
108
|
+
CheckoutHooks["OnOrderCreationFailed"] = "checkout:onOrderCreationFailed";
|
|
109
|
+
CheckoutHooks["OnPaymentStarted"] = "checkout:onPaymentStarted";
|
|
110
|
+
CheckoutHooks["OnPaymentSuccess"] = "checkout:onPaymentSuccess";
|
|
111
|
+
CheckoutHooks["OnPaymentFailed"] = "checkout:onPaymentFailed";
|
|
112
|
+
CheckoutHooks["OnCheckoutCompleted"] = "checkout:onCompleted";
|
|
113
|
+
CheckoutHooks["OnCheckoutCancelled"] = "checkout:onCancelled";
|
|
114
|
+
CheckoutHooks["OnError"] = "checkout:onError";
|
|
115
|
+
CheckoutHooks["OnStateAmountChanged"] = "checkout:onStateAmountChanged";
|
|
116
|
+
CheckoutHooks["OnBalanceDueAmountChanged"] = "checkout:onBalanceDueAmountChanged";
|
|
117
|
+
CheckoutHooks["OnOrderPaymentCompleted"] = "checkout:onOrderPaymentCompleted";
|
|
118
|
+
CheckoutHooks["OnOrderSynced"] = "checkout:onOrderSynced";
|
|
119
|
+
CheckoutHooks["OnOrderSyncFailed"] = "checkout:onOrderSyncFailed";
|
|
120
|
+
CheckoutHooks["OnOrderNoteChanged"] = "checkout:onOrderNoteChanged";
|
|
121
|
+
CheckoutHooks["OnShopDiscountChanged"] = "checkout:onShopDiscountChanged";
|
|
122
|
+
CheckoutHooks["OnOrderCancelled"] = "checkout:onOrderCancelled";
|
|
123
|
+
CheckoutHooks["OnOrderCleared"] = "checkout:onOrderCleared";
|
|
124
|
+
CheckoutHooks["OnOrderSubmitStart"] = "checkout:onOrderSubmitStart";
|
|
125
|
+
CheckoutHooks["OnOrderSubmitEnd"] = "checkout:onOrderSubmitEnd";
|
|
126
|
+
CheckoutHooks["OnWalletDataInitialized"] = "checkout:onWalletDataInitialized";
|
|
127
|
+
return CheckoutHooks;
|
|
128
|
+
}({});
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 结账状态数据
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* 当前订单基础信息
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* 结账解决方案 API 接口
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 发送客户支付链接参数
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* 结账事件数据类型
|
|
148
|
+
*/
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { CheckoutInitParams, CheckoutError, CheckoutErrorType, CheckoutStatus, CheckoutStep, LocalOrderData, CartSummaryItem, ExtractedAmountInfo } from '../types';
|
|
2
|
+
import { CartItem } from '../../../modules/Cart/types';
|
|
3
|
+
/**
|
|
4
|
+
* 验证结账数据
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateCheckoutData(params: CheckoutInitParams): {
|
|
7
|
+
valid: boolean;
|
|
8
|
+
errors: string[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* 创建结账错误对象
|
|
12
|
+
*/
|
|
13
|
+
export declare function createCheckoutError(type: CheckoutErrorType, message: string, details?: any): CheckoutError;
|
|
14
|
+
/**
|
|
15
|
+
* 计算结账进度
|
|
16
|
+
*/
|
|
17
|
+
export declare function calculateProgress(status: CheckoutStatus, step: CheckoutStep): number;
|
|
18
|
+
/**
|
|
19
|
+
* 格式化金额
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatAmount(amount: string | number): string;
|
|
22
|
+
/**
|
|
23
|
+
* 验证金额
|
|
24
|
+
*/
|
|
25
|
+
export declare function validateAmount(amount: string | number): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 生成唯一订单ID
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateOrderId(prefix?: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* 检查是否为有效的支付方式代码
|
|
32
|
+
*/
|
|
33
|
+
export declare function isValidPaymentMethodCode(code: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 安全地解析JSON
|
|
36
|
+
*/
|
|
37
|
+
export declare function safeJsonParse<T>(jsonString: string, defaultValue: T): T;
|
|
38
|
+
/**
|
|
39
|
+
* 深度克隆对象
|
|
40
|
+
*/
|
|
41
|
+
export declare function deepClone<T>(obj: T): T;
|
|
42
|
+
/**
|
|
43
|
+
* 防抖函数
|
|
44
|
+
*/
|
|
45
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
46
|
+
/**
|
|
47
|
+
* 节流函数
|
|
48
|
+
*/
|
|
49
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
50
|
+
/**
|
|
51
|
+
* 重试函数
|
|
52
|
+
*/
|
|
53
|
+
export declare function retry<T>(fn: () => Promise<T>, maxAttempts?: number, delay?: number): Promise<T>;
|
|
54
|
+
/**
|
|
55
|
+
* 检查对象是否为空
|
|
56
|
+
*/
|
|
57
|
+
export declare function isEmpty(obj: any): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* 获取错误消息
|
|
60
|
+
*/
|
|
61
|
+
export declare function getErrorMessage(error: unknown): string;
|
|
62
|
+
/**
|
|
63
|
+
* 检查是否为生产环境
|
|
64
|
+
*/
|
|
65
|
+
export declare function isProduction(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 日志记录器
|
|
68
|
+
*/
|
|
69
|
+
export declare const logger: {
|
|
70
|
+
info: (message: string, ...args: any[]) => void;
|
|
71
|
+
warn: (message: string, ...args: any[]) => void;
|
|
72
|
+
error: (message: string, ...args: any[]) => void;
|
|
73
|
+
debug: (message: string, ...args: any[]) => void;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* 验证本地订单数据
|
|
77
|
+
*/
|
|
78
|
+
export declare function validateLocalOrderData(orderData: LocalOrderData): {
|
|
79
|
+
valid: boolean;
|
|
80
|
+
errors: string[];
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* 生成本地订单ID
|
|
84
|
+
*/
|
|
85
|
+
export declare function generateLocalOrderId(): string;
|
|
86
|
+
/**
|
|
87
|
+
* 格式化日期时间为 YYYY-MM-DD hh:mm:ss 格式
|
|
88
|
+
*
|
|
89
|
+
* @param date 要格式化的日期对象
|
|
90
|
+
* @returns 格式化后的日期时间字符串
|
|
91
|
+
*/
|
|
92
|
+
export declare function formatDateTime(date: Date): string;
|
|
93
|
+
/**
|
|
94
|
+
* 从购物车小计数据中提取金额信息
|
|
95
|
+
*/
|
|
96
|
+
export declare function extractAmountFromCartSummary(cartSummary: CartSummaryItem[]): ExtractedAmountInfo;
|
|
97
|
+
/**
|
|
98
|
+
* 计算购物车总金额
|
|
99
|
+
*/
|
|
100
|
+
export declare function calculateTotalAmount(cartItems: CartItem[]): string;
|
|
101
|
+
/**
|
|
102
|
+
* 判断订单ID是否为本地生成的虚拟ID
|
|
103
|
+
*
|
|
104
|
+
* @param orderId 订单ID
|
|
105
|
+
* @returns true 表示是虚拟ID,false 表示是真实的后端ID
|
|
106
|
+
*/
|
|
107
|
+
export declare function isVirtualOrderId(orderId: string): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* 判断支付方式是否需要同步订单到后端
|
|
110
|
+
*
|
|
111
|
+
* 现金支付(CASHMANUAL)和自定义支付不需要同步,其他支付方式需要同步
|
|
112
|
+
*
|
|
113
|
+
* @param paymentCode 支付方式代码
|
|
114
|
+
* @param paymentType 支付方式类型
|
|
115
|
+
* @returns 是否需要同步订单
|
|
116
|
+
*/
|
|
117
|
+
export declare function shouldSyncOrderForPayment(paymentCode: string, paymentType: string): boolean;
|