@pisell/pisellos 3.0.75 → 3.0.76

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 (319) hide show
  1. package/dist/core/index.js +2 -1
  2. package/dist/effects/index.d.ts +5 -3
  3. package/dist/effects/index.js +40 -8
  4. package/dist/modules/Account/index.js +2 -3
  5. package/dist/modules/AccountList/index.d.ts +7 -1
  6. package/dist/modules/AccountList/index.js +81 -14
  7. package/dist/modules/AccountList/types.d.ts +28 -0
  8. package/dist/modules/AccountList/types.js +8 -0
  9. package/dist/modules/BaseModule.d.ts +3 -0
  10. package/dist/modules/BaseModule.js +15 -0
  11. package/dist/modules/Cart/index.d.ts +1 -0
  12. package/dist/modules/Cart/index.js +2 -1
  13. package/dist/modules/Cart/utils/cartProduct.js +21 -4
  14. package/dist/modules/Customer/constants.d.ts +7 -0
  15. package/dist/modules/Customer/constants.js +12 -0
  16. package/dist/modules/Customer/index.d.ts +122 -0
  17. package/dist/modules/Customer/index.js +696 -0
  18. package/dist/modules/Customer/types.d.ts +146 -0
  19. package/dist/modules/Customer/types.js +41 -0
  20. package/dist/modules/Discount/index.d.ts +1 -0
  21. package/dist/modules/Discount/index.js +3 -3
  22. package/dist/modules/Discount/types.d.ts +9 -0
  23. package/dist/modules/Guests/index.js +9 -9
  24. package/dist/modules/Order/index.d.ts +25 -1
  25. package/dist/modules/Order/index.js +224 -3
  26. package/dist/modules/Order/types.d.ts +45 -0
  27. package/dist/modules/Order/types.js +8 -0
  28. package/dist/modules/Order/utils.js +1 -1
  29. package/dist/modules/Payment/cash.d.ts +19 -0
  30. package/dist/modules/Payment/cash.js +97 -0
  31. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  32. package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
  33. package/dist/modules/Payment/eftpos.d.ts +11 -0
  34. package/dist/modules/Payment/eftpos.js +80 -0
  35. package/dist/modules/Payment/index.d.ts +184 -9
  36. package/dist/modules/Payment/index.js +2084 -109
  37. package/dist/modules/Payment/mx51.d.ts +0 -0
  38. package/dist/modules/Payment/mx51.js +0 -0
  39. package/dist/modules/Payment/types.d.ts +772 -30
  40. package/dist/modules/Payment/types.js +236 -12
  41. package/dist/modules/Payment/utils.d.ts +17 -0
  42. package/dist/modules/Payment/utils.js +62 -0
  43. package/dist/modules/Payment/walletpass.d.ts +99 -0
  44. package/dist/modules/Payment/walletpass.js +711 -0
  45. package/dist/modules/ProductList/index.d.ts +12 -1
  46. package/dist/modules/ProductList/index.js +37 -15
  47. package/dist/modules/Resource/index.js +1 -1
  48. package/dist/modules/Rules/index.d.ts +2 -1
  49. package/dist/modules/Rules/index.js +470 -127
  50. package/dist/modules/Rules/types.d.ts +1 -0
  51. package/dist/modules/Schedule/index.d.ts +9 -0
  52. package/dist/modules/Schedule/index.js +77 -0
  53. package/dist/modules/Summary/utils.d.ts +5 -0
  54. package/dist/modules/Summary/utils.js +36 -1
  55. package/dist/modules/index.d.ts +1 -0
  56. package/dist/modules/index.js +1 -0
  57. package/dist/plugins/app-types/app/app.d.ts +83 -0
  58. package/dist/plugins/app-types/app/const.d.ts +4 -0
  59. package/dist/plugins/app-types/app/index.d.ts +14 -0
  60. package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
  61. package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
  62. package/dist/plugins/app-types/config.d.ts +3 -0
  63. package/dist/plugins/app-types/cookie/index.d.ts +13 -0
  64. package/dist/plugins/app-types/data/index.d.ts +8 -0
  65. package/dist/plugins/app-types/history/config.d.ts +24 -0
  66. package/dist/plugins/app-types/history/index.d.ts +20 -0
  67. package/dist/plugins/app-types/history/type.d.ts +2 -0
  68. package/dist/plugins/app-types/hooks/index.d.ts +12 -0
  69. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  70. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  71. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  72. package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  73. package/dist/plugins/app-types/index.d.ts +6 -0
  74. package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
  75. package/dist/plugins/app-types/locales/en.d.ts +3 -0
  76. package/dist/plugins/app-types/locales/index.d.ts +37 -0
  77. package/dist/plugins/app-types/locales/original.d.ts +3 -0
  78. package/dist/plugins/app-types/locales/type.d.ts +19 -0
  79. package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
  80. package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
  81. package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
  82. package/dist/plugins/app-types/logger/index.d.ts +122 -0
  83. package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
  84. package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
  85. package/dist/plugins/app-types/models/global.d.ts +32 -0
  86. package/dist/plugins/app-types/models/index.d.ts +45 -0
  87. package/dist/plugins/app-types/models/type.d.ts +2 -0
  88. package/dist/plugins/app-types/package.json +15 -0
  89. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  90. package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
  91. package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
  92. package/dist/plugins/app-types/request/cache.d.ts +46 -0
  93. package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
  94. package/dist/plugins/app-types/request/config.d.ts +3 -0
  95. package/dist/plugins/app-types/request/constants.d.ts +2 -0
  96. package/dist/plugins/app-types/request/index.d.ts +24 -0
  97. package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
  98. package/dist/plugins/app-types/request/type.d.ts +41 -0
  99. package/dist/plugins/app-types/request/utils.d.ts +46 -0
  100. package/dist/plugins/app-types/routes/config.d.ts +7 -0
  101. package/dist/plugins/app-types/routes/index.d.ts +28 -0
  102. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  103. package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
  104. package/dist/plugins/app-types/socket/constants.d.ts +33 -0
  105. package/dist/plugins/app-types/socket/events.d.ts +31 -0
  106. package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
  107. package/dist/plugins/app-types/socket/index.d.ts +61 -0
  108. package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
  109. package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
  110. package/dist/plugins/app-types/socket/socket.d.ts +129 -0
  111. package/dist/plugins/app-types/socket/types.d.ts +85 -0
  112. package/dist/plugins/app-types/storage/index.d.ts +17 -0
  113. package/dist/plugins/app-types/tasks/index.d.ts +77 -0
  114. package/dist/plugins/app-types/tasks/type.d.ts +62 -0
  115. package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
  116. package/dist/plugins/app-types/type.d.ts +2 -0
  117. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  118. package/dist/plugins/app-types/variables/config.d.ts +3 -0
  119. package/dist/plugins/app-types/variables/index.d.ts +6 -0
  120. package/dist/plugins/app-types/variables/type.d.ts +2 -0
  121. package/dist/plugins/app-types/website/index.d.ts +6 -0
  122. package/dist/plugins/app.d.ts +8 -0
  123. package/dist/plugins/app.js +1 -0
  124. package/dist/plugins/window.d.ts +1 -0
  125. package/dist/solution/BookingByStep/index.js +43 -13
  126. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  127. package/dist/solution/BookingByStep/utils/products.d.ts +6 -0
  128. package/dist/solution/BookingByStep/utils/products.js +10 -0
  129. package/dist/solution/BookingTicket/index.d.ts +184 -0
  130. package/dist/solution/BookingTicket/index.js +698 -0
  131. package/dist/solution/BookingTicket/types.d.ts +68 -0
  132. package/dist/solution/BookingTicket/types.js +43 -0
  133. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  134. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
  135. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
  136. package/dist/solution/BookingTicket/utils/scan/handleScan.js +189 -0
  137. package/dist/solution/BookingTicket/utils/scan/index.d.ts +85 -0
  138. package/dist/solution/BookingTicket/utils/scan/index.js +294 -0
  139. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  140. package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
  141. package/dist/solution/BuyTickets/index.js +7 -8
  142. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  143. package/dist/solution/Checkout/index.d.ts +432 -0
  144. package/dist/solution/Checkout/index.js +4452 -0
  145. package/dist/solution/Checkout/types.d.ts +727 -0
  146. package/dist/solution/Checkout/types.js +104 -0
  147. package/dist/solution/Checkout/utils/index.d.ts +121 -0
  148. package/dist/solution/Checkout/utils/index.js +511 -0
  149. package/dist/solution/ShopDiscount/index.d.ts +10 -10
  150. package/dist/solution/ShopDiscount/index.js +111 -60
  151. package/dist/solution/ShopDiscount/types.d.ts +8 -0
  152. package/dist/solution/ShopDiscount/utils.d.ts +24 -0
  153. package/dist/solution/ShopDiscount/utils.js +135 -1
  154. package/dist/solution/index.d.ts +2 -0
  155. package/dist/solution/index.js +3 -1
  156. package/dist/types/index.d.ts +4 -1
  157. package/dist/utils/task.d.ts +40 -0
  158. package/dist/utils/task.js +171 -0
  159. package/dist/utils/watch.d.ts +102 -0
  160. package/dist/utils/watch.js +294 -0
  161. package/lib/core/index.js +1 -1
  162. package/lib/effects/index.d.ts +5 -3
  163. package/lib/effects/index.js +17 -1
  164. package/lib/modules/Account/index.js +2 -3
  165. package/lib/modules/AccountList/index.d.ts +7 -1
  166. package/lib/modules/AccountList/index.js +27 -0
  167. package/lib/modules/AccountList/types.d.ts +28 -0
  168. package/lib/modules/BaseModule.d.ts +3 -0
  169. package/lib/modules/BaseModule.js +9 -0
  170. package/lib/modules/Cart/index.d.ts +1 -0
  171. package/lib/modules/Cart/index.js +5 -2
  172. package/lib/modules/Cart/utils/cartProduct.js +22 -6
  173. package/lib/modules/Customer/constants.d.ts +7 -0
  174. package/lib/modules/Customer/constants.js +39 -0
  175. package/lib/modules/Customer/index.d.ts +122 -0
  176. package/lib/modules/Customer/index.js +439 -0
  177. package/lib/modules/Customer/types.d.ts +146 -0
  178. package/lib/modules/Customer/types.js +37 -0
  179. package/lib/modules/Discount/index.d.ts +1 -0
  180. package/lib/modules/Discount/index.js +3 -3
  181. package/lib/modules/Discount/types.d.ts +9 -0
  182. package/lib/modules/Guests/index.js +9 -9
  183. package/lib/modules/Order/index.d.ts +25 -1
  184. package/lib/modules/Order/index.js +186 -1
  185. package/lib/modules/Order/types.d.ts +45 -0
  186. package/lib/modules/Order/utils.js +1 -1
  187. package/lib/modules/Payment/cash.d.ts +19 -0
  188. package/lib/modules/Payment/cash.js +64 -0
  189. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
  190. package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
  191. package/lib/modules/Payment/eftpos.d.ts +11 -0
  192. package/lib/modules/Payment/eftpos.js +51 -0
  193. package/lib/modules/Payment/index.d.ts +184 -9
  194. package/lib/modules/Payment/index.js +1084 -51
  195. package/lib/modules/Payment/mx51.d.ts +0 -0
  196. package/lib/modules/Payment/mx51.js +0 -0
  197. package/lib/modules/Payment/types.d.ts +772 -30
  198. package/lib/modules/Payment/types.js +79 -6
  199. package/lib/modules/Payment/utils.d.ts +17 -0
  200. package/lib/modules/Payment/utils.js +67 -0
  201. package/lib/modules/Payment/walletpass.d.ts +99 -0
  202. package/lib/modules/Payment/walletpass.js +484 -0
  203. package/lib/modules/ProductList/index.d.ts +12 -1
  204. package/lib/modules/ProductList/index.js +31 -12
  205. package/lib/modules/Resource/index.js +1 -1
  206. package/lib/modules/Rules/index.d.ts +2 -1
  207. package/lib/modules/Rules/index.js +318 -72
  208. package/lib/modules/Rules/types.d.ts +1 -0
  209. package/lib/modules/Schedule/index.d.ts +9 -0
  210. package/lib/modules/Schedule/index.js +60 -0
  211. package/lib/modules/Summary/utils.d.ts +5 -0
  212. package/lib/modules/Summary/utils.js +27 -3
  213. package/lib/modules/index.d.ts +1 -0
  214. package/lib/modules/index.js +2 -0
  215. package/lib/plugins/app-types/app/app.d.ts +83 -0
  216. package/lib/plugins/app-types/app/const.d.ts +4 -0
  217. package/lib/plugins/app-types/app/index.d.ts +14 -0
  218. package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
  219. package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
  220. package/lib/plugins/app-types/config.d.ts +3 -0
  221. package/lib/plugins/app-types/cookie/index.d.ts +13 -0
  222. package/lib/plugins/app-types/data/index.d.ts +8 -0
  223. package/lib/plugins/app-types/history/config.d.ts +24 -0
  224. package/lib/plugins/app-types/history/index.d.ts +20 -0
  225. package/lib/plugins/app-types/history/type.d.ts +2 -0
  226. package/lib/plugins/app-types/hooks/index.d.ts +12 -0
  227. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  228. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  229. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  230. package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  231. package/lib/plugins/app-types/index.d.ts +6 -0
  232. package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
  233. package/lib/plugins/app-types/locales/en.d.ts +3 -0
  234. package/lib/plugins/app-types/locales/index.d.ts +37 -0
  235. package/lib/plugins/app-types/locales/original.d.ts +3 -0
  236. package/lib/plugins/app-types/locales/type.d.ts +19 -0
  237. package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
  238. package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
  239. package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
  240. package/lib/plugins/app-types/logger/index.d.ts +122 -0
  241. package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
  242. package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
  243. package/lib/plugins/app-types/models/global.d.ts +32 -0
  244. package/lib/plugins/app-types/models/index.d.ts +45 -0
  245. package/lib/plugins/app-types/models/type.d.ts +2 -0
  246. package/lib/plugins/app-types/package.json +15 -0
  247. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  248. package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
  249. package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
  250. package/lib/plugins/app-types/request/cache.d.ts +46 -0
  251. package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
  252. package/lib/plugins/app-types/request/config.d.ts +3 -0
  253. package/lib/plugins/app-types/request/constants.d.ts +2 -0
  254. package/lib/plugins/app-types/request/index.d.ts +24 -0
  255. package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
  256. package/lib/plugins/app-types/request/type.d.ts +41 -0
  257. package/lib/plugins/app-types/request/utils.d.ts +46 -0
  258. package/lib/plugins/app-types/routes/config.d.ts +7 -0
  259. package/lib/plugins/app-types/routes/index.d.ts +28 -0
  260. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  261. package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
  262. package/lib/plugins/app-types/socket/constants.d.ts +33 -0
  263. package/lib/plugins/app-types/socket/events.d.ts +31 -0
  264. package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
  265. package/lib/plugins/app-types/socket/index.d.ts +61 -0
  266. package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
  267. package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
  268. package/lib/plugins/app-types/socket/socket.d.ts +129 -0
  269. package/lib/plugins/app-types/socket/types.d.ts +85 -0
  270. package/lib/plugins/app-types/storage/index.d.ts +17 -0
  271. package/lib/plugins/app-types/tasks/index.d.ts +77 -0
  272. package/lib/plugins/app-types/tasks/type.d.ts +62 -0
  273. package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
  274. package/lib/plugins/app-types/type.d.ts +2 -0
  275. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  276. package/lib/plugins/app-types/variables/config.d.ts +3 -0
  277. package/lib/plugins/app-types/variables/index.d.ts +6 -0
  278. package/lib/plugins/app-types/variables/type.d.ts +2 -0
  279. package/lib/plugins/app-types/website/index.d.ts +6 -0
  280. package/lib/plugins/app.d.ts +8 -0
  281. package/lib/plugins/app.js +17 -0
  282. package/lib/plugins/window.d.ts +1 -0
  283. package/lib/solution/BookingByStep/index.js +18 -6
  284. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  285. package/lib/solution/BookingByStep/utils/products.d.ts +6 -0
  286. package/lib/solution/BookingByStep/utils/products.js +8 -2
  287. package/lib/solution/BookingTicket/index.d.ts +184 -0
  288. package/lib/solution/BookingTicket/index.js +426 -0
  289. package/lib/solution/BookingTicket/types.d.ts +68 -0
  290. package/lib/solution/BookingTicket/types.js +72 -0
  291. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  292. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
  293. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
  294. package/lib/solution/BookingTicket/utils/scan/handleScan.js +132 -0
  295. package/lib/solution/BookingTicket/utils/scan/index.d.ts +85 -0
  296. package/lib/solution/BookingTicket/utils/scan/index.js +216 -0
  297. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  298. package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
  299. package/lib/solution/BuyTickets/index.js +7 -8
  300. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  301. package/lib/solution/Checkout/index.d.ts +432 -0
  302. package/lib/solution/Checkout/index.js +2776 -0
  303. package/lib/solution/Checkout/types.d.ts +727 -0
  304. package/lib/solution/Checkout/types.js +63 -0
  305. package/lib/solution/Checkout/utils/index.d.ts +121 -0
  306. package/lib/solution/Checkout/utils/index.js +362 -0
  307. package/lib/solution/ShopDiscount/index.d.ts +10 -10
  308. package/lib/solution/ShopDiscount/index.js +53 -27
  309. package/lib/solution/ShopDiscount/types.d.ts +8 -0
  310. package/lib/solution/ShopDiscount/utils.d.ts +24 -0
  311. package/lib/solution/ShopDiscount/utils.js +88 -1
  312. package/lib/solution/index.d.ts +2 -0
  313. package/lib/solution/index.js +5 -1
  314. package/lib/types/index.d.ts +4 -1
  315. package/lib/utils/task.d.ts +40 -0
  316. package/lib/utils/task.js +109 -0
  317. package/lib/utils/watch.d.ts +102 -0
  318. package/lib/utils/watch.js +217 -0
  319. package/package.json +3 -1
@@ -0,0 +1,727 @@
1
+ import { Module } from '../../types';
2
+ import { OrderModule } from '../../modules/Order';
3
+ import { PaymentModuleAPI, PaymentOrder, PaymentMethod, PaymentStatus, PaymentItem, PaymentItemInput } from '../../modules/Payment';
4
+ import { CartItem } from '../../modules/Cart/types';
5
+ /**
6
+ * 结账错误类型
7
+ */
8
+ export declare enum CheckoutErrorType {
9
+ /** 订单创建失败 */
10
+ OrderCreationFailed = "order_creation_failed",
11
+ /** 支付失败 */
12
+ PaymentFailed = "payment_failed",
13
+ /** 验证失败 */
14
+ ValidationFailed = "validation_failed",
15
+ /** 网络错误 */
16
+ NetworkError = "network_error",
17
+ /** 未知错误 */
18
+ UnknownError = "unknown_error"
19
+ }
20
+ /**
21
+ * 结账错误信息
22
+ */
23
+ export interface CheckoutError {
24
+ /** 错误类型 */
25
+ type: CheckoutErrorType;
26
+ /** 错误消息 */
27
+ message: string;
28
+ /** 错误详情 */
29
+ details?: any;
30
+ /** 错误时间戳 */
31
+ timestamp: number;
32
+ }
33
+ /**
34
+ * 结账初始化参数
35
+ */
36
+ export interface CheckoutInitParams {
37
+ /** 购物车商品 */
38
+ cartItems: CartItem[];
39
+ /** 订单类型 */
40
+ orderType?: 'virtual' | 'appointment_booking';
41
+ /** 平台类型 */
42
+ platform?: 'pc' | 'h5';
43
+ /** 自动进入支付 */
44
+ autoPayment?: boolean;
45
+ }
46
+ /**
47
+ * 购物车小计项
48
+ */
49
+ export interface CartSummaryItem {
50
+ /** 项目键名 */
51
+ key: string;
52
+ /** 项目值 */
53
+ value: number;
54
+ /** 是否隐藏显示 */
55
+ hidden?: boolean;
56
+ /** 显示标签 */
57
+ label?: string;
58
+ /** 税费详情 (当 key 为 tax 时) */
59
+ tax?: Record<string, any>;
60
+ }
61
+ /**
62
+ * 从购物车小计提取的金额信息
63
+ */
64
+ export interface ExtractedAmountInfo {
65
+ /** 总金额 (expect_amount) */
66
+ totalAmount: string;
67
+ /** 小计 (sub_total) */
68
+ subTotal: string;
69
+ /** 税费 (tax) */
70
+ taxAmount: string;
71
+ /** 折扣 (discount) */
72
+ discountAmount: string;
73
+ /** 商店折扣 (shop_discount) */
74
+ shopDiscountAmount: string;
75
+ /** 四舍五入金额 (custom_roundingAmount) */
76
+ roundingAmount: string;
77
+ /** 定金金额 (如果是定金订单) */
78
+ depositAmount?: string;
79
+ /** 税费详情 */
80
+ taxDetails?: Record<string, any>;
81
+ }
82
+ /**
83
+ * 本地订单创建参数
84
+ */
85
+ export interface CreateLocalOrderParams {
86
+ /** 订单数据 (来自购物车的完整订单参数) */
87
+ orderData: LocalOrderData;
88
+ /** 购物车小计数据 */
89
+ cartSummary: CartSummaryItem[];
90
+ /** 是否自动进入支付流程 */
91
+ autoPayment?: boolean;
92
+ totalInfo: any;
93
+ }
94
+ /**
95
+ * 本地订单更新参数
96
+ */
97
+ export interface UpdateLocalOrderParams {
98
+ /** 要更新的后端订单ID(已同步过后端的订单) */
99
+ orderId: string;
100
+ /** 更新后的订单数据(结构与创建时一致,允许部分字段变化) */
101
+ orderData: LocalOrderData;
102
+ /** 更新后的购物车小计数据 */
103
+ cartSummary: CartSummaryItem[];
104
+ /** total 信息(用于拆解金额) */
105
+ totalInfo: any;
106
+ }
107
+ /**
108
+ * 本地订单数据结构 (基于 appointmentDemo.json)
109
+ */
110
+ export interface LocalOrderData {
111
+ /** 订单类型 */
112
+ type: 'appointment_booking' | 'virtual';
113
+ /** 平台 */
114
+ platform: 'PC' | 'H5';
115
+ /** 销售渠道 */
116
+ sales_channel: string;
117
+ /** 订单销售渠道 */
118
+ order_sales_channel: string;
119
+ /** 预订信息 */
120
+ bookings: LocalBookingItem[];
121
+ /** 商店备注 */
122
+ shop_note: string;
123
+ /** 预约日期 */
124
+ schedule_date: string;
125
+ /** 是否定金 */
126
+ is_deposit: number;
127
+ /** 关联商品 */
128
+ relation_products: any[];
129
+ /** 关联表单 */
130
+ relation_forms: any[];
131
+ /** 客户ID */
132
+ customer_id?: string;
133
+ /** 客户姓名 */
134
+ customer_name?: string;
135
+ /** 创建时间 (YYYY-MM-DD hh:mm:ss) */
136
+ created_at?: string;
137
+ /** 附加费用 */
138
+ surcharge_fee?: number;
139
+ /** 附加费列表 */
140
+ surcharges?: any[];
141
+ /** 商店折扣金额 */
142
+ shop_discount?: number;
143
+ /** 税费金额 */
144
+ tax_fee?: number;
145
+ }
146
+ /**
147
+ * 本地预订项
148
+ */
149
+ export interface LocalBookingItem {
150
+ /** ID */
151
+ id: number;
152
+ /** 数量 */
153
+ number: number;
154
+ /** 注册类型 */
155
+ registration_type: string;
156
+ /** 关联商品 */
157
+ relation_products: any[];
158
+ /** 是否全部 */
159
+ is_all: boolean;
160
+ /** 商品信息 */
161
+ product: LocalProductInfo;
162
+ /** 子类型 */
163
+ sub_type: string;
164
+ /** 时长 */
165
+ duration: number;
166
+ /** 喜好状态 */
167
+ like_status: string;
168
+ /** 资源列表 */
169
+ resources: LocalResourceItem[];
170
+ /** 预约ID */
171
+ schedule_id: number;
172
+ /** 开始日期 */
173
+ start_date: string;
174
+ /** 开始时间 */
175
+ start_time: string;
176
+ /** 选择日期 */
177
+ select_date: string;
178
+ /** 结束时间 */
179
+ end_time: string;
180
+ /** 结束日期 */
181
+ end_date: string;
182
+ /** 元数据 */
183
+ metadata: {
184
+ account?: {
185
+ id: number;
186
+ username: string;
187
+ };
188
+ capacity?: Array<{
189
+ id: number;
190
+ value: number;
191
+ name: string;
192
+ }>;
193
+ };
194
+ /** 持有者 */
195
+ holder: any;
196
+ /** 关联表单 */
197
+ relation_forms: any[];
198
+ }
199
+ /**
200
+ * 本地商品信息
201
+ */
202
+ export interface LocalProductInfo {
203
+ /** 数量 */
204
+ num: number;
205
+ /** 商品ID */
206
+ product_id: number;
207
+ /** 商品变体ID */
208
+ product_variant_id: number;
209
+ /** 商品套装 */
210
+ product_bundle: any[];
211
+ /** 商品选项 */
212
+ product_option_item: any[];
213
+ /** 折扣列表 */
214
+ discount_list: LocalDiscountItem[];
215
+ }
216
+ /**
217
+ * 本地折扣项
218
+ */
219
+ export interface LocalDiscountItem {
220
+ /** 金额 */
221
+ amount: number;
222
+ /** 类型 */
223
+ type: string;
224
+ /** 折扣详情 */
225
+ discount: {
226
+ resource_id: number;
227
+ title: {
228
+ auto: string;
229
+ original: string;
230
+ en?: string;
231
+ 'zh-CN'?: string;
232
+ 'zh-HK'?: string;
233
+ };
234
+ original_amount: number;
235
+ product_id: number;
236
+ percent: string;
237
+ };
238
+ }
239
+ /**
240
+ * 本地资源项
241
+ */
242
+ export interface LocalResourceItem {
243
+ /** 关联类型 */
244
+ relation_type: string;
245
+ /** 喜好状态 */
246
+ like_status: string;
247
+ /** 表单ID */
248
+ form_id: number;
249
+ /** 关联ID */
250
+ relation_id: number;
251
+ /** 容量 */
252
+ capacity: number;
253
+ /** 元数据 */
254
+ metadata: {
255
+ combined_resource?: {
256
+ status: number;
257
+ resource_ids: number[];
258
+ } | null;
259
+ form_name: string;
260
+ resource_name: string;
261
+ };
262
+ /** 子资源 */
263
+ children?: LocalResourceItem[];
264
+ /** ID (可选) */
265
+ id?: number;
266
+ /** 主字段 (可选) */
267
+ main_field?: string;
268
+ /** 资源类型 (可选) */
269
+ resourceType?: string;
270
+ }
271
+ /**
272
+ * 结账事件钩子
273
+ */
274
+ export declare enum CheckoutHooks {
275
+ /** 结账初始化完成 */
276
+ OnCheckoutInitialized = "checkout:onInitialized",
277
+ /** 订单创建成功 */
278
+ OnOrderCreated = "checkout:onOrderCreated",
279
+ /** 订单创建失败 */
280
+ OnOrderCreationFailed = "checkout:onOrderCreationFailed",
281
+ /** 支付开始 */
282
+ OnPaymentStarted = "checkout:onPaymentStarted",
283
+ /** 支付成功 */
284
+ OnPaymentSuccess = "checkout:onPaymentSuccess",
285
+ /** 支付失败 */
286
+ OnPaymentFailed = "checkout:onPaymentFailed",
287
+ /** 结账完成 */
288
+ OnCheckoutCompleted = "checkout:onCompleted",
289
+ /** 结账取消 */
290
+ OnCheckoutCancelled = "checkout:onCancelled",
291
+ /** 错误发生 */
292
+ OnError = "checkout:onError",
293
+ /** 自定义支付金额变更 */
294
+ OnStateAmountChanged = "checkout:onStateAmountChanged",
295
+ /** 系统计算的待付金额变更 */
296
+ OnBalanceDueAmountChanged = "checkout:onBalanceDueAmountChanged",
297
+ /** 订单支付完成(待付款金额 ≤ 0) */
298
+ OnOrderPaymentCompleted = "checkout:onOrderPaymentCompleted",
299
+ /** 订单同步到后端完成 */
300
+ OnOrderSynced = "checkout:onOrderSynced",
301
+ /** 订单同步到后端失败 */
302
+ OnOrderSyncFailed = "checkout:onOrderSyncFailed",
303
+ /** 订单备注变更 */
304
+ OnOrderNoteChanged = "checkout:onOrderNoteChanged",
305
+ /** 商店折扣变更 */
306
+ OnShopDiscountChanged = "checkout:onShopDiscountChanged",
307
+ /** 订单取消 */
308
+ OnOrderCancelled = "checkout:onOrderCancelled",
309
+ /** 订单状态已清理 */
310
+ OnOrderCleared = "checkout:onOrderCleared",
311
+ /** 下单接口请求开始 */
312
+ OnOrderSubmitStart = "checkout:onOrderSubmitStart",
313
+ /** 下单接口请求完成 */
314
+ OnOrderSubmitEnd = "checkout:onOrderSubmitEnd",
315
+ /** 钱包数据初始化完成 */
316
+ OnWalletDataInitialized = "checkout:onWalletDataInitialized",
317
+ /** 支付项添加成功 */
318
+ OnPaymentItemAdded = "checkout:onPaymentItemAdded"
319
+ }
320
+ /**
321
+ * 结账状态数据
322
+ */
323
+ export interface CheckoutState {
324
+ /** 当前订单 */
325
+ currentOrder?: PaymentOrder;
326
+ /** 购物车商品 */
327
+ cartItems: CartItem[];
328
+ /** 本地订单数据 */
329
+ localOrderData?: LocalOrderData;
330
+ /** 购物车小计数据 */
331
+ cartSummary?: CartSummaryItem[];
332
+ /** 可用支付方式 */
333
+ paymentMethods: PaymentMethod[];
334
+ /** 错误信息 */
335
+ lastError?: CheckoutError;
336
+ /** UI 自定义支付金额 */
337
+ stateAmount: string;
338
+ /** 系统计算的待付金额(只读,由系统内部计算) */
339
+ balanceDueAmount: string;
340
+ /** 订单是否已同步到后端 */
341
+ isOrderSynced: boolean;
342
+ /** 当前客户信息 */
343
+ currentCustomer?: {
344
+ customer_id?: string;
345
+ customer_name?: string;
346
+ };
347
+ }
348
+ /**
349
+ * 当前订单基础信息
350
+ */
351
+ export interface CurrentOrderInfo {
352
+ /** 订单UUID */
353
+ uuid?: string;
354
+ /** 订单ID */
355
+ orderId?: string;
356
+ /** 订单总金额 */
357
+ totalAmount?: string;
358
+ /** 待付金额 */
359
+ remainingAmount?: string;
360
+ /** 支付状态 */
361
+ paymentStatus?: PaymentStatus;
362
+ /** 是否为定金订单 */
363
+ isDeposit?: boolean;
364
+ /** 定金金额 */
365
+ depositAmount?: string;
366
+ /** 订单类型 */
367
+ orderType?: 'virtual' | 'appointment_booking';
368
+ /** 平台类型 */
369
+ platform?: 'pc' | 'h5';
370
+ /** 创建时间 */
371
+ createdAt?: string;
372
+ /** 商品数量 */
373
+ itemCount?: number;
374
+ /** 是否有本地订单数据 */
375
+ hasLocalOrderData?: boolean;
376
+ }
377
+ /**
378
+ * 结账解决方案 API 接口
379
+ */
380
+ export interface CheckoutModuleAPI extends Module {
381
+ /**
382
+ * 初始化结账流程
383
+ */
384
+ initializeCheckoutAsync(params: CheckoutInitParams): Promise<void>;
385
+ /**
386
+ * 创建本地订单 (前端模拟下单流程)
387
+ */
388
+ createLocalOrderAsync(params: CreateLocalOrderParams): Promise<PaymentOrder>;
389
+ /**
390
+ * 更新本地订单(基于已同步后的真实 orderId)并设置为当前订单
391
+ */
392
+ updateLocalOrderAsync(params: UpdateLocalOrderParams): Promise<PaymentOrder>;
393
+ /**
394
+ * 完成结账
395
+ */
396
+ completeCheckoutAsync(): Promise<{
397
+ success: boolean;
398
+ orderId?: string;
399
+ }>;
400
+ /**
401
+ * 获取当前订单基础信息
402
+ */
403
+ getCurrentOrderInfo(): CurrentOrderInfo | null;
404
+ /**
405
+ * 获取当前订单的支付项
406
+ */
407
+ getCurrentOrderPaymentItemsAsync(): Promise<PaymentItem[]>;
408
+ /**
409
+ * 获取订单模块
410
+ */
411
+ getOrderModule(): OrderModule;
412
+ /**
413
+ * 获取支付模块
414
+ */
415
+ getPaymentModule(): PaymentModuleAPI;
416
+ /**
417
+ * 替换本地订单ID为真实订单ID
418
+ */
419
+ replaceLocalOrderIdAsync(newOrderId: string): Promise<PaymentOrder | null>;
420
+ /**
421
+ * 设置自定义支付金额
422
+ */
423
+ setStateAmountAsync(amount: string): Promise<void>;
424
+ /**
425
+ * 获取当前自定义支付金额
426
+ */
427
+ getStateAmount(): string;
428
+ /**
429
+ * 获取系统计算的待付金额(只读)
430
+ *
431
+ * @returns 当前系统计算的待付金额
432
+ */
433
+ getBalanceDueAmount(): string;
434
+ /**
435
+ * 获取购物车小计数据
436
+ */
437
+ getCartSummary(): CartSummaryItem[] | null;
438
+ /**
439
+ * 获取支付方式列表(直接调用 Payment 模块)
440
+ */
441
+ getPaymentMethodsAsync(): Promise<PaymentMethod[]>;
442
+ /**
443
+ * 为当前订单添加支付项
444
+ */
445
+ addPaymentItemAsync(paymentItem: PaymentItemInput): Promise<void>;
446
+ /**
447
+ * 删除当前订单的支付项
448
+ */
449
+ deletePaymentItemAsync(paymentUuid: string): Promise<void>;
450
+ /**
451
+ * 批量更新当前订单的代金券支付项(覆盖更新)
452
+ */
453
+ updateVoucherPaymentItemsAsync(voucherPaymentItems: PaymentItemInput[]): Promise<void>;
454
+ /**
455
+ * 修改当前订单的定金状态
456
+ */
457
+ updateOrderDepositStatusAsync(isDeposit: number): Promise<void>;
458
+ /**
459
+ * 手动设置当前订单的定金金额
460
+ *
461
+ * @param depositAmount 定金金额,必须是有效的数字字符串,且不能超过订单总额
462
+ */
463
+ setDepositAmountAsync(depositAmount: string): Promise<void>;
464
+ /**
465
+ * 手动同步订单到后端
466
+ *
467
+ * 用于强制同步订单到后端,特别适用于纯代金券支付完成的订单
468
+ */
469
+ manualSyncOrderAsync(): Promise<{
470
+ success: boolean;
471
+ message?: string;
472
+ orderId?: string;
473
+ orderUuid?: string;
474
+ response?: any;
475
+ }>;
476
+ /**
477
+ * 更新订单备注
478
+ *
479
+ * @param note 订单备注内容
480
+ */
481
+ updateOrderNoteAsync(note: string): Promise<void>;
482
+ /**
483
+ * 获取当前订单备注
484
+ *
485
+ * @returns 当前订单的备注内容,如果没有则返回空字符串
486
+ */
487
+ getOrderNote(): string;
488
+ /**
489
+ * 获取当前订单ID
490
+ *
491
+ * @returns 当前订单的ID,如果没有订单则返回null
492
+ */
493
+ getCurrentOrderId(): string | null;
494
+ /**
495
+ * 获取当前订单是否已同步到后端
496
+ *
497
+ * @returns 当前订单是否已同步状态,如果没有订单则返回false
498
+ */
499
+ isCurrentOrderSynced(): boolean;
500
+ /**
501
+ * 取消当前本地订单
502
+ *
503
+ * 只能取消未同步到后端的本地订单,如果订单已同步则不能取消
504
+ *
505
+ * @param cancelReason 取消原因(可选)
506
+ * @returns 取消结果
507
+ */
508
+ cancelCurrentOrderAsync(cancelReason?: string): Promise<{
509
+ success: boolean;
510
+ message?: string;
511
+ orderId?: string;
512
+ }>;
513
+ /**
514
+ * 保存订单并稍后支付
515
+ *
516
+ * 将当前订单保存到后端,但排除代金券类支付项(voucher_id),
517
+ * 适用于用户想要保存订单但稍后完成支付的场景
518
+ *
519
+ * @returns 保存结果,包含订单ID和状态
520
+ */
521
+ saveForLaterPaymentAsync(): Promise<{
522
+ success: boolean;
523
+ message?: string;
524
+ orderId?: string;
525
+ orderUuid?: string;
526
+ response?: any;
527
+ }>;
528
+ /**
529
+ * 通过订单ID编辑订单备注
530
+ *
531
+ * 用于修改已同步到后端的订单备注,通常在支付成功后的弹窗中使用
532
+ *
533
+ * @param orderId 后端订单ID
534
+ * @param note 新的订单备注
535
+ * @returns 修改结果
536
+ */
537
+ editOrderNoteByOrderIdAsync(orderId: string | number, note: string): Promise<{
538
+ success: boolean;
539
+ message?: string;
540
+ orderId?: string | number;
541
+ }>;
542
+ /**
543
+ * 发送客户支付链接邮件
544
+ *
545
+ * 向指定邮箱发送订单支付提醒邮件
546
+ *
547
+ * @param params 发送参数
548
+ * @returns 发送结果
549
+ */
550
+ sendCustomerPayLinkAsync(params: SendCustomerPayLinkParams): Promise<{
551
+ success: boolean;
552
+ message?: string;
553
+ }>;
554
+ /**
555
+ * 金额舍入
556
+ *
557
+ * 根据系统配置的舍入设置对金额进行舍入处理
558
+ *
559
+ * @param amount 原始金额
560
+ * @returns 舍入结果详情,包含原始金额、舍入后金额和舍入差额
561
+ */
562
+ roundAmountAsync(amount: number): Promise<{
563
+ originalAmount: string;
564
+ roundedAmount: string;
565
+ roundingDifference: string;
566
+ }>;
567
+ }
568
+ /**
569
+ * 发送客户支付链接参数
570
+ */
571
+ export interface SendCustomerPayLinkParams {
572
+ /** 订单ID列表 */
573
+ order_ids: string[];
574
+ /** 通知动作,固定为订单支付提醒 */
575
+ notify_action?: string;
576
+ /** 邮箱地址列表 */
577
+ emails: string[];
578
+ }
579
+ /**
580
+ * 结账事件数据类型
581
+ */
582
+ export interface CheckoutEventData {
583
+ /** 订单创建事件 */
584
+ orderCreated: {
585
+ order: PaymentOrder;
586
+ timestamp: number;
587
+ };
588
+ /** 支付事件 */
589
+ paymentEvent: {
590
+ orderUuid: string;
591
+ paymentMethodCode: string;
592
+ amount: string;
593
+ timestamp: number;
594
+ };
595
+ /** 错误事件 */
596
+ error: {
597
+ error: CheckoutError;
598
+ context?: any;
599
+ timestamp: number;
600
+ };
601
+ /** 自定义支付金额变更事件 */
602
+ stateAmountChanged: {
603
+ oldAmount: string;
604
+ newAmount: string;
605
+ timestamp: number;
606
+ };
607
+ /** 系统计算的待付金额变更事件 */
608
+ balanceDueAmountChanged: {
609
+ oldAmount: string;
610
+ newAmount: string;
611
+ timestamp: number;
612
+ };
613
+ /** 订单支付完成事件 */
614
+ orderPaymentCompleted: {
615
+ orderUuid: string;
616
+ orderId: string;
617
+ totalAmount: string;
618
+ paidAmount: string;
619
+ remainingAmount: string;
620
+ timestamp: number;
621
+ };
622
+ /** 订单同步到后端完成事件 */
623
+ orderSynced: {
624
+ orderUuid: string;
625
+ realOrderId: string;
626
+ virtualOrderId: string;
627
+ timestamp: number;
628
+ /** 是否为手动同步 */
629
+ isManual?: boolean;
630
+ /** 后端响应数据 */
631
+ response?: any;
632
+ };
633
+ /** 订单同步到后端失败事件 */
634
+ orderSyncFailed: {
635
+ orderUuid: string;
636
+ /** 操作类型 */
637
+ operation: 'create' | 'update';
638
+ /** 是否为手动同步 */
639
+ isManual: boolean;
640
+ /** 错误信息 */
641
+ error: string;
642
+ /** 错误类型 */
643
+ errorType: 'network_error' | 'api_error' | 'response_invalid' | 'unknown';
644
+ /** 后端响应数据(如果有) */
645
+ response?: any;
646
+ /** 耗时(毫秒) */
647
+ duration?: number;
648
+ timestamp: number;
649
+ };
650
+ /** 订单备注变更事件 */
651
+ orderNoteChanged: {
652
+ orderUuid?: string;
653
+ oldNote: string;
654
+ newNote: string;
655
+ timestamp: number;
656
+ };
657
+ /** 商店折扣变更事件 */
658
+ shopDiscountChanged: {
659
+ orderUuid?: string;
660
+ oldDiscount: number;
661
+ newDiscount: number;
662
+ timestamp: number;
663
+ };
664
+ /** 订单取消事件 */
665
+ orderCancelled: {
666
+ orderUuid?: string;
667
+ orderId?: string;
668
+ cancelReason?: string;
669
+ wasSynced: boolean;
670
+ timestamp: number;
671
+ };
672
+ /** 订单状态清理事件 */
673
+ orderCleared: {
674
+ previousOrder?: {
675
+ uuid: string;
676
+ orderId: string;
677
+ } | null;
678
+ timestamp: number;
679
+ };
680
+ /** 下单接口请求开始事件 */
681
+ orderSubmitStart: {
682
+ /** 订单UUID */
683
+ orderUuid: string;
684
+ /** 操作类型 */
685
+ operation: 'create' | 'update';
686
+ /** 是否手动同步 */
687
+ isManual: boolean;
688
+ /** 支付项数量 */
689
+ paymentItemCount: number;
690
+ timestamp: number;
691
+ };
692
+ /** 下单接口请求完成事件 */
693
+ orderSubmitEnd: {
694
+ /** 是否成功 */
695
+ success: boolean;
696
+ /** 订单UUID */
697
+ orderUuid: string;
698
+ /** 操作类型 */
699
+ operation: 'create' | 'update';
700
+ /** 是否手动同步 */
701
+ isManual: boolean;
702
+ /** 返回的订单ID(成功时) */
703
+ orderId?: string;
704
+ /** 错误信息(失败时) */
705
+ error?: string;
706
+ /** 耗时(毫秒) */
707
+ duration?: number;
708
+ timestamp: number;
709
+ };
710
+ /** 钱包数据初始化完成事件 */
711
+ walletDataInitialized: {
712
+ /** 订单UUID */
713
+ orderUuid?: string;
714
+ /** 客户ID */
715
+ customerId?: number;
716
+ /** 钱包业务数据 */
717
+ walletBusinessData: {
718
+ customer_id?: number;
719
+ amountInfo: {
720
+ totalAmount: string;
721
+ subTotal: string;
722
+ };
723
+ order_wait_pay_amount?: number;
724
+ };
725
+ timestamp: number;
726
+ };
727
+ }