@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,550 +0,0 @@
1
- import { Module } from '../../types';
2
- import { OrderModule } from '../../modules/Order';
3
- import { PaymentModule, PaymentModuleAPI, PaymentOrder, PaymentMethod, PaymentStatus } from '../../modules/Payment';
4
- import { CartItem } from '../../modules/Cart/types';
5
- /**
6
- * 结账状态枚举
7
- */
8
- export declare enum CheckoutStatus {
9
- /** 初始化中 */
10
- Initializing = "initializing",
11
- /** 准备就绪 */
12
- Ready = "ready",
13
- /** 创建订单中 */
14
- CreatingOrder = "creating_order",
15
- /** 订单已创建 */
16
- OrderCreated = "order_created",
17
- /** 处理支付中 */
18
- ProcessingPayment = "processing_payment",
19
- /** 支付完成 */
20
- PaymentCompleted = "payment_completed",
21
- /** 结账完成 */
22
- Completed = "completed",
23
- /** 已取消 */
24
- Cancelled = "cancelled",
25
- /** 错误状态 */
26
- Error = "error"
27
- }
28
- /**
29
- * 结账步骤枚举
30
- */
31
- export declare enum CheckoutStep {
32
- /** 订单确认 */
33
- OrderConfirmation = "order_confirmation",
34
- /** 支付方式选择 */
35
- PaymentMethod = "payment_method",
36
- /** 支付处理 */
37
- PaymentProcessing = "payment_processing",
38
- /** 完成 */
39
- Complete = "complete"
40
- }
41
- /**
42
- * 结账错误类型
43
- */
44
- export declare enum CheckoutErrorType {
45
- /** 订单创建失败 */
46
- OrderCreationFailed = "order_creation_failed",
47
- /** 支付失败 */
48
- PaymentFailed = "payment_failed",
49
- /** 验证失败 */
50
- ValidationFailed = "validation_failed",
51
- /** 网络错误 */
52
- NetworkError = "network_error",
53
- /** 未知错误 */
54
- UnknownError = "unknown_error"
55
- }
56
- /**
57
- * 结账错误信息
58
- */
59
- export interface CheckoutError {
60
- /** 错误类型 */
61
- type: CheckoutErrorType;
62
- /** 错误消息 */
63
- message: string;
64
- /** 错误详情 */
65
- details?: any;
66
- /** 错误时间戳 */
67
- timestamp: number;
68
- }
69
- /**
70
- * 结账初始化参数
71
- */
72
- export interface CheckoutInitParams {
73
- /** 购物车商品 */
74
- cartItems: CartItem[];
75
- /** 订单类型 */
76
- orderType?: 'virtual' | 'appointment_booking';
77
- /** 平台类型 */
78
- platform?: 'pc' | 'h5';
79
- /** 自动进入支付 */
80
- autoPayment?: boolean;
81
- }
82
- /**
83
- * 购物车小计项
84
- */
85
- export interface CartSummaryItem {
86
- /** 项目键名 */
87
- key: string;
88
- /** 项目值 */
89
- value: number;
90
- /** 是否隐藏显示 */
91
- hidden?: boolean;
92
- /** 显示标签 */
93
- label?: string;
94
- /** 税费详情 (当 key 为 tax 时) */
95
- tax?: Record<string, any>;
96
- }
97
- /**
98
- * 从购物车小计提取的金额信息
99
- */
100
- export interface ExtractedAmountInfo {
101
- /** 总金额 (expect_amount) */
102
- totalAmount: string;
103
- /** 小计 (sub_total) */
104
- subTotal: string;
105
- /** 税费 (tax) */
106
- taxAmount: string;
107
- /** 折扣 (discount) */
108
- discountAmount: string;
109
- /** 商店折扣 (shop_discount) */
110
- shopDiscountAmount: string;
111
- /** 四舍五入金额 (custom_roundingAmount) */
112
- roundingAmount: string;
113
- /** 定金金额 (如果是定金订单) */
114
- depositAmount?: string;
115
- /** 税费详情 */
116
- taxDetails?: Record<string, any>;
117
- }
118
- /**
119
- * 本地订单创建参数
120
- */
121
- export interface CreateLocalOrderParams {
122
- /** 订单数据 (来自购物车的完整订单参数) */
123
- orderData: LocalOrderData;
124
- /** 购物车小计数据 */
125
- cartSummary: CartSummaryItem[];
126
- /** 是否自动进入支付流程 */
127
- autoPayment?: boolean;
128
- }
129
- /**
130
- * 手动下单参数
131
- */
132
- export interface PlaceOrderParams {
133
- /** 订单提交的 URL (可选,默认使用 /order/appointment) */
134
- url?: string;
135
- /** 是否自动替换虚拟订单ID为真实订单ID */
136
- autoReplaceOrderId?: boolean;
137
- }
138
- /**
139
- * 本地订单数据结构 (基于 appointmentDemo.json)
140
- */
141
- export interface LocalOrderData {
142
- /** 订单类型 */
143
- type: 'appointment_booking' | 'virtual';
144
- /** 平台 */
145
- platform: 'PC' | 'H5';
146
- /** 销售渠道 */
147
- sales_channel: string;
148
- /** 订单销售渠道 */
149
- order_sales_channel: string;
150
- /** 预订信息 */
151
- bookings: LocalBookingItem[];
152
- /** 商店备注 */
153
- shop_note: string;
154
- /** 预约日期 */
155
- schedule_date: string;
156
- /** 是否定金 */
157
- is_deposit: number;
158
- /** 关联商品 */
159
- relation_products: any[];
160
- /** 关联表单 */
161
- relation_forms: any[];
162
- }
163
- /**
164
- * 本地预订项
165
- */
166
- export interface LocalBookingItem {
167
- /** ID */
168
- id: number;
169
- /** 数量 */
170
- number: number;
171
- /** 注册类型 */
172
- registration_type: string;
173
- /** 关联商品 */
174
- relation_products: any[];
175
- /** 是否全部 */
176
- is_all: boolean;
177
- /** 商品信息 */
178
- product: LocalProductInfo;
179
- /** 子类型 */
180
- sub_type: string;
181
- /** 时长 */
182
- duration: number;
183
- /** 喜好状态 */
184
- like_status: string;
185
- /** 资源列表 */
186
- resources: LocalResourceItem[];
187
- /** 预约ID */
188
- schedule_id: number;
189
- /** 开始日期 */
190
- start_date: string;
191
- /** 开始时间 */
192
- start_time: string;
193
- /** 选择日期 */
194
- select_date: string;
195
- /** 结束时间 */
196
- end_time: string;
197
- /** 结束日期 */
198
- end_date: string;
199
- /** 元数据 */
200
- metadata: {
201
- account?: {
202
- id: number;
203
- username: string;
204
- };
205
- capacity?: Array<{
206
- id: number;
207
- value: number;
208
- name: string;
209
- }>;
210
- };
211
- /** 持有者 */
212
- holder: any;
213
- /** 关联表单 */
214
- relation_forms: any[];
215
- }
216
- /**
217
- * 本地商品信息
218
- */
219
- export interface LocalProductInfo {
220
- /** 数量 */
221
- num: number;
222
- /** 商品ID */
223
- product_id: number;
224
- /** 商品变体ID */
225
- product_variant_id: number;
226
- /** 商品套装 */
227
- product_bundle: any[];
228
- /** 商品选项 */
229
- product_option_item: any[];
230
- /** 折扣列表 */
231
- discount_list: LocalDiscountItem[];
232
- }
233
- /**
234
- * 本地折扣项
235
- */
236
- export interface LocalDiscountItem {
237
- /** 金额 */
238
- amount: number;
239
- /** 类型 */
240
- type: string;
241
- /** 折扣详情 */
242
- discount: {
243
- resource_id: number;
244
- title: {
245
- auto: string;
246
- original: string;
247
- en?: string;
248
- 'zh-CN'?: string;
249
- 'zh-HK'?: string;
250
- };
251
- original_amount: number;
252
- product_id: number;
253
- percent: string;
254
- };
255
- }
256
- /**
257
- * 本地资源项
258
- */
259
- export interface LocalResourceItem {
260
- /** 关联类型 */
261
- relation_type: string;
262
- /** 喜好状态 */
263
- like_status: string;
264
- /** 表单ID */
265
- form_id: number;
266
- /** 关联ID */
267
- relation_id: number;
268
- /** 容量 */
269
- capacity: number;
270
- /** 元数据 */
271
- metadata: {
272
- combined_resource?: {
273
- status: number;
274
- resource_ids: number[];
275
- } | null;
276
- form_name: string;
277
- resource_name: string;
278
- };
279
- /** 子资源 */
280
- children?: LocalResourceItem[];
281
- /** ID (可选) */
282
- id?: number;
283
- /** 主字段 (可选) */
284
- main_field?: string;
285
- /** 资源类型 (可选) */
286
- resourceType?: string;
287
- }
288
- /**
289
- * 订单创建参数
290
- */
291
- export interface CreateOrderParams {
292
- /** 购物车商品 */
293
- cartItems: CartItem[];
294
- /** 订单类型 */
295
- type?: 'virtual' | 'appointment_booking';
296
- /** 平台类型 */
297
- platform?: 'pc' | 'h5';
298
- /** 额外参数 */
299
- extra?: Record<string, any>;
300
- }
301
- /**
302
- * 支付处理参数
303
- */
304
- export interface ProcessPaymentParams {
305
- /** 订单UUID */
306
- orderUuid: string;
307
- /** 支付方式代码 */
308
- paymentMethodCode: string;
309
- /** 支付金额 */
310
- amount: string | number;
311
- /** 支付元数据 */
312
- metadata?: Record<string, any>;
313
- }
314
- /**
315
- * 结账状态信息
316
- */
317
- export interface CheckoutStatusInfo {
318
- /** 当前状态 */
319
- status: CheckoutStatus;
320
- /** 当前步骤 */
321
- step: CheckoutStep;
322
- /** 进度百分比 (0-100) */
323
- progress: number;
324
- /** 状态消息 */
325
- message?: string;
326
- /** 错误信息 */
327
- error?: CheckoutError;
328
- }
329
- /**
330
- * 结账摘要信息
331
- */
332
- export interface CheckoutSummary {
333
- /** 订单信息 */
334
- order?: PaymentOrder;
335
- /** 总金额 */
336
- totalAmount: string;
337
- /** 已支付金额 */
338
- paidAmount: string;
339
- /** 待支付金额 */
340
- remainingAmount: string;
341
- /** 支付状态 */
342
- paymentStatus: PaymentStatus;
343
- /** 可用支付方式 */
344
- availablePaymentMethods: PaymentMethod[];
345
- }
346
- /**
347
- * 结账事件钩子
348
- */
349
- export declare enum CheckoutHooks {
350
- /** 结账初始化完成 */
351
- OnCheckoutInitialized = "checkout:onInitialized",
352
- /** 状态变更 */
353
- OnStatusChanged = "checkout:onStatusChanged",
354
- /** 步骤变更 */
355
- OnStepChanged = "checkout:onStepChanged",
356
- /** 订单创建成功 */
357
- OnOrderCreated = "checkout:onOrderCreated",
358
- /** 订单创建失败 */
359
- OnOrderCreationFailed = "checkout:onOrderCreationFailed",
360
- /** 支付开始 */
361
- OnPaymentStarted = "checkout:onPaymentStarted",
362
- /** 支付成功 */
363
- OnPaymentSuccess = "checkout:onPaymentSuccess",
364
- /** 支付失败 */
365
- OnPaymentFailed = "checkout:onPaymentFailed",
366
- /** 结账完成 */
367
- OnCheckoutCompleted = "checkout:onCompleted",
368
- /** 结账取消 */
369
- OnCheckoutCancelled = "checkout:onCancelled",
370
- /** 错误发生 */
371
- OnError = "checkout:onError"
372
- }
373
- /**
374
- * 结账状态数据
375
- */
376
- export interface CheckoutState {
377
- /** 订单模块 */
378
- order: OrderModule;
379
- /** 支付模块 */
380
- payment: PaymentModule;
381
- /** 当前状态 */
382
- status: CheckoutStatus;
383
- /** 当前步骤 */
384
- step: CheckoutStep;
385
- /** 当前订单 */
386
- currentOrder?: PaymentOrder;
387
- /** 购物车商品 */
388
- cartItems: CartItem[];
389
- /** 本地订单数据 */
390
- localOrderData?: LocalOrderData;
391
- /** 可用支付方式 */
392
- paymentMethods: PaymentMethod[];
393
- /** 错误信息 */
394
- lastError?: CheckoutError;
395
- }
396
- /**
397
- * 当前订单基础信息
398
- */
399
- export interface CurrentOrderInfo {
400
- /** 订单UUID */
401
- uuid?: string;
402
- /** 订单ID */
403
- orderId?: string;
404
- /** 订单状态 */
405
- status?: CheckoutStatus;
406
- /** 当前步骤 */
407
- step?: CheckoutStep;
408
- /** 订单总金额 */
409
- totalAmount?: string;
410
- /** 待付金额 */
411
- remainingAmount?: string;
412
- /** 支付状态 */
413
- paymentStatus?: PaymentStatus;
414
- /** 是否为定金订单 */
415
- isDeposit?: boolean;
416
- /** 定金金额 */
417
- depositAmount?: string;
418
- /** 订单类型 */
419
- orderType?: 'virtual' | 'appointment_booking';
420
- /** 平台类型 */
421
- platform?: 'pc' | 'h5';
422
- /** 创建时间 */
423
- createdAt?: string;
424
- /** 商品数量 */
425
- itemCount?: number;
426
- /** 是否有本地订单数据 */
427
- hasLocalOrderData?: boolean;
428
- }
429
- /**
430
- * 结账解决方案 API 接口
431
- */
432
- export interface CheckoutModuleAPI extends Module {
433
- /**
434
- * 初始化结账流程
435
- */
436
- initializeCheckoutAsync(params: CheckoutInitParams): Promise<void>;
437
- /**
438
- * 创建本地订单 (前端模拟下单流程)
439
- */
440
- createLocalOrderAsync(params: CreateLocalOrderParams): Promise<PaymentOrder>;
441
- /**
442
- * 手动下单 (根据虚拟订单生成实际订单)
443
- */
444
- placeOrderAsync(params?: PlaceOrderParams): Promise<{
445
- success: boolean;
446
- orderId?: string;
447
- error?: string;
448
- }>;
449
- /**
450
- * 创建订单
451
- */
452
- createOrderAsync(params: CreateOrderParams): Promise<PaymentOrder>;
453
- /**
454
- * 处理支付
455
- */
456
- processPaymentAsync(params: ProcessPaymentParams): Promise<void>;
457
- /**
458
- * 完成结账
459
- */
460
- completeCheckoutAsync(): Promise<{
461
- success: boolean;
462
- orderId?: string;
463
- }>;
464
- /**
465
- * 取消结账
466
- */
467
- cancelCheckoutAsync(): Promise<void>;
468
- /**
469
- * 获取结账状态
470
- */
471
- getCheckoutStatus(): CheckoutStatusInfo;
472
- /**
473
- * 获取结账摘要
474
- */
475
- getCheckoutSummaryAsync(): Promise<CheckoutSummary>;
476
- /**
477
- * 获取可用支付方式
478
- */
479
- getAvailablePaymentMethodsAsync(): Promise<PaymentMethod[]>;
480
- /**
481
- * 刷新支付方式缓存
482
- */
483
- refreshPaymentMethodsAsync(): Promise<PaymentMethod[]>;
484
- /**
485
- * 获取当前订单基础信息
486
- */
487
- getCurrentOrderInfo(): CurrentOrderInfo | null;
488
- /**
489
- * 验证结账前置条件
490
- */
491
- validateCheckoutAsync(): Promise<{
492
- valid: boolean;
493
- errors: string[];
494
- }>;
495
- /**
496
- * 重试失败的操作
497
- */
498
- retryFailedOperationAsync(): Promise<void>;
499
- /**
500
- * 设置当前步骤
501
- */
502
- setCurrentStep(step: CheckoutStep): void;
503
- /**
504
- * 获取订单模块
505
- */
506
- getOrderModule(): OrderModule;
507
- /**
508
- * 获取支付模块
509
- */
510
- getPaymentModule(): PaymentModuleAPI;
511
- /**
512
- * 替换本地订单ID为真实订单ID
513
- */
514
- replaceLocalOrderIdAsync(newOrderId: string): Promise<PaymentOrder | null>;
515
- }
516
- /**
517
- * 结账事件数据类型
518
- */
519
- export interface CheckoutEventData {
520
- /** 状态变更事件 */
521
- statusChanged: {
522
- oldStatus: CheckoutStatus;
523
- newStatus: CheckoutStatus;
524
- timestamp: number;
525
- };
526
- /** 步骤变更事件 */
527
- stepChanged: {
528
- oldStep: CheckoutStep;
529
- newStep: CheckoutStep;
530
- timestamp: number;
531
- };
532
- /** 订单创建事件 */
533
- orderCreated: {
534
- order: PaymentOrder;
535
- timestamp: number;
536
- };
537
- /** 支付事件 */
538
- paymentEvent: {
539
- orderUuid: string;
540
- paymentMethodCode: string;
541
- amount: string;
542
- timestamp: number;
543
- };
544
- /** 错误事件 */
545
- error: {
546
- error: CheckoutError;
547
- context?: any;
548
- timestamp: number;
549
- };
550
- }
@@ -1,132 +0,0 @@
1
- /**
2
- * 结账状态枚举
3
- */
4
- export var CheckoutStatus = /*#__PURE__*/function (CheckoutStatus) {
5
- CheckoutStatus["Initializing"] = "initializing";
6
- CheckoutStatus["Ready"] = "ready";
7
- CheckoutStatus["CreatingOrder"] = "creating_order";
8
- CheckoutStatus["OrderCreated"] = "order_created";
9
- CheckoutStatus["ProcessingPayment"] = "processing_payment";
10
- CheckoutStatus["PaymentCompleted"] = "payment_completed";
11
- CheckoutStatus["Completed"] = "completed";
12
- CheckoutStatus["Cancelled"] = "cancelled";
13
- CheckoutStatus["Error"] = "error";
14
- return CheckoutStatus;
15
- }({});
16
-
17
- /**
18
- * 结账步骤枚举
19
- */
20
- export var CheckoutStep = /*#__PURE__*/function (CheckoutStep) {
21
- CheckoutStep["OrderConfirmation"] = "order_confirmation";
22
- CheckoutStep["PaymentMethod"] = "payment_method";
23
- CheckoutStep["PaymentProcessing"] = "payment_processing";
24
- CheckoutStep["Complete"] = "complete";
25
- return CheckoutStep;
26
- }({});
27
-
28
- /**
29
- * 结账错误类型
30
- */
31
- export var CheckoutErrorType = /*#__PURE__*/function (CheckoutErrorType) {
32
- CheckoutErrorType["OrderCreationFailed"] = "order_creation_failed";
33
- CheckoutErrorType["PaymentFailed"] = "payment_failed";
34
- CheckoutErrorType["ValidationFailed"] = "validation_failed";
35
- CheckoutErrorType["NetworkError"] = "network_error";
36
- CheckoutErrorType["UnknownError"] = "unknown_error";
37
- return CheckoutErrorType;
38
- }({});
39
-
40
- /**
41
- * 结账错误信息
42
- */
43
-
44
- /**
45
- * 结账初始化参数
46
- */
47
-
48
- /**
49
- * 购物车小计项
50
- */
51
-
52
- /**
53
- * 从购物车小计提取的金额信息
54
- */
55
-
56
- /**
57
- * 本地订单创建参数
58
- */
59
-
60
- /**
61
- * 手动下单参数
62
- */
63
-
64
- /**
65
- * 本地订单数据结构 (基于 appointmentDemo.json)
66
- */
67
-
68
- /**
69
- * 本地预订项
70
- */
71
-
72
- /**
73
- * 本地商品信息
74
- */
75
-
76
- /**
77
- * 本地折扣项
78
- */
79
-
80
- /**
81
- * 本地资源项
82
- */
83
-
84
- /**
85
- * 订单创建参数
86
- */
87
-
88
- /**
89
- * 支付处理参数
90
- */
91
-
92
- /**
93
- * 结账状态信息
94
- */
95
-
96
- /**
97
- * 结账摘要信息
98
- */
99
-
100
- /**
101
- * 结账事件钩子
102
- */
103
- export var CheckoutHooks = /*#__PURE__*/function (CheckoutHooks) {
104
- CheckoutHooks["OnCheckoutInitialized"] = "checkout:onInitialized";
105
- CheckoutHooks["OnStatusChanged"] = "checkout:onStatusChanged";
106
- CheckoutHooks["OnStepChanged"] = "checkout:onStepChanged";
107
- CheckoutHooks["OnOrderCreated"] = "checkout:onOrderCreated";
108
- CheckoutHooks["OnOrderCreationFailed"] = "checkout:onOrderCreationFailed";
109
- CheckoutHooks["OnPaymentStarted"] = "checkout:onPaymentStarted";
110
- CheckoutHooks["OnPaymentSuccess"] = "checkout:onPaymentSuccess";
111
- CheckoutHooks["OnPaymentFailed"] = "checkout:onPaymentFailed";
112
- CheckoutHooks["OnCheckoutCompleted"] = "checkout:onCompleted";
113
- CheckoutHooks["OnCheckoutCancelled"] = "checkout:onCancelled";
114
- CheckoutHooks["OnError"] = "checkout:onError";
115
- return CheckoutHooks;
116
- }({});
117
-
118
- /**
119
- * 结账状态数据
120
- */
121
-
122
- /**
123
- * 当前订单基础信息
124
- */
125
-
126
- /**
127
- * 结账解决方案 API 接口
128
- */
129
-
130
- /**
131
- * 结账事件数据类型
132
- */