@pisell/pisellos 3.0.55 → 3.0.57
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/Cart/utils/changePrice.d.ts +2 -2
- package/dist/modules/Cart/utils/changePrice.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/Payment/cash.d.ts +11 -0
- package/dist/modules/Payment/cash.js +78 -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 +273 -9
- package/dist/modules/Payment/index.js +2525 -109
- package/dist/modules/Payment/types.d.ts +382 -30
- package/dist/modules/Payment/types.js +116 -14
- package/dist/modules/Payment/wallet.d.ts +11 -0
- package/dist/modules/Payment/wallet.js +78 -0
- package/dist/modules/Payment/walletpass.d.ts +0 -0
- package/dist/modules/Payment/walletpass.js +0 -0
- package/dist/modules/ProductList/index.d.ts +14 -3
- package/dist/modules/ProductList/index.js +58 -44
- package/dist/modules/ProductList/types.d.ts +0 -1
- package/dist/modules/Rules/index.js +27 -14
- package/dist/modules/Rules/types.d.ts +1 -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.js +59 -35
- package/dist/solution/BookingByStep/types.d.ts +3 -2
- package/dist/solution/BookingTicket/index.d.ts +172 -0
- package/dist/solution/BookingTicket/index.js +665 -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 +16 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +174 -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/BuyTickets/index.d.ts +2 -2
- package/dist/solution/BuyTickets/index.js +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +181 -0
- package/dist/solution/Checkout/index.js +1596 -0
- package/dist/solution/Checkout/types.d.ts +550 -0
- package/dist/solution/Checkout/types.js +132 -0
- package/dist/solution/Checkout/utils/index.d.ts +73 -0
- package/dist/solution/Checkout/utils/index.js +371 -0
- package/dist/solution/ShopDiscount/index.js +4 -2
- 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/Cart/utils/changePrice.d.ts +2 -2
- package/lib/modules/Cart/utils/changePrice.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/Payment/cash.d.ts +11 -0
- package/lib/modules/Payment/cash.js +51 -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 +273 -9
- package/lib/modules/Payment/index.js +1285 -50
- package/lib/modules/Payment/types.d.ts +382 -30
- package/lib/modules/Payment/types.js +41 -6
- package/lib/modules/Payment/wallet.d.ts +11 -0
- package/lib/modules/Payment/wallet.js +51 -0
- package/lib/modules/Payment/walletpass.d.ts +0 -0
- package/lib/modules/Payment/walletpass.js +0 -0
- package/lib/modules/ProductList/index.d.ts +14 -3
- package/lib/modules/ProductList/index.js +42 -28
- package/lib/modules/ProductList/types.d.ts +0 -1
- package/lib/modules/Rules/index.js +20 -12
- package/lib/modules/Rules/types.d.ts +1 -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.js +40 -29
- package/lib/solution/BookingByStep/types.d.ts +3 -2
- package/lib/solution/BookingTicket/index.d.ts +172 -0
- package/lib/solution/BookingTicket/index.js +399 -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 +16 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +125 -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/BuyTickets/index.d.ts +2 -2
- package/lib/solution/BuyTickets/index.js +1 -1
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +181 -0
- package/lib/solution/Checkout/index.js +864 -0
- package/lib/solution/Checkout/types.d.ts +550 -0
- package/lib/solution/Checkout/types.js +75 -0
- package/lib/solution/Checkout/utils/index.d.ts +73 -0
- package/lib/solution/Checkout/utils/index.js +266 -0
- package/lib/solution/ShopDiscount/index.js +2 -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,146 @@
|
|
|
1
|
+
import { ICustomer } from "../AccountList/types";
|
|
2
|
+
export declare enum CustomerHooks {
|
|
3
|
+
OnCustomerListUpdate = "customer:onUpdate",
|
|
4
|
+
OnCustomerListError = "customer:onError",
|
|
5
|
+
OnCustomerSelected = "customer:onSelected",
|
|
6
|
+
OnPaginationChange = "customer:onPaginationChange",
|
|
7
|
+
OnScrollLoadMore = "customer:onScrollLoadMore",
|
|
8
|
+
OnScrollLoadComplete = "customer:onScrollLoadComplete"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 客户数据
|
|
12
|
+
*/
|
|
13
|
+
export interface ShopCustomer extends ICustomer {
|
|
14
|
+
/** 客户ID */
|
|
15
|
+
id: string | number;
|
|
16
|
+
/** 客户姓名 */
|
|
17
|
+
name: string;
|
|
18
|
+
/** 客户电话 */
|
|
19
|
+
phone?: string;
|
|
20
|
+
/** 客户邮箱 */
|
|
21
|
+
email?: string;
|
|
22
|
+
/** 客户创建时间 */
|
|
23
|
+
created_at?: string;
|
|
24
|
+
/** 客户更新时间 */
|
|
25
|
+
updated_at?: string;
|
|
26
|
+
/** 其他客户信息 */
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 客户列表关联查询参数
|
|
31
|
+
*
|
|
32
|
+
* formRecord: 用户表单记录
|
|
33
|
+
* walletDetails.wallet: 用户所有wallet
|
|
34
|
+
* latestWalletDetail.wallet: 用户最新wallet
|
|
35
|
+
*/
|
|
36
|
+
type CustomerWith = 'formRecord' | 'walletDetails.wallet' | 'latestWalletDetail.wallet';
|
|
37
|
+
/**
|
|
38
|
+
* 获取客户列表参数
|
|
39
|
+
*/
|
|
40
|
+
export interface ShopGetCustomerListParams {
|
|
41
|
+
/** 页码 */
|
|
42
|
+
skip?: number;
|
|
43
|
+
/** 每页数量 */
|
|
44
|
+
num?: number;
|
|
45
|
+
/** 搜索关键词 */
|
|
46
|
+
search?: string;
|
|
47
|
+
/** 关联查询参数 */
|
|
48
|
+
with?: CustomerWith[];
|
|
49
|
+
/** wallet搜索标识 */
|
|
50
|
+
search_wallet_flag?: 0 | 1;
|
|
51
|
+
/** wallet pass搜索标识 */
|
|
52
|
+
search_wallet_pass_flag?: 0 | 1;
|
|
53
|
+
/** 其他筛选参数 */
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 分页信息
|
|
58
|
+
*/
|
|
59
|
+
export interface IPaginationInfo {
|
|
60
|
+
/** 当前页码 */
|
|
61
|
+
page: number;
|
|
62
|
+
/** 每页数量 */
|
|
63
|
+
pageSize: number;
|
|
64
|
+
/** 总数 */
|
|
65
|
+
total: number;
|
|
66
|
+
/** 总页数 */
|
|
67
|
+
totalPages: number;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 客户列表响应
|
|
71
|
+
*/
|
|
72
|
+
export interface ICustomerListResponse {
|
|
73
|
+
/** 客户列表 */
|
|
74
|
+
list: ShopCustomer[];
|
|
75
|
+
/** 总数 */
|
|
76
|
+
total: number;
|
|
77
|
+
/** 当前页 */
|
|
78
|
+
page?: number;
|
|
79
|
+
/** 每页数量 */
|
|
80
|
+
pageSize?: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 客户列表状态
|
|
84
|
+
*/
|
|
85
|
+
export interface CustomerState {
|
|
86
|
+
/** 客户列表 */
|
|
87
|
+
customerList: ShopCustomer[];
|
|
88
|
+
/** 当前选择的客户 */
|
|
89
|
+
selectedCustomer: ShopCustomer | null;
|
|
90
|
+
/** 列表总数 */
|
|
91
|
+
total: number;
|
|
92
|
+
/** 当前页码 */
|
|
93
|
+
currentPage: number;
|
|
94
|
+
/** 每页数量 */
|
|
95
|
+
pageSize: number;
|
|
96
|
+
/** 加载状态 */
|
|
97
|
+
loading: boolean;
|
|
98
|
+
/** 错误信息 */
|
|
99
|
+
error: string | null;
|
|
100
|
+
/** 是否支持滚动加载更多 */
|
|
101
|
+
hasMore: boolean;
|
|
102
|
+
/** 滚动加载状态 */
|
|
103
|
+
loadingMore: boolean;
|
|
104
|
+
/** 当前搜索条件 */
|
|
105
|
+
searchParams: Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 客户模块 API
|
|
109
|
+
*/
|
|
110
|
+
export interface CustomerModuleAPI {
|
|
111
|
+
/** 获取客户列表 */
|
|
112
|
+
getCustomerList: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
113
|
+
/** 设置客户列表 */
|
|
114
|
+
setCustomerList: (customers: ShopCustomer[], total?: number) => void;
|
|
115
|
+
/** 设置当前选择的客户 */
|
|
116
|
+
setSelectedCustomer: (customer: ShopCustomer | null) => void;
|
|
117
|
+
/** 获取当前选择的客户 */
|
|
118
|
+
getSelectedCustomer: () => ShopCustomer | null;
|
|
119
|
+
/** 获取客户列表 */
|
|
120
|
+
getCustomers: () => ShopCustomer[];
|
|
121
|
+
/** 根据ID查找客户 */
|
|
122
|
+
getCustomerById: (id: string | number) => ShopCustomer | null;
|
|
123
|
+
/** 清空客户列表 */
|
|
124
|
+
clearCustomers: () => void;
|
|
125
|
+
/** 添加客户到列表第一位 */
|
|
126
|
+
addCustomerToFirst: (customer: ShopCustomer) => void;
|
|
127
|
+
/** 获取当前状态 */
|
|
128
|
+
getState: () => CustomerState;
|
|
129
|
+
/** 获取分页信息 */
|
|
130
|
+
getPaginationInfo: () => IPaginationInfo;
|
|
131
|
+
/** 触发分页变化事件 */
|
|
132
|
+
triggerPaginationChange: (pagination: IPaginationInfo) => void;
|
|
133
|
+
/** 设置分页信息 */
|
|
134
|
+
setPaginationInfo: (page: number, pageSize: number) => void;
|
|
135
|
+
/** 便捷方法:切换分页并自动获取数据 */
|
|
136
|
+
changeCustomerPage: (page: number, pageSize?: number) => Promise<ICustomerListResponse>;
|
|
137
|
+
/** 滚动加载更多客户数据 */
|
|
138
|
+
loadMoreCustomers: () => Promise<ICustomerListResponse>;
|
|
139
|
+
/** 重置并重新开始滚动加载 */
|
|
140
|
+
resetAndLoadCustomers: (params?: ShopGetCustomerListParams) => Promise<ICustomerListResponse>;
|
|
141
|
+
/** 检查是否还有更多数据可以加载 */
|
|
142
|
+
hasMoreCustomers: () => boolean;
|
|
143
|
+
/** 获取当前的搜索条件 */
|
|
144
|
+
getCurrentSearchParams: () => Omit<ShopGetCustomerListParams, 'skip' | 'num'>;
|
|
145
|
+
}
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/Customer/types.ts
|
|
20
|
+
var types_exports = {};
|
|
21
|
+
__export(types_exports, {
|
|
22
|
+
CustomerHooks: () => CustomerHooks
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(types_exports);
|
|
25
|
+
var CustomerHooks = /* @__PURE__ */ ((CustomerHooks2) => {
|
|
26
|
+
CustomerHooks2["OnCustomerListUpdate"] = "customer:onUpdate";
|
|
27
|
+
CustomerHooks2["OnCustomerListError"] = "customer:onError";
|
|
28
|
+
CustomerHooks2["OnCustomerSelected"] = "customer:onSelected";
|
|
29
|
+
CustomerHooks2["OnPaginationChange"] = "customer:onPaginationChange";
|
|
30
|
+
CustomerHooks2["OnScrollLoadMore"] = "customer:onScrollLoadMore";
|
|
31
|
+
CustomerHooks2["OnScrollLoadComplete"] = "customer:onScrollLoadComplete";
|
|
32
|
+
return CustomerHooks2;
|
|
33
|
+
})(CustomerHooks || {});
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
CustomerHooks
|
|
37
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CashPayment } from './types';
|
|
2
|
+
import type { PaymentModule } from './index';
|
|
3
|
+
/**
|
|
4
|
+
* 现金支付实现
|
|
5
|
+
*/
|
|
6
|
+
export declare class CashPaymentImpl implements CashPayment {
|
|
7
|
+
private paymentModule;
|
|
8
|
+
constructor(paymentModule: PaymentModule);
|
|
9
|
+
processCashPayment(amount: number, orderUuid: string): Promise<void>;
|
|
10
|
+
getCashBalance(): Promise<number>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/Payment/cash.ts
|
|
20
|
+
var cash_exports = {};
|
|
21
|
+
__export(cash_exports, {
|
|
22
|
+
CashPaymentImpl: () => CashPaymentImpl
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(cash_exports);
|
|
25
|
+
var CashPaymentImpl = class {
|
|
26
|
+
constructor(paymentModule) {
|
|
27
|
+
this.paymentModule = paymentModule;
|
|
28
|
+
}
|
|
29
|
+
async processCashPayment(amount, orderUuid) {
|
|
30
|
+
const cashMethod = await this.paymentModule.getCashPaymentMethod();
|
|
31
|
+
if (!cashMethod) {
|
|
32
|
+
throw new Error("现金支付方式未找到");
|
|
33
|
+
}
|
|
34
|
+
const paymentItem = {
|
|
35
|
+
amount: amount.toString(),
|
|
36
|
+
code: cashMethod.code,
|
|
37
|
+
id: cashMethod.id,
|
|
38
|
+
name: cashMethod.name,
|
|
39
|
+
type: cashMethod.type,
|
|
40
|
+
voucher_id: ""
|
|
41
|
+
};
|
|
42
|
+
await this.paymentModule.pushPaymentAsync(orderUuid, paymentItem);
|
|
43
|
+
}
|
|
44
|
+
async getCashBalance() {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
CashPaymentImpl
|
|
51
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EftposPayment } from './types';
|
|
2
|
+
import type { PaymentModule } from './index';
|
|
3
|
+
/**
|
|
4
|
+
* Eftpos支付实现
|
|
5
|
+
*/
|
|
6
|
+
export declare class EftposPaymentImpl implements EftposPayment {
|
|
7
|
+
private paymentModule;
|
|
8
|
+
constructor(paymentModule: PaymentModule);
|
|
9
|
+
processEftposPayment(amount: number, orderUuid: string): Promise<void>;
|
|
10
|
+
checkDeviceStatus(): Promise<boolean>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/modules/Payment/eftpos.ts
|
|
20
|
+
var eftpos_exports = {};
|
|
21
|
+
__export(eftpos_exports, {
|
|
22
|
+
EftposPaymentImpl: () => EftposPaymentImpl
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(eftpos_exports);
|
|
25
|
+
var EftposPaymentImpl = class {
|
|
26
|
+
constructor(paymentModule) {
|
|
27
|
+
this.paymentModule = paymentModule;
|
|
28
|
+
}
|
|
29
|
+
async processEftposPayment(amount, orderUuid) {
|
|
30
|
+
const eftposMethod = await this.paymentModule.getEftposPaymentMethod();
|
|
31
|
+
if (!eftposMethod) {
|
|
32
|
+
throw new Error("Eftpos支付方式未找到");
|
|
33
|
+
}
|
|
34
|
+
const paymentItem = {
|
|
35
|
+
amount: amount.toString(),
|
|
36
|
+
code: eftposMethod.code,
|
|
37
|
+
id: eftposMethod.id,
|
|
38
|
+
name: eftposMethod.name,
|
|
39
|
+
type: eftposMethod.type,
|
|
40
|
+
voucher_id: ""
|
|
41
|
+
};
|
|
42
|
+
await this.paymentModule.pushPaymentAsync(orderUuid, paymentItem);
|
|
43
|
+
}
|
|
44
|
+
async checkDeviceStatus() {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
EftposPaymentImpl
|
|
51
|
+
});
|
|
@@ -1,16 +1,280 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import {
|
|
3
|
+
import { PaymentModuleAPI, PaymentMethod, PaymentOrder, PaymentItem, PaymentItemInput, PaymentUpdateFields, PushOrderParams, CashPayment, EftposPayment, WalletPayment } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export { generateRequestUniqueId };
|
|
6
|
+
/**
|
|
7
|
+
* 生成请求唯一ID
|
|
8
|
+
* 格式: 年月日时分秒毫秒+4位随机数
|
|
9
|
+
* 示例: 20241201143025123456
|
|
10
|
+
*/
|
|
11
|
+
declare function generateRequestUniqueId(): string;
|
|
12
|
+
/**
|
|
13
|
+
* 支付模块实现
|
|
14
|
+
*
|
|
15
|
+
* 支付流程说明:
|
|
16
|
+
* 1. 用户操作 → 调用支付API (pushPaymentAsync, submitPayAsync等)
|
|
17
|
+
* 2. 数据处理 → 更新本地IndexDB中的订单和支付项数据
|
|
18
|
+
* 3. 立即完成 → 本地订单状态立即更新为PaymentStatus.Finished(isSynced保持false)
|
|
19
|
+
* 4. 后台同步 → 网络请求推送到TasksManager异步同步到服务器
|
|
20
|
+
* 5. 同步成功 → 网络请求成功后,isSynced设为true
|
|
21
|
+
* 6. 自动重试 → TasksManager自动重试失败的网络请求,直到isSynced为true
|
|
22
|
+
*
|
|
23
|
+
* 数据状态说明:
|
|
24
|
+
* - PaymentStatus.Processing: 订单正在进行支付操作
|
|
25
|
+
* - PaymentStatus.PartiallyPaid + isSynced=false: 部分支付完成,等待服务器同步
|
|
26
|
+
* - PaymentStatus.PartiallyPaid + isSynced=true: 部分支付且已同步到服务器
|
|
27
|
+
* - PaymentStatus.Finished + isSynced=false: 本地支付完成,等待服务器同步
|
|
28
|
+
* - PaymentStatus.Finished + isSynced=true: 支付完成且已同步到服务器
|
|
29
|
+
*
|
|
30
|
+
* 这种设计的优势:
|
|
31
|
+
* - 即时反馈:支付操作后立即显示完成状态,用户体验更佳
|
|
32
|
+
* - 离线支持:即使网络断开也能正常操作,数据保存在本地
|
|
33
|
+
* - 同步追踪:通过isSynced清楚知道哪些数据还未同步到服务器
|
|
34
|
+
* - 自动重试:TasksManager会自动重试失败的网络请求
|
|
35
|
+
* - 异步处理:不阻塞用户界面,网络同步在后台进行
|
|
36
|
+
* - 数据一致性:通过事件系统确保数据状态同步
|
|
37
|
+
*/
|
|
4
38
|
export declare class PaymentModule extends BaseModule implements Module, PaymentModuleAPI {
|
|
5
39
|
protected defaultName: string;
|
|
6
40
|
protected defaultVersion: string;
|
|
7
|
-
private
|
|
41
|
+
private request;
|
|
42
|
+
private app;
|
|
43
|
+
private store;
|
|
44
|
+
private dbManager;
|
|
45
|
+
private logger;
|
|
46
|
+
cash: CashPayment;
|
|
47
|
+
eftpos: EftposPayment;
|
|
48
|
+
wallet: WalletPayment;
|
|
8
49
|
constructor(name?: string, version?: string);
|
|
9
|
-
initialize(core: PisellCore, options
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
50
|
+
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* 记录信息日志
|
|
53
|
+
*/
|
|
54
|
+
private logInfo;
|
|
55
|
+
/**
|
|
56
|
+
* 记录警告日志
|
|
57
|
+
*/
|
|
58
|
+
private logWarning;
|
|
59
|
+
/**
|
|
60
|
+
* 记录错误日志
|
|
61
|
+
*/
|
|
62
|
+
private logError;
|
|
63
|
+
/**
|
|
64
|
+
* 记录调试日志
|
|
65
|
+
*/
|
|
66
|
+
private logDebug;
|
|
67
|
+
/**
|
|
68
|
+
* 网络恢复以后,尝试执行队列
|
|
69
|
+
*
|
|
70
|
+
*/
|
|
71
|
+
private registerNetworkHandlers;
|
|
72
|
+
/**
|
|
73
|
+
* 获取支付方式列表
|
|
74
|
+
*/
|
|
75
|
+
getPayMethodListAsync(): Promise<PaymentMethod[]>;
|
|
76
|
+
/**
|
|
77
|
+
* 后台刷新支付方式列表
|
|
78
|
+
*/
|
|
79
|
+
private refreshPaymentMethodsInBackground;
|
|
80
|
+
/**
|
|
81
|
+
* 检查支付方式列表是否有变化
|
|
82
|
+
*/
|
|
83
|
+
private hasPaymentMethodsChanged;
|
|
84
|
+
/**
|
|
85
|
+
* 获取订单列表
|
|
86
|
+
*/
|
|
87
|
+
getOrderListAsync(): Promise<PaymentOrder[]>;
|
|
88
|
+
/**
|
|
89
|
+
* 根据订单UUID获取支付订单(新方法)
|
|
90
|
+
*/
|
|
91
|
+
getPaymentOrderByUuidAsync(orderUuid: string): Promise<PaymentOrder | null>;
|
|
92
|
+
/**
|
|
93
|
+
* 创建支付订单(新方法,专注支付数据)
|
|
94
|
+
*/
|
|
95
|
+
createPaymentOrderAsync(params: PushOrderParams): Promise<PaymentOrder>;
|
|
96
|
+
/**
|
|
97
|
+
* 往交易组中添加订单(兼容性方法)
|
|
98
|
+
* @deprecated 使用 createPaymentOrderAsync 替代
|
|
99
|
+
*/
|
|
100
|
+
pushOrderAsync(params: PushOrderParams): Promise<PaymentOrder>;
|
|
101
|
+
/**
|
|
102
|
+
* 删除支付订单(新方法)
|
|
103
|
+
*/
|
|
104
|
+
deletePaymentOrderAsync(orderUuid: string): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* 删除订单(兼容性方法)
|
|
107
|
+
* @deprecated 使用 deletePaymentOrderAsync 替代
|
|
108
|
+
*/
|
|
109
|
+
deleteOrderAsync(orderUuid: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* 更新订单
|
|
112
|
+
*/
|
|
113
|
+
updateOrderAsync(orderUuid: string, params: Partial<PaymentOrder>): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* 基于UUID替换订单ID
|
|
116
|
+
*
|
|
117
|
+
* 此方法用于将本地虚拟订单ID替换为真实的订单ID。
|
|
118
|
+
* 当前端模拟下单流程完成后,后端返回真实订单ID时调用此方法。
|
|
119
|
+
*
|
|
120
|
+
* @param orderUuid 订单的UUID
|
|
121
|
+
* @param newOrderId 新的订单ID (来自后端)
|
|
122
|
+
* @returns 更新后的订单对象,如果订单不存在则返回null
|
|
123
|
+
*/
|
|
124
|
+
replaceOrderIdByUuidAsync(orderUuid: string, newOrderId: string): Promise<PaymentOrder | null>;
|
|
125
|
+
/**
|
|
126
|
+
* 获取支付项(新方法)
|
|
127
|
+
*/
|
|
128
|
+
getPaymentItemsAsync(orderUuid: string): Promise<PaymentItem[]>;
|
|
129
|
+
/**
|
|
130
|
+
* 获取支付项(兼容性方法)
|
|
131
|
+
* @deprecated 使用 getPaymentItemsAsync 替代
|
|
132
|
+
*/
|
|
133
|
+
getPaymentAsync(orderUuid: string): Promise<PaymentItem[]>;
|
|
134
|
+
/**
|
|
135
|
+
* 为某个订单添加支付项(新方法)
|
|
136
|
+
*/
|
|
137
|
+
addPaymentItemAsync(orderUuid: string, paymentItem: PaymentItemInput): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* 为某个订单设置一个支付项(兼容性方法)
|
|
140
|
+
* @deprecated 使用 addPaymentItemAsync 替代
|
|
141
|
+
*/
|
|
142
|
+
pushPaymentAsync(orderUuid: string, paymentItem: PaymentItemInput): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* 删除一个支付项
|
|
145
|
+
*/
|
|
146
|
+
deletePaymentAsync(orderUuid: string, paymentUuid: string): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* 更新一个支付项
|
|
149
|
+
*/
|
|
150
|
+
updatePaymentAsync(orderUuid: string, paymentUuid: string, params: PaymentUpdateFields): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* 提交支付
|
|
153
|
+
*/
|
|
154
|
+
submitPayAsync(orderUuid?: string): Promise<{
|
|
155
|
+
status: 'success' | 'failed';
|
|
156
|
+
}>;
|
|
157
|
+
/**
|
|
158
|
+
* 提交单个订单的支付(推送到任务队列)
|
|
159
|
+
*/
|
|
160
|
+
private submitSingleOrderPayment;
|
|
161
|
+
/**
|
|
162
|
+
* 添加到同步任务队列
|
|
163
|
+
*/
|
|
164
|
+
private addToSyncQueue;
|
|
165
|
+
/**
|
|
166
|
+
* 获取订单剩余待付金额
|
|
167
|
+
*/
|
|
168
|
+
getRemainingOrderAmountAsync(orderUuid: string): Promise<number>;
|
|
169
|
+
/**
|
|
170
|
+
* 在比如现金支付界面的地方,用户输入了一个金额,在下方显示剩余多少金额,通过此方法获取
|
|
171
|
+
*/
|
|
172
|
+
getRemainingOrderAmountWithInputAsync(inputAmount: string | number, orderUuid: string): Promise<number>;
|
|
173
|
+
/**
|
|
174
|
+
* 重新计算订单金额
|
|
175
|
+
*/
|
|
176
|
+
private recalculateOrderAmount;
|
|
177
|
+
/**
|
|
178
|
+
* 获取现金支付方式
|
|
179
|
+
*/
|
|
180
|
+
getCashPaymentMethod(): Promise<PaymentMethod | null>;
|
|
181
|
+
/**
|
|
182
|
+
* 获取Eftpos支付方式
|
|
183
|
+
*/
|
|
184
|
+
getEftposPaymentMethod(): Promise<PaymentMethod | null>;
|
|
185
|
+
/**
|
|
186
|
+
* 获取钱包支付方式
|
|
187
|
+
*/
|
|
188
|
+
getWalletPaymentMethod(): Promise<PaymentMethod | null>;
|
|
189
|
+
/**
|
|
190
|
+
* 注册任务处理函数
|
|
191
|
+
*/
|
|
192
|
+
private registerTaskHandlers;
|
|
193
|
+
/**
|
|
194
|
+
* 静态方法:处理支付同步任务(后台网络同步)
|
|
195
|
+
* 这个方法里不允许用 this,因为需要作为静态方法注入到任务队列里
|
|
196
|
+
*/
|
|
197
|
+
static syncPaymentTask(payload: any): Promise<any>;
|
|
198
|
+
/**
|
|
199
|
+
* 确保支付模块所需的数据库表已创建
|
|
200
|
+
*/
|
|
201
|
+
private ensurePaymentTables;
|
|
202
|
+
/**
|
|
203
|
+
* 获取部分支付的订单
|
|
204
|
+
*/
|
|
205
|
+
getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
|
|
206
|
+
/**
|
|
207
|
+
* 获取未同步到服务器的订单
|
|
208
|
+
*/
|
|
209
|
+
getUnsyncedOrdersAsync(): Promise<PaymentOrder[]>;
|
|
210
|
+
/**
|
|
211
|
+
* 清理已完成且已同步的订单
|
|
212
|
+
* 注意:只清理完全支付的订单,部分支付的订单保留以便继续支付
|
|
213
|
+
*/
|
|
214
|
+
cleanupFinishedOrders(): Promise<void>;
|
|
215
|
+
/**
|
|
216
|
+
* 检测未同步的订单并重新加入任务队列
|
|
217
|
+
*
|
|
218
|
+
* 此方法专门用于处理因网络问题导致任务队列执行失败但队列被清空的情况。
|
|
219
|
+
* 它会检查本地 IndexDB 中所有未同步的订单(isSynced: false),
|
|
220
|
+
* 并将这些订单重新添加到任务队列中。
|
|
221
|
+
*
|
|
222
|
+
* 使用场景:
|
|
223
|
+
* - 网络恢复后重新检查未同步的订单
|
|
224
|
+
* - 应用启动时检查并重新排队未完成的支付
|
|
225
|
+
* - 用户手动重试前的预检查
|
|
226
|
+
*
|
|
227
|
+
* @returns Promise<number> 返回重新加入队列的订单数量
|
|
228
|
+
*/
|
|
229
|
+
recheckAndRequeueUnsyncedOrders(): Promise<number>;
|
|
230
|
+
/**
|
|
231
|
+
* 手动执行支付同步队列
|
|
232
|
+
* 外部可以调用此方法来触发支付同步任务的执行
|
|
233
|
+
*
|
|
234
|
+
* 注意:此方法只执行现有队列中的任务,不会检查未同步的订单。
|
|
235
|
+
* 如果需要检查未同步订单,请先调用 recheckAndRequeueUnsyncedOrders()
|
|
236
|
+
*
|
|
237
|
+
* 使用示例:
|
|
238
|
+
* ```typescript
|
|
239
|
+
* // 1. 先检查并重新排队未同步订单,然后执行队列
|
|
240
|
+
* const requeuedCount = await paymentModule.recheckAndRequeueUnsyncedOrders();
|
|
241
|
+
* if (requeuedCount > 0) {
|
|
242
|
+
* await paymentModule.runPaymentSyncQueue();
|
|
243
|
+
* }
|
|
244
|
+
*
|
|
245
|
+
* // 2. 或者直接执行现有队列(不检查未同步订单)
|
|
246
|
+
* await paymentModule.runPaymentSyncQueue();
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
runPaymentSyncQueue(): Promise<void>;
|
|
250
|
+
/**
|
|
251
|
+
* 重新将订单添加到同步队列
|
|
252
|
+
* 用于处理因网络问题导致任务队列清空但订单未同步的情况
|
|
253
|
+
*
|
|
254
|
+
* @param order 要重新添加的订单
|
|
255
|
+
* @returns Promise<boolean> 是否成功添加到队列
|
|
256
|
+
*/
|
|
257
|
+
private reAddOrderToSyncQueue;
|
|
258
|
+
/**
|
|
259
|
+
* 删除支付项(新方法)
|
|
260
|
+
*/
|
|
261
|
+
deletePaymentItemAsync(orderUuid: string, paymentUuid: string): Promise<void>;
|
|
262
|
+
/**
|
|
263
|
+
* 更新支付项(新方法)
|
|
264
|
+
*/
|
|
265
|
+
updatePaymentItemAsync(orderUuid: string, paymentUuid: string, params: PaymentUpdateFields): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* 获取订单剩余待付金额(新方法)
|
|
268
|
+
*/
|
|
269
|
+
getRemainingAmountAsync(orderUuid: string): Promise<number>;
|
|
270
|
+
/**
|
|
271
|
+
* 获取订单剩余待付金额(基于用户输入的金额)(新方法)
|
|
272
|
+
*/
|
|
273
|
+
getRemainingAmountWithInputAsync(inputAmount: string | number, orderUuid: string): Promise<number>;
|
|
274
|
+
/**
|
|
275
|
+
* 提交支付(新方法)
|
|
276
|
+
*/
|
|
277
|
+
submitPaymentAsync(orderUuid: string): Promise<{
|
|
278
|
+
status: 'success' | 'failed';
|
|
279
|
+
}>;
|
|
16
280
|
}
|