@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.
Files changed (268) hide show
  1. package/dist/core/index.js +2 -1
  2. package/dist/effects/index.d.ts +4 -3
  3. package/dist/effects/index.js +15 -6
  4. package/dist/modules/AccountList/index.d.ts +7 -1
  5. package/dist/modules/AccountList/index.js +81 -14
  6. package/dist/modules/AccountList/types.d.ts +28 -0
  7. package/dist/modules/AccountList/types.js +8 -0
  8. package/dist/modules/Cart/index.js +1 -1
  9. package/dist/modules/Cart/utils/changePrice.d.ts +2 -2
  10. package/dist/modules/Cart/utils/changePrice.js +1 -1
  11. package/dist/modules/Customer/constants.d.ts +7 -0
  12. package/dist/modules/Customer/constants.js +12 -0
  13. package/dist/modules/Customer/index.d.ts +122 -0
  14. package/dist/modules/Customer/index.js +697 -0
  15. package/dist/modules/Customer/types.d.ts +146 -0
  16. package/dist/modules/Customer/types.js +41 -0
  17. package/dist/modules/Payment/cash.d.ts +11 -0
  18. package/dist/modules/Payment/cash.js +78 -0
  19. package/dist/modules/Payment/eftpos.d.ts +11 -0
  20. package/dist/modules/Payment/eftpos.js +80 -0
  21. package/dist/modules/Payment/index.d.ts +273 -9
  22. package/dist/modules/Payment/index.js +2525 -109
  23. package/dist/modules/Payment/types.d.ts +382 -30
  24. package/dist/modules/Payment/types.js +116 -14
  25. package/dist/modules/Payment/wallet.d.ts +11 -0
  26. package/dist/modules/Payment/wallet.js +78 -0
  27. package/dist/modules/Payment/walletpass.d.ts +0 -0
  28. package/dist/modules/Payment/walletpass.js +0 -0
  29. package/dist/modules/ProductList/index.d.ts +14 -3
  30. package/dist/modules/ProductList/index.js +58 -44
  31. package/dist/modules/ProductList/types.d.ts +0 -1
  32. package/dist/modules/Rules/index.js +27 -14
  33. package/dist/modules/Rules/types.d.ts +1 -0
  34. package/dist/modules/index.d.ts +1 -0
  35. package/dist/modules/index.js +1 -0
  36. package/dist/plugins/app-types/app/app.d.ts +83 -0
  37. package/dist/plugins/app-types/app/const.d.ts +4 -0
  38. package/dist/plugins/app-types/app/index.d.ts +14 -0
  39. package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
  40. package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
  41. package/dist/plugins/app-types/config.d.ts +3 -0
  42. package/dist/plugins/app-types/cookie/index.d.ts +13 -0
  43. package/dist/plugins/app-types/data/index.d.ts +8 -0
  44. package/dist/plugins/app-types/history/config.d.ts +24 -0
  45. package/dist/plugins/app-types/history/index.d.ts +20 -0
  46. package/dist/plugins/app-types/history/type.d.ts +2 -0
  47. package/dist/plugins/app-types/hooks/index.d.ts +12 -0
  48. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  49. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  50. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  51. package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  52. package/dist/plugins/app-types/index.d.ts +6 -0
  53. package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
  54. package/dist/plugins/app-types/locales/en.d.ts +3 -0
  55. package/dist/plugins/app-types/locales/index.d.ts +37 -0
  56. package/dist/plugins/app-types/locales/original.d.ts +3 -0
  57. package/dist/plugins/app-types/locales/type.d.ts +19 -0
  58. package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
  59. package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
  60. package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
  61. package/dist/plugins/app-types/logger/index.d.ts +122 -0
  62. package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
  63. package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
  64. package/dist/plugins/app-types/models/global.d.ts +32 -0
  65. package/dist/plugins/app-types/models/index.d.ts +45 -0
  66. package/dist/plugins/app-types/models/type.d.ts +2 -0
  67. package/dist/plugins/app-types/package.json +15 -0
  68. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  69. package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
  70. package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
  71. package/dist/plugins/app-types/request/cache.d.ts +46 -0
  72. package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
  73. package/dist/plugins/app-types/request/config.d.ts +3 -0
  74. package/dist/plugins/app-types/request/constants.d.ts +2 -0
  75. package/dist/plugins/app-types/request/index.d.ts +24 -0
  76. package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
  77. package/dist/plugins/app-types/request/type.d.ts +41 -0
  78. package/dist/plugins/app-types/request/utils.d.ts +46 -0
  79. package/dist/plugins/app-types/routes/config.d.ts +7 -0
  80. package/dist/plugins/app-types/routes/index.d.ts +28 -0
  81. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  82. package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
  83. package/dist/plugins/app-types/socket/constants.d.ts +33 -0
  84. package/dist/plugins/app-types/socket/events.d.ts +31 -0
  85. package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
  86. package/dist/plugins/app-types/socket/index.d.ts +61 -0
  87. package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
  88. package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
  89. package/dist/plugins/app-types/socket/socket.d.ts +129 -0
  90. package/dist/plugins/app-types/socket/types.d.ts +85 -0
  91. package/dist/plugins/app-types/storage/index.d.ts +17 -0
  92. package/dist/plugins/app-types/tasks/index.d.ts +77 -0
  93. package/dist/plugins/app-types/tasks/type.d.ts +62 -0
  94. package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
  95. package/dist/plugins/app-types/type.d.ts +2 -0
  96. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  97. package/dist/plugins/app-types/variables/config.d.ts +3 -0
  98. package/dist/plugins/app-types/variables/index.d.ts +6 -0
  99. package/dist/plugins/app-types/variables/type.d.ts +2 -0
  100. package/dist/plugins/app-types/website/index.d.ts +6 -0
  101. package/dist/plugins/app.d.ts +8 -0
  102. package/dist/plugins/app.js +1 -0
  103. package/dist/plugins/window.d.ts +1 -0
  104. package/dist/solution/BookingByStep/index.js +59 -35
  105. package/dist/solution/BookingByStep/types.d.ts +3 -2
  106. package/dist/solution/BookingTicket/index.d.ts +172 -0
  107. package/dist/solution/BookingTicket/index.js +665 -0
  108. package/dist/solution/BookingTicket/types.d.ts +68 -0
  109. package/dist/solution/BookingTicket/types.js +43 -0
  110. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  111. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
  112. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
  113. package/dist/solution/BookingTicket/utils/scan/handleScan.js +174 -0
  114. package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
  115. package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
  116. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  117. package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
  118. package/dist/solution/BuyTickets/index.d.ts +2 -2
  119. package/dist/solution/BuyTickets/index.js +1 -1
  120. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  121. package/dist/solution/Checkout/index.d.ts +181 -0
  122. package/dist/solution/Checkout/index.js +1596 -0
  123. package/dist/solution/Checkout/types.d.ts +550 -0
  124. package/dist/solution/Checkout/types.js +132 -0
  125. package/dist/solution/Checkout/utils/index.d.ts +73 -0
  126. package/dist/solution/Checkout/utils/index.js +371 -0
  127. package/dist/solution/ShopDiscount/index.js +4 -2
  128. package/dist/solution/index.d.ts +2 -0
  129. package/dist/solution/index.js +3 -1
  130. package/dist/types/index.d.ts +3 -1
  131. package/dist/utils/task.d.ts +40 -0
  132. package/dist/utils/task.js +171 -0
  133. package/dist/utils/watch.d.ts +102 -0
  134. package/dist/utils/watch.js +294 -0
  135. package/lib/core/index.js +1 -1
  136. package/lib/effects/index.d.ts +4 -3
  137. package/lib/effects/index.js +4 -1
  138. package/lib/modules/AccountList/index.d.ts +7 -1
  139. package/lib/modules/AccountList/index.js +27 -0
  140. package/lib/modules/AccountList/types.d.ts +28 -0
  141. package/lib/modules/Cart/index.js +1 -1
  142. package/lib/modules/Cart/utils/changePrice.d.ts +2 -2
  143. package/lib/modules/Cart/utils/changePrice.js +1 -1
  144. package/lib/modules/Customer/constants.d.ts +7 -0
  145. package/lib/modules/Customer/constants.js +39 -0
  146. package/lib/modules/Customer/index.d.ts +122 -0
  147. package/lib/modules/Customer/index.js +440 -0
  148. package/lib/modules/Customer/types.d.ts +146 -0
  149. package/lib/modules/Customer/types.js +37 -0
  150. package/lib/modules/Payment/cash.d.ts +11 -0
  151. package/lib/modules/Payment/cash.js +51 -0
  152. package/lib/modules/Payment/eftpos.d.ts +11 -0
  153. package/lib/modules/Payment/eftpos.js +51 -0
  154. package/lib/modules/Payment/index.d.ts +273 -9
  155. package/lib/modules/Payment/index.js +1285 -50
  156. package/lib/modules/Payment/types.d.ts +382 -30
  157. package/lib/modules/Payment/types.js +41 -6
  158. package/lib/modules/Payment/wallet.d.ts +11 -0
  159. package/lib/modules/Payment/wallet.js +51 -0
  160. package/lib/modules/Payment/walletpass.d.ts +0 -0
  161. package/lib/modules/Payment/walletpass.js +0 -0
  162. package/lib/modules/ProductList/index.d.ts +14 -3
  163. package/lib/modules/ProductList/index.js +42 -28
  164. package/lib/modules/ProductList/types.d.ts +0 -1
  165. package/lib/modules/Rules/index.js +20 -12
  166. package/lib/modules/Rules/types.d.ts +1 -0
  167. package/lib/modules/index.d.ts +1 -0
  168. package/lib/modules/index.js +2 -0
  169. package/lib/plugins/app-types/app/app.d.ts +83 -0
  170. package/lib/plugins/app-types/app/const.d.ts +4 -0
  171. package/lib/plugins/app-types/app/index.d.ts +14 -0
  172. package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
  173. package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
  174. package/lib/plugins/app-types/config.d.ts +3 -0
  175. package/lib/plugins/app-types/cookie/index.d.ts +13 -0
  176. package/lib/plugins/app-types/data/index.d.ts +8 -0
  177. package/lib/plugins/app-types/history/config.d.ts +24 -0
  178. package/lib/plugins/app-types/history/index.d.ts +20 -0
  179. package/lib/plugins/app-types/history/type.d.ts +2 -0
  180. package/lib/plugins/app-types/hooks/index.d.ts +12 -0
  181. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  182. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  183. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  184. package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  185. package/lib/plugins/app-types/index.d.ts +6 -0
  186. package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
  187. package/lib/plugins/app-types/locales/en.d.ts +3 -0
  188. package/lib/plugins/app-types/locales/index.d.ts +37 -0
  189. package/lib/plugins/app-types/locales/original.d.ts +3 -0
  190. package/lib/plugins/app-types/locales/type.d.ts +19 -0
  191. package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
  192. package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
  193. package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
  194. package/lib/plugins/app-types/logger/index.d.ts +122 -0
  195. package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
  196. package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
  197. package/lib/plugins/app-types/models/global.d.ts +32 -0
  198. package/lib/plugins/app-types/models/index.d.ts +45 -0
  199. package/lib/plugins/app-types/models/type.d.ts +2 -0
  200. package/lib/plugins/app-types/package.json +15 -0
  201. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  202. package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
  203. package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
  204. package/lib/plugins/app-types/request/cache.d.ts +46 -0
  205. package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
  206. package/lib/plugins/app-types/request/config.d.ts +3 -0
  207. package/lib/plugins/app-types/request/constants.d.ts +2 -0
  208. package/lib/plugins/app-types/request/index.d.ts +24 -0
  209. package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
  210. package/lib/plugins/app-types/request/type.d.ts +41 -0
  211. package/lib/plugins/app-types/request/utils.d.ts +46 -0
  212. package/lib/plugins/app-types/routes/config.d.ts +7 -0
  213. package/lib/plugins/app-types/routes/index.d.ts +28 -0
  214. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  215. package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
  216. package/lib/plugins/app-types/socket/constants.d.ts +33 -0
  217. package/lib/plugins/app-types/socket/events.d.ts +31 -0
  218. package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
  219. package/lib/plugins/app-types/socket/index.d.ts +61 -0
  220. package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
  221. package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
  222. package/lib/plugins/app-types/socket/socket.d.ts +129 -0
  223. package/lib/plugins/app-types/socket/types.d.ts +85 -0
  224. package/lib/plugins/app-types/storage/index.d.ts +17 -0
  225. package/lib/plugins/app-types/tasks/index.d.ts +77 -0
  226. package/lib/plugins/app-types/tasks/type.d.ts +62 -0
  227. package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
  228. package/lib/plugins/app-types/type.d.ts +2 -0
  229. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  230. package/lib/plugins/app-types/variables/config.d.ts +3 -0
  231. package/lib/plugins/app-types/variables/index.d.ts +6 -0
  232. package/lib/plugins/app-types/variables/type.d.ts +2 -0
  233. package/lib/plugins/app-types/website/index.d.ts +6 -0
  234. package/lib/plugins/app.d.ts +8 -0
  235. package/lib/plugins/app.js +17 -0
  236. package/lib/plugins/window.d.ts +1 -0
  237. package/lib/solution/BookingByStep/index.js +40 -29
  238. package/lib/solution/BookingByStep/types.d.ts +3 -2
  239. package/lib/solution/BookingTicket/index.d.ts +172 -0
  240. package/lib/solution/BookingTicket/index.js +399 -0
  241. package/lib/solution/BookingTicket/types.d.ts +68 -0
  242. package/lib/solution/BookingTicket/types.js +72 -0
  243. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  244. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
  245. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
  246. package/lib/solution/BookingTicket/utils/scan/handleScan.js +125 -0
  247. package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
  248. package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
  249. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  250. package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
  251. package/lib/solution/BuyTickets/index.d.ts +2 -2
  252. package/lib/solution/BuyTickets/index.js +1 -1
  253. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  254. package/lib/solution/Checkout/index.d.ts +181 -0
  255. package/lib/solution/Checkout/index.js +864 -0
  256. package/lib/solution/Checkout/types.d.ts +550 -0
  257. package/lib/solution/Checkout/types.js +75 -0
  258. package/lib/solution/Checkout/utils/index.d.ts +73 -0
  259. package/lib/solution/Checkout/utils/index.js +266 -0
  260. package/lib/solution/ShopDiscount/index.js +2 -1
  261. package/lib/solution/index.d.ts +2 -0
  262. package/lib/solution/index.js +5 -1
  263. package/lib/types/index.d.ts +3 -1
  264. package/lib/utils/task.d.ts +40 -0
  265. package/lib/utils/task.js +109 -0
  266. package/lib/utils/watch.d.ts +102 -0
  267. package/lib/utils/watch.js +217 -0
  268. package/package.json +4 -2
@@ -0,0 +1,550 @@
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
+ }
@@ -0,0 +1,132 @@
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
+ */