@pisell/pisellos 2.1.4 → 2.1.5
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 +68 -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 +51 -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
|
@@ -1,47 +1,767 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 支付相关类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 支付方式枚举
|
|
6
|
+
*/
|
|
7
|
+
export declare enum PaymentMethodType {
|
|
8
|
+
Cash = "CASHMANUAL",
|
|
9
|
+
Eftpos = "EFTPOS",
|
|
10
|
+
Wallet = "WALLET"
|
|
6
11
|
}
|
|
7
12
|
/**
|
|
8
|
-
*
|
|
13
|
+
* 支付状态枚举
|
|
9
14
|
*/
|
|
10
|
-
export
|
|
15
|
+
export declare enum PaymentStatus {
|
|
16
|
+
/** 支付处理中 - 订单正在进行支付操作 */
|
|
17
|
+
Processing = "payment_processing",
|
|
18
|
+
/** 同步中 - 暂时不使用,为了向后兼容保留 */
|
|
19
|
+
Sync = "sync",
|
|
20
|
+
/** 部分支付 - 支付金额不足订单总金额 */
|
|
21
|
+
PartiallyPaid = "partially_paid",
|
|
22
|
+
/** 已完成 - 本地支付完成,后台自动同步到服务器 */
|
|
23
|
+
Finished = "finish"
|
|
24
|
+
}
|
|
11
25
|
/**
|
|
12
|
-
*
|
|
26
|
+
* 任务状态枚举
|
|
13
27
|
*/
|
|
14
|
-
export
|
|
28
|
+
export declare enum TaskRunStatus {
|
|
29
|
+
Pending = "pending",
|
|
30
|
+
Running = "running",
|
|
31
|
+
Success = "success",
|
|
32
|
+
Failed = "failed"
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 舍入规则枚举
|
|
36
|
+
*/
|
|
37
|
+
export declare enum RoundingRule {
|
|
38
|
+
/** 标准舍入(中点向上) */
|
|
39
|
+
Standard = "standard_rounding",
|
|
40
|
+
/** 标准舍入(中点向下) */
|
|
41
|
+
StandardDown = "standard_down",
|
|
42
|
+
/** 总是向上舍入 */
|
|
43
|
+
AlwaysUp = "always_up",
|
|
44
|
+
/** 总是向下舍入 */
|
|
45
|
+
AlwaysDown = "always_down"
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 舍入结果
|
|
49
|
+
*/
|
|
50
|
+
export interface RoundingResult {
|
|
51
|
+
/** 原始金额 */
|
|
52
|
+
originalAmount: string;
|
|
53
|
+
/** 舍入后的金额 */
|
|
54
|
+
roundedAmount: string;
|
|
55
|
+
/** 舍入差额(舍入后金额 - 原始金额) */
|
|
56
|
+
roundingDifference: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 舍入间隔枚举
|
|
60
|
+
*/
|
|
61
|
+
export declare enum RoundingInterval {
|
|
62
|
+
/** 0.05 间隔 */
|
|
63
|
+
Interval005 = 0.05,
|
|
64
|
+
/** 0.1 间隔 */
|
|
65
|
+
Interval01 = 0.1,
|
|
66
|
+
/** 0.5 间隔 */
|
|
67
|
+
Interval05 = 0.5,
|
|
68
|
+
/** 1 间隔 */
|
|
69
|
+
Interval1 = 1
|
|
70
|
+
}
|
|
15
71
|
/**
|
|
16
|
-
*
|
|
72
|
+
* 支付方式信息
|
|
17
73
|
*/
|
|
18
|
-
export interface
|
|
74
|
+
export interface PaymentMethod {
|
|
75
|
+
/** 支付方式ID */
|
|
76
|
+
id: number;
|
|
77
|
+
/** 支付方式代码 */
|
|
78
|
+
code: string;
|
|
79
|
+
/** 支付方式名称 */
|
|
80
|
+
name: string;
|
|
81
|
+
/** 支付方式类型 */
|
|
82
|
+
type: string;
|
|
83
|
+
/** 是否启用 */
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
/** 其他配置信息 */
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 支付项
|
|
90
|
+
*/
|
|
91
|
+
export interface PaymentItem {
|
|
92
|
+
/** 当前支付项的唯一 ID */
|
|
93
|
+
uuid: string;
|
|
94
|
+
/** 当前支付方式付出去多少钱 */
|
|
95
|
+
amount: string;
|
|
96
|
+
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
97
|
+
code: string;
|
|
98
|
+
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
99
|
+
id: number;
|
|
100
|
+
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
101
|
+
name: string;
|
|
102
|
+
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
103
|
+
type: string;
|
|
104
|
+
/** 代金券、充值卡、积分卡等wallet pass id */
|
|
105
|
+
voucher_id?: string;
|
|
106
|
+
/** 拓展参数字段 */
|
|
107
|
+
metadata?: {
|
|
108
|
+
/** 钱箱 ID */
|
|
109
|
+
shop_wallet_pass_id?: string;
|
|
110
|
+
/** 唯一支付号 */
|
|
111
|
+
unique_payment_number?: string;
|
|
112
|
+
/** rouding规则 */
|
|
113
|
+
rounding_rule?: any;
|
|
114
|
+
/** 实付金额(现金支付时的实际给出金额) */
|
|
115
|
+
actual_paid_amount?: number;
|
|
116
|
+
/** 找零金额(现金支付时的找零金额) */
|
|
117
|
+
change_given_amount?: number;
|
|
118
|
+
};
|
|
119
|
+
/** rouding金额 */
|
|
120
|
+
rounding_amount?: string;
|
|
121
|
+
/** 三方支付手续费 */
|
|
122
|
+
service_charge?: {
|
|
123
|
+
percentage?: string;
|
|
124
|
+
amount?: string;
|
|
125
|
+
};
|
|
126
|
+
/** 支付项状态 */
|
|
127
|
+
status?: 'active' | 'voided';
|
|
128
|
+
/** 原始金额(用于记录撤销前的金额) */
|
|
129
|
+
origin_amount?: string;
|
|
130
|
+
/** 订单支付类型 */
|
|
131
|
+
order_payment_type?: 'normal' | 'deposit';
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 订单信息
|
|
135
|
+
*/
|
|
136
|
+
export interface OrderInfo {
|
|
137
|
+
/** 订单 id */
|
|
138
|
+
order_id: number;
|
|
139
|
+
/** 订单总金额 */
|
|
140
|
+
total_amount: string;
|
|
141
|
+
/** 是否是定金订单 */
|
|
142
|
+
is_deposit: number;
|
|
143
|
+
/** 定金金额 */
|
|
144
|
+
deposit_amount: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* 支付订单(简化版,仅保留支付相关信息)
|
|
148
|
+
*/
|
|
149
|
+
export interface PaymentOrder {
|
|
150
|
+
/** 当前订单的唯一 ID */
|
|
151
|
+
uuid: string;
|
|
152
|
+
/** 订单ID(字符串类型,支持本地虚拟ID) */
|
|
19
153
|
id: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
154
|
+
/** 订单ID(数字类型,兼容旧版本) */
|
|
155
|
+
order_id: string;
|
|
156
|
+
/** 支付项列表 */
|
|
157
|
+
payment: PaymentItem[];
|
|
158
|
+
/** 修改的支付项列表 */
|
|
159
|
+
adjust_offline_payments: PaymentItem[];
|
|
160
|
+
/** 总计金额 */
|
|
161
|
+
total_amount: string;
|
|
162
|
+
/** 待付金额 */
|
|
163
|
+
expect_amount: string;
|
|
164
|
+
/** 支付状态 */
|
|
165
|
+
payment_status: PaymentStatus;
|
|
166
|
+
/** 是否是定金订单 */
|
|
167
|
+
is_deposit: number;
|
|
168
|
+
/** 定金金额 */
|
|
169
|
+
deposit_amount: string;
|
|
170
|
+
/** 总税费 */
|
|
171
|
+
tax_fee: string;
|
|
172
|
+
/** 原始订单数据(由 Checkout 模块传入) */
|
|
173
|
+
order_info?: any;
|
|
29
174
|
}
|
|
30
175
|
/**
|
|
31
|
-
*
|
|
176
|
+
* 支付状态
|
|
32
177
|
*/
|
|
33
178
|
export interface PaymentState {
|
|
34
|
-
currentPayment: Payment | null;
|
|
35
|
-
paymentHistory: Payment[];
|
|
36
179
|
}
|
|
37
180
|
/**
|
|
38
|
-
*
|
|
181
|
+
* 推送订单参数(简化版)
|
|
182
|
+
*/
|
|
183
|
+
export interface PushOrderParams {
|
|
184
|
+
/** 订单ID */
|
|
185
|
+
order_id: string;
|
|
186
|
+
/** 总金额 */
|
|
187
|
+
total_amount: string;
|
|
188
|
+
/** 是否是定金订单 */
|
|
189
|
+
is_deposit?: number;
|
|
190
|
+
/** 定金金额 */
|
|
191
|
+
deposit_amount?: string;
|
|
192
|
+
/** 原始订单数据(可选,由 Checkout 模块传入) */
|
|
193
|
+
order_info?: any;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* 更新订单参数
|
|
197
|
+
*/
|
|
198
|
+
export interface UpdateOrderParams {
|
|
199
|
+
/** 订单UUID */
|
|
200
|
+
uuid: string;
|
|
201
|
+
/** 更新的字段 */
|
|
202
|
+
[key: string]: any;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 支付项输入类型(允许 amount 为数字)
|
|
206
|
+
*/
|
|
207
|
+
export interface PaymentItemInput {
|
|
208
|
+
/** 当前支付方式付出去多少钱 */
|
|
209
|
+
amount: string | number;
|
|
210
|
+
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
211
|
+
code: string;
|
|
212
|
+
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
213
|
+
id: number;
|
|
214
|
+
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
215
|
+
name: string;
|
|
216
|
+
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
217
|
+
type: string;
|
|
218
|
+
/** 代金券、充值卡、积分卡等wallet pass id */
|
|
219
|
+
voucher_id?: string;
|
|
220
|
+
/** 三方支付手续费 */
|
|
221
|
+
service_charge?: {
|
|
222
|
+
percentage?: string;
|
|
223
|
+
amount?: string;
|
|
224
|
+
};
|
|
225
|
+
/** 舍入金额 */
|
|
226
|
+
rounding_amount?: string;
|
|
227
|
+
/** 订单支付类型 */
|
|
228
|
+
order_payment_type?: 'normal' | 'deposit';
|
|
229
|
+
/** 扩展参数字段 */
|
|
230
|
+
metadata?: {
|
|
231
|
+
/** 钱箱 ID */
|
|
232
|
+
shop_wallet_pass_id?: string;
|
|
233
|
+
/** 唯一支付号 */
|
|
234
|
+
unique_payment_number?: string;
|
|
235
|
+
/** rounding规则 */
|
|
236
|
+
rounding_rule?: any;
|
|
237
|
+
/** 实付金额(现金支付时的实际给出金额) */
|
|
238
|
+
actual_paid_amount?: number;
|
|
239
|
+
/** 找零金额(现金支付时的找零金额) */
|
|
240
|
+
change_given_amount?: number;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* 推送支付项参数
|
|
245
|
+
*/
|
|
246
|
+
export interface PushPaymentParams {
|
|
247
|
+
/** 订单UUID */
|
|
248
|
+
orderUuid: string;
|
|
249
|
+
/** 支付项信息 */
|
|
250
|
+
paymentItem: PaymentItemInput;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* 更新支付项参数中的字段类型(允许 amount 为数字)
|
|
254
|
+
*/
|
|
255
|
+
export interface PaymentUpdateFields {
|
|
256
|
+
/** 当前支付项的唯一 ID */
|
|
257
|
+
uuid?: string;
|
|
258
|
+
/** 当前支付方式付出去多少钱 */
|
|
259
|
+
amount?: string | number;
|
|
260
|
+
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
261
|
+
code?: string;
|
|
262
|
+
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
263
|
+
id?: number;
|
|
264
|
+
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
265
|
+
name?: string;
|
|
266
|
+
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
267
|
+
type?: string;
|
|
268
|
+
/** 代金券、充值卡、积分卡等wallet pass id */
|
|
269
|
+
voucher_id?: string;
|
|
270
|
+
/** 该支付项是否已经同步给后端服务器(只有网络请求成功后才为true) */
|
|
271
|
+
isSynced?: boolean;
|
|
272
|
+
/** 同步错误信息(业务错误时记录错误信息,用于区分"未同步"和"同步失败") */
|
|
273
|
+
syncError?: {
|
|
274
|
+
error: string;
|
|
275
|
+
errorCode?: string;
|
|
276
|
+
statusCode?: number;
|
|
277
|
+
timestamp: number;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* 更新支付项参数
|
|
282
|
+
*/
|
|
283
|
+
export interface UpdatePaymentParams {
|
|
284
|
+
/** 订单UUID */
|
|
285
|
+
orderUuid: string;
|
|
286
|
+
/** 支付项UUID */
|
|
287
|
+
paymentUuid: string;
|
|
288
|
+
/** 更新的字段 */
|
|
289
|
+
params: PaymentUpdateFields;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* 删除支付项参数
|
|
293
|
+
*/
|
|
294
|
+
export interface DeletePaymentParams {
|
|
295
|
+
/** 订单UUID */
|
|
296
|
+
orderUuid: string;
|
|
297
|
+
/** 支付项UUID */
|
|
298
|
+
paymentUuid: string;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* 现金支付接口
|
|
302
|
+
*/
|
|
303
|
+
export interface CashPayment {
|
|
304
|
+
/** 处理现金支付 */
|
|
305
|
+
processCashPayment: (amount: number, orderUuid: string) => Promise<void>;
|
|
306
|
+
/** 获取现金余额 */
|
|
307
|
+
getCashBalance: () => Promise<number>;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Eftpos支付接口
|
|
311
|
+
*/
|
|
312
|
+
export interface EftposPayment {
|
|
313
|
+
/** 处理Eftpos支付 */
|
|
314
|
+
processEftposPayment: (amount: number, orderUuid: string) => Promise<void>;
|
|
315
|
+
/** 检查Eftpos设备状态 */
|
|
316
|
+
checkDeviceStatus: () => Promise<boolean>;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* 钱包支付接口
|
|
320
|
+
*/
|
|
321
|
+
export interface WalletPassPayment {
|
|
322
|
+
/** 生成钱包API默认参数 */
|
|
323
|
+
generateWalletParams: (businessData: WalletInitBusinessData) => WalletDeductionRecommendParams;
|
|
324
|
+
/** 获取已存储的钱包参数 */
|
|
325
|
+
getStoredWalletParams: () => WalletDeductionRecommendParams | null;
|
|
326
|
+
/** 清理已存储的钱包参数 */
|
|
327
|
+
clearStoredWalletParams: () => void;
|
|
328
|
+
/** 初始化钱包数据(从业务数据开始,内部生成参数) */
|
|
329
|
+
initializeWalletDataFromBusinessAsync: (businessData: WalletInitBusinessData) => Promise<{
|
|
330
|
+
walletRecommendList: WalletRecommendItem[];
|
|
331
|
+
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
332
|
+
}>;
|
|
333
|
+
/** 初始化钱包数据(先获取推荐列表,再获取用户识别码列表) */
|
|
334
|
+
initializeWalletDataAsync: (baseParams: WalletDeductionRecommendParams) => Promise<{
|
|
335
|
+
walletRecommendList: WalletRecommendItem[];
|
|
336
|
+
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
337
|
+
}>;
|
|
338
|
+
/** 获取钱包推荐扣款列表(异步获取并缓存) */
|
|
339
|
+
getWalletPassRecommendListAsync: (params: WalletDeductionRecommendParams) => Promise<WalletRecommendItem[]>;
|
|
340
|
+
/** 查询用户识别码列表(异步获取并缓存) */
|
|
341
|
+
getUserIdentificationCodeListAsync: (params: UserIdentificationCodeParams) => Promise<UserIdentificationCodeItem[]>;
|
|
342
|
+
/** 搜索识别码信息 */
|
|
343
|
+
searchIdentificationCodeAsync: (params: SearchIdentificationCodeParams) => Promise<SearchIdentificationCodeResult>;
|
|
344
|
+
/** 获取缓存的搜索结果列表 */
|
|
345
|
+
getSearchResults: () => SearchIdentificationCodeItem[];
|
|
346
|
+
/** 根据识别码查找搜索结果 */
|
|
347
|
+
findSearchResultByCode: (code: string) => SearchIdentificationCodeItem | undefined;
|
|
348
|
+
/** 获取缓存的钱包推荐列表 */
|
|
349
|
+
getWalletRecommendList: () => WalletRecommendItem[];
|
|
350
|
+
/** 获取缓存的用户识别码列表 */
|
|
351
|
+
getUserIdentificationCodes: () => UserIdentificationCodeItem[];
|
|
352
|
+
/** 清除钱包推荐列表 */
|
|
353
|
+
clearWalletRecommendList: () => void;
|
|
354
|
+
/** 清除用户识别码列表 */
|
|
355
|
+
clearUserIdentificationCodes: () => void;
|
|
356
|
+
/** 清除搜索结果缓存 */
|
|
357
|
+
clearSearchResults: () => void;
|
|
358
|
+
/** 清除所有缓存数据 */
|
|
359
|
+
clearAllCache: () => void;
|
|
360
|
+
/** 处理钱包支付 */
|
|
361
|
+
processWalletPayment: (amount: number, orderUuid: string, voucherId?: string) => Promise<void>;
|
|
362
|
+
/** 获取钱包余额 */
|
|
363
|
+
getWalletBalance: (voucherId: string) => Promise<number>;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 支付模块API接口
|
|
39
367
|
*/
|
|
40
368
|
export interface PaymentModuleAPI {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
369
|
+
/** 现金支付相关方法 */
|
|
370
|
+
cash: CashPayment;
|
|
371
|
+
/** Eftpos支付相关方法 */
|
|
372
|
+
eftpos: EftposPayment;
|
|
373
|
+
/** 钱包支付相关方法 */
|
|
374
|
+
wallet: WalletPassPayment;
|
|
375
|
+
/** 获取支付方式列表 */
|
|
376
|
+
getPayMethodListAsync: () => Promise<PaymentMethod[]>;
|
|
377
|
+
/** 创建支付订单(仅保存支付相关信息) */
|
|
378
|
+
createPaymentOrderAsync: (params: PushOrderParams) => Promise<PaymentOrder>;
|
|
379
|
+
/** 根据订单UUID获取支付订单 */
|
|
380
|
+
getPaymentOrderByUuidAsync: (orderUuid: string) => Promise<PaymentOrder | null>;
|
|
381
|
+
/** 基于UUID替换订单ID */
|
|
382
|
+
replaceOrderIdByUuidAsync: (orderUuid: string, newOrderId: string) => Promise<PaymentOrder | null>;
|
|
383
|
+
/** 删除支付订单 */
|
|
384
|
+
deletePaymentOrderAsync: (orderUuid: string) => Promise<void>;
|
|
385
|
+
/** 获取支付项 */
|
|
386
|
+
getPaymentItemsAsync: (orderUuid: string, includeVoided?: boolean) => Promise<PaymentItem[]>;
|
|
387
|
+
/** 获取所有支付项(包括已撤销的) */
|
|
388
|
+
getAllPaymentItemsAsync: (orderUuid: string) => Promise<PaymentItem[]>;
|
|
389
|
+
/** 为某个订单添加支付项 */
|
|
390
|
+
addPaymentItemAsync: (orderUuid: string, paymentItem: PaymentItemInput) => Promise<void>;
|
|
391
|
+
/** 删除支付项 */
|
|
392
|
+
deletePaymentAsync: (orderUuid: string, paymentUuid: string) => Promise<void>;
|
|
393
|
+
/** 更新支付项 */
|
|
394
|
+
updatePaymentAsync: (orderUuid: string, paymentUuid: string, params: PaymentUpdateFields) => Promise<void>;
|
|
395
|
+
/** 批量更新代金券类支付项(覆盖更新) */
|
|
396
|
+
updateVoucherPaymentItemsAsync: (orderUuid: string, voucherPaymentItems: PaymentItemInput[]) => Promise<void>;
|
|
397
|
+
/** 获取订单剩余待付金额 */
|
|
398
|
+
getRemainingOrderAmountAsync: (orderUuid: string) => Promise<number>;
|
|
399
|
+
/** 获取订单剩余待付金额(基于用户输入的金额) */
|
|
400
|
+
getRemainingOrderAmountWithInputAsync: (inputAmount: string | number, orderUuid: string) => Promise<number>;
|
|
401
|
+
/**
|
|
402
|
+
* 智能金额舍入
|
|
403
|
+
* @param originalAmount 原始金额
|
|
404
|
+
* @param interval 舍入间隔 (0.05, 0.1, 0.5, 1)
|
|
405
|
+
* @param rule 舍入规则 (standard, standard_down, always_up, always_down)
|
|
406
|
+
* @returns 舍入后的金额
|
|
407
|
+
*/
|
|
408
|
+
roundAmountAsync: (originalAmount: number | string, interval: RoundingInterval | number, rule: RoundingRule | string) => Promise<RoundingResult>;
|
|
409
|
+
/** 提交支付 */
|
|
410
|
+
submitPayAsync: (orderUuid?: string) => Promise<{
|
|
411
|
+
status: 'success' | 'failed';
|
|
412
|
+
}>;
|
|
413
|
+
/** 获取部分支付的订单 */
|
|
414
|
+
getPartiallyPaidOrdersAsync: () => Promise<PaymentOrder[]>;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* 订单变化事件数据
|
|
418
|
+
*/
|
|
419
|
+
export interface OnOrderChangedEventData {
|
|
420
|
+
/** 操作类型 */
|
|
421
|
+
action: 'add' | 'delete' | 'update' | 'payment_add' | 'payment_delete' | 'payment_update' | 'submit';
|
|
422
|
+
/** 当前订单 */
|
|
423
|
+
order: PaymentOrder;
|
|
424
|
+
/** 原始订单(仅在 update 操作时提供) */
|
|
425
|
+
originalOrder?: PaymentOrder;
|
|
426
|
+
/** 相关的支付项(仅在 payment_* 操作时提供) */
|
|
427
|
+
paymentItem?: PaymentItem;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* 支付方式变化事件数据
|
|
431
|
+
*/
|
|
432
|
+
export interface OnPaymentMethodsChangedEventData {
|
|
433
|
+
/** 旧的支付方式列表 */
|
|
434
|
+
oldMethods: PaymentMethod[];
|
|
435
|
+
/** 新的支付方式列表 */
|
|
436
|
+
newMethods: PaymentMethod[];
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* 支付同步错误事件数据
|
|
440
|
+
*/
|
|
441
|
+
export interface OnPaymentSyncErrorEventData {
|
|
442
|
+
/** 订单UUID */
|
|
443
|
+
orderUuid: string;
|
|
444
|
+
/** 订单ID */
|
|
445
|
+
orderId: number;
|
|
446
|
+
/** 错误信息 */
|
|
447
|
+
error: string;
|
|
448
|
+
/** 错误代码 */
|
|
449
|
+
errorCode?: string;
|
|
450
|
+
/** HTTP状态码 */
|
|
451
|
+
statusCode?: number;
|
|
452
|
+
/** 错误发生时间 */
|
|
453
|
+
timestamp: number;
|
|
454
|
+
/** 响应数据(当HTTP请求成功但业务失败时) */
|
|
455
|
+
responseData?: any;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* 支付同步成功事件数据
|
|
459
|
+
*/
|
|
460
|
+
export interface OnPaymentSyncSuccessEventData {
|
|
461
|
+
/** 订单UUID */
|
|
462
|
+
orderUuid: string;
|
|
463
|
+
/** 订单ID */
|
|
464
|
+
orderId: number;
|
|
465
|
+
/** 成功时间 */
|
|
466
|
+
timestamp: number;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* 钱包推荐列表更新事件数据
|
|
470
|
+
*/
|
|
471
|
+
export interface OnWalletRecommendListUpdatedEventData {
|
|
472
|
+
/** 新的钱包推荐列表 */
|
|
473
|
+
walletRecommendList: WalletRecommendItem[];
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* 用户识别码列表更新事件数据
|
|
477
|
+
*/
|
|
478
|
+
export interface OnUserIdentificationCodesUpdatedEventData {
|
|
479
|
+
/** 新的用户识别码列表 */
|
|
480
|
+
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* 钱包缓存清除事件数据
|
|
484
|
+
*/
|
|
485
|
+
export interface OnWalletCacheClearedEventData {
|
|
486
|
+
/** 清除的数据类型 */
|
|
487
|
+
clearedTypes: ('walletRecommendList' | 'userIdentificationCodes' | 'all')[];
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* 搜索识别码完成事件数据
|
|
491
|
+
*/
|
|
492
|
+
export interface OnSearchIdentificationCodeCompletedEventData {
|
|
493
|
+
/** 当前搜索的识别码 */
|
|
494
|
+
searchCode: string;
|
|
495
|
+
/** 当前搜索返回的结果 */
|
|
496
|
+
currentSearchResults: SearchIdentificationCodeItem[];
|
|
497
|
+
/** 缓存中的所有搜索结果 */
|
|
498
|
+
cachedSearchResults: SearchIdentificationCodeItem[];
|
|
499
|
+
/** 搜索参数 */
|
|
500
|
+
searchParams: SearchIdentificationCodeParams;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* 钱包初始化开始事件数据
|
|
504
|
+
*/
|
|
505
|
+
export interface OnWalletInitializationStartedEventData {
|
|
506
|
+
/** 业务数据 */
|
|
507
|
+
businessData: WalletInitBusinessData;
|
|
508
|
+
/** 开始时间 */
|
|
509
|
+
startTime: number;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* 钱包初始化完成事件数据
|
|
513
|
+
*/
|
|
514
|
+
export interface OnWalletInitializationCompletedEventData {
|
|
515
|
+
/** 业务数据 */
|
|
516
|
+
businessData: WalletInitBusinessData;
|
|
517
|
+
/** 初始化结果 */
|
|
518
|
+
result: {
|
|
519
|
+
walletRecommendList: WalletRecommendItem[];
|
|
520
|
+
userIdentificationCodes: UserIdentificationCodeItem[];
|
|
521
|
+
};
|
|
522
|
+
/** 开始时间 */
|
|
523
|
+
startTime: number;
|
|
524
|
+
/** 结束时间 */
|
|
525
|
+
endTime: number;
|
|
526
|
+
/** 执行时长(毫秒) */
|
|
527
|
+
duration: number;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* 钱包初始化失败事件数据
|
|
531
|
+
*/
|
|
532
|
+
export interface OnWalletInitializationFailedEventData {
|
|
533
|
+
/** 业务数据 */
|
|
534
|
+
businessData: WalletInitBusinessData;
|
|
535
|
+
/** 错误信息 */
|
|
536
|
+
error: Error;
|
|
537
|
+
/** 开始时间 */
|
|
538
|
+
startTime: number;
|
|
539
|
+
/** 结束时间 */
|
|
540
|
+
endTime: number;
|
|
541
|
+
/** 执行时长(毫秒) */
|
|
542
|
+
duration: number;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* 钱包支付事件枚举
|
|
546
|
+
*/
|
|
547
|
+
export declare enum WalletPassHooks {
|
|
548
|
+
OnWalletRecommendListUpdated = "wallet:onWalletRecommendListUpdated",
|
|
549
|
+
OnWalletRecommendListCleared = "wallet:onWalletRecommendListCleared",
|
|
550
|
+
OnUserIdentificationCodesUpdated = "wallet:onUserIdentificationCodesUpdated",
|
|
551
|
+
OnUserIdentificationCodesCleared = "wallet:onUserIdentificationCodesCleared",
|
|
552
|
+
OnWalletCacheCleared = "wallet:onWalletCacheCleared",
|
|
553
|
+
OnSearchIdentificationCodeCompleted = "wallet:onSearchIdentificationCodeCompleted",
|
|
554
|
+
OnWalletInitializationStarted = "wallet:onWalletInitializationStarted",
|
|
555
|
+
OnWalletInitializationCompleted = "wallet:onWalletInitializationCompleted",
|
|
556
|
+
OnWalletInitializationFailed = "wallet:onWalletInitializationFailed"
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* 支付钩子事件(统一接口)
|
|
560
|
+
*/
|
|
561
|
+
export declare enum PaymentHooks {
|
|
562
|
+
OnPaymentMethodsLoaded = "payment:onPaymentMethodsLoaded",
|
|
563
|
+
OnPaymentMethodsChanged = "payment:onPaymentMethodsChanged",
|
|
564
|
+
OnOrderChanged = "payment:onOrderChanged",
|
|
565
|
+
OnOrderAdded = "payment:onOrderAdded",
|
|
566
|
+
OnOrderUpdated = "payment:onOrderUpdated",
|
|
567
|
+
OnOrderDeleted = "payment:onOrderDeleted",
|
|
568
|
+
OnPaymentAdded = "payment:onPaymentAdded",
|
|
569
|
+
OnPaymentUpdated = "payment:onPaymentUpdated",
|
|
570
|
+
OnPaymentDeleted = "payment:onPaymentDeleted",
|
|
571
|
+
OnPaymentSubmitted = "payment:onPaymentSubmitted",
|
|
572
|
+
OnOrderAmountChanged = "payment:onOrderAmountChanged",
|
|
573
|
+
OnPaymentSyncError = "payment:onPaymentSyncError",
|
|
574
|
+
OnPaymentSyncSuccess = "payment:onPaymentSyncSuccess",
|
|
575
|
+
OnWalletRecommendListUpdated = "wallet:onWalletRecommendListUpdated",
|
|
576
|
+
OnWalletRecommendListCleared = "wallet:onWalletRecommendListCleared",
|
|
577
|
+
OnUserIdentificationCodesUpdated = "wallet:onUserIdentificationCodesUpdated",
|
|
578
|
+
OnUserIdentificationCodesCleared = "wallet:onUserIdentificationCodesCleared",
|
|
579
|
+
OnWalletCacheCleared = "wallet:onWalletCacheCleared",
|
|
580
|
+
OnSearchIdentificationCodeCompleted = "wallet:onSearchIdentificationCodeCompleted"
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* 钱包推荐扣款请求参数
|
|
584
|
+
*/
|
|
585
|
+
export interface WalletDeductionRecommendParams {
|
|
586
|
+
/** 销售渠道 */
|
|
587
|
+
sale_channel: string;
|
|
588
|
+
/** 前端设置只想要的字段 */
|
|
589
|
+
expect_columns?: string[];
|
|
590
|
+
/** 客户id */
|
|
591
|
+
customer_id?: number;
|
|
592
|
+
/** 订单总计金额 */
|
|
593
|
+
order_expect_amount: number;
|
|
594
|
+
/** 订单小计金额 */
|
|
595
|
+
order_product_amount: number;
|
|
596
|
+
/** 订单待支付金额 */
|
|
597
|
+
order_wait_pay_amount: number;
|
|
598
|
+
/** 统计计数用户id */
|
|
599
|
+
order_behavior_count_customer_id?: number;
|
|
600
|
+
/** 已选商品 */
|
|
601
|
+
products: {
|
|
602
|
+
/** 商品id */
|
|
603
|
+
product_id: number;
|
|
604
|
+
/** 商品variant_id */
|
|
605
|
+
product_variant_id: string;
|
|
606
|
+
/** 商品数量 */
|
|
607
|
+
quantity: number;
|
|
608
|
+
/** 商品使用了所有优惠后的最终价格 */
|
|
609
|
+
selling_price: number;
|
|
610
|
+
}[];
|
|
611
|
+
/** 预备支付 */
|
|
612
|
+
prepare_payments?: {
|
|
613
|
+
voucher_id: number;
|
|
614
|
+
amount: number;
|
|
615
|
+
tag: string;
|
|
616
|
+
}[];
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* 钱包初始化业务数据接口
|
|
620
|
+
* 用于生成钱包API参数的必要业务信息
|
|
621
|
+
*/
|
|
622
|
+
export interface WalletInitBusinessData {
|
|
623
|
+
/** 客户ID(可选) */
|
|
624
|
+
customer_id?: number;
|
|
625
|
+
/** 金额信息 */
|
|
626
|
+
amountInfo: {
|
|
627
|
+
totalAmount: string;
|
|
628
|
+
subTotal: string;
|
|
629
|
+
};
|
|
630
|
+
/** 商品列表 */
|
|
631
|
+
products: {
|
|
632
|
+
product_id: number;
|
|
633
|
+
product_variant_id: string;
|
|
634
|
+
quantity: number;
|
|
635
|
+
selling_price: number;
|
|
636
|
+
}[];
|
|
637
|
+
order_wait_pay_amount?: number;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* 查询用户识别码列表请求参数
|
|
641
|
+
*/
|
|
642
|
+
export interface UserIdentificationCodeParams extends WalletDeductionRecommendParams {
|
|
643
|
+
/** 是否可用 */
|
|
644
|
+
available?: 0 | 1 | 2;
|
|
645
|
+
/** 其他精确码 */
|
|
646
|
+
other_exact_codes?: string[];
|
|
647
|
+
/** 过滤预备钱包通行证 */
|
|
648
|
+
filter_prepare_wallet_pass?: 0 | 1;
|
|
649
|
+
/** 预备支付 */
|
|
650
|
+
prepare_payments?: {
|
|
651
|
+
voucher_id: number;
|
|
652
|
+
amount: number;
|
|
653
|
+
tag: string;
|
|
654
|
+
}[];
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* 钱包推荐扣款响应数据
|
|
658
|
+
*/
|
|
659
|
+
export interface WalletDeductionRecommendResponse {
|
|
660
|
+
/** 响应状态码 */
|
|
661
|
+
code?: number;
|
|
662
|
+
/** 响应消息 */
|
|
663
|
+
message?: string;
|
|
664
|
+
/** 响应数据 */
|
|
665
|
+
data?: WalletRecommendItem[];
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* 用户识别码列表响应数据
|
|
669
|
+
*/
|
|
670
|
+
export interface UserIdentificationCodeResponse {
|
|
671
|
+
/** 响应状态码 */
|
|
672
|
+
code?: number;
|
|
673
|
+
/** 响应消息 */
|
|
674
|
+
message?: string;
|
|
675
|
+
/** 响应数据 */
|
|
676
|
+
data?: UserIdentificationCodeItem[];
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* 用户识别码项目
|
|
680
|
+
*/
|
|
681
|
+
export interface UserIdentificationCodeItem {
|
|
682
|
+
/** 识别码ID */
|
|
683
|
+
id: number;
|
|
684
|
+
/** 识别码 */
|
|
685
|
+
code: string;
|
|
686
|
+
/** 识别码名称 */
|
|
687
|
+
name: string;
|
|
688
|
+
/** 识别码类型 */
|
|
689
|
+
type: string;
|
|
690
|
+
/** 是否可用 */
|
|
691
|
+
available: boolean;
|
|
692
|
+
/** 余额信息 */
|
|
693
|
+
balance?: number;
|
|
694
|
+
/** 有效期 */
|
|
695
|
+
expires_at?: string;
|
|
696
|
+
/** 其他扩展字段 */
|
|
697
|
+
[key: string]: any;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* 搜索识别码请求参数
|
|
701
|
+
* 基于 WalletDeductionRecommendParams 并增加 code 字段
|
|
702
|
+
*/
|
|
703
|
+
export interface SearchIdentificationCodeParams extends WalletDeductionRecommendParams {
|
|
704
|
+
/** 识别码 */
|
|
705
|
+
code: string;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* 搜索识别码响应数据
|
|
709
|
+
*/
|
|
710
|
+
export interface SearchIdentificationCodeResponse {
|
|
711
|
+
/** 响应状态码 */
|
|
712
|
+
code?: number;
|
|
713
|
+
/** 响应消息 */
|
|
714
|
+
message?: string;
|
|
715
|
+
/** 响应数据 */
|
|
716
|
+
data?: SearchIdentificationCodeItem[];
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* 搜索识别码结果类型
|
|
720
|
+
*/
|
|
721
|
+
export type SearchIdentificationCodeResult = {
|
|
722
|
+
type: 'walletCode';
|
|
723
|
+
data: SearchIdentificationCodeItem[];
|
|
724
|
+
} | {
|
|
725
|
+
type: 'normalCode';
|
|
726
|
+
data: SearchIdentificationCodeItem[];
|
|
727
|
+
};
|
|
728
|
+
/**
|
|
729
|
+
* 搜索识别码项目
|
|
730
|
+
*/
|
|
731
|
+
export interface SearchIdentificationCodeItem {
|
|
732
|
+
/** 识别码ID */
|
|
733
|
+
id: number;
|
|
734
|
+
/** 识别码 */
|
|
735
|
+
code: string;
|
|
736
|
+
/** 识别码名称 */
|
|
737
|
+
name: string;
|
|
738
|
+
/** 识别码类型 */
|
|
739
|
+
type: string;
|
|
740
|
+
/** 标签 */
|
|
741
|
+
tag?: string;
|
|
742
|
+
/** 是否可用 */
|
|
743
|
+
available: boolean;
|
|
744
|
+
/** 余额信息 */
|
|
745
|
+
balance?: number;
|
|
746
|
+
/** 有效期 */
|
|
747
|
+
expires_at?: string;
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* 钱包推荐项目
|
|
751
|
+
*/
|
|
752
|
+
export interface WalletRecommendItem {
|
|
753
|
+
/** 推荐项目ID */
|
|
754
|
+
id: number;
|
|
755
|
+
/** 推荐项目名称 */
|
|
756
|
+
name: string;
|
|
757
|
+
/** 推荐金额 */
|
|
758
|
+
amount: number;
|
|
759
|
+
/** 项目类型 */
|
|
760
|
+
type: string;
|
|
761
|
+
/** 是否可用 */
|
|
762
|
+
available: boolean;
|
|
763
|
+
/** 优先级 */
|
|
764
|
+
priority?: number;
|
|
765
|
+
/** 其他扩展字段 */
|
|
766
|
+
[key: string]: any;
|
|
47
767
|
}
|