@pisell/pisellos 0.0.568 → 0.10.1

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 (588) hide show
  1. package/dist/core/index.js +10 -6
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.js +0 -3
  4. package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
  5. package/dist/model/strategy/adapter/walletPass/evaluator.js +7 -5
  6. package/dist/model/strategy/adapter/walletPass/example.js +26 -3
  7. package/dist/model/strategy/adapter/walletPass/index.js +5 -5
  8. package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -3
  9. package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -26
  10. package/dist/model/strategy/adapter/walletPass/utils.js +24 -96
  11. package/dist/model/strategy/strategy-example.js +19 -5
  12. package/dist/modules/BaseModule.d.ts +2 -2
  13. package/dist/modules/BaseModule.js +12 -14
  14. package/dist/modules/BookingContext/index.d.ts +48 -0
  15. package/dist/modules/BookingContext/index.js +566 -0
  16. package/dist/modules/BookingContext/types.d.ts +102 -0
  17. package/dist/modules/BookingContext/types.js +51 -0
  18. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  19. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +302 -0
  20. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  21. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +149 -0
  22. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  23. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +249 -0
  24. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  25. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  26. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  27. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  28. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  29. package/dist/modules/BookingContext/utils/index.js +11 -0
  30. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  31. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  32. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  33. package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
  34. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  35. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  36. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  37. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  38. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  39. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  40. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  41. package/dist/modules/BookingContext/utils/resources.js +486 -0
  42. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  43. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  44. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  45. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  46. package/dist/modules/Cart/index.js +3 -0
  47. package/dist/modules/Cart/utils/cartProduct.js +27 -5
  48. package/dist/modules/Cart/utils/cartResource.js +0 -2
  49. package/dist/modules/Cart/utils/changePrice.js +11 -11
  50. package/dist/modules/Customer/index.d.ts +20 -0
  51. package/dist/modules/Customer/index.js +172 -83
  52. package/dist/modules/Customer/types.d.ts +2 -0
  53. package/dist/modules/Date/index.js +5 -1
  54. package/dist/modules/Discount/index.d.ts +2 -2
  55. package/dist/modules/Discount/index.js +43 -30
  56. package/dist/modules/Discount/types.d.ts +1 -1
  57. package/dist/modules/OpenData/index.d.ts +8 -0
  58. package/dist/modules/OpenData/index.js +38 -16
  59. package/dist/modules/Order/index.d.ts +449 -24
  60. package/dist/modules/Order/index.js +5460 -574
  61. package/dist/modules/Order/types.d.ts +693 -88
  62. package/dist/modules/Order/types.js +68 -1
  63. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  64. package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
  65. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  66. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  67. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  68. package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
  69. package/dist/modules/Order/utils.d.ts +167 -18
  70. package/dist/modules/Order/utils.js +960 -165
  71. package/dist/modules/Payment/index.d.ts +10 -9
  72. package/dist/modules/Payment/index.js +573 -746
  73. package/dist/modules/Payment/types.d.ts +44 -24
  74. package/dist/modules/Payment/utils.d.ts +1 -1
  75. package/dist/modules/Payment/utils.js +4 -3
  76. package/dist/modules/Payment/walletpass.d.ts +0 -2
  77. package/dist/modules/Payment/walletpass.js +49 -33
  78. package/dist/modules/Product/types.d.ts +29 -7
  79. package/dist/modules/ProductList/index.d.ts +17 -13
  80. package/dist/modules/ProductList/index.js +182 -81
  81. package/dist/modules/ProductList/types.d.ts +16 -0
  82. package/dist/modules/Quotation/index.d.ts +22 -2
  83. package/dist/modules/Quotation/index.js +108 -42
  84. package/dist/modules/Quotation/types.d.ts +19 -0
  85. package/dist/modules/ResourcePlanner/index.d.ts +24 -0
  86. package/dist/modules/ResourcePlanner/index.js +181 -0
  87. package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
  88. package/dist/modules/ResourcePlanner/planner.js +1069 -0
  89. package/dist/modules/ResourcePlanner/types.d.ts +227 -0
  90. package/dist/modules/ResourcePlanner/types.js +1 -0
  91. package/dist/modules/Rules/index.d.ts +8 -10
  92. package/dist/modules/Rules/index.js +324 -513
  93. package/dist/modules/Rules/types.d.ts +14 -3
  94. package/dist/modules/SalesSummary/index.d.ts +23 -26
  95. package/dist/modules/SalesSummary/index.js +152 -46
  96. package/dist/modules/SalesSummary/types.d.ts +9 -1
  97. package/dist/modules/SalesSummary/utils.d.ts +3 -22
  98. package/dist/modules/SalesSummary/utils.js +804 -165
  99. package/dist/modules/Schedule/getDateIsInSchedule.js +14 -12
  100. package/dist/modules/Schedule/index.d.ts +18 -5
  101. package/dist/modules/Schedule/index.js +79 -24
  102. package/dist/modules/Schedule/types.d.ts +2 -0
  103. package/dist/modules/Schedule/utils.js +1 -0
  104. package/dist/modules/Step/index.js +1 -0
  105. package/dist/modules/Summary/index.js +4 -3
  106. package/dist/modules/Summary/utils.js +22 -43
  107. package/dist/modules/SurchargeList/index.d.ts +18 -0
  108. package/dist/modules/SurchargeList/index.js +185 -0
  109. package/dist/modules/SurchargeList/types.d.ts +15 -0
  110. package/dist/modules/SurchargeList/types.js +1 -0
  111. package/dist/modules/index.d.ts +3 -0
  112. package/dist/modules/index.js +4 -1
  113. package/dist/plugins/app.d.ts +2 -0
  114. package/dist/plugins/request.d.ts +1 -0
  115. package/dist/plugins/request.js +4 -1
  116. package/dist/plugins/window.js +6 -2
  117. package/dist/server/index.d.ts +462 -8
  118. package/dist/server/index.js +6168 -680
  119. package/dist/server/modules/floor-plan/index.d.ts +39 -0
  120. package/dist/server/modules/floor-plan/index.js +595 -0
  121. package/dist/server/modules/floor-plan/types.d.ts +43 -0
  122. package/dist/server/modules/floor-plan/types.js +13 -0
  123. package/dist/server/modules/index.d.ts +7 -2
  124. package/dist/server/modules/index.js +6 -0
  125. package/dist/server/modules/menu/index.js +41 -32
  126. package/dist/server/modules/order/index.d.ts +207 -14
  127. package/dist/server/modules/order/index.js +2328 -379
  128. package/dist/server/modules/order/types.d.ts +76 -5
  129. package/dist/server/modules/order/types.js +14 -1
  130. package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
  131. package/dist/server/modules/order/utils/filterBookings.js +118 -11
  132. package/dist/server/modules/order/utils/filterOrders.js +242 -14
  133. package/dist/server/modules/payment/index.d.ts +28 -0
  134. package/dist/server/modules/payment/index.js +305 -0
  135. package/dist/server/modules/payment/types.d.ts +9 -0
  136. package/dist/server/modules/payment/types.js +1 -0
  137. package/dist/server/modules/products/index.d.ts +105 -14
  138. package/dist/server/modules/products/index.js +1416 -521
  139. package/dist/server/modules/products/types.d.ts +34 -1
  140. package/dist/server/modules/products/types.js +4 -0
  141. package/dist/server/modules/quotation/index.d.ts +39 -0
  142. package/dist/server/modules/quotation/index.js +298 -77
  143. package/dist/server/modules/resource/index.d.ts +2 -3
  144. package/dist/server/modules/resource/index.js +109 -86
  145. package/dist/server/modules/schedule/index.d.ts +6 -4
  146. package/dist/server/modules/schedule/index.js +145 -106
  147. package/dist/server/test.json +713 -0
  148. package/dist/server/types.d.ts +2 -0
  149. package/dist/server/utils/product.js +3 -2
  150. package/dist/server/utils/small-ticket.d.ts +71 -0
  151. package/dist/server/utils/small-ticket.js +963 -0
  152. package/dist/solution/BaseSales/index.d.ts +378 -0
  153. package/dist/solution/BaseSales/index.js +4009 -0
  154. package/dist/solution/BaseSales/types.d.ts +394 -0
  155. package/dist/solution/BaseSales/types.js +40 -0
  156. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  157. package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
  158. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  159. package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
  160. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  161. package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
  162. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  163. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
  164. package/dist/solution/BaseSales/utils.d.ts +40 -0
  165. package/dist/solution/BaseSales/utils.js +263 -0
  166. package/dist/solution/BookingByStep/index.d.ts +1 -1
  167. package/dist/solution/BookingByStep/index.js +60 -11
  168. package/dist/solution/BookingByStep/utils/capacity.js +11 -1
  169. package/dist/solution/BookingByStep/utils/resources.js +3 -1
  170. package/dist/solution/BookingByStep/utils/timeslots.js +43 -2
  171. package/dist/solution/BookingTicket/index.d.ts +393 -24
  172. package/dist/solution/BookingTicket/index.js +2508 -443
  173. package/dist/solution/BookingTicket/types.d.ts +191 -6
  174. package/dist/solution/BookingTicket/types.js +83 -10
  175. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  176. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  177. package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  178. package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
  179. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  180. package/dist/solution/BookingTicket/utils/bookingStatus.js +136 -0
  181. package/dist/solution/BookingTicket/utils/cartView.d.ts +29 -0
  182. package/dist/solution/BookingTicket/utils/cartView.js +209 -0
  183. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  184. package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
  185. package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  186. package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
  187. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  188. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
  189. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  190. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
  191. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  192. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +42 -1
  193. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  194. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
  195. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  196. package/dist/solution/BookingTicket/utils/scan/handleScan.js +42 -28
  197. package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  198. package/dist/solution/BookingTicket/utils/scan/index.js +30 -14
  199. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  200. package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
  201. package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  202. package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
  203. package/dist/solution/BuyTickets/index.js +12 -9
  204. package/dist/solution/Checkout/index.d.ts +1 -0
  205. package/dist/solution/Checkout/index.js +275 -209
  206. package/dist/solution/Checkout/utils/index.js +20 -8
  207. package/dist/solution/RegisterAndLogin/config.js +2 -10
  208. package/dist/solution/RegisterAndLogin/index.js +76 -30
  209. package/dist/solution/Sales/index.d.ts +50 -5
  210. package/dist/solution/Sales/index.js +484 -92
  211. package/dist/solution/Sales/types.d.ts +26 -2
  212. package/dist/solution/ScanOrder/index.d.ts +27 -21
  213. package/dist/solution/ScanOrder/index.js +519 -444
  214. package/dist/solution/ScanOrder/types.d.ts +33 -11
  215. package/dist/solution/ScanOrder/types.js +4 -5
  216. package/dist/solution/ScanOrder/utils.d.ts +4 -1
  217. package/dist/solution/ScanOrder/utils.js +109 -34
  218. package/dist/solution/ShopDiscount/index.js +18 -19
  219. package/dist/solution/ShopDiscount/types.d.ts +4 -5
  220. package/dist/solution/ShopDiscount/utils.d.ts +0 -9
  221. package/dist/solution/ShopDiscount/utils.js +0 -9
  222. package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
  223. package/dist/solution/UnifiedBookingSales/index.js +1871 -0
  224. package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
  225. package/dist/solution/UnifiedBookingSales/types.js +11 -0
  226. package/dist/solution/VenueBooking/index.d.ts +32 -51
  227. package/dist/solution/VenueBooking/index.js +741 -808
  228. package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  229. package/dist/solution/VenueBooking/types.d.ts +1 -3
  230. package/dist/solution/VenueBooking/types.js +0 -1
  231. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
  232. package/dist/solution/VenueBooking/utils/dateSummary.js +25 -12
  233. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  234. package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
  235. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
  236. package/dist/solution/VenueBooking/utils/timeSlot.js +4 -9
  237. package/dist/solution/index.d.ts +2 -0
  238. package/dist/solution/index.js +3 -1
  239. package/dist/types/index.d.ts +12 -2
  240. package/dist/utils/task.js +18 -15
  241. package/dist/utils/watch.js +1 -0
  242. package/lib/apis/picoding.js +0 -2
  243. package/lib/core/index.js +132 -130
  244. package/lib/effects/index.js +57 -46
  245. package/lib/index.d.ts +0 -1
  246. package/lib/index.js +50 -92
  247. package/lib/model/index.js +21 -14
  248. package/lib/model/strategy/adapter/dataVariant/adapter.js +50 -38
  249. package/lib/model/strategy/adapter/dataVariant/evaluator.js +236 -162
  250. package/lib/model/strategy/adapter/dataVariant/examples.js +237 -229
  251. package/lib/model/strategy/adapter/dataVariant/index.js +34 -39
  252. package/lib/model/strategy/adapter/dataVariant/type.js +28 -57
  253. package/lib/model/strategy/adapter/index.js +64 -100
  254. package/lib/model/strategy/adapter/itemRule/adapter.js +144 -156
  255. package/lib/model/strategy/adapter/itemRule/evaluator.js +48 -36
  256. package/lib/model/strategy/adapter/itemRule/examples.js +225 -295
  257. package/lib/model/strategy/adapter/itemRule/index.js +57 -83
  258. package/lib/model/strategy/adapter/itemRule/type.js +36 -97
  259. package/lib/model/strategy/adapter/promotion/adapter.js +63 -84
  260. package/lib/model/strategy/adapter/promotion/evaluator.js +233 -382
  261. package/lib/model/strategy/adapter/promotion/examples.js +159 -139
  262. package/lib/model/strategy/adapter/promotion/index.js +0 -1
  263. package/lib/model/strategy/adapter/promotion/type.js +35 -199
  264. package/lib/model/strategy/adapter/type.js +16 -4
  265. package/lib/model/strategy/adapter/walletPass/evaluator.js +152 -180
  266. package/lib/model/strategy/adapter/walletPass/example.js +190 -217
  267. package/lib/model/strategy/adapter/walletPass/index.js +51 -75
  268. package/lib/model/strategy/adapter/walletPass/locales.js +58 -36
  269. package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -3
  270. package/lib/model/strategy/adapter/walletPass/type.js +16 -4
  271. package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -26
  272. package/lib/model/strategy/adapter/walletPass/utils.js +383 -676
  273. package/lib/model/strategy/engine.js +168 -270
  274. package/lib/model/strategy/index.js +34 -49
  275. package/lib/model/strategy/strategy-example.js +239 -243
  276. package/lib/model/strategy/type.js +40 -100
  277. package/lib/modules/Account/index.js +53 -39
  278. package/lib/modules/Account/types.js +33 -20
  279. package/lib/modules/AccountList/index.js +154 -116
  280. package/lib/modules/AccountList/types.js +31 -30
  281. package/lib/modules/AccountList/utils.js +30 -18
  282. package/lib/modules/BaseModule.d.ts +2 -2
  283. package/lib/modules/BaseModule.js +50 -29
  284. package/lib/modules/BookingContext/index.d.ts +48 -0
  285. package/lib/modules/BookingContext/index.js +368 -0
  286. package/lib/modules/BookingContext/types.d.ts +102 -0
  287. package/lib/modules/BookingContext/types.js +34 -0
  288. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  289. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +298 -0
  290. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  291. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +155 -0
  292. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  293. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +222 -0
  294. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  295. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  296. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  297. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  298. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  299. package/lib/modules/BookingContext/utils/index.js +43 -0
  300. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  301. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  302. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  303. package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
  304. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  305. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  306. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  307. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  308. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  309. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  310. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  311. package/lib/modules/BookingContext/utils/resources.js +377 -0
  312. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  313. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  314. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  315. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  316. package/lib/modules/Cart/index.js +124 -170
  317. package/lib/modules/Cart/types.js +51 -46
  318. package/lib/modules/Cart/utils/cartAccount.js +39 -40
  319. package/lib/modules/Cart/utils/cartDate.js +61 -56
  320. package/lib/modules/Cart/utils/cartDiscount.js +33 -28
  321. package/lib/modules/Cart/utils/cartNote.js +32 -27
  322. package/lib/modules/Cart/utils/cartProduct.js +261 -309
  323. package/lib/modules/Cart/utils/cartRelationForms.js +35 -29
  324. package/lib/modules/Cart/utils/cartResource.js +78 -72
  325. package/lib/modules/Cart/utils/changePrice.js +59 -31
  326. package/lib/modules/Cart/utils/index.js +48 -106
  327. package/lib/modules/Customer/constants.js +34 -13
  328. package/lib/modules/Customer/index.d.ts +20 -0
  329. package/lib/modules/Customer/index.js +207 -217
  330. package/lib/modules/Customer/types.d.ts +2 -0
  331. package/lib/modules/Customer/types.js +35 -38
  332. package/lib/modules/Date/index.js +115 -116
  333. package/lib/modules/Date/types.js +28 -16
  334. package/lib/modules/Date/utils.js +123 -174
  335. package/lib/modules/Discount/index.d.ts +2 -2
  336. package/lib/modules/Discount/index.js +133 -119
  337. package/lib/modules/Discount/types.d.ts +1 -1
  338. package/lib/modules/Discount/types.js +31 -9
  339. package/lib/modules/Guests/index.js +56 -30
  340. package/lib/modules/Guests/types.js +33 -23
  341. package/lib/modules/Holder/index.js +189 -209
  342. package/lib/modules/Holder/types.js +16 -4
  343. package/lib/modules/Holder/utils.js +49 -20
  344. package/lib/modules/OpenData/index.d.ts +8 -0
  345. package/lib/modules/OpenData/index.js +88 -63
  346. package/lib/modules/OpenData/types.js +16 -4
  347. package/lib/modules/OpenData/utils.js +78 -44
  348. package/lib/modules/Order/index.d.ts +449 -24
  349. package/lib/modules/Order/index.js +4184 -514
  350. package/lib/modules/Order/types.d.ts +693 -88
  351. package/lib/modules/Order/types.js +35 -24
  352. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  353. package/lib/modules/Order/utils/bundleDiscountHydration.js +139 -0
  354. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  355. package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
  356. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
  357. package/lib/modules/Order/utils/orderCollectionIdentity.js +415 -0
  358. package/lib/modules/Order/utils.d.ts +167 -18
  359. package/lib/modules/Order/utils.js +1085 -414
  360. package/lib/modules/Payment/cash.js +33 -20
  361. package/lib/modules/Payment/cashRecommendationAlgorithm.js +76 -145
  362. package/lib/modules/Payment/eftpos.js +30 -16
  363. package/lib/modules/Payment/index.d.ts +10 -9
  364. package/lib/modules/Payment/index.js +402 -636
  365. package/lib/modules/Payment/mx51.js +0 -1
  366. package/lib/modules/Payment/types.d.ts +44 -24
  367. package/lib/modules/Payment/types.js +107 -216
  368. package/lib/modules/Payment/utils.d.ts +1 -1
  369. package/lib/modules/Payment/utils.js +50 -52
  370. package/lib/modules/Payment/walletpass.d.ts +0 -2
  371. package/lib/modules/Payment/walletpass.js +216 -221
  372. package/lib/modules/Product/index.js +46 -51
  373. package/lib/modules/Product/types.d.ts +29 -7
  374. package/lib/modules/Product/types.js +16 -4
  375. package/lib/modules/Product/utils.js +33 -32
  376. package/lib/modules/ProductList/index.d.ts +17 -13
  377. package/lib/modules/ProductList/index.js +161 -120
  378. package/lib/modules/ProductList/types.d.ts +16 -0
  379. package/lib/modules/ProductList/types.js +31 -9
  380. package/lib/modules/Quotation/index.d.ts +22 -2
  381. package/lib/modules/Quotation/index.js +154 -64
  382. package/lib/modules/Quotation/types.d.ts +19 -0
  383. package/lib/modules/Quotation/types.js +16 -4
  384. package/lib/modules/Resource/index.js +59 -27
  385. package/lib/modules/Resource/types.js +32 -22
  386. package/lib/modules/Resource/utils.js +38 -30
  387. package/lib/modules/ResourcePlanner/index.d.ts +24 -0
  388. package/lib/modules/ResourcePlanner/index.js +148 -0
  389. package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
  390. package/lib/modules/ResourcePlanner/planner.js +933 -0
  391. package/lib/modules/ResourcePlanner/types.d.ts +227 -0
  392. package/lib/modules/ResourcePlanner/types.js +17 -0
  393. package/lib/modules/Rules/index.d.ts +8 -10
  394. package/lib/modules/Rules/index.js +960 -1440
  395. package/lib/modules/Rules/types.d.ts +14 -3
  396. package/lib/modules/Rules/types.js +40 -17
  397. package/lib/modules/SalesSummary/index.d.ts +23 -26
  398. package/lib/modules/SalesSummary/index.js +134 -61
  399. package/lib/modules/SalesSummary/types.d.ts +9 -1
  400. package/lib/modules/SalesSummary/types.js +16 -4
  401. package/lib/modules/SalesSummary/utils.d.ts +3 -22
  402. package/lib/modules/SalesSummary/utils.js +814 -233
  403. package/lib/modules/ScanOrderLogger/index.js +79 -59
  404. package/lib/modules/ScanOrderLogger/providers/feishu.js +78 -54
  405. package/lib/modules/ScanOrderLogger/providers/grafana.js +36 -13
  406. package/lib/modules/ScanOrderLogger/types.js +16 -4
  407. package/lib/modules/Schedule/getDateIsInSchedule.js +169 -338
  408. package/lib/modules/Schedule/index.d.ts +18 -5
  409. package/lib/modules/Schedule/index.js +153 -104
  410. package/lib/modules/Schedule/type.js +16 -4
  411. package/lib/modules/Schedule/types.d.ts +2 -0
  412. package/lib/modules/Schedule/types.js +16 -4
  413. package/lib/modules/Schedule/utils.js +291 -433
  414. package/lib/modules/Step/index.js +52 -40
  415. package/lib/modules/Step/tyeps.js +16 -4
  416. package/lib/modules/Summary/index.js +71 -66
  417. package/lib/modules/Summary/types.js +16 -4
  418. package/lib/modules/Summary/utils.js +418 -791
  419. package/lib/modules/SurchargeList/index.d.ts +18 -0
  420. package/lib/modules/SurchargeList/index.js +109 -0
  421. package/lib/modules/SurchargeList/types.d.ts +15 -0
  422. package/lib/modules/SurchargeList/types.js +17 -0
  423. package/lib/modules/index.d.ts +3 -0
  424. package/lib/modules/index.js +63 -212
  425. package/lib/plugins/app.d.ts +2 -0
  426. package/lib/plugins/app.js +16 -4
  427. package/lib/plugins/index.js +25 -36
  428. package/lib/plugins/request.d.ts +1 -0
  429. package/lib/plugins/request.js +126 -137
  430. package/lib/plugins/shopStore.js +16 -4
  431. package/lib/plugins/user.js +16 -4
  432. package/lib/plugins/window.js +179 -171
  433. package/lib/server/index.d.ts +462 -8
  434. package/lib/server/index.js +4520 -1162
  435. package/lib/server/modules/floor-plan/index.d.ts +39 -0
  436. package/lib/server/modules/floor-plan/index.js +327 -0
  437. package/lib/server/modules/floor-plan/types.d.ts +43 -0
  438. package/lib/server/modules/floor-plan/types.js +34 -0
  439. package/lib/server/modules/index.d.ts +7 -2
  440. package/lib/server/modules/index.js +67 -84
  441. package/lib/server/modules/menu/index.js +122 -146
  442. package/lib/server/modules/menu/types.js +31 -18
  443. package/lib/server/modules/order/index.d.ts +207 -14
  444. package/lib/server/modules/order/index.js +1543 -285
  445. package/lib/server/modules/order/types.d.ts +76 -5
  446. package/lib/server/modules/order/types.js +32 -107
  447. package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
  448. package/lib/server/modules/order/utils/filterBookings.js +259 -176
  449. package/lib/server/modules/order/utils/filterOrders.js +293 -94
  450. package/lib/server/modules/payment/index.d.ts +28 -0
  451. package/lib/server/modules/payment/index.js +192 -0
  452. package/lib/server/modules/payment/types.d.ts +9 -0
  453. package/lib/server/modules/payment/types.js +17 -0
  454. package/lib/server/modules/products/index.d.ts +105 -14
  455. package/lib/server/modules/products/index.js +850 -475
  456. package/lib/server/modules/products/types.d.ts +34 -1
  457. package/lib/server/modules/products/types.js +34 -41
  458. package/lib/server/modules/quotation/index.d.ts +39 -0
  459. package/lib/server/modules/quotation/index.js +254 -75
  460. package/lib/server/modules/quotation/types.js +31 -21
  461. package/lib/server/modules/resource/index.d.ts +2 -3
  462. package/lib/server/modules/resource/index.js +240 -243
  463. package/lib/server/modules/resource/types.js +33 -42
  464. package/lib/server/modules/schedule/index.d.ts +6 -4
  465. package/lib/server/modules/schedule/index.js +146 -147
  466. package/lib/server/modules/schedule/types.js +21 -14
  467. package/lib/server/modules/schedule/utils.js +163 -334
  468. package/lib/server/test.json +713 -0
  469. package/lib/server/types.d.ts +2 -0
  470. package/lib/server/types.js +16 -4
  471. package/lib/server/utils/index.js +23 -25
  472. package/lib/server/utils/product.js +140 -197
  473. package/lib/server/utils/schedule.js +41 -34
  474. package/lib/server/utils/small-ticket.d.ts +71 -0
  475. package/lib/server/utils/small-ticket.js +904 -0
  476. package/lib/server/utils/time.js +49 -40
  477. package/lib/solution/BaseSales/index.d.ts +378 -0
  478. package/lib/solution/BaseSales/index.js +2533 -0
  479. package/lib/solution/BaseSales/types.d.ts +394 -0
  480. package/lib/solution/BaseSales/types.js +43 -0
  481. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
  482. package/lib/solution/BaseSales/utils/cartPromotion.js +1004 -0
  483. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
  484. package/lib/solution/BaseSales/utils/parseSalesResponse.js +160 -0
  485. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
  486. package/lib/solution/BaseSales/utils/quotationPrice.js +289 -0
  487. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
  488. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +256 -0
  489. package/lib/solution/BaseSales/utils.d.ts +40 -0
  490. package/lib/solution/BaseSales/utils.js +244 -0
  491. package/lib/solution/BookingByStep/index.d.ts +1 -1
  492. package/lib/solution/BookingByStep/index.js +1340 -1530
  493. package/lib/solution/BookingByStep/types.js +99 -40
  494. package/lib/solution/BookingByStep/utils/capacity.js +160 -192
  495. package/lib/solution/BookingByStep/utils/products.js +52 -42
  496. package/lib/solution/BookingByStep/utils/resources.js +330 -527
  497. package/lib/solution/BookingByStep/utils/stock.js +44 -65
  498. package/lib/solution/BookingByStep/utils/timeslots.js +131 -129
  499. package/lib/solution/BookingTicket/index.d.ts +393 -24
  500. package/lib/solution/BookingTicket/index.js +1374 -184
  501. package/lib/solution/BookingTicket/types.d.ts +191 -6
  502. package/lib/solution/BookingTicket/types.js +79 -40
  503. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
  504. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  505. package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
  506. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
  507. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  508. package/lib/solution/BookingTicket/utils/bookingStatus.js +107 -0
  509. package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
  510. package/lib/solution/BookingTicket/utils/cartView.js +184 -0
  511. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  512. package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
  513. package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  514. package/lib/solution/BookingTicket/utils/orderCustomer.js +58 -0
  515. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  516. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
  517. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
  518. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
  519. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
  520. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +97 -64
  521. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
  522. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
  523. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
  524. package/lib/solution/BookingTicket/utils/scan/handleScan.js +81 -82
  525. package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
  526. package/lib/solution/BookingTicket/utils/scan/index.js +109 -91
  527. package/lib/solution/BookingTicket/utils/scan/scanCache.js +43 -90
  528. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  529. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
  530. package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
  531. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
  532. package/lib/solution/BuyTickets/index.js +70 -67
  533. package/lib/solution/BuyTickets/types.js +38 -22
  534. package/lib/solution/Checkout/index.d.ts +1 -0
  535. package/lib/solution/Checkout/index.js +1169 -1463
  536. package/lib/solution/Checkout/types.js +61 -91
  537. package/lib/solution/Checkout/utils/index.js +156 -228
  538. package/lib/solution/PlaceOrder/index.js +0 -55
  539. package/lib/solution/RegisterAndLogin/config.js +462 -503
  540. package/lib/solution/RegisterAndLogin/index.js +630 -633
  541. package/lib/solution/RegisterAndLogin/types.js +76 -189
  542. package/lib/solution/RegisterAndLogin/utils.js +125 -183
  543. package/lib/solution/Sales/index.d.ts +50 -5
  544. package/lib/solution/Sales/index.js +498 -238
  545. package/lib/solution/Sales/types.d.ts +26 -2
  546. package/lib/solution/Sales/types.js +33 -27
  547. package/lib/solution/ScanOrder/index.d.ts +27 -21
  548. package/lib/solution/ScanOrder/index.js +936 -864
  549. package/lib/solution/ScanOrder/types.d.ts +33 -11
  550. package/lib/solution/ScanOrder/types.js +34 -34
  551. package/lib/solution/ScanOrder/utils.d.ts +4 -1
  552. package/lib/solution/ScanOrder/utils.js +422 -385
  553. package/lib/solution/ShopDiscount/index.js +233 -235
  554. package/lib/solution/ShopDiscount/types.d.ts +4 -5
  555. package/lib/solution/ShopDiscount/types.js +37 -15
  556. package/lib/solution/ShopDiscount/utils.d.ts +0 -9
  557. package/lib/solution/ShopDiscount/utils.js +172 -309
  558. package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
  559. package/lib/solution/UnifiedBookingSales/index.js +1076 -0
  560. package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
  561. package/lib/solution/UnifiedBookingSales/types.js +33 -0
  562. package/lib/solution/VenueBooking/index.d.ts +32 -51
  563. package/lib/solution/VenueBooking/index.js +1008 -984
  564. package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
  565. package/lib/solution/VenueBooking/types.d.ts +1 -3
  566. package/lib/solution/VenueBooking/types.js +39 -20
  567. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
  568. package/lib/solution/VenueBooking/utils/dateSummary.js +62 -25
  569. package/lib/solution/VenueBooking/utils/resource.js +54 -31
  570. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  571. package/lib/solution/VenueBooking/utils/slotMerge.js +109 -90
  572. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
  573. package/lib/solution/VenueBooking/utils/timeSlot.js +133 -138
  574. package/lib/solution/VenueBooking/utils.js +67 -130
  575. package/lib/solution/index.d.ts +2 -0
  576. package/lib/solution/index.js +41 -102
  577. package/lib/store/createStore.js +29 -32
  578. package/lib/types/index.d.ts +12 -2
  579. package/lib/types/index.js +16 -4
  580. package/lib/utils/task.js +36 -36
  581. package/lib/utils/watch.js +47 -81
  582. package/package.json +2 -4
  583. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  584. package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
  585. package/dist/solution/VenueBooking/utils/smartPricing.js +0 -233
  586. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  587. package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
  588. package/lib/solution/VenueBooking/utils/smartPricing.js +0 -192
@@ -117,19 +117,20 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
117
117
  _context.next = 15;
118
118
  return this.initializeSubModules(core, options);
119
119
  case 15:
120
- _context.next = 17;
121
- return this.preloadPaymentMethods();
122
- case 17:
123
- _context.next = 19;
124
- return this.cleanupExpiredOrdersAsync();
125
- case 19:
126
- _context.next = 21;
120
+ // 预加载支付方式(利用缓存机制)
121
+ // await this.preloadPaymentMethods();
122
+
123
+ // 清理过期的已同步订单数据
124
+ // await this.cleanupExpiredOrdersAsync();
125
+
126
+ console.log('[Checkout] 初始化完成');
127
+ _context.next = 18;
127
128
  return this.core.effects.emit("".concat(this.name, ":onCheckoutInitialized"), {
128
129
  timestamp: Date.now()
129
130
  });
130
- case 21:
131
+ case 18:
131
132
  this.logInfo('CheckoutModule initialized successfully');
132
- case 22:
133
+ case 19:
133
134
  case "end":
134
135
  return _context.stop();
135
136
  }
@@ -287,8 +288,9 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
287
288
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
288
289
  while (1) switch (_context5.prev = _context5.next) {
289
290
  case 0:
291
+ console.log('[Checkout] 收到支付方式加载完成事件:', methods.length);
290
292
  _this2.store.paymentMethods = methods;
291
- case 1:
293
+ case 2:
292
294
  case "end":
293
295
  return _context5.stop();
294
296
  }
@@ -305,8 +307,12 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
305
307
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
306
308
  while (1) switch (_context6.prev = _context6.next) {
307
309
  case 0:
310
+ console.log('[Checkout] 收到支付方式变更事件:', {
311
+ oldCount: data.oldMethods.length,
312
+ newCount: data.newMethods.length
313
+ });
308
314
  _this2.store.paymentMethods = data.newMethods;
309
- case 1:
315
+ case 2:
310
316
  case "end":
311
317
  return _context6.stop();
312
318
  }
@@ -346,20 +352,21 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
346
352
  case 5:
347
353
  // 保存购物车数据
348
354
  this.store.cartItems = params.cartItems;
349
- _context7.next = 13;
355
+ console.log('[Checkout] 结账流程初始化完成');
356
+ _context7.next = 14;
350
357
  break;
351
- case 8:
352
- _context7.prev = 8;
358
+ case 9:
359
+ _context7.prev = 9;
353
360
  _context7.t0 = _context7["catch"](1);
354
- _context7.next = 12;
361
+ _context7.next = 13;
355
362
  return this.handleError(_context7.t0, CheckoutErrorType.UnknownError);
356
- case 12:
357
- throw _context7.t0;
358
363
  case 13:
364
+ throw _context7.t0;
365
+ case 14:
359
366
  case "end":
360
367
  return _context7.stop();
361
368
  }
362
- }, _callee7, this, [[1, 8]]);
369
+ }, _callee7, this, [[1, 9]]);
363
370
  }));
364
371
  function initializeCheckoutAsync(_x9) {
365
372
  return _initializeCheckoutAsync.apply(this, arguments);
@@ -661,8 +668,10 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
661
668
  }; // 只有在有客户信息时才存储
662
669
  if (customerInfo.customer_id || customerInfo.customer_name) {
663
670
  this.store.currentCustomer = customerInfo;
671
+ console.log('[Checkout] 保存客户信息:', customerInfo);
664
672
  } else {
665
673
  this.store.currentCustomer = undefined;
674
+ console.log('[Checkout] 未提供客户信息');
666
675
  }
667
676
 
668
677
  // 计算是否需要支付定金,如果需要默认切换到定金模式,以及记录定金总金额,并把当前默认待付金额调整为定金总金额
@@ -1088,26 +1097,28 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1088
1097
  timestamp: Date.now()
1089
1098
  });
1090
1099
  case 11:
1100
+ console.log('[Checkout] 结账流程完成:', order.id);
1101
+
1091
1102
  // 🔧 新增:自动重置 store 状态(同步执行)
1092
1103
  this.resetStoreState();
1093
1104
  return _context11.abrupt("return", {
1094
1105
  success: true,
1095
1106
  orderId: String(order.id)
1096
1107
  });
1097
- case 15:
1098
- _context11.prev = 15;
1108
+ case 16:
1109
+ _context11.prev = 16;
1099
1110
  _context11.t0 = _context11["catch"](0);
1100
- _context11.next = 19;
1111
+ _context11.next = 20;
1101
1112
  return this.handleError(_context11.t0, CheckoutErrorType.UnknownError);
1102
- case 19:
1113
+ case 20:
1103
1114
  return _context11.abrupt("return", {
1104
1115
  success: false
1105
1116
  });
1106
- case 20:
1117
+ case 21:
1107
1118
  case "end":
1108
1119
  return _context11.stop();
1109
1120
  }
1110
- }, _callee11, this, [[0, 15]]);
1121
+ }, _callee11, this, [[0, 16]]);
1111
1122
  }));
1112
1123
  function completeCheckoutAsync() {
1113
1124
  return _completeCheckoutAsync.apply(this, arguments);
@@ -1139,6 +1150,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1139
1150
  cartItems = _this$store.cartItems,
1140
1151
  localOrderData = _this$store.localOrderData;
1141
1152
  if (!_currentOrder) {
1153
+ console.log('[Checkout] 当前没有活跃订单');
1142
1154
  return null;
1143
1155
  }
1144
1156
 
@@ -1184,26 +1196,27 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1184
1196
  _context12.prev = 0;
1185
1197
  _currentOrder2 = this.store.currentOrder;
1186
1198
  if (_currentOrder2) {
1187
- _context12.next = 4;
1199
+ _context12.next = 5;
1188
1200
  break;
1189
1201
  }
1202
+ console.log('[Checkout] 当前没有活跃订单,无法获取支付项');
1190
1203
  return _context12.abrupt("return", []);
1191
- case 4:
1192
- _context12.next = 6;
1204
+ case 5:
1205
+ _context12.next = 7;
1193
1206
  return this.payment.getPaymentItemsAsync(_currentOrder2.uuid);
1194
- case 6:
1207
+ case 7:
1195
1208
  paymentItems = _context12.sent;
1196
1209
  return _context12.abrupt("return", paymentItems);
1197
- case 10:
1198
- _context12.prev = 10;
1210
+ case 11:
1211
+ _context12.prev = 11;
1199
1212
  _context12.t0 = _context12["catch"](0);
1200
1213
  console.error('[Checkout] 获取当前订单支付项失败:', _context12.t0);
1201
1214
  return _context12.abrupt("return", []);
1202
- case 14:
1215
+ case 15:
1203
1216
  case "end":
1204
1217
  return _context12.stop();
1205
1218
  }
1206
- }, _callee12, this, [[0, 10]]);
1219
+ }, _callee12, this, [[0, 11]]);
1207
1220
  }));
1208
1221
  function getCurrentOrderPaymentItemsAsync() {
1209
1222
  return _getCurrentOrderPaymentItemsAsync.apply(this, arguments);
@@ -1260,7 +1273,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1260
1273
  case 8:
1261
1274
  updatedOrder = _context13.sent;
1262
1275
  if (!updatedOrder) {
1263
- _context13.next = 19;
1276
+ _context13.next = 20;
1264
1277
  break;
1265
1278
  }
1266
1279
  // 🔧 重要:Payment.replaceOrderIdByUuidAsync 返回的是 DB 快照(只保证 order_id 变化)
@@ -1285,27 +1298,32 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1285
1298
  timestamp: Date.now()
1286
1299
  });
1287
1300
  case 16:
1301
+ console.log('[Checkout] 本地订单ID替换成功:', {
1302
+ uuid: updatedOrder.uuid,
1303
+ newOrderId: updatedOrder.id
1304
+ });
1305
+
1288
1306
  // 标记订单已同步(替换ID意味着订单已在后端创建)
1289
1307
  this.store.isOrderSynced = true;
1290
1308
 
1291
1309
  // 订单ID替换后更新 stateAmount
1292
- _context13.next = 19;
1310
+ _context13.next = 20;
1293
1311
  return this.updateStateAmountToRemaining(false);
1294
- case 19:
1312
+ case 20:
1295
1313
  return _context13.abrupt("return", updatedOrder);
1296
- case 22:
1297
- _context13.prev = 22;
1314
+ case 23:
1315
+ _context13.prev = 23;
1298
1316
  _context13.t0 = _context13["catch"](0);
1299
1317
  console.error('[Checkout] 替换订单ID失败:', _context13.t0);
1300
- _context13.next = 27;
1318
+ _context13.next = 28;
1301
1319
  return this.handleError(_context13.t0, CheckoutErrorType.UnknownError);
1302
- case 27:
1303
- return _context13.abrupt("return", null);
1304
1320
  case 28:
1321
+ return _context13.abrupt("return", null);
1322
+ case 29:
1305
1323
  case "end":
1306
1324
  return _context13.stop();
1307
1325
  }
1308
- }, _callee13, this, [[0, 22]]);
1326
+ }, _callee13, this, [[0, 23]]);
1309
1327
  }));
1310
1328
  function replaceLocalOrderIdAsync(_x13) {
1311
1329
  return _replaceLocalOrderIdAsync.apply(this, arguments);
@@ -1952,11 +1970,12 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1952
1970
  newDepositValue = isDeposit;
1953
1971
  oldDepositValue = this.store.currentOrder.is_deposit; // 如果状态没有变化,直接返回
1954
1972
  if (!(oldDepositValue === newDepositValue)) {
1955
- _context19.next = 9;
1973
+ _context19.next = 10;
1956
1974
  break;
1957
1975
  }
1976
+ console.log('[Checkout] 定金状态无变化,跳过更新');
1958
1977
  return _context19.abrupt("return");
1959
- case 9:
1978
+ case 10:
1960
1979
  deposit_amount = this.store.currentOrder.deposit_amount || '0.00'; // 如果原来没有 deposit_amount,则默认把待付金额置为 deposit_amount
1961
1980
  if (!deposit_amount || Number(deposit_amount) === 0) {
1962
1981
  deposit_amount = this.store.currentOrder.expect_amount;
@@ -1975,9 +1994,9 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1975
1994
  // this.logInfo('订单从定金改为全款,清空定金金额');
1976
1995
  // }
1977
1996
  // 调用 Payment 模块更新订单
1978
- _context19.next = 14;
1997
+ _context19.next = 15;
1979
1998
  return this.payment.updateOrderAsync(this.store.currentOrder.uuid, updateParams);
1980
- case 14:
1999
+ case 15:
1981
2000
  // 更新本地缓存的订单对象
1982
2001
  this.store.currentOrder = _objectSpread(_objectSpread({}, this.store.currentOrder), updateParams);
1983
2002
 
@@ -1991,31 +2010,31 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1991
2010
  this.updateStateAmountToRemaining(false);
1992
2011
 
1993
2012
  // 触发订单更新事件
1994
- _context19.next = 20;
2013
+ _context19.next = 21;
1995
2014
  return this.core.effects.emit("".concat(this.name, ":onOrderCreated"), {
1996
2015
  order: this.store.currentOrder,
1997
2016
  timestamp: Date.now()
1998
2017
  });
1999
- case 20:
2018
+ case 21:
2000
2019
  this.logInfo('订单定金状态更新成功:', {
2001
2020
  isDeposit: newDepositValue,
2002
2021
  depositAmount: this.store.currentOrder.deposit_amount
2003
2022
  });
2004
- _context19.next = 29;
2023
+ _context19.next = 30;
2005
2024
  break;
2006
- case 23:
2007
- _context19.prev = 23;
2025
+ case 24:
2026
+ _context19.prev = 24;
2008
2027
  _context19.t0 = _context19["catch"](0);
2009
2028
  this.logError('更新订单定金状态失败:', _context19.t0);
2010
- _context19.next = 28;
2029
+ _context19.next = 29;
2011
2030
  return this.handleError(_context19.t0, CheckoutErrorType.ValidationFailed);
2012
- case 28:
2013
- throw _context19.t0;
2014
2031
  case 29:
2032
+ throw _context19.t0;
2033
+ case 30:
2015
2034
  case "end":
2016
2035
  return _context19.stop();
2017
2036
  }
2018
- }, _callee19, this, [[0, 23]]);
2037
+ }, _callee19, this, [[0, 24]]);
2019
2038
  }));
2020
2039
  function updateOrderDepositStatusAsync(_x19) {
2021
2040
  return _updateOrderDepositStatusAsync.apply(this, arguments);
@@ -2170,6 +2189,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2170
2189
  return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2171
2190
  while (1) switch (_context21.prev = _context21.next) {
2172
2191
  case 0:
2192
+ console.log('manualSyncOrderAsync called');
2173
2193
  this.logInfo('manualSyncOrderAsync called', {
2174
2194
  hasCurrentOrder: !!this.store.currentOrder,
2175
2195
  currentOrderId: (_this$store$currentOr15 = this.store.currentOrder) === null || _this$store$currentOr15 === void 0 ? void 0 : _this$store$currentOr15.order_id,
@@ -2178,16 +2198,16 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2178
2198
  isOrderSynced: this.store.isOrderSynced,
2179
2199
  isVirtualOrderId: this.store.currentOrder ? isVirtualOrderId(this.store.currentOrder.order_id) : false
2180
2200
  });
2181
- _context21.prev = 1;
2201
+ _context21.prev = 2;
2182
2202
  if (this.store.currentOrder) {
2183
- _context21.next = 4;
2203
+ _context21.next = 5;
2184
2204
  break;
2185
2205
  }
2186
2206
  return _context21.abrupt("return", {
2187
2207
  success: false,
2188
2208
  message: '当前没有活跃订单,无法同步'
2189
2209
  });
2190
- case 4:
2210
+ case 5:
2191
2211
  orderUuid = this.store.currentOrder.uuid;
2192
2212
  oldOrderId = this.store.currentOrder.order_id; // 检查订单是否已经同步
2193
2213
  if (this.store.isOrderSynced) {
@@ -2197,9 +2217,9 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2197
2217
  _context21.t1 = orderUuid;
2198
2218
  _context21.t2 = oldOrderId;
2199
2219
  _context21.t3 = this.store.currentOrder.total_amount;
2200
- _context21.next = 13;
2220
+ _context21.next = 14;
2201
2221
  return this.calculateRemainingAmountAsync();
2202
- case 13:
2222
+ case 14:
2203
2223
  _context21.t4 = _context21.sent;
2204
2224
  _context21.t5 = {
2205
2225
  orderUuid: _context21.t1,
@@ -2208,10 +2228,14 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2208
2228
  remainingAmount: _context21.t4
2209
2229
  };
2210
2230
  _context21.t0.logInfo.call(_context21.t0, '开始手动同步订单到后端:', _context21.t5);
2211
- _context21.next = 18;
2231
+ console.time('manualSyncOrderAsync');
2232
+
2233
+ // 强制同步订单到后端,并获取完整响应数据
2234
+ _context21.next = 20;
2212
2235
  return this.syncOrderToBackendWithReturn(true);
2213
- case 18:
2236
+ case 20:
2214
2237
  syncResult = _context21.sent;
2238
+ console.timeEnd('manualSyncOrderAsync');
2215
2239
  this.logInfo('手动同步订单完成:', {
2216
2240
  orderUuid: orderUuid,
2217
2241
  syncResult: syncResult,
@@ -2232,13 +2256,13 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2232
2256
  newRes = _objectSpread(_objectSpread({}, syncResult), {}, {
2233
2257
  is_deposit: ((_this$store$currentOr18 = this.store.currentOrder) === null || _this$store$currentOr18 === void 0 ? void 0 : _this$store$currentOr18.is_deposit) || 0
2234
2258
  });
2235
- _context21.next = 27;
2259
+ _context21.next = 30;
2236
2260
  return this.updateStateAmountToRemaining(false);
2237
- case 27:
2238
- return _context21.abrupt("return", newRes);
2239
2261
  case 30:
2240
- _context21.prev = 30;
2241
- _context21.t6 = _context21["catch"](1);
2262
+ return _context21.abrupt("return", newRes);
2263
+ case 33:
2264
+ _context21.prev = 33;
2265
+ _context21.t6 = _context21["catch"](2);
2242
2266
  this.logError('手动同步订单失败:', _context21.t6);
2243
2267
  errorMessage = _context21.t6 instanceof Error ? _context21.t6.message : '同步失败';
2244
2268
  return _context21.abrupt("return", {
@@ -2246,11 +2270,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2246
2270
  message: "\u8BA2\u5355\u540C\u6B65\u5931\u8D25: ".concat(errorMessage),
2247
2271
  orderUuid: (_this$store$currentOr19 = this.store.currentOrder) === null || _this$store$currentOr19 === void 0 ? void 0 : _this$store$currentOr19.uuid
2248
2272
  });
2249
- case 35:
2273
+ case 38:
2250
2274
  case "end":
2251
2275
  return _context21.stop();
2252
2276
  }
2253
- }, _callee21, this, [[1, 30]]);
2277
+ }, _callee21, this, [[2, 33]]);
2254
2278
  }));
2255
2279
  function manualSyncOrderAsync() {
2256
2280
  return _manualSyncOrderAsync.apply(this, arguments);
@@ -2267,6 +2291,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2267
2291
  key: "getOrderNote",
2268
2292
  value: function getOrderNote() {
2269
2293
  if (!this.store.localOrderData) {
2294
+ console.log('[Checkout] 没有本地订单数据,无法获取备注');
2270
2295
  return '';
2271
2296
  }
2272
2297
  return this.store.localOrderData.shop_note || '';
@@ -2296,9 +2321,15 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2296
2321
  value: function isCurrentOrderSynced() {
2297
2322
  // 如果没有当前订单,返回false
2298
2323
  if (!this.store.currentOrder) {
2324
+ console.log('[Checkout] 没有当前订单,同步状态为false');
2299
2325
  return false;
2300
2326
  }
2301
2327
  var syncStatus = this.store.isOrderSynced;
2328
+ console.log('[Checkout] 当前订单同步状态:', {
2329
+ orderUuid: this.store.currentOrder.uuid,
2330
+ orderId: this.store.currentOrder.order_id,
2331
+ isOrderSynced: syncStatus
2332
+ });
2302
2333
  return syncStatus;
2303
2334
  }
2304
2335
 
@@ -2517,7 +2548,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2517
2548
  key: "updateOrderNoteAsync",
2518
2549
  value: (function () {
2519
2550
  var _updateOrderNoteAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(note) {
2520
- var _this$store$currentOr23, oldNote, orderInPayment;
2551
+ var _this$store$currentOr23, _this$store$currentOr24, oldNote, orderInPayment;
2521
2552
  return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2522
2553
  while (1) switch (_context24.prev = _context24.next) {
2523
2554
  case 0:
@@ -2528,51 +2559,65 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2528
2559
  }
2529
2560
  throw createCheckoutError(CheckoutErrorType.ValidationFailed, '没有本地订单数据,无法更新备注');
2530
2561
  case 3:
2562
+ console.log('[Checkout] 更新订单备注:', {
2563
+ orderUuid: (_this$store$currentOr23 = this.store.currentOrder) === null || _this$store$currentOr23 === void 0 ? void 0 : _this$store$currentOr23.uuid,
2564
+ oldNote: this.store.localOrderData.shop_note,
2565
+ newNote: note
2566
+ });
2567
+
2531
2568
  // 更新备注
2532
2569
  oldNote = this.store.localOrderData.shop_note;
2533
2570
  this.store.localOrderData.shop_note = note;
2534
2571
 
2535
2572
  // 如果有当前订单,也同步到Payment模块中的订单数据
2536
2573
  if (!this.store.currentOrder) {
2537
- _context24.next = 16;
2574
+ _context24.next = 17;
2538
2575
  break;
2539
2576
  }
2540
- _context24.prev = 6;
2541
- _context24.next = 9;
2577
+ _context24.prev = 7;
2578
+ _context24.next = 10;
2542
2579
  return this.payment.getPaymentOrderByUuidAsync(this.store.currentOrder.uuid);
2543
- case 9:
2580
+ case 10:
2544
2581
  orderInPayment = _context24.sent;
2545
- if (orderInPayment && orderInPayment.note !== undefined) {}
2546
- _context24.next = 16;
2582
+ if (orderInPayment && orderInPayment.note !== undefined) {
2583
+ // 使用Payment模块的更新方法(如果有的话)
2584
+ // 这里可能需要根据Payment模块的实际API来调整
2585
+ console.log('[Checkout] 同步备注到Payment模块的订单数据中');
2586
+ }
2587
+ _context24.next = 17;
2547
2588
  break;
2548
- case 13:
2549
- _context24.prev = 13;
2550
- _context24.t0 = _context24["catch"](6);
2589
+ case 14:
2590
+ _context24.prev = 14;
2591
+ _context24.t0 = _context24["catch"](7);
2551
2592
  console.warn('[Checkout] 同步备注到Payment模块失败,但本地更新成功:', _context24.t0);
2552
- case 16:
2553
- _context24.next = 18;
2593
+ case 17:
2594
+ _context24.next = 19;
2554
2595
  return this.core.effects.emit("".concat(this.name, ":onOrderNoteChanged"), {
2555
- orderUuid: (_this$store$currentOr23 = this.store.currentOrder) === null || _this$store$currentOr23 === void 0 ? void 0 : _this$store$currentOr23.uuid,
2596
+ orderUuid: (_this$store$currentOr24 = this.store.currentOrder) === null || _this$store$currentOr24 === void 0 ? void 0 : _this$store$currentOr24.uuid,
2556
2597
  oldNote: oldNote,
2557
2598
  newNote: note,
2558
2599
  timestamp: Date.now()
2559
2600
  });
2560
- case 18:
2561
- _context24.next = 26;
2601
+ case 19:
2602
+ console.log('[Checkout] 订单备注更新成功:', {
2603
+ oldNote: oldNote,
2604
+ newNote: note
2605
+ });
2606
+ _context24.next = 28;
2562
2607
  break;
2563
- case 20:
2564
- _context24.prev = 20;
2608
+ case 22:
2609
+ _context24.prev = 22;
2565
2610
  _context24.t1 = _context24["catch"](0);
2566
2611
  console.error('[Checkout] 更新订单备注失败:', _context24.t1);
2567
- _context24.next = 25;
2612
+ _context24.next = 27;
2568
2613
  return this.handleError(_context24.t1, CheckoutErrorType.ValidationFailed);
2569
- case 25:
2614
+ case 27:
2570
2615
  throw _context24.t1;
2571
- case 26:
2616
+ case 28:
2572
2617
  case "end":
2573
2618
  return _context24.stop();
2574
2619
  }
2575
- }, _callee24, this, [[0, 20], [6, 13]]);
2620
+ }, _callee24, this, [[0, 22], [7, 14]]);
2576
2621
  }));
2577
2622
  function updateOrderNoteAsync(_x22) {
2578
2623
  return _updateOrderNoteAsync.apply(this, arguments);
@@ -2620,7 +2665,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2620
2665
  key: "handlePaymentSuccess",
2621
2666
  value: (function () {
2622
2667
  var _handlePaymentSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(data) {
2623
- var _this$store$currentOr24;
2668
+ var _this$store$currentOr25;
2624
2669
  return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2625
2670
  while (1) switch (_context26.prev = _context26.next) {
2626
2671
  case 0:
@@ -2631,7 +2676,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2631
2676
  return this.core.effects.emit("".concat(this.name, ":onPaymentSuccess"), {
2632
2677
  orderUuid: data.orderUuid,
2633
2678
  paymentMethodCode: '',
2634
- amount: ((_this$store$currentOr24 = this.store.currentOrder) === null || _this$store$currentOr24 === void 0 ? void 0 : _this$store$currentOr24.total_amount) || '0',
2679
+ amount: ((_this$store$currentOr25 = this.store.currentOrder) === null || _this$store$currentOr25 === void 0 ? void 0 : _this$store$currentOr25.total_amount) || '0',
2635
2680
  timestamp: data.timestamp
2636
2681
  });
2637
2682
  case 4:
@@ -2656,7 +2701,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2656
2701
  key: "handlePaymentError",
2657
2702
  value: (function () {
2658
2703
  var _handlePaymentError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(data) {
2659
- var _this$store$currentOr25;
2704
+ var _this$store$currentOr26;
2660
2705
  var error;
2661
2706
  return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2662
2707
  while (1) switch (_context27.prev = _context27.next) {
@@ -2669,7 +2714,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2669
2714
  return this.core.effects.emit("".concat(this.name, ":onPaymentFailed"), {
2670
2715
  orderUuid: data.orderUuid,
2671
2716
  paymentMethodCode: '',
2672
- amount: ((_this$store$currentOr25 = this.store.currentOrder) === null || _this$store$currentOr25 === void 0 ? void 0 : _this$store$currentOr25.total_amount) || '0',
2717
+ amount: ((_this$store$currentOr26 = this.store.currentOrder) === null || _this$store$currentOr26 === void 0 ? void 0 : _this$store$currentOr26.total_amount) || '0',
2673
2718
  timestamp: data.timestamp
2674
2719
  });
2675
2720
  case 5:
@@ -2703,7 +2748,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2703
2748
  key: "processCashPaymentItem",
2704
2749
  value: (function () {
2705
2750
  var _processCashPaymentItem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(paymentItem) {
2706
- var cashPayment, remainingAmountStr, remainingAmount, cashAmount, changeAmount, processedPaymentItem;
2751
+ var cashPayment, remainingAmountStr, remainingAmount, cashAmount, roundingAmount, chargeAmount, changeAmount, processedPaymentItem;
2707
2752
  return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2708
2753
  while (1) switch (_context28.prev = _context28.next) {
2709
2754
  case 0:
@@ -2721,41 +2766,35 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2721
2766
  case 6:
2722
2767
  remainingAmountStr = _context28.sent;
2723
2768
  remainingAmount = new Decimal(remainingAmountStr);
2724
- cashAmount = new Decimal(String(paymentItem.amount)); // 如果现金金额小于等于剩余待付金额,无需找零
2769
+ cashAmount = new Decimal(String(paymentItem.amount));
2770
+ roundingAmount = new Decimal(String(paymentItem.rounding_amount || '0')); // 如果现金金额小于等于剩余待付金额,无需找零
2725
2771
  if (!cashAmount.lte(remainingAmount)) {
2726
- _context28.next = 11;
2772
+ _context28.next = 12;
2727
2773
  break;
2728
2774
  }
2729
2775
  return _context28.abrupt("return", paymentItem);
2730
- case 11:
2731
- // 使用 Decimal.js 安全计算找零金额
2732
- changeAmount = cashAmount.sub(remainingAmount); // 如果还有 rounding_amount 的配置,要判断是否和 changeAmount 相等
2733
- if (!(Number(paymentItem.rounding_amount) > 0)) {
2734
- _context28.next = 18;
2735
- break;
2736
- }
2737
- if (!(Number(paymentItem.rounding_amount) === changeAmount.toNumber())) {
2738
- _context28.next = 17;
2776
+ case 12:
2777
+ // 超付场景使用 rounding 回算应收金额(兼容 UI 已做抹零 + 允许超付)
2778
+ chargeAmount = Decimal.max(remainingAmount.add(roundingAmount), new Decimal(0));
2779
+ if (!cashAmount.lte(chargeAmount)) {
2780
+ _context28.next = 15;
2739
2781
  break;
2740
2782
  }
2741
2783
  return _context28.abrupt("return", paymentItem);
2742
- case 17:
2743
- // 如果不等于,则remainingAmount需要加上 rounding_amount,避免这里被改为未舍入金额
2744
- remainingAmount = remainingAmount.add(new Decimal(paymentItem.rounding_amount || '0'));
2745
- case 18:
2746
- // 创建包含找零信息的支付项
2784
+ case 15:
2785
+ changeAmount = cashAmount.sub(chargeAmount); // 创建包含找零信息的支付项
2747
2786
  processedPaymentItem = _objectSpread(_objectSpread({}, paymentItem), {}, {
2748
- amount: remainingAmount.toFixed(2),
2749
- // 将 amount 设置为剩余待付金额,保留2位小数
2787
+ amount: chargeAmount.toFixed(2),
2750
2788
  metadata: _objectSpread(_objectSpread({}, paymentItem.metadata), {}, {
2751
2789
  actual_paid_amount: cashAmount.toNumber(),
2752
- // 实付金额
2753
- change_given_amount: changeAmount.toNumber() // 找零金额
2790
+ change_given_amount: changeAmount.toNumber()
2754
2791
  })
2755
2792
  });
2756
2793
  this.logInfo('Cash payment with change processed', {
2757
2794
  originalAmount: cashAmount.toFixed(2),
2758
- chargedAmount: remainingAmount.toFixed(2),
2795
+ remainingAmount: remainingAmount.toFixed(2),
2796
+ roundingAmount: roundingAmount.toFixed(2),
2797
+ chargedAmount: chargeAmount.toFixed(2),
2759
2798
  changeAmount: changeAmount.toFixed(2),
2760
2799
  paymentCode: paymentItem.code,
2761
2800
  paymentType: paymentItem.type,
@@ -2763,21 +2802,23 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2763
2802
  decimalPrecisionCheck: {
2764
2803
  cashAmountPrecise: cashAmount.toString(),
2765
2804
  remainingAmountPrecise: remainingAmount.toString(),
2805
+ roundingAmountPrecise: roundingAmount.toString(),
2806
+ chargeAmountPrecise: chargeAmount.toString(),
2766
2807
  changeAmountPrecise: changeAmount.toString()
2767
2808
  }
2768
2809
  });
2769
2810
  return _context28.abrupt("return", processedPaymentItem);
2770
- case 23:
2771
- _context28.prev = 23;
2811
+ case 21:
2812
+ _context28.prev = 21;
2772
2813
  _context28.t0 = _context28["catch"](3);
2773
2814
  this.logError('处理现金支付项时出错:', _context28.t0);
2774
2815
  // 出错时返回原始支付项,避免中断支付流程
2775
2816
  return _context28.abrupt("return", paymentItem);
2776
- case 27:
2817
+ case 25:
2777
2818
  case "end":
2778
2819
  return _context28.stop();
2779
2820
  }
2780
- }, _callee28, this, [[3, 23]]);
2821
+ }, _callee28, this, [[3, 21]]);
2781
2822
  }));
2782
2823
  function processCashPaymentItem(_x27) {
2783
2824
  return _processCashPaymentItem.apply(this, arguments);
@@ -2797,23 +2838,25 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2797
2838
  while (1) switch (_context29.prev = _context29.next) {
2798
2839
  case 0:
2799
2840
  _context29.prev = 0;
2800
- _context29.next = 3;
2841
+ console.log('[Checkout] 预加载支付方式...');
2842
+ _context29.next = 4;
2801
2843
  return this.payment.getPayMethodListAsync();
2802
- case 3:
2844
+ case 4:
2803
2845
  methods = _context29.sent;
2804
2846
  this.store.paymentMethods = methods;
2805
- _context29.next = 11;
2847
+ console.log("[Checkout] \u9884\u52A0\u8F7D\u5B8C\u6210\uFF0C\u5171 ".concat(methods.length, " \u79CD\u652F\u4ED8\u65B9\u5F0F"));
2848
+ _context29.next = 13;
2806
2849
  break;
2807
- case 7:
2808
- _context29.prev = 7;
2850
+ case 9:
2851
+ _context29.prev = 9;
2809
2852
  _context29.t0 = _context29["catch"](0);
2810
2853
  console.error('[Checkout] 预加载支付方式失败:', _context29.t0);
2811
2854
  this.store.paymentMethods = [];
2812
- case 11:
2855
+ case 13:
2813
2856
  case "end":
2814
2857
  return _context29.stop();
2815
2858
  }
2816
- }, _callee29, this, [[0, 7]]);
2859
+ }, _callee29, this, [[0, 9]]);
2817
2860
  }));
2818
2861
  function preloadPaymentMethods() {
2819
2862
  return _preloadPaymentMethods.apply(this, arguments);
@@ -2825,6 +2868,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2825
2868
  *
2826
2869
  * 删除本地 IndexDB 中超过指定天数且已同步到后端的订单数据
2827
2870
  */
2871
+ /** @deprecated */
2828
2872
  )
2829
2873
  }, {
2830
2874
  key: "cleanupExpiredOrdersAsync",
@@ -2841,43 +2885,48 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2841
2885
  retentionDays = cleanupConfig.retentionDays || 7; // 默认保留7天
2842
2886
  maxOrdersToDelete = cleanupConfig.maxOrdersToDelete || 100; // 默认最多删除100个订单
2843
2887
  if (isCleanupEnabled) {
2844
- _context30.next = 7;
2888
+ _context30.next = 8;
2845
2889
  break;
2846
2890
  }
2891
+ console.log('[Checkout] 订单数据清理功能已禁用');
2847
2892
  return _context30.abrupt("return");
2848
- case 7:
2849
- _context30.next = 9;
2893
+ case 8:
2894
+ console.log("[Checkout] \u5F00\u59CB\u6E05\u7406\u8FC7\u671F\u8BA2\u5355\u6570\u636E\uFF08\u4FDD\u7559 ".concat(retentionDays, " \u5929\u5185\u7684\u6570\u636E\uFF09..."));
2895
+
2896
+ // 获取所有订单
2897
+ _context30.next = 11;
2850
2898
  return this.payment.getOrderListAsync();
2851
- case 9:
2899
+ case 11:
2852
2900
  allOrders = _context30.sent;
2853
2901
  if (!(!allOrders || allOrders.length === 0)) {
2854
- _context30.next = 12;
2902
+ _context30.next = 15;
2855
2903
  break;
2856
2904
  }
2905
+ console.log('[Checkout] 没有找到需要清理的订单数据');
2857
2906
  return _context30.abrupt("return");
2858
- case 12:
2907
+ case 15:
2859
2908
  thresholdDate = new Date();
2860
2909
  thresholdDate.setDate(thresholdDate.getDate() - retentionDays);
2861
2910
  deletedCount = 0;
2862
2911
  ordersToDelete = [];
2863
2912
  _iterator = _createForOfIteratorHelper(allOrders);
2864
- _context30.prev = 17;
2913
+ _context30.prev = 20;
2865
2914
  _iterator.s();
2866
- case 19:
2915
+ case 22:
2867
2916
  if ((_step = _iterator.n()).done) {
2868
- _context30.next = 38;
2917
+ _context30.next = 41;
2869
2918
  break;
2870
2919
  }
2871
2920
  order = _step.value;
2872
- _context30.prev = 21;
2921
+ _context30.prev = 24;
2873
2922
  // 检查订单是否已同步(订单ID不是虚拟ID)
2874
2923
  isSynced = order.order_id && !isVirtualOrderId(order.order_id);
2875
2924
  if (isSynced) {
2876
- _context30.next = 25;
2925
+ _context30.next = 28;
2877
2926
  break;
2878
2927
  }
2879
- return _context30.abrupt("continue", 36);
2880
- case 25:
2928
+ return _context30.abrupt("continue", 39);
2929
+ case 28:
2881
2930
  // 检查创建时间
2882
2931
  orderCreatedAt = null; // 尝试从 order_info.created_at 获取创建时间
2883
2932
  if ((_order$order_info = order.order_info) !== null && _order$order_info !== void 0 && _order$order_info.created_at) {
@@ -2890,11 +2939,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2890
2939
 
2891
2940
  // 如果无法获取创建时间,跳过此订单
2892
2941
  if (!(!orderCreatedAt || isNaN(orderCreatedAt.getTime()))) {
2893
- _context30.next = 29;
2942
+ _context30.next = 32;
2894
2943
  break;
2895
2944
  }
2896
- return _context30.abrupt("continue", 36);
2897
- case 29:
2945
+ return _context30.abrupt("continue", 39);
2946
+ case 32:
2898
2947
  // 检查是否超过指定天数
2899
2948
  if (orderCreatedAt < thresholdDate) {
2900
2949
  ordersToDelete.push({
@@ -2904,68 +2953,69 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2904
2953
  daysSinceCreated: Math.floor((Date.now() - orderCreatedAt.getTime()) / (1000 * 60 * 60 * 24))
2905
2954
  });
2906
2955
  }
2907
- _context30.next = 36;
2956
+ _context30.next = 39;
2908
2957
  break;
2909
- case 32:
2910
- _context30.prev = 32;
2911
- _context30.t0 = _context30["catch"](21);
2958
+ case 35:
2959
+ _context30.prev = 35;
2960
+ _context30.t0 = _context30["catch"](24);
2912
2961
  console.warn("[Checkout] \u5904\u7406\u8BA2\u5355 ".concat(order.uuid, " \u65F6\u51FA\u9519:"), _context30.t0);
2913
- return _context30.abrupt("continue", 36);
2914
- case 36:
2915
- _context30.next = 19;
2962
+ return _context30.abrupt("continue", 39);
2963
+ case 39:
2964
+ _context30.next = 22;
2916
2965
  break;
2917
- case 38:
2918
- _context30.next = 43;
2966
+ case 41:
2967
+ _context30.next = 46;
2919
2968
  break;
2920
- case 40:
2921
- _context30.prev = 40;
2922
- _context30.t1 = _context30["catch"](17);
2923
- _iterator.e(_context30.t1);
2924
2969
  case 43:
2925
2970
  _context30.prev = 43;
2926
- _iterator.f();
2927
- return _context30.finish(43);
2971
+ _context30.t1 = _context30["catch"](20);
2972
+ _iterator.e(_context30.t1);
2928
2973
  case 46:
2974
+ _context30.prev = 46;
2975
+ _iterator.f();
2976
+ return _context30.finish(46);
2977
+ case 49:
2929
2978
  // 按创建时间排序(最老的先删除)并限制删除数量
2930
2979
  ordersToDelete.sort(function (a, b) {
2931
2980
  return new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime();
2932
2981
  });
2933
2982
  actualOrdersToDelete = ordersToDelete.slice(0, maxOrdersToDelete); // 删除符合条件的订单
2934
2983
  _iterator2 = _createForOfIteratorHelper(actualOrdersToDelete);
2935
- _context30.prev = 49;
2984
+ _context30.prev = 52;
2936
2985
  _iterator2.s();
2937
- case 51:
2986
+ case 54:
2938
2987
  if ((_step2 = _iterator2.n()).done) {
2939
- _context30.next = 64;
2988
+ _context30.next = 68;
2940
2989
  break;
2941
2990
  }
2942
2991
  orderInfo = _step2.value;
2943
- _context30.prev = 53;
2944
- _context30.next = 56;
2992
+ _context30.prev = 56;
2993
+ _context30.next = 59;
2945
2994
  return this.payment.deletePaymentOrderAsync(orderInfo.uuid);
2946
- case 56:
2995
+ case 59:
2947
2996
  deletedCount++;
2948
- _context30.next = 62;
2997
+ console.log("[Checkout] \u5DF2\u5220\u9664\u8FC7\u671F\u8BA2\u5355: ".concat(orderInfo.orderId, " (").concat(orderInfo.daysSinceCreated, " \u5929\u524D\u521B\u5EFA)"));
2998
+ _context30.next = 66;
2949
2999
  break;
2950
- case 59:
2951
- _context30.prev = 59;
2952
- _context30.t2 = _context30["catch"](53);
3000
+ case 63:
3001
+ _context30.prev = 63;
3002
+ _context30.t2 = _context30["catch"](56);
2953
3003
  console.error("[Checkout] \u5220\u9664\u8BA2\u5355 ".concat(orderInfo.uuid, " \u5931\u8D25:"), _context30.t2);
2954
- case 62:
2955
- _context30.next = 51;
3004
+ case 66:
3005
+ _context30.next = 54;
2956
3006
  break;
2957
- case 64:
2958
- _context30.next = 69;
3007
+ case 68:
3008
+ _context30.next = 73;
2959
3009
  break;
2960
- case 66:
2961
- _context30.prev = 66;
2962
- _context30.t3 = _context30["catch"](49);
3010
+ case 70:
3011
+ _context30.prev = 70;
3012
+ _context30.t3 = _context30["catch"](52);
2963
3013
  _iterator2.e(_context30.t3);
2964
- case 69:
2965
- _context30.prev = 69;
3014
+ case 73:
3015
+ _context30.prev = 73;
2966
3016
  _iterator2.f();
2967
- return _context30.finish(69);
2968
- case 72:
3017
+ return _context30.finish(73);
3018
+ case 76:
2969
3019
  summary = {
2970
3020
  totalOrders: allOrders.length,
2971
3021
  expiredSyncedOrders: ordersToDelete.length,
@@ -2977,22 +3027,26 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
2977
3027
  skippedOrders: Math.max(0, ordersToDelete.length - maxOrdersToDelete)
2978
3028
  }; // 记录清理结果
2979
3029
  this.logInfo('Expired orders cleanup completed', summary);
2980
- if (ordersToDelete.length > maxOrdersToDelete) {} else {}
2981
- _context30.next = 82;
3030
+ if (ordersToDelete.length > maxOrdersToDelete) {
3031
+ console.log("[Checkout] \u8FC7\u671F\u8BA2\u5355\u6E05\u7406\u5B8C\u6210: \u603B\u8BA1 ".concat(allOrders.length, " \u4E2A\u8BA2\u5355\uFF0C\u53D1\u73B0 ").concat(ordersToDelete.length, " \u4E2A\u8FC7\u671F\u5DF2\u540C\u6B65\u8BA2\u5355\uFF0C\u5220\u9664\u4E86 ").concat(deletedCount, " \u4E2A\uFF08\u9650\u5236\u4E3A ").concat(maxOrdersToDelete, " \u4E2A\uFF09"));
3032
+ } else {
3033
+ console.log("[Checkout] \u8FC7\u671F\u8BA2\u5355\u6E05\u7406\u5B8C\u6210: \u603B\u8BA1 ".concat(allOrders.length, " \u4E2A\u8BA2\u5355\uFF0C\u5220\u9664\u4E86 ").concat(deletedCount, " \u4E2A\u8FC7\u671F\u5DF2\u540C\u6B65\u8BA2\u5355"));
3034
+ }
3035
+ _context30.next = 86;
2982
3036
  break;
2983
- case 77:
2984
- _context30.prev = 77;
3037
+ case 81:
3038
+ _context30.prev = 81;
2985
3039
  _context30.t4 = _context30["catch"](0);
2986
3040
  errorMessage = _context30.t4 instanceof Error ? _context30.t4.message : String(_context30.t4);
2987
3041
  console.error('[Checkout] 清理过期订单数据失败:', _context30.t4);
2988
3042
  this.logError('Expired orders cleanup failed', {
2989
3043
  error: errorMessage
2990
3044
  });
2991
- case 82:
3045
+ case 86:
2992
3046
  case "end":
2993
3047
  return _context30.stop();
2994
3048
  }
2995
- }, _callee30, this, [[0, 77], [17, 40, 43, 46], [21, 32], [49, 66, 69, 72], [53, 59]]);
3049
+ }, _callee30, this, [[0, 81], [20, 43, 46, 49], [24, 35], [52, 70, 73, 76], [56, 63]]);
2996
3050
  }));
2997
3051
  function cleanupExpiredOrdersAsync() {
2998
3052
  return _cleanupExpiredOrdersAsync.apply(this, arguments);
@@ -3390,19 +3444,22 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
3390
3444
  }
3391
3445
  return _context36.abrupt("return");
3392
3446
  case 4:
3393
- _context36.next = 6;
3447
+ console.time('updateStateAmountToRemaining');
3448
+ // 🚀 性能优化:一次性批量获取所有需要的数据
3449
+ _context36.next = 7;
3394
3450
  return this.fetchOrderDataBatch();
3395
- case 6:
3451
+ case 7:
3396
3452
  _yield$this$fetchOrde3 = _context36.sent;
3397
3453
  paymentItems = _yield$this$fetchOrde3.paymentItems;
3398
3454
  _currentOrder3 = _yield$this$fetchOrde3.currentOrder;
3455
+ console.timeEnd('updateStateAmountToRemaining');
3399
3456
  if (_currentOrder3) {
3400
- _context36.next = 12;
3457
+ _context36.next = 14;
3401
3458
  break;
3402
3459
  }
3403
3460
  this.logWarning('updateStateAmountToRemaining: 未找到当前订单');
3404
3461
  return _context36.abrupt("return");
3405
- case 12:
3462
+ case 14:
3406
3463
  // 🚀 性能优化:一次性计算所有金额(纯计算,不查询数据库)
3407
3464
  paidAmount = this.calculatePaidAmountFromItems(paymentItems); // 缓存已支付金额,供其他方法使用
3408
3465
  this.calculationCache.paidAmount = paidAmount;
@@ -3438,19 +3495,20 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
3438
3495
  currentBalanceDueAmount = this.store.balanceDueAmount; // 批量更新状态,减少操作次数
3439
3496
  hasStateChanged = false; // 如果需要更新定金状态
3440
3497
  if (!needUpdateDepositStatus) {
3441
- _context36.next = 26;
3498
+ _context36.next = 28;
3442
3499
  break;
3443
3500
  }
3444
3501
  this.store.currentOrder = _objectSpread(_objectSpread({}, this.store.currentOrder), {}, {
3445
3502
  is_deposit: 0
3446
3503
  });
3447
- _context36.next = 25;
3504
+ _context36.next = 27;
3448
3505
  return this.payment.updateOrderAsync(this.store.currentOrder.uuid, {
3449
3506
  is_deposit: 0
3450
3507
  });
3451
- case 25:
3508
+ case 27:
3452
3509
  hasStateChanged = true;
3453
- case 26:
3510
+ case 28:
3511
+ console.time('updateStateAmountToRemaining: remainingAmount');
3454
3512
  // 更新 stateAmount
3455
3513
  if (remainingAmount !== currentStateAmount) {
3456
3514
  this.store.stateAmount = remainingAmount;
@@ -3469,6 +3527,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
3469
3527
  newAmount: remainingAmount
3470
3528
  });
3471
3529
  }
3530
+ console.timeEnd('updateStateAmountToRemaining: remainingAmount');
3531
+ console.time('updateStateAmountToRemaining: updateStateAmountToRemaining');
3472
3532
  // 更新 balanceDueAmount
3473
3533
  if (remainingAmount !== currentBalanceDueAmount) {
3474
3534
  this.store.balanceDueAmount = remainingAmount;
@@ -3488,6 +3548,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
3488
3548
  newAmount: remainingAmount
3489
3549
  });
3490
3550
  }
3551
+ console.timeEnd('updateStateAmountToRemaining: updateStateAmountToRemaining');
3491
3552
  if (!hasStateChanged) {
3492
3553
  this.logInfo('状态无需更新,当前值已是最新:', {
3493
3554
  stateAmount: currentStateAmount,
@@ -3497,28 +3558,28 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
3497
3558
 
3498
3559
  // 检查订单支付完成(复用已获取的数据)
3499
3560
  if (!checkOrder) {
3500
- _context36.next = 34;
3561
+ _context36.next = 40;
3501
3562
  break;
3502
3563
  }
3503
- _context36.next = 32;
3564
+ _context36.next = 38;
3504
3565
  return this.checkOrderPaymentCompletionOptimized(paymentItems, remainingAmount);
3505
- case 32:
3506
- _context36.next = 35;
3566
+ case 38:
3567
+ _context36.next = 41;
3507
3568
  break;
3508
- case 34:
3569
+ case 40:
3509
3570
  this.logInfo('外部传入无需 checkOrder,不执行订单支付完成检测和同步');
3510
- case 35:
3511
- _context36.next = 40;
3571
+ case 41:
3572
+ _context36.next = 46;
3512
3573
  break;
3513
- case 37:
3514
- _context36.prev = 37;
3574
+ case 43:
3575
+ _context36.prev = 43;
3515
3576
  _context36.t0 = _context36["catch"](1);
3516
3577
  this.logError('更新 stateAmount 为剩余金额失败:', _context36.t0);
3517
- case 40:
3578
+ case 46:
3518
3579
  case "end":
3519
3580
  return _context36.stop();
3520
3581
  }
3521
- }, _callee36, this, [[1, 37]]);
3582
+ }, _callee36, this, [[1, 43]]);
3522
3583
  }));
3523
3584
  function updateStateAmountToRemaining() {
3524
3585
  return _updateStateAmountToRemaining.apply(this, arguments);
@@ -4149,11 +4210,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
4149
4210
  resolveInFlight,
4150
4211
  rejectInFlight,
4151
4212
  inFlightPromise,
4152
- _this$store$currentOr26,
4153
4213
  _this$store$currentOr27,
4214
+ _this$store$currentOr28,
4154
4215
  _this$store$currentCu2,
4155
4216
  _this$otherParams2,
4156
- _this$store$currentOr28,
4217
+ _this$store$currentOr29,
4157
4218
  _this$store$localOrde,
4158
4219
  _this$store$localOrde2,
4159
4220
  _checkoutResponse12,
@@ -4270,7 +4331,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
4270
4331
  })
4271
4332
  });
4272
4333
  }); // 确定最终的定金金额:优先使用手动设置的值,否则从支付项中计算
4273
- manualDepositAmount = ((_this$store$currentOr26 = this.store.currentOrder) === null || _this$store$currentOr26 === void 0 ? void 0 : _this$store$currentOr26.deposit_amount) || '0.00'; // 优先级逻辑:手动设置的定金金额 > 从支付项计算的金额
4334
+ manualDepositAmount = ((_this$store$currentOr27 = this.store.currentOrder) === null || _this$store$currentOr27 === void 0 ? void 0 : _this$store$currentOr27.deposit_amount) || '0.00'; // 优先级逻辑:手动设置的定金金额 > 从支付项计算的金额
4274
4335
  manualDepositValue = new Decimal(manualDepositAmount);
4275
4336
  if (manualDepositValue.gt(0)) {
4276
4337
  // 如果手动设置了定金金额且大于0,使用手动设置的值
@@ -4330,7 +4391,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
4330
4391
  }),
4331
4392
  manualDepositAmount: manualDepositAmount,
4332
4393
  finalDepositAmount: finalDepositAmount,
4333
- isDeposit: ((_this$store$currentOr27 = this.store.currentOrder) === null || _this$store$currentOr27 === void 0 ? void 0 : _this$store$currentOr27.is_deposit) || 0
4394
+ isDeposit: ((_this$store$currentOr28 = this.store.currentOrder) === null || _this$store$currentOr28 === void 0 ? void 0 : _this$store$currentOr28.is_deposit) || 0
4334
4395
  });
4335
4396
 
4336
4397
  // 计算订单状态,优先读取外面传递的,如果没有则根据订单支付数据来
@@ -4378,7 +4439,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
4378
4439
  currency_symbol: this.otherParams.currency_symbol,
4379
4440
  currency_format: this.otherParams.currency_format,
4380
4441
  business_code: ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.business_code) || undefined,
4381
- is_deposit: ((_this$store$currentOr28 = this.store.currentOrder) !== null && _this$store$currentOr28 !== void 0 && _this$store$currentOr28.is_deposit || Number(finalDepositAmount) > 0 ? 1 : 0) || 0,
4442
+ is_deposit: ((_this$store$currentOr29 = this.store.currentOrder) !== null && _this$store$currentOr29 !== void 0 && _this$store$currentOr29.is_deposit || Number(finalDepositAmount) > 0 ? 1 : 0) || 0,
4382
4443
  deposit_amount: finalDepositAmount,
4383
4444
  // 使用最终确定的定金金额(手动设置优先)
4384
4445
  product_tax_fee: this.store.localOrderData.tax_fee,
@@ -5021,7 +5082,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
5021
5082
  case 6:
5022
5083
  // 取消注册模块
5023
5084
  this.core.unregisterModule(this);
5024
- case 7:
5085
+ console.log('[Checkout] 已销毁');
5086
+ case 8:
5025
5087
  case "end":
5026
5088
  return _context46.stop();
5027
5089
  }
@@ -5048,6 +5110,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
5048
5110
  uuid: this.store.currentOrder.uuid,
5049
5111
  orderId: this.store.currentOrder.order_id
5050
5112
  } : null;
5113
+ console.log('[Checkout] 重置 store 状态,准备创建新订单', prevOrderInfo);
5114
+
5051
5115
  // 重置订单相关的 store 状态(保留 paymentMethods,因为支付方式数据变更不频繁)
5052
5116
  this.store.currentOrder = undefined;
5053
5117
  this.store.localOrderData = undefined;
@@ -5069,6 +5133,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
5069
5133
 
5070
5134
  // 注意:故意保留 this.store.paymentMethods,因为支付方式数据不易变更,保留在内存中提高性能
5071
5135
 
5136
+ console.log('[Checkout] Store 状态重置完成');
5137
+
5072
5138
  // 🚀 性能优化:异步触发订单清理事件(不阻塞主流程)
5073
5139
  // 使用 setTimeout 确保事件处理不会阻塞状态重置
5074
5140
  if (prevOrderInfo) {