@pisell/pisellos 3.0.76 → 3.0.78

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