@pisell/pisellos 3.0.57 → 3.0.59

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.
Files changed (256) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -4
  3. package/dist/effects/index.js +6 -15
  4. package/dist/modules/AccountList/index.d.ts +1 -7
  5. package/dist/modules/AccountList/index.js +14 -81
  6. package/dist/modules/AccountList/types.d.ts +0 -28
  7. package/dist/modules/AccountList/types.js +0 -8
  8. package/dist/modules/Cart/index.js +1 -1
  9. package/dist/modules/Payment/index.d.ts +9 -273
  10. package/dist/modules/Payment/index.js +109 -2525
  11. package/dist/modules/Payment/types.d.ts +30 -382
  12. package/dist/modules/Payment/types.js +14 -116
  13. package/dist/modules/ProductList/index.d.ts +1 -12
  14. package/dist/modules/ProductList/index.js +3 -27
  15. package/dist/modules/Rules/index.js +14 -27
  16. package/dist/modules/Rules/types.d.ts +0 -1
  17. package/dist/modules/index.d.ts +0 -1
  18. package/dist/modules/index.js +0 -1
  19. package/dist/plugins/window.d.ts +0 -1
  20. package/dist/solution/BookingByStep/index.js +1 -9
  21. package/dist/solution/ShopDiscount/index.js +2 -4
  22. package/dist/solution/index.d.ts +0 -2
  23. package/dist/solution/index.js +1 -3
  24. package/dist/types/index.d.ts +1 -3
  25. package/lib/core/index.js +1 -1
  26. package/lib/effects/index.d.ts +3 -4
  27. package/lib/effects/index.js +1 -4
  28. package/lib/modules/AccountList/index.d.ts +1 -7
  29. package/lib/modules/AccountList/index.js +0 -27
  30. package/lib/modules/AccountList/types.d.ts +0 -28
  31. package/lib/modules/Cart/index.js +1 -1
  32. package/lib/modules/Payment/index.d.ts +9 -273
  33. package/lib/modules/Payment/index.js +50 -1285
  34. package/lib/modules/Payment/types.d.ts +30 -382
  35. package/lib/modules/Payment/types.js +6 -41
  36. package/lib/modules/ProductList/index.d.ts +1 -12
  37. package/lib/modules/ProductList/index.js +2 -29
  38. package/lib/modules/Rules/index.js +12 -20
  39. package/lib/modules/Rules/types.d.ts +0 -1
  40. package/lib/modules/index.d.ts +0 -1
  41. package/lib/modules/index.js +0 -2
  42. package/lib/plugins/window.d.ts +0 -1
  43. package/lib/solution/BookingByStep/index.js +2 -1
  44. package/lib/solution/ShopDiscount/index.js +1 -2
  45. package/lib/solution/index.d.ts +0 -2
  46. package/lib/solution/index.js +1 -5
  47. package/lib/types/index.d.ts +1 -3
  48. package/package.json +2 -4
  49. package/dist/modules/Customer/constants.d.ts +0 -7
  50. package/dist/modules/Customer/constants.js +0 -12
  51. package/dist/modules/Customer/index.d.ts +0 -122
  52. package/dist/modules/Customer/index.js +0 -697
  53. package/dist/modules/Customer/types.d.ts +0 -146
  54. package/dist/modules/Customer/types.js +0 -41
  55. package/dist/modules/Payment/cash.d.ts +0 -11
  56. package/dist/modules/Payment/cash.js +0 -78
  57. package/dist/modules/Payment/eftpos.d.ts +0 -11
  58. package/dist/modules/Payment/eftpos.js +0 -80
  59. package/dist/modules/Payment/wallet.d.ts +0 -11
  60. package/dist/modules/Payment/wallet.js +0 -78
  61. package/dist/modules/Payment/walletpass.d.ts +0 -0
  62. package/dist/modules/Payment/walletpass.js +0 -0
  63. package/dist/plugins/app-types/app/app.d.ts +0 -83
  64. package/dist/plugins/app-types/app/const.d.ts +0 -4
  65. package/dist/plugins/app-types/app/index.d.ts +0 -14
  66. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  67. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  68. package/dist/plugins/app-types/config.d.ts +0 -3
  69. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  70. package/dist/plugins/app-types/data/index.d.ts +0 -8
  71. package/dist/plugins/app-types/history/config.d.ts +0 -24
  72. package/dist/plugins/app-types/history/index.d.ts +0 -20
  73. package/dist/plugins/app-types/history/type.d.ts +0 -2
  74. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  75. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  76. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  77. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  78. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  79. package/dist/plugins/app-types/index.d.ts +0 -6
  80. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  81. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  82. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  83. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  84. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  85. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  86. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  87. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  88. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  89. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  90. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  91. package/dist/plugins/app-types/models/global.d.ts +0 -32
  92. package/dist/plugins/app-types/models/index.d.ts +0 -45
  93. package/dist/plugins/app-types/models/type.d.ts +0 -2
  94. package/dist/plugins/app-types/package.json +0 -15
  95. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  96. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  97. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  98. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  99. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  100. package/dist/plugins/app-types/request/config.d.ts +0 -3
  101. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  102. package/dist/plugins/app-types/request/index.d.ts +0 -24
  103. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  104. package/dist/plugins/app-types/request/type.d.ts +0 -41
  105. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  106. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  107. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  108. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  109. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  110. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  111. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  112. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  113. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  114. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  115. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  116. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  117. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  118. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  119. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  120. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  121. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  122. package/dist/plugins/app-types/type.d.ts +0 -2
  123. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  124. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  125. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  126. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  127. package/dist/plugins/app-types/website/index.d.ts +0 -6
  128. package/dist/plugins/app.d.ts +0 -8
  129. package/dist/plugins/app.js +0 -1
  130. package/dist/solution/BookingTicket/index.d.ts +0 -172
  131. package/dist/solution/BookingTicket/index.js +0 -665
  132. package/dist/solution/BookingTicket/types.d.ts +0 -68
  133. package/dist/solution/BookingTicket/types.js +0 -43
  134. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  135. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  136. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  137. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -174
  138. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  139. package/dist/solution/BookingTicket/utils/scan/index.js +0 -285
  140. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  141. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  142. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  143. package/dist/solution/Checkout/index.d.ts +0 -181
  144. package/dist/solution/Checkout/index.js +0 -1596
  145. package/dist/solution/Checkout/types.d.ts +0 -550
  146. package/dist/solution/Checkout/types.js +0 -132
  147. package/dist/solution/Checkout/utils/index.d.ts +0 -73
  148. package/dist/solution/Checkout/utils/index.js +0 -371
  149. package/dist/utils/task.d.ts +0 -40
  150. package/dist/utils/task.js +0 -171
  151. package/dist/utils/watch.d.ts +0 -102
  152. package/dist/utils/watch.js +0 -294
  153. package/lib/modules/Customer/constants.d.ts +0 -7
  154. package/lib/modules/Customer/constants.js +0 -39
  155. package/lib/modules/Customer/index.d.ts +0 -122
  156. package/lib/modules/Customer/index.js +0 -440
  157. package/lib/modules/Customer/types.d.ts +0 -146
  158. package/lib/modules/Customer/types.js +0 -37
  159. package/lib/modules/Payment/cash.d.ts +0 -11
  160. package/lib/modules/Payment/cash.js +0 -51
  161. package/lib/modules/Payment/eftpos.d.ts +0 -11
  162. package/lib/modules/Payment/eftpos.js +0 -51
  163. package/lib/modules/Payment/wallet.d.ts +0 -11
  164. package/lib/modules/Payment/wallet.js +0 -51
  165. package/lib/modules/Payment/walletpass.d.ts +0 -0
  166. package/lib/modules/Payment/walletpass.js +0 -0
  167. package/lib/plugins/app-types/app/app.d.ts +0 -83
  168. package/lib/plugins/app-types/app/const.d.ts +0 -4
  169. package/lib/plugins/app-types/app/index.d.ts +0 -14
  170. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  171. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  172. package/lib/plugins/app-types/config.d.ts +0 -3
  173. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  174. package/lib/plugins/app-types/data/index.d.ts +0 -8
  175. package/lib/plugins/app-types/history/config.d.ts +0 -24
  176. package/lib/plugins/app-types/history/index.d.ts +0 -20
  177. package/lib/plugins/app-types/history/type.d.ts +0 -2
  178. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  179. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  180. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  181. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  182. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  183. package/lib/plugins/app-types/index.d.ts +0 -6
  184. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  185. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  186. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  187. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  188. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  189. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  190. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  191. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  192. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  193. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  194. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  195. package/lib/plugins/app-types/models/global.d.ts +0 -32
  196. package/lib/plugins/app-types/models/index.d.ts +0 -45
  197. package/lib/plugins/app-types/models/type.d.ts +0 -2
  198. package/lib/plugins/app-types/package.json +0 -15
  199. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  200. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  201. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  202. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  203. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  204. package/lib/plugins/app-types/request/config.d.ts +0 -3
  205. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  206. package/lib/plugins/app-types/request/index.d.ts +0 -24
  207. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  208. package/lib/plugins/app-types/request/type.d.ts +0 -41
  209. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  210. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  211. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  212. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  213. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  214. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  215. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  216. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  217. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  218. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  219. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  220. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  221. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  222. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  223. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  224. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  225. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  226. package/lib/plugins/app-types/type.d.ts +0 -2
  227. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  228. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  229. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  230. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  231. package/lib/plugins/app-types/website/index.d.ts +0 -6
  232. package/lib/plugins/app.d.ts +0 -8
  233. package/lib/plugins/app.js +0 -17
  234. package/lib/solution/BookingTicket/index.d.ts +0 -172
  235. package/lib/solution/BookingTicket/index.js +0 -399
  236. package/lib/solution/BookingTicket/types.d.ts +0 -68
  237. package/lib/solution/BookingTicket/types.js +0 -72
  238. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  239. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  240. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  241. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -125
  242. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  243. package/lib/solution/BookingTicket/utils/scan/index.js +0 -210
  244. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  245. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  246. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  247. package/lib/solution/Checkout/index.d.ts +0 -181
  248. package/lib/solution/Checkout/index.js +0 -864
  249. package/lib/solution/Checkout/types.d.ts +0 -550
  250. package/lib/solution/Checkout/types.js +0 -75
  251. package/lib/solution/Checkout/utils/index.d.ts +0 -73
  252. package/lib/solution/Checkout/utils/index.js +0 -266
  253. package/lib/utils/task.d.ts +0 -40
  254. package/lib/utils/task.js +0 -109
  255. package/lib/utils/watch.d.ts +0 -102
  256. 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 interface PaymentItem {
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 interface OrderInfo {
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 PaymentOrder {
112
- /** 当前订单的唯一 ID */
113
- uuid: string;
114
- /** 订单ID(字符串类型,支持本地虚拟ID) */
18
+ export interface Payment {
115
19
  id: string;
116
- /** 订单ID(数字类型,兼容旧版本) */
117
- order_id: string;
118
- /** 支付项列表 */
119
- payment: PaymentItem[];
120
- /** 修改的支付项列表 */
121
- adjust_offline_payments: PaymentItem[];
122
- /** 总计金额 */
123
- total_amount: string;
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
- cash: CashPayment;
273
- /** Eftpos支付相关方法 */
274
- eftpos: EftposPayment;
275
- /** 钱包支付相关方法 */
276
- wallet: WalletPayment;
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
- export var TaskRunStatus = /*#__PURE__*/function (TaskRunStatus) {
30
- TaskRunStatus["Pending"] = "pending";
31
- TaskRunStatus["Running"] = "running";
32
- TaskRunStatus["Success"] = "success";
33
- TaskRunStatus["Failed"] = "failed";
34
- return TaskRunStatus;
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
- * 更新支付项参数中的字段类型(允许 amount 为数字)
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, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
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, _ref$menu_list_ids, menu_list_ids, paramsCustomerId, _ref$with_count, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, userPlugin, customer_id, _userPlugin$get, productsData, sortedList;
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, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule;
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 = paramsCustomerId || (userPlugin === null || userPlugin === void 0 || (_userPlugin$get = userPlugin.get()) === null || _userPlugin$get === void 0 ? void 0 : _userPlugin$get.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);