@pisell/pisellos 3.0.57 → 3.0.58
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 -4
- package/dist/effects/index.js +6 -15
- 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/Cart/index.js +1 -1
- package/dist/modules/Payment/index.d.ts +9 -273
- package/dist/modules/Payment/index.js +109 -2525
- package/dist/modules/Payment/types.d.ts +30 -382
- package/dist/modules/Payment/types.js +14 -116
- package/dist/modules/ProductList/index.d.ts +1 -12
- package/dist/modules/ProductList/index.js +3 -27
- package/dist/modules/Rules/index.js +14 -27
- package/dist/modules/Rules/types.d.ts +0 -1
- 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 +1 -9
- package/dist/solution/ShopDiscount/index.js +2 -4
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/dist/types/index.d.ts +1 -3
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +3 -4
- package/lib/effects/index.js +1 -4
- 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/Cart/index.js +1 -1
- package/lib/modules/Payment/index.d.ts +9 -273
- package/lib/modules/Payment/index.js +50 -1285
- package/lib/modules/Payment/types.d.ts +30 -382
- package/lib/modules/Payment/types.js +6 -41
- package/lib/modules/ProductList/index.d.ts +1 -12
- package/lib/modules/ProductList/index.js +2 -29
- package/lib/modules/Rules/index.js +12 -20
- package/lib/modules/Rules/types.d.ts +0 -1
- 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 +2 -1
- package/lib/solution/ShopDiscount/index.js +1 -2
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/lib/types/index.d.ts +1 -3
- package/package.json +2 -4
- 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 -697
- 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 -11
- package/dist/modules/Payment/cash.js +0 -78
- package/dist/modules/Payment/eftpos.d.ts +0 -11
- package/dist/modules/Payment/eftpos.js +0 -80
- package/dist/modules/Payment/wallet.d.ts +0 -11
- package/dist/modules/Payment/wallet.js +0 -78
- package/dist/modules/Payment/walletpass.d.ts +0 -0
- package/dist/modules/Payment/walletpass.js +0 -0
- 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 -172
- package/dist/solution/BookingTicket/index.js +0 -665
- 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 -16
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -174
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -81
- package/dist/solution/BookingTicket/utils/scan/index.js +0 -285
- 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 -181
- package/dist/solution/Checkout/index.js +0 -1596
- package/dist/solution/Checkout/types.d.ts +0 -550
- package/dist/solution/Checkout/types.js +0 -132
- package/dist/solution/Checkout/utils/index.d.ts +0 -73
- package/dist/solution/Checkout/utils/index.js +0 -371
- 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 -440
- 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 -11
- package/lib/modules/Payment/cash.js +0 -51
- package/lib/modules/Payment/eftpos.d.ts +0 -11
- package/lib/modules/Payment/eftpos.js +0 -51
- package/lib/modules/Payment/wallet.d.ts +0 -11
- package/lib/modules/Payment/wallet.js +0 -51
- package/lib/modules/Payment/walletpass.d.ts +0 -0
- package/lib/modules/Payment/walletpass.js +0 -0
- 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 -172
- package/lib/solution/BookingTicket/index.js +0 -399
- 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 -16
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -125
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -81
- package/lib/solution/BookingTicket/utils/scan/index.js +0 -210
- 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 -181
- package/lib/solution/Checkout/index.js +0 -864
- package/lib/solution/Checkout/types.d.ts +0 -550
- package/lib/solution/Checkout/types.js +0 -75
- package/lib/solution/Checkout/utils/index.d.ts +0 -73
- package/lib/solution/Checkout/utils/index.js +0 -266
- 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,399 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export declare enum PaymentMethodType {
|
|
8
|
-
Cash = "CASHMANUAL",
|
|
9
|
-
Eftpos = "EFTPOS",
|
|
10
|
-
Wallet = "WALLET"
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* 支付状态枚举
|
|
14
|
-
*/
|
|
15
|
-
export declare enum PaymentStatus {
|
|
16
|
-
/** 支付处理中 - 订单正在进行支付操作 */
|
|
17
|
-
Processing = "payment_processing",
|
|
18
|
-
/** 同步中 - 暂时不使用,为了向后兼容保留 */
|
|
19
|
-
Sync = "sync",
|
|
20
|
-
/** 部分支付 - 支付金额不足订单总金额 */
|
|
21
|
-
PartiallyPaid = "partially_paid",
|
|
22
|
-
/** 已完成 - 本地支付完成,后台自动同步到服务器 */
|
|
23
|
-
Finished = "finish"
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 任务状态枚举
|
|
27
|
-
*/
|
|
28
|
-
export declare enum TaskRunStatus {
|
|
29
|
-
Pending = "pending",
|
|
30
|
-
Running = "running",
|
|
31
|
-
Success = "success",
|
|
32
|
-
Failed = "failed"
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* 支付方式信息
|
|
36
|
-
*/
|
|
37
|
-
export interface PaymentMethod {
|
|
38
|
-
/** 支付方式ID */
|
|
39
|
-
id: number;
|
|
40
|
-
/** 支付方式代码 */
|
|
41
|
-
code: string;
|
|
42
|
-
/** 支付方式名称 */
|
|
43
|
-
name: string;
|
|
44
|
-
/** 支付方式类型 */
|
|
45
|
-
type: string;
|
|
46
|
-
/** 是否启用 */
|
|
47
|
-
enabled: boolean;
|
|
48
|
-
/** 其他配置信息 */
|
|
49
|
-
[key: string]: any;
|
|
1
|
+
export declare enum PaymentHooks {
|
|
2
|
+
OnPaymentInit = "payment:onPaymentInit",
|
|
3
|
+
OnPaymentSuccess = "payment:onPaymentSuccess",
|
|
4
|
+
OnPaymentFailure = "payment:onPaymentFailure",
|
|
5
|
+
OnPaymentRefund = "payment:onPaymentRefund"
|
|
50
6
|
}
|
|
51
7
|
/**
|
|
52
|
-
*
|
|
8
|
+
* 支付方式
|
|
53
9
|
*/
|
|
54
|
-
export
|
|
55
|
-
/** 当前支付项的唯一 ID */
|
|
56
|
-
uuid: string;
|
|
57
|
-
/** 当前支付方式付出去多少钱 */
|
|
58
|
-
amount: string;
|
|
59
|
-
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
60
|
-
code: string;
|
|
61
|
-
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
62
|
-
id: number;
|
|
63
|
-
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
64
|
-
name: string;
|
|
65
|
-
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
66
|
-
type: string;
|
|
67
|
-
/** 代金券、充值卡、积分卡等wallet pass id */
|
|
68
|
-
voucher_id?: string;
|
|
69
|
-
/** 拓展参数字段 */
|
|
70
|
-
metadata?: {
|
|
71
|
-
/** 钱箱 ID */
|
|
72
|
-
shop_wallet_pass_id?: string;
|
|
73
|
-
/** 唯一支付号 */
|
|
74
|
-
unique_payment_number?: string;
|
|
75
|
-
/** rouding规则 */
|
|
76
|
-
rounding_rule?: any;
|
|
77
|
-
};
|
|
78
|
-
/** rouding金额 */
|
|
79
|
-
rounding_amount?: string;
|
|
80
|
-
/** 三方支付手续费 */
|
|
81
|
-
service_charge?: {
|
|
82
|
-
percentage: string;
|
|
83
|
-
amount: string;
|
|
84
|
-
};
|
|
85
|
-
/** 该支付项是否已经同步给后端服务器(只有网络请求成功后才为true) */
|
|
86
|
-
isSynced?: boolean;
|
|
87
|
-
/** 同步错误信息(业务错误时记录错误信息,用于区分"未同步"和"同步失败") */
|
|
88
|
-
syncError?: {
|
|
89
|
-
error: string;
|
|
90
|
-
errorCode?: string;
|
|
91
|
-
statusCode?: number;
|
|
92
|
-
timestamp: number;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
10
|
+
export type PaymentMethod = 'credit_card' | 'debit_card' | 'paypal' | 'alipay' | 'wechat_pay' | 'bank_transfer';
|
|
95
11
|
/**
|
|
96
|
-
*
|
|
12
|
+
* 支付状态
|
|
97
13
|
*/
|
|
98
|
-
export
|
|
99
|
-
/** 订单 id */
|
|
100
|
-
order_id: number;
|
|
101
|
-
/** 订单总金额 */
|
|
102
|
-
total_amount: string;
|
|
103
|
-
/** 是否是定金订单 */
|
|
104
|
-
is_deposit: number;
|
|
105
|
-
/** 定金金额 */
|
|
106
|
-
deposit_amount: string;
|
|
107
|
-
}
|
|
14
|
+
export type PaymentStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'refunded';
|
|
108
15
|
/**
|
|
109
|
-
*
|
|
16
|
+
* 支付信息
|
|
110
17
|
*/
|
|
111
|
-
export interface
|
|
112
|
-
/** 当前订单的唯一 ID */
|
|
113
|
-
uuid: string;
|
|
114
|
-
/** 订单ID(字符串类型,支持本地虚拟ID) */
|
|
18
|
+
export interface Payment {
|
|
115
19
|
id: string;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
expect_amount: string;
|
|
126
|
-
/** 支付状态 */
|
|
127
|
-
payment_status: PaymentStatus;
|
|
128
|
-
/** 是否是定金订单 */
|
|
129
|
-
is_deposit: number;
|
|
130
|
-
/** 定金金额 */
|
|
131
|
-
deposit_amount: string;
|
|
132
|
-
/** 总税费 */
|
|
133
|
-
tax_fee: string;
|
|
134
|
-
/** 原始订单数据(由 Checkout 模块传入) */
|
|
135
|
-
order_info?: any;
|
|
20
|
+
orderId: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
currency: string;
|
|
23
|
+
method: PaymentMethod;
|
|
24
|
+
status: PaymentStatus;
|
|
25
|
+
transactionId?: string;
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
metadata?: Record<string, any>;
|
|
136
29
|
}
|
|
137
30
|
/**
|
|
138
|
-
*
|
|
31
|
+
* 支付模块状态
|
|
139
32
|
*/
|
|
140
33
|
export interface PaymentState {
|
|
34
|
+
currentPayment: Payment | null;
|
|
35
|
+
paymentHistory: Payment[];
|
|
141
36
|
}
|
|
142
37
|
/**
|
|
143
|
-
*
|
|
144
|
-
*/
|
|
145
|
-
export interface PushOrderParams {
|
|
146
|
-
/** 订单ID */
|
|
147
|
-
order_id: string;
|
|
148
|
-
/** 总金额 */
|
|
149
|
-
total_amount: string;
|
|
150
|
-
/** 是否是定金订单 */
|
|
151
|
-
is_deposit?: number;
|
|
152
|
-
/** 定金金额 */
|
|
153
|
-
deposit_amount?: string;
|
|
154
|
-
/** 原始订单数据(可选,由 Checkout 模块传入) */
|
|
155
|
-
order_info?: any;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* 更新订单参数
|
|
159
|
-
*/
|
|
160
|
-
export interface UpdateOrderParams {
|
|
161
|
-
/** 订单UUID */
|
|
162
|
-
uuid: string;
|
|
163
|
-
/** 更新的字段 */
|
|
164
|
-
[key: string]: any;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* 支付项输入类型(允许 amount 为数字)
|
|
168
|
-
*/
|
|
169
|
-
export interface PaymentItemInput {
|
|
170
|
-
/** 当前支付方式付出去多少钱 */
|
|
171
|
-
amount: string | number;
|
|
172
|
-
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
173
|
-
code: string;
|
|
174
|
-
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
175
|
-
id: number;
|
|
176
|
-
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
177
|
-
name: string;
|
|
178
|
-
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
179
|
-
type: string;
|
|
180
|
-
/** 代金券、充值卡、积分卡等wallet pass id */
|
|
181
|
-
voucher_id?: string;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* 推送支付项参数
|
|
185
|
-
*/
|
|
186
|
-
export interface PushPaymentParams {
|
|
187
|
-
/** 订单UUID */
|
|
188
|
-
orderUuid: string;
|
|
189
|
-
/** 支付项信息 */
|
|
190
|
-
paymentItem: PaymentItemInput;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* 更新支付项参数中的字段类型(允许 amount 为数字)
|
|
194
|
-
*/
|
|
195
|
-
export interface PaymentUpdateFields {
|
|
196
|
-
/** 当前支付项的唯一 ID */
|
|
197
|
-
uuid?: string;
|
|
198
|
-
/** 当前支付方式付出去多少钱 */
|
|
199
|
-
amount?: string | number;
|
|
200
|
-
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
201
|
-
code?: string;
|
|
202
|
-
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
203
|
-
id?: number;
|
|
204
|
-
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
205
|
-
name?: string;
|
|
206
|
-
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
207
|
-
type?: string;
|
|
208
|
-
/** 代金券、充值卡、积分卡等wallet pass id */
|
|
209
|
-
voucher_id?: string;
|
|
210
|
-
/** 该支付项是否已经同步给后端服务器(只有网络请求成功后才为true) */
|
|
211
|
-
isSynced?: boolean;
|
|
212
|
-
/** 同步错误信息(业务错误时记录错误信息,用于区分"未同步"和"同步失败") */
|
|
213
|
-
syncError?: {
|
|
214
|
-
error: string;
|
|
215
|
-
errorCode?: string;
|
|
216
|
-
statusCode?: number;
|
|
217
|
-
timestamp: number;
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* 更新支付项参数
|
|
222
|
-
*/
|
|
223
|
-
export interface UpdatePaymentParams {
|
|
224
|
-
/** 订单UUID */
|
|
225
|
-
orderUuid: string;
|
|
226
|
-
/** 支付项UUID */
|
|
227
|
-
paymentUuid: string;
|
|
228
|
-
/** 更新的字段 */
|
|
229
|
-
params: PaymentUpdateFields;
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* 删除支付项参数
|
|
233
|
-
*/
|
|
234
|
-
export interface DeletePaymentParams {
|
|
235
|
-
/** 订单UUID */
|
|
236
|
-
orderUuid: string;
|
|
237
|
-
/** 支付项UUID */
|
|
238
|
-
paymentUuid: string;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* 现金支付接口
|
|
242
|
-
*/
|
|
243
|
-
export interface CashPayment {
|
|
244
|
-
/** 处理现金支付 */
|
|
245
|
-
processCashPayment: (amount: number, orderUuid: string) => Promise<void>;
|
|
246
|
-
/** 获取现金余额 */
|
|
247
|
-
getCashBalance: () => Promise<number>;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Eftpos支付接口
|
|
251
|
-
*/
|
|
252
|
-
export interface EftposPayment {
|
|
253
|
-
/** 处理Eftpos支付 */
|
|
254
|
-
processEftposPayment: (amount: number, orderUuid: string) => Promise<void>;
|
|
255
|
-
/** 检查Eftpos设备状态 */
|
|
256
|
-
checkDeviceStatus: () => Promise<boolean>;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* 钱包支付接口
|
|
260
|
-
*/
|
|
261
|
-
export interface WalletPayment {
|
|
262
|
-
/** 处理钱包支付 */
|
|
263
|
-
processWalletPayment: (amount: number, orderUuid: string, voucherId?: string) => Promise<void>;
|
|
264
|
-
/** 获取钱包余额 */
|
|
265
|
-
getWalletBalance: (voucherId: string) => Promise<number>;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* 支付模块API接口
|
|
38
|
+
* 支付模块 API
|
|
269
39
|
*/
|
|
270
40
|
export interface PaymentModuleAPI {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
/** 获取支付方式列表 */
|
|
278
|
-
getPayMethodListAsync: () => Promise<PaymentMethod[]>;
|
|
279
|
-
/** 创建支付订单(仅保存支付相关信息) */
|
|
280
|
-
createPaymentOrderAsync: (params: PushOrderParams) => Promise<PaymentOrder>;
|
|
281
|
-
/** 根据订单UUID获取支付订单 */
|
|
282
|
-
getPaymentOrderByUuidAsync: (orderUuid: string) => Promise<PaymentOrder | null>;
|
|
283
|
-
/** 基于UUID替换订单ID */
|
|
284
|
-
replaceOrderIdByUuidAsync: (orderUuid: string, newOrderId: string) => Promise<PaymentOrder | null>;
|
|
285
|
-
/** 删除支付订单 */
|
|
286
|
-
deletePaymentOrderAsync: (orderUuid: string) => Promise<void>;
|
|
287
|
-
/** 获取支付项 */
|
|
288
|
-
getPaymentItemsAsync: (orderUuid: string) => Promise<PaymentItem[]>;
|
|
289
|
-
/** 为某个订单添加支付项 */
|
|
290
|
-
addPaymentItemAsync: (orderUuid: string, paymentItem: PaymentItemInput) => Promise<void>;
|
|
291
|
-
/** 删除支付项 */
|
|
292
|
-
deletePaymentItemAsync: (orderUuid: string, paymentUuid: string) => Promise<void>;
|
|
293
|
-
/** 更新支付项 */
|
|
294
|
-
updatePaymentItemAsync: (orderUuid: string, paymentUuid: string, params: PaymentUpdateFields) => Promise<void>;
|
|
295
|
-
/** 获取订单剩余待付金额 */
|
|
296
|
-
getRemainingAmountAsync: (orderUuid: string) => Promise<number>;
|
|
297
|
-
/** 获取订单剩余待付金额(基于用户输入的金额) */
|
|
298
|
-
getRemainingAmountWithInputAsync: (inputAmount: string | number, orderUuid: string) => Promise<number>;
|
|
299
|
-
/** 提交支付 */
|
|
300
|
-
submitPaymentAsync: (orderUuid: string) => Promise<{
|
|
301
|
-
status: 'success' | 'failed';
|
|
302
|
-
}>;
|
|
303
|
-
/** 获取部分支付的订单 */
|
|
304
|
-
getPartiallyPaidOrdersAsync: () => Promise<PaymentOrder[]>;
|
|
305
|
-
/** 获取未同步到服务器的订单 */
|
|
306
|
-
getUnsyncedOrdersAsync: () => Promise<PaymentOrder[]>;
|
|
307
|
-
/** 检测未同步的订单并重新加入任务队列 */
|
|
308
|
-
recheckAndRequeueUnsyncedOrders: () => Promise<number>;
|
|
309
|
-
/** 手动执行支付同步队列 */
|
|
310
|
-
runPaymentSyncQueue: () => Promise<void>;
|
|
311
|
-
/** @deprecated 使用 createPaymentOrderAsync 替代 */
|
|
312
|
-
pushOrderAsync: (params: PushOrderParams) => Promise<PaymentOrder>;
|
|
313
|
-
/** @deprecated 使用 getPaymentItemsAsync 替代 */
|
|
314
|
-
getPaymentAsync: (orderUuid: string) => Promise<PaymentItem[]>;
|
|
315
|
-
/** @deprecated 使用 addPaymentItemAsync 替代 */
|
|
316
|
-
pushPaymentAsync: (orderUuid: string, paymentItem: PaymentItemInput) => Promise<void>;
|
|
317
|
-
/** @deprecated 使用 deletePaymentItemAsync 替代 */
|
|
318
|
-
deletePaymentAsync: (orderUuid: string, paymentUuid: string) => Promise<void>;
|
|
319
|
-
/** @deprecated 使用 updatePaymentItemAsync 替代 */
|
|
320
|
-
updatePaymentAsync: (orderUuid: string, paymentUuid: string, params: PaymentUpdateFields) => Promise<void>;
|
|
321
|
-
/** @deprecated 使用 submitPaymentAsync 替代 */
|
|
322
|
-
submitPayAsync: (orderUuid?: string) => Promise<{
|
|
323
|
-
status: 'success' | 'failed';
|
|
324
|
-
}>;
|
|
325
|
-
/** @deprecated 使用 getRemainingAmountAsync 替代 */
|
|
326
|
-
getRemainingOrderAmountAsync: (orderUuid: string) => Promise<number>;
|
|
327
|
-
/** @deprecated 使用 getRemainingAmountWithInputAsync 替代 */
|
|
328
|
-
getRemainingOrderAmountWithInputAsync: (inputAmount: string | number, orderUuid: string) => Promise<number>;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* 订单变化事件数据
|
|
332
|
-
*/
|
|
333
|
-
export interface OnOrderChangedEventData {
|
|
334
|
-
/** 操作类型 */
|
|
335
|
-
action: 'add' | 'delete' | 'update' | 'payment_add' | 'payment_delete' | 'payment_update' | 'submit';
|
|
336
|
-
/** 当前订单 */
|
|
337
|
-
order: PaymentOrder;
|
|
338
|
-
/** 原始订单(仅在 update 操作时提供) */
|
|
339
|
-
originalOrder?: PaymentOrder;
|
|
340
|
-
/** 相关的支付项(仅在 payment_* 操作时提供) */
|
|
341
|
-
paymentItem?: PaymentItem;
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* 支付方式变化事件数据
|
|
345
|
-
*/
|
|
346
|
-
export interface OnPaymentMethodsChangedEventData {
|
|
347
|
-
/** 旧的支付方式列表 */
|
|
348
|
-
oldMethods: PaymentMethod[];
|
|
349
|
-
/** 新的支付方式列表 */
|
|
350
|
-
newMethods: PaymentMethod[];
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* 支付同步错误事件数据
|
|
354
|
-
*/
|
|
355
|
-
export interface OnPaymentSyncErrorEventData {
|
|
356
|
-
/** 订单UUID */
|
|
357
|
-
orderUuid: string;
|
|
358
|
-
/** 订单ID */
|
|
359
|
-
orderId: number;
|
|
360
|
-
/** 错误信息 */
|
|
361
|
-
error: string;
|
|
362
|
-
/** 错误代码 */
|
|
363
|
-
errorCode?: string;
|
|
364
|
-
/** HTTP状态码 */
|
|
365
|
-
statusCode?: number;
|
|
366
|
-
/** 错误发生时间 */
|
|
367
|
-
timestamp: number;
|
|
368
|
-
/** 响应数据(当HTTP请求成功但业务失败时) */
|
|
369
|
-
responseData?: any;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* 支付同步成功事件数据
|
|
373
|
-
*/
|
|
374
|
-
export interface OnPaymentSyncSuccessEventData {
|
|
375
|
-
/** 订单UUID */
|
|
376
|
-
orderUuid: string;
|
|
377
|
-
/** 订单ID */
|
|
378
|
-
orderId: number;
|
|
379
|
-
/** 成功时间 */
|
|
380
|
-
timestamp: number;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* 支付钩子事件
|
|
384
|
-
*/
|
|
385
|
-
export declare enum PaymentHooks {
|
|
386
|
-
OnPaymentMethodsLoaded = "payment:onPaymentMethodsLoaded",
|
|
387
|
-
OnPaymentMethodsChanged = "payment:onPaymentMethodsChanged",
|
|
388
|
-
OnOrderChanged = "payment:onOrderChanged",
|
|
389
|
-
OnOrderAdded = "payment:onOrderAdded",
|
|
390
|
-
OnOrderUpdated = "payment:onOrderUpdated",
|
|
391
|
-
OnOrderDeleted = "payment:onOrderDeleted",
|
|
392
|
-
OnPaymentAdded = "payment:onPaymentAdded",
|
|
393
|
-
OnPaymentUpdated = "payment:onPaymentUpdated",
|
|
394
|
-
OnPaymentDeleted = "payment:onPaymentDeleted",
|
|
395
|
-
OnPaymentSubmitted = "payment:onPaymentSubmitted",
|
|
396
|
-
OnOrderAmountChanged = "payment:onOrderAmountChanged",
|
|
397
|
-
OnPaymentSyncError = "payment:onPaymentSyncError",
|
|
398
|
-
OnPaymentSyncSuccess = "payment:onPaymentSyncSuccess"
|
|
41
|
+
processPayment: (paymentId: string) => Promise<void>;
|
|
42
|
+
getPayment: (paymentId: string) => Promise<Payment>;
|
|
43
|
+
getPaymentHistory: () => Promise<Payment[]>;
|
|
44
|
+
refund: (paymentId: string) => Promise<void>;
|
|
45
|
+
getAvailablePaymentMethods: () => PaymentMethod[];
|
|
46
|
+
checkPaymentStatus: (paymentId: string) => Promise<PaymentStatus>;
|
|
399
47
|
}
|
|
@@ -1,135 +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
|
-
}({});
|
|
1
|
+
// import { Order } from '../Order/types'
|
|
25
2
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
TaskRunStatus["Success"] = "success";
|
|
33
|
-
TaskRunStatus["Failed"] = "failed";
|
|
34
|
-
return TaskRunStatus;
|
|
3
|
+
export var PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
|
|
4
|
+
PaymentHooks["OnPaymentInit"] = "payment:onPaymentInit";
|
|
5
|
+
PaymentHooks["OnPaymentSuccess"] = "payment:onPaymentSuccess";
|
|
6
|
+
PaymentHooks["OnPaymentFailure"] = "payment:onPaymentFailure";
|
|
7
|
+
PaymentHooks["OnPaymentRefund"] = "payment:onPaymentRefund";
|
|
8
|
+
return PaymentHooks;
|
|
35
9
|
}({});
|
|
36
10
|
|
|
37
11
|
/**
|
|
38
|
-
*
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 支付项
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 订单信息
|
|
12
|
+
* 支付方式
|
|
47
13
|
*/
|
|
48
14
|
|
|
49
|
-
|
|
50
|
-
* 支付订单(简化版,仅保留支付相关信息)
|
|
51
|
-
*/
|
|
15
|
+
// 银行转账
|
|
52
16
|
|
|
53
17
|
/**
|
|
54
18
|
* 支付状态
|
|
55
19
|
*/
|
|
56
20
|
|
|
57
|
-
|
|
58
|
-
* 推送订单参数(简化版)
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* 更新订单参数
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 支付项输入类型(允许 amount 为数字)
|
|
67
|
-
*/
|
|
21
|
+
// 已退款
|
|
68
22
|
|
|
69
23
|
/**
|
|
70
|
-
*
|
|
24
|
+
* 支付信息
|
|
71
25
|
*/
|
|
72
26
|
|
|
73
27
|
/**
|
|
74
|
-
*
|
|
28
|
+
* 支付模块状态
|
|
75
29
|
*/
|
|
76
30
|
|
|
77
31
|
/**
|
|
78
|
-
*
|
|
79
|
-
*/
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* 删除支付项参数
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* 现金支付接口
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Eftpos支付接口
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* 钱包支付接口
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 支付模块API接口
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* 订单变化事件数据
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* 支付方式变化事件数据
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* 支付同步错误事件数据
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 支付同步成功事件数据
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* 支付钩子事件
|
|
119
|
-
*/
|
|
120
|
-
export var PaymentHooks = /*#__PURE__*/function (PaymentHooks) {
|
|
121
|
-
PaymentHooks["OnPaymentMethodsLoaded"] = "payment:onPaymentMethodsLoaded";
|
|
122
|
-
PaymentHooks["OnPaymentMethodsChanged"] = "payment:onPaymentMethodsChanged";
|
|
123
|
-
PaymentHooks["OnOrderChanged"] = "payment:onOrderChanged";
|
|
124
|
-
PaymentHooks["OnOrderAdded"] = "payment:onOrderAdded";
|
|
125
|
-
PaymentHooks["OnOrderUpdated"] = "payment:onOrderUpdated";
|
|
126
|
-
PaymentHooks["OnOrderDeleted"] = "payment:onOrderDeleted";
|
|
127
|
-
PaymentHooks["OnPaymentAdded"] = "payment:onPaymentAdded";
|
|
128
|
-
PaymentHooks["OnPaymentUpdated"] = "payment:onPaymentUpdated";
|
|
129
|
-
PaymentHooks["OnPaymentDeleted"] = "payment:onPaymentDeleted";
|
|
130
|
-
PaymentHooks["OnPaymentSubmitted"] = "payment:onPaymentSubmitted";
|
|
131
|
-
PaymentHooks["OnOrderAmountChanged"] = "payment:onOrderAmountChanged";
|
|
132
|
-
PaymentHooks["OnPaymentSyncError"] = "payment:onPaymentSyncError";
|
|
133
|
-
PaymentHooks["OnPaymentSyncSuccess"] = "payment:onPaymentSyncSuccess";
|
|
134
|
-
return PaymentHooks;
|
|
135
|
-
}({});
|
|
32
|
+
* 支付模块 API
|
|
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
|
}
|
|
@@ -87,11 +87,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
87
87
|
value: function () {
|
|
88
88
|
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref) {
|
|
89
89
|
var _this$otherParams;
|
|
90
|
-
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;
|
|
91
91
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
92
92
|
while (1) switch (_context3.prev = _context3.next) {
|
|
93
93
|
case 0:
|
|
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,
|
|
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;
|
|
95
95
|
// // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
|
|
96
96
|
// if (!schedule_ids?.length) {
|
|
97
97
|
// const schedule_ids_data = this.store.schedule
|
|
@@ -107,7 +107,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
107
107
|
userPlugin = this.core.getPlugin('user');
|
|
108
108
|
customer_id = undefined;
|
|
109
109
|
try {
|
|
110
|
-
customer_id =
|
|
110
|
+
customer_id = userPlugin === null || userPlugin === void 0 || (_userPlugin$get = userPlugin.get()) === null || _userPlugin$get === void 0 ? void 0 : _userPlugin$get.id;
|
|
111
111
|
} catch (error) {
|
|
112
112
|
console.error(error);
|
|
113
113
|
}
|
|
@@ -126,12 +126,8 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
126
126
|
ids: product_ids,
|
|
127
127
|
collection: collection,
|
|
128
128
|
front_end_cache_id: cacheId,
|
|
129
|
-
menu_list_ids: menu_list_ids,
|
|
130
|
-
with_count: with_count,
|
|
131
129
|
// client_schedule_ids: schedule_ids,
|
|
132
130
|
schedule_date: schedule_date,
|
|
133
|
-
with_schedule: with_schedule,
|
|
134
|
-
schedule_datetime: schedule_datetime,
|
|
135
131
|
application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel
|
|
136
132
|
}, {
|
|
137
133
|
useCache: true
|
|
@@ -291,26 +287,6 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
291
287
|
}
|
|
292
288
|
return selectProducts;
|
|
293
289
|
}()
|
|
294
|
-
/**
|
|
295
|
-
* 根据商品编码或条码搜索商品
|
|
296
|
-
* @param code 商品编码或条码
|
|
297
|
-
* @returns 匹配的商品列表,如果没有匹配则返回空数组
|
|
298
|
-
*/
|
|
299
|
-
}, {
|
|
300
|
-
key: "findProductsByCodeOrBarcode",
|
|
301
|
-
value: function findProductsByCodeOrBarcode(code) {
|
|
302
|
-
if (!code || typeof code !== 'string') {
|
|
303
|
-
return [];
|
|
304
|
-
}
|
|
305
|
-
var trimmedCode = code.trim();
|
|
306
|
-
if (!trimmedCode) {
|
|
307
|
-
return [];
|
|
308
|
-
}
|
|
309
|
-
var matchingProducts = this.store.list.filter(function (product) {
|
|
310
|
-
return product.code && product.code.trim() === trimmedCode || product.barcode && product.barcode.trim() === trimmedCode;
|
|
311
|
-
});
|
|
312
|
-
return cloneDeep(matchingProducts);
|
|
313
|
-
}
|
|
314
290
|
}]);
|
|
315
291
|
return ProductList;
|
|
316
292
|
}(BaseModule);
|