@pisell/pisellos 0.0.567 → 0.0.569
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.
- package/dist/core/index.js +6 -9
- package/dist/model/strategy/adapter/promotion/evaluator.js +3 -2
- package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -2
- package/dist/model/strategy/adapter/walletPass/example.js +3 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +7 -7
- package/dist/model/strategy/strategy-example.js +5 -19
- package/dist/modules/BaseModule.d.ts +2 -2
- package/dist/modules/BaseModule.js +4 -4
- package/dist/modules/BookingContext/index.d.ts +48 -0
- package/dist/modules/BookingContext/index.js +566 -0
- package/dist/modules/BookingContext/types.d.ts +102 -0
- package/dist/modules/BookingContext/types.js +51 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +302 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +149 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +249 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/flexible.js +56 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
- package/dist/modules/BookingContext/utils/index.d.ts +11 -0
- package/dist/modules/BookingContext/utils/index.js +11 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/noResource.js +77 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/dist/modules/BookingContext/utils/productExtend.js +339 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
- package/dist/modules/BookingContext/utils/resources.js +486 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
- package/dist/modules/Cart/index.js +0 -3
- package/dist/modules/Cart/utils/cartProduct.js +26 -6
- package/dist/modules/Cart/utils/changePrice.js +27 -20
- package/dist/modules/Customer/index.d.ts +20 -0
- package/dist/modules/Customer/index.js +172 -83
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Date/index.js +1 -5
- package/dist/modules/Discount/index.d.ts +2 -1
- package/dist/modules/Discount/index.js +37 -12
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +35 -17
- package/dist/modules/Order/index.d.ts +449 -24
- package/dist/modules/Order/index.js +5437 -608
- package/dist/modules/Order/types.d.ts +693 -88
- package/dist/modules/Order/types.js +68 -1
- package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +405 -0
- package/dist/modules/Order/utils.d.ts +167 -18
- package/dist/modules/Order/utils.js +960 -165
- package/dist/modules/Payment/index.d.ts +10 -9
- package/dist/modules/Payment/index.js +508 -874
- package/dist/modules/Payment/types.d.ts +40 -16
- package/dist/modules/Payment/utils.d.ts +1 -1
- package/dist/modules/Payment/utils.js +4 -3
- package/dist/modules/Payment/walletpass.js +48 -34
- package/dist/modules/Product/types.d.ts +29 -7
- package/dist/modules/ProductList/index.d.ts +17 -13
- package/dist/modules/ProductList/index.js +184 -74
- package/dist/modules/ProductList/types.d.ts +17 -0
- package/dist/modules/Quotation/index.d.ts +22 -2
- package/dist/modules/Quotation/index.js +108 -42
- package/dist/modules/Quotation/types.d.ts +19 -0
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.d.ts +8 -10
- package/dist/modules/Rules/index.js +219 -114
- package/dist/modules/Rules/types.d.ts +14 -3
- package/dist/modules/SalesSummary/index.d.ts +23 -26
- package/dist/modules/SalesSummary/index.js +152 -46
- package/dist/modules/SalesSummary/types.d.ts +9 -1
- package/dist/modules/SalesSummary/utils.d.ts +3 -22
- package/dist/modules/SalesSummary/utils.js +803 -163
- package/dist/modules/Schedule/getDateIsInSchedule.js +14 -7
- package/dist/modules/Schedule/index.d.ts +18 -5
- package/dist/modules/Schedule/index.js +78 -24
- package/dist/modules/Schedule/types.d.ts +2 -0
- package/dist/modules/Schedule/utils.js +0 -1
- package/dist/modules/Step/index.js +0 -1
- package/dist/modules/Summary/index.js +4 -3
- package/dist/modules/SurchargeList/index.d.ts +18 -0
- package/dist/modules/SurchargeList/index.js +185 -0
- package/dist/modules/SurchargeList/types.d.ts +15 -0
- package/dist/modules/SurchargeList/types.js +1 -0
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +4 -1
- package/dist/plugins/app.d.ts +2 -0
- package/dist/plugins/request.d.ts +1 -0
- package/dist/plugins/request.js +1 -4
- package/dist/plugins/window.js +2 -6
- package/dist/server/index.d.ts +462 -8
- package/dist/server/index.js +6137 -714
- package/dist/server/modules/floor-plan/index.d.ts +39 -0
- package/dist/server/modules/floor-plan/index.js +595 -0
- package/dist/server/modules/floor-plan/types.d.ts +43 -0
- package/dist/server/modules/floor-plan/types.js +13 -0
- package/dist/server/modules/index.d.ts +7 -2
- package/dist/server/modules/index.js +6 -0
- package/dist/server/modules/menu/index.js +32 -41
- package/dist/server/modules/order/index.d.ts +207 -14
- package/dist/server/modules/order/index.js +2326 -379
- package/dist/server/modules/order/types.d.ts +76 -5
- package/dist/server/modules/order/types.js +14 -1
- package/dist/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/dist/server/modules/order/utils/filterBookings.js +118 -11
- package/dist/server/modules/order/utils/filterOrders.js +242 -14
- package/dist/server/modules/payment/index.d.ts +28 -0
- package/dist/server/modules/payment/index.js +305 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/payment/types.js +1 -0
- package/dist/server/modules/products/index.d.ts +105 -14
- package/dist/server/modules/products/index.js +1397 -540
- package/dist/server/modules/products/types.d.ts +34 -1
- package/dist/server/modules/products/types.js +4 -0
- package/dist/server/modules/quotation/index.d.ts +39 -0
- package/dist/server/modules/quotation/index.js +289 -86
- package/dist/server/modules/resource/index.d.ts +2 -3
- package/dist/server/modules/resource/index.js +105 -84
- package/dist/server/modules/schedule/index.d.ts +6 -4
- package/dist/server/modules/schedule/index.js +137 -114
- package/dist/server/test.json +713 -0
- package/dist/server/types.d.ts +2 -0
- package/dist/server/utils/product.js +2 -3
- package/dist/server/utils/small-ticket.d.ts +71 -0
- package/dist/server/utils/small-ticket.js +963 -0
- package/dist/solution/BaseSales/index.d.ts +378 -0
- package/dist/solution/BaseSales/index.js +4006 -0
- package/dist/solution/BaseSales/types.d.ts +394 -0
- package/dist/solution/BaseSales/types.js +40 -0
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1450 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/dist/solution/BaseSales/utils/parseSalesResponse.js +157 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +250 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +218 -0
- package/dist/solution/BaseSales/utils.d.ts +40 -0
- package/dist/solution/BaseSales/utils.js +263 -0
- package/dist/solution/BookingByStep/index.js +7 -59
- package/dist/solution/BookingByStep/utils/capacity.js +1 -11
- package/dist/solution/BookingByStep/utils/resources.js +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
- package/dist/solution/BookingTicket/index.d.ts +393 -24
- package/dist/solution/BookingTicket/index.js +2506 -445
- package/dist/solution/BookingTicket/types.d.ts +191 -6
- package/dist/solution/BookingTicket/types.js +83 -10
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.js +136 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts +29 -0
- package/dist/solution/BookingTicket/utils/cartView.js +209 -0
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +41 -1
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +36 -34
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +26 -18
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
- package/dist/solution/BuyTickets/index.js +9 -12
- package/dist/solution/Checkout/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +199 -277
- package/dist/solution/Checkout/utils/index.js +8 -20
- package/dist/solution/RegisterAndLogin/config.js +2 -10
- package/dist/solution/RegisterAndLogin/index.js +30 -76
- package/dist/solution/Sales/index.d.ts +50 -5
- package/dist/solution/Sales/index.js +484 -92
- package/dist/solution/Sales/types.d.ts +26 -2
- package/dist/solution/ScanOrder/index.d.ts +27 -21
- package/dist/solution/ScanOrder/index.js +509 -454
- package/dist/solution/ScanOrder/types.d.ts +33 -11
- package/dist/solution/ScanOrder/types.js +4 -5
- package/dist/solution/ScanOrder/utils.d.ts +4 -1
- package/dist/solution/ScanOrder/utils.js +109 -34
- package/dist/solution/ShopDiscount/index.js +6 -11
- package/dist/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/dist/solution/UnifiedBookingSales/index.js +1871 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +34 -20
- package/dist/solution/VenueBooking/index.js +630 -505
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +11 -1
- package/dist/utils/task.js +15 -18
- package/dist/utils/watch.js +0 -1
- package/lib/apis/picoding.js +2 -0
- package/lib/core/index.js +130 -131
- package/lib/effects/index.js +46 -57
- package/lib/index.js +92 -53
- package/lib/model/index.js +14 -21
- package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
- package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
- package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
- package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
- package/lib/model/strategy/adapter/index.js +100 -64
- package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
- package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
- package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
- package/lib/model/strategy/adapter/itemRule/index.js +83 -57
- package/lib/model/strategy/adapter/itemRule/type.js +97 -36
- package/lib/model/strategy/adapter/promotion/adapter.js +84 -63
- package/lib/model/strategy/adapter/promotion/evaluator.js +383 -232
- package/lib/model/strategy/adapter/promotion/examples.js +139 -159
- package/lib/model/strategy/adapter/promotion/index.js +1 -49
- package/lib/model/strategy/adapter/promotion/type.js +199 -35
- package/lib/model/strategy/adapter/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -152
- package/lib/model/strategy/adapter/walletPass/example.js +217 -190
- package/lib/model/strategy/adapter/walletPass/index.js +75 -51
- package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
- package/lib/model/strategy/adapter/walletPass/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/utils.js +654 -402
- package/lib/model/strategy/engine.js +270 -168
- package/lib/model/strategy/index.js +49 -34
- package/lib/model/strategy/strategy-example.js +243 -239
- package/lib/model/strategy/type.js +100 -40
- package/lib/modules/Account/index.js +39 -53
- package/lib/modules/Account/types.js +20 -33
- package/lib/modules/AccountList/index.js +116 -154
- package/lib/modules/AccountList/types.js +30 -31
- package/lib/modules/AccountList/utils.js +18 -30
- package/lib/modules/BaseModule.d.ts +2 -2
- package/lib/modules/BaseModule.js +26 -49
- package/lib/modules/BookingContext/index.d.ts +48 -0
- package/lib/modules/BookingContext/index.js +390 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +48 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +286 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +242 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +63 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +35 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +126 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +78 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +29 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +330 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +419 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +161 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +114 -0
- package/lib/modules/Cart/index.js +170 -124
- package/lib/modules/Cart/types.js +46 -51
- package/lib/modules/Cart/utils/cartAccount.js +40 -39
- package/lib/modules/Cart/utils/cartDate.js +56 -61
- package/lib/modules/Cart/utils/cartDiscount.js +28 -33
- package/lib/modules/Cart/utils/cartNote.js +27 -32
- package/lib/modules/Cart/utils/cartProduct.js +331 -244
- package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
- package/lib/modules/Cart/utils/cartResource.js +72 -78
- package/lib/modules/Cart/utils/changePrice.js +37 -67
- package/lib/modules/Cart/utils/index.js +106 -48
- package/lib/modules/Customer/constants.js +13 -34
- package/lib/modules/Customer/index.d.ts +20 -0
- package/lib/modules/Customer/index.js +270 -154
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Customer/types.js +38 -35
- package/lib/modules/Date/index.js +116 -115
- package/lib/modules/Date/types.js +16 -28
- package/lib/modules/Date/utils.js +174 -123
- package/lib/modules/Discount/index.d.ts +2 -1
- package/lib/modules/Discount/index.js +133 -113
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Discount/types.js +9 -31
- package/lib/modules/Guests/index.js +30 -56
- package/lib/modules/Guests/types.js +23 -33
- package/lib/modules/Holder/index.js +209 -189
- package/lib/modules/Holder/types.js +4 -16
- package/lib/modules/Holder/utils.js +20 -49
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +81 -74
- package/lib/modules/OpenData/types.js +4 -16
- package/lib/modules/OpenData/utils.js +44 -78
- package/lib/modules/Order/index.d.ts +449 -24
- package/lib/modules/Order/index.js +3834 -489
- package/lib/modules/Order/types.d.ts +693 -88
- package/lib/modules/Order/types.js +78 -33
- package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
- package/lib/modules/Order/utils/bundleDiscountHydration.js +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +53 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +353 -0
- package/lib/modules/Order/utils.d.ts +167 -18
- package/lib/modules/Order/utils.js +1247 -345
- package/lib/modules/Payment/cash.js +20 -33
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
- package/lib/modules/Payment/eftpos.js +16 -30
- package/lib/modules/Payment/index.d.ts +10 -9
- package/lib/modules/Payment/index.js +542 -502
- package/lib/modules/Payment/mx51.js +1 -0
- package/lib/modules/Payment/types.d.ts +40 -16
- package/lib/modules/Payment/types.js +216 -107
- package/lib/modules/Payment/utils.d.ts +1 -1
- package/lib/modules/Payment/utils.js +53 -49
- package/lib/modules/Payment/walletpass.js +231 -203
- package/lib/modules/Product/index.js +51 -46
- package/lib/modules/Product/types.d.ts +29 -7
- package/lib/modules/Product/types.js +4 -16
- package/lib/modules/Product/utils.js +32 -33
- package/lib/modules/ProductList/index.d.ts +17 -13
- package/lib/modules/ProductList/index.js +160 -118
- package/lib/modules/ProductList/types.d.ts +17 -0
- package/lib/modules/ProductList/types.js +9 -31
- package/lib/modules/Quotation/index.d.ts +22 -2
- package/lib/modules/Quotation/index.js +123 -89
- package/lib/modules/Quotation/types.d.ts +19 -0
- package/lib/modules/Quotation/types.js +4 -16
- package/lib/modules/Resource/index.js +27 -59
- package/lib/modules/Resource/types.js +22 -32
- package/lib/modules/Resource/utils.js +30 -38
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +147 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +895 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +5 -0
- package/lib/modules/Rules/index.d.ts +8 -10
- package/lib/modules/Rules/index.js +1286 -894
- package/lib/modules/Rules/types.d.ts +14 -3
- package/lib/modules/Rules/types.js +17 -40
- package/lib/modules/SalesSummary/index.d.ts +23 -26
- package/lib/modules/SalesSummary/index.js +130 -71
- package/lib/modules/SalesSummary/types.d.ts +9 -1
- package/lib/modules/SalesSummary/types.js +4 -16
- package/lib/modules/SalesSummary/utils.d.ts +3 -22
- package/lib/modules/SalesSummary/utils.js +738 -250
- package/lib/modules/ScanOrderLogger/index.js +59 -79
- package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
- package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
- package/lib/modules/ScanOrderLogger/types.js +4 -16
- package/lib/modules/Schedule/getDateIsInSchedule.js +345 -171
- package/lib/modules/Schedule/index.d.ts +18 -5
- package/lib/modules/Schedule/index.js +139 -114
- package/lib/modules/Schedule/type.js +4 -16
- package/lib/modules/Schedule/types.d.ts +2 -0
- package/lib/modules/Schedule/types.js +4 -16
- package/lib/modules/Schedule/utils.js +433 -291
- package/lib/modules/Step/index.js +40 -52
- package/lib/modules/Step/tyeps.js +4 -16
- package/lib/modules/Summary/index.js +66 -70
- package/lib/modules/Summary/types.js +4 -16
- package/lib/modules/Summary/utils.js +782 -429
- package/lib/modules/SurchargeList/index.d.ts +18 -0
- package/lib/modules/SurchargeList/index.js +95 -0
- package/lib/modules/SurchargeList/types.d.ts +15 -0
- package/lib/modules/SurchargeList/types.js +5 -0
- package/lib/modules/index.d.ts +3 -0
- package/lib/modules/index.js +245 -57
- package/lib/plugins/app.d.ts +2 -0
- package/lib/plugins/app.js +4 -16
- package/lib/plugins/index.js +36 -25
- package/lib/plugins/request.d.ts +1 -0
- package/lib/plugins/request.js +137 -126
- package/lib/plugins/shopStore.js +4 -16
- package/lib/plugins/user.js +4 -16
- package/lib/plugins/window.js +171 -179
- package/lib/server/index.d.ts +462 -8
- package/lib/server/index.js +4668 -713
- package/lib/server/modules/floor-plan/index.d.ts +39 -0
- package/lib/server/modules/floor-plan/index.js +306 -0
- package/lib/server/modules/floor-plan/types.d.ts +43 -0
- package/lib/server/modules/floor-plan/types.js +19 -0
- package/lib/server/modules/index.d.ts +7 -2
- package/lib/server/modules/index.js +106 -59
- package/lib/server/modules/menu/index.js +146 -122
- package/lib/server/modules/menu/types.js +18 -31
- package/lib/server/modules/order/index.d.ts +207 -14
- package/lib/server/modules/order/index.js +1463 -316
- package/lib/server/modules/order/types.d.ts +76 -5
- package/lib/server/modules/order/types.js +117 -32
- package/lib/server/modules/order/utils/filterBookings.d.ts +7 -1
- package/lib/server/modules/order/utils/filterBookings.js +288 -146
- package/lib/server/modules/order/utils/filterOrders.js +318 -64
- package/lib/server/modules/payment/index.d.ts +28 -0
- package/lib/server/modules/payment/index.js +168 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/payment/types.js +5 -0
- package/lib/server/modules/products/index.d.ts +105 -14
- package/lib/server/modules/products/index.js +969 -383
- package/lib/server/modules/products/types.d.ts +34 -1
- package/lib/server/modules/products/types.js +44 -34
- package/lib/server/modules/quotation/index.d.ts +39 -0
- package/lib/server/modules/quotation/index.js +220 -77
- package/lib/server/modules/quotation/types.js +21 -31
- package/lib/server/modules/resource/index.d.ts +2 -3
- package/lib/server/modules/resource/index.js +269 -214
- package/lib/server/modules/resource/types.js +42 -33
- package/lib/server/modules/schedule/index.d.ts +6 -4
- package/lib/server/modules/schedule/index.js +158 -132
- package/lib/server/modules/schedule/types.js +14 -21
- package/lib/server/modules/schedule/utils.js +334 -163
- package/lib/server/test.json +713 -0
- package/lib/server/types.d.ts +2 -0
- package/lib/server/types.js +4 -16
- package/lib/server/utils/index.js +25 -23
- package/lib/server/utils/product.js +197 -140
- package/lib/server/utils/schedule.js +34 -41
- package/lib/server/utils/small-ticket.d.ts +71 -0
- package/lib/server/utils/small-ticket.js +926 -0
- package/lib/server/utils/time.js +40 -49
- package/lib/solution/BaseSales/index.d.ts +378 -0
- package/lib/solution/BaseSales/index.js +2367 -0
- package/lib/solution/BaseSales/types.d.ts +394 -0
- package/lib/solution/BaseSales/types.js +47 -0
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +1155 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +144 -0
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +140 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +18 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +231 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +63 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +215 -0
- package/lib/solution/BaseSales/utils.d.ts +40 -0
- package/lib/solution/BaseSales/utils.js +259 -0
- package/lib/solution/BookingByStep/index.js +1530 -1343
- package/lib/solution/BookingByStep/types.js +40 -99
- package/lib/solution/BookingByStep/utils/capacity.js +192 -160
- package/lib/solution/BookingByStep/utils/products.js +42 -52
- package/lib/solution/BookingByStep/utils/resources.js +527 -330
- package/lib/solution/BookingByStep/utils/stock.js +65 -44
- package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
- package/lib/solution/BookingTicket/index.d.ts +393 -24
- package/lib/solution/BookingTicket/index.js +1459 -160
- package/lib/solution/BookingTicket/types.d.ts +191 -6
- package/lib/solution/BookingTicket/types.js +101 -66
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +353 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +94 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +136 -0
- package/lib/solution/BookingTicket/utils/cartView.d.ts +29 -0
- package/lib/solution/BookingTicket/utils/cartView.js +200 -0
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +35 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +387 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +220 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +4 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +85 -80
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +64 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -80
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +103 -95
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +115 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +83 -0
- package/lib/solution/BuyTickets/index.js +67 -70
- package/lib/solution/BuyTickets/types.js +22 -38
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +1461 -1169
- package/lib/solution/Checkout/types.js +91 -61
- package/lib/solution/Checkout/utils/index.js +228 -159
- package/lib/solution/PlaceOrder/index.js +55 -0
- package/lib/solution/RegisterAndLogin/config.js +495 -470
- package/lib/solution/RegisterAndLogin/index.js +633 -630
- package/lib/solution/RegisterAndLogin/types.js +189 -76
- package/lib/solution/RegisterAndLogin/utils.js +183 -125
- package/lib/solution/Sales/index.d.ts +50 -5
- package/lib/solution/Sales/index.js +495 -220
- package/lib/solution/Sales/types.d.ts +26 -2
- package/lib/solution/Sales/types.js +27 -33
- package/lib/solution/ScanOrder/index.d.ts +27 -21
- package/lib/solution/ScanOrder/index.js +908 -904
- package/lib/solution/ScanOrder/types.d.ts +33 -11
- package/lib/solution/ScanOrder/types.js +33 -34
- package/lib/solution/ScanOrder/utils.d.ts +4 -1
- package/lib/solution/ScanOrder/utils.js +457 -344
- package/lib/solution/ShopDiscount/index.js +230 -236
- package/lib/solution/ShopDiscount/types.js +15 -37
- package/lib/solution/ShopDiscount/utils.js +309 -172
- package/lib/solution/UnifiedBookingSales/index.d.ts +183 -0
- package/lib/solution/UnifiedBookingSales/index.js +1050 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +143 -0
- package/lib/solution/UnifiedBookingSales/types.js +14 -0
- package/lib/solution/VenueBooking/index.d.ts +34 -20
- package/lib/solution/VenueBooking/index.js +982 -950
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/solution/VenueBooking/types.js +20 -40
- package/lib/solution/VenueBooking/utils/dateSummary.js +22 -54
- package/lib/solution/VenueBooking/utils/resource.js +31 -54
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +96 -108
- package/lib/solution/VenueBooking/utils/smartPricing.js +112 -100
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -132
- package/lib/solution/VenueBooking/utils.js +130 -67
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +124 -37
- package/lib/store/createStore.js +32 -29
- package/lib/types/index.d.ts +11 -1
- package/lib/types/index.js +4 -16
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +81 -47
- package/package.json +2 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -118,19 +118,12 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
118
118
|
return this.initializeSubModules(core, options);
|
|
119
119
|
case 15:
|
|
120
120
|
_context.next = 17;
|
|
121
|
-
return this.preloadPaymentMethods();
|
|
122
|
-
case 17:
|
|
123
|
-
_context.next = 19;
|
|
124
|
-
return this.cleanupExpiredOrdersAsync();
|
|
125
|
-
case 19:
|
|
126
|
-
console.log('[Checkout] 初始化完成');
|
|
127
|
-
_context.next = 22;
|
|
128
121
|
return this.core.effects.emit("".concat(this.name, ":onCheckoutInitialized"), {
|
|
129
122
|
timestamp: Date.now()
|
|
130
123
|
});
|
|
131
|
-
case
|
|
124
|
+
case 17:
|
|
132
125
|
this.logInfo('CheckoutModule initialized successfully');
|
|
133
|
-
case
|
|
126
|
+
case 18:
|
|
134
127
|
case "end":
|
|
135
128
|
return _context.stop();
|
|
136
129
|
}
|
|
@@ -288,9 +281,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
288
281
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
289
282
|
while (1) switch (_context5.prev = _context5.next) {
|
|
290
283
|
case 0:
|
|
291
|
-
console.log('[Checkout] 收到支付方式加载完成事件:', methods.length);
|
|
292
284
|
_this2.store.paymentMethods = methods;
|
|
293
|
-
case
|
|
285
|
+
case 1:
|
|
294
286
|
case "end":
|
|
295
287
|
return _context5.stop();
|
|
296
288
|
}
|
|
@@ -307,12 +299,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
307
299
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
308
300
|
while (1) switch (_context6.prev = _context6.next) {
|
|
309
301
|
case 0:
|
|
310
|
-
console.log('[Checkout] 收到支付方式变更事件:', {
|
|
311
|
-
oldCount: data.oldMethods.length,
|
|
312
|
-
newCount: data.newMethods.length
|
|
313
|
-
});
|
|
314
302
|
_this2.store.paymentMethods = data.newMethods;
|
|
315
|
-
case
|
|
303
|
+
case 1:
|
|
316
304
|
case "end":
|
|
317
305
|
return _context6.stop();
|
|
318
306
|
}
|
|
@@ -352,21 +340,20 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
352
340
|
case 5:
|
|
353
341
|
// 保存购物车数据
|
|
354
342
|
this.store.cartItems = params.cartItems;
|
|
355
|
-
|
|
356
|
-
_context7.next = 14;
|
|
343
|
+
_context7.next = 13;
|
|
357
344
|
break;
|
|
358
|
-
case
|
|
359
|
-
_context7.prev =
|
|
345
|
+
case 8:
|
|
346
|
+
_context7.prev = 8;
|
|
360
347
|
_context7.t0 = _context7["catch"](1);
|
|
361
|
-
_context7.next =
|
|
348
|
+
_context7.next = 12;
|
|
362
349
|
return this.handleError(_context7.t0, CheckoutErrorType.UnknownError);
|
|
363
|
-
case
|
|
350
|
+
case 12:
|
|
364
351
|
throw _context7.t0;
|
|
365
|
-
case
|
|
352
|
+
case 13:
|
|
366
353
|
case "end":
|
|
367
354
|
return _context7.stop();
|
|
368
355
|
}
|
|
369
|
-
}, _callee7, this, [[1,
|
|
356
|
+
}, _callee7, this, [[1, 8]]);
|
|
370
357
|
}));
|
|
371
358
|
function initializeCheckoutAsync(_x9) {
|
|
372
359
|
return _initializeCheckoutAsync.apply(this, arguments);
|
|
@@ -668,10 +655,8 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
668
655
|
}; // 只有在有客户信息时才存储
|
|
669
656
|
if (customerInfo.customer_id || customerInfo.customer_name) {
|
|
670
657
|
this.store.currentCustomer = customerInfo;
|
|
671
|
-
console.log('[Checkout] 保存客户信息:', customerInfo);
|
|
672
658
|
} else {
|
|
673
659
|
this.store.currentCustomer = undefined;
|
|
674
|
-
console.log('[Checkout] 未提供客户信息');
|
|
675
660
|
}
|
|
676
661
|
|
|
677
662
|
// 计算是否需要支付定金,如果需要默认切换到定金模式,以及记录定金总金额,并把当前默认待付金额调整为定金总金额
|
|
@@ -1097,28 +1082,26 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1097
1082
|
timestamp: Date.now()
|
|
1098
1083
|
});
|
|
1099
1084
|
case 11:
|
|
1100
|
-
console.log('[Checkout] 结账流程完成:', order.id);
|
|
1101
|
-
|
|
1102
1085
|
// 🔧 新增:自动重置 store 状态(同步执行)
|
|
1103
1086
|
this.resetStoreState();
|
|
1104
1087
|
return _context11.abrupt("return", {
|
|
1105
1088
|
success: true,
|
|
1106
1089
|
orderId: String(order.id)
|
|
1107
1090
|
});
|
|
1108
|
-
case
|
|
1109
|
-
_context11.prev =
|
|
1091
|
+
case 15:
|
|
1092
|
+
_context11.prev = 15;
|
|
1110
1093
|
_context11.t0 = _context11["catch"](0);
|
|
1111
|
-
_context11.next =
|
|
1094
|
+
_context11.next = 19;
|
|
1112
1095
|
return this.handleError(_context11.t0, CheckoutErrorType.UnknownError);
|
|
1113
|
-
case
|
|
1096
|
+
case 19:
|
|
1114
1097
|
return _context11.abrupt("return", {
|
|
1115
1098
|
success: false
|
|
1116
1099
|
});
|
|
1117
|
-
case
|
|
1100
|
+
case 20:
|
|
1118
1101
|
case "end":
|
|
1119
1102
|
return _context11.stop();
|
|
1120
1103
|
}
|
|
1121
|
-
}, _callee11, this, [[0,
|
|
1104
|
+
}, _callee11, this, [[0, 15]]);
|
|
1122
1105
|
}));
|
|
1123
1106
|
function completeCheckoutAsync() {
|
|
1124
1107
|
return _completeCheckoutAsync.apply(this, arguments);
|
|
@@ -1150,7 +1133,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1150
1133
|
cartItems = _this$store.cartItems,
|
|
1151
1134
|
localOrderData = _this$store.localOrderData;
|
|
1152
1135
|
if (!_currentOrder) {
|
|
1153
|
-
console.log('[Checkout] 当前没有活跃订单');
|
|
1154
1136
|
return null;
|
|
1155
1137
|
}
|
|
1156
1138
|
|
|
@@ -1196,27 +1178,26 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1196
1178
|
_context12.prev = 0;
|
|
1197
1179
|
_currentOrder2 = this.store.currentOrder;
|
|
1198
1180
|
if (_currentOrder2) {
|
|
1199
|
-
_context12.next =
|
|
1181
|
+
_context12.next = 4;
|
|
1200
1182
|
break;
|
|
1201
1183
|
}
|
|
1202
|
-
console.log('[Checkout] 当前没有活跃订单,无法获取支付项');
|
|
1203
1184
|
return _context12.abrupt("return", []);
|
|
1204
|
-
case
|
|
1205
|
-
_context12.next =
|
|
1185
|
+
case 4:
|
|
1186
|
+
_context12.next = 6;
|
|
1206
1187
|
return this.payment.getPaymentItemsAsync(_currentOrder2.uuid);
|
|
1207
|
-
case
|
|
1188
|
+
case 6:
|
|
1208
1189
|
paymentItems = _context12.sent;
|
|
1209
1190
|
return _context12.abrupt("return", paymentItems);
|
|
1210
|
-
case
|
|
1211
|
-
_context12.prev =
|
|
1191
|
+
case 10:
|
|
1192
|
+
_context12.prev = 10;
|
|
1212
1193
|
_context12.t0 = _context12["catch"](0);
|
|
1213
1194
|
console.error('[Checkout] 获取当前订单支付项失败:', _context12.t0);
|
|
1214
1195
|
return _context12.abrupt("return", []);
|
|
1215
|
-
case
|
|
1196
|
+
case 14:
|
|
1216
1197
|
case "end":
|
|
1217
1198
|
return _context12.stop();
|
|
1218
1199
|
}
|
|
1219
|
-
}, _callee12, this, [[0,
|
|
1200
|
+
}, _callee12, this, [[0, 10]]);
|
|
1220
1201
|
}));
|
|
1221
1202
|
function getCurrentOrderPaymentItemsAsync() {
|
|
1222
1203
|
return _getCurrentOrderPaymentItemsAsync.apply(this, arguments);
|
|
@@ -1273,7 +1254,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1273
1254
|
case 8:
|
|
1274
1255
|
updatedOrder = _context13.sent;
|
|
1275
1256
|
if (!updatedOrder) {
|
|
1276
|
-
_context13.next =
|
|
1257
|
+
_context13.next = 19;
|
|
1277
1258
|
break;
|
|
1278
1259
|
}
|
|
1279
1260
|
// 🔧 重要:Payment.replaceOrderIdByUuidAsync 返回的是 DB 快照(只保证 order_id 变化)
|
|
@@ -1298,32 +1279,27 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1298
1279
|
timestamp: Date.now()
|
|
1299
1280
|
});
|
|
1300
1281
|
case 16:
|
|
1301
|
-
console.log('[Checkout] 本地订单ID替换成功:', {
|
|
1302
|
-
uuid: updatedOrder.uuid,
|
|
1303
|
-
newOrderId: updatedOrder.id
|
|
1304
|
-
});
|
|
1305
|
-
|
|
1306
1282
|
// 标记订单已同步(替换ID意味着订单已在后端创建)
|
|
1307
1283
|
this.store.isOrderSynced = true;
|
|
1308
1284
|
|
|
1309
1285
|
// 订单ID替换后更新 stateAmount
|
|
1310
|
-
_context13.next =
|
|
1286
|
+
_context13.next = 19;
|
|
1311
1287
|
return this.updateStateAmountToRemaining(false);
|
|
1312
|
-
case
|
|
1288
|
+
case 19:
|
|
1313
1289
|
return _context13.abrupt("return", updatedOrder);
|
|
1314
|
-
case
|
|
1315
|
-
_context13.prev =
|
|
1290
|
+
case 22:
|
|
1291
|
+
_context13.prev = 22;
|
|
1316
1292
|
_context13.t0 = _context13["catch"](0);
|
|
1317
1293
|
console.error('[Checkout] 替换订单ID失败:', _context13.t0);
|
|
1318
|
-
_context13.next =
|
|
1294
|
+
_context13.next = 27;
|
|
1319
1295
|
return this.handleError(_context13.t0, CheckoutErrorType.UnknownError);
|
|
1320
|
-
case
|
|
1296
|
+
case 27:
|
|
1321
1297
|
return _context13.abrupt("return", null);
|
|
1322
|
-
case
|
|
1298
|
+
case 28:
|
|
1323
1299
|
case "end":
|
|
1324
1300
|
return _context13.stop();
|
|
1325
1301
|
}
|
|
1326
|
-
}, _callee13, this, [[0,
|
|
1302
|
+
}, _callee13, this, [[0, 22]]);
|
|
1327
1303
|
}));
|
|
1328
1304
|
function replaceLocalOrderIdAsync(_x13) {
|
|
1329
1305
|
return _replaceLocalOrderIdAsync.apply(this, arguments);
|
|
@@ -1970,12 +1946,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1970
1946
|
newDepositValue = isDeposit;
|
|
1971
1947
|
oldDepositValue = this.store.currentOrder.is_deposit; // 如果状态没有变化,直接返回
|
|
1972
1948
|
if (!(oldDepositValue === newDepositValue)) {
|
|
1973
|
-
_context19.next =
|
|
1949
|
+
_context19.next = 9;
|
|
1974
1950
|
break;
|
|
1975
1951
|
}
|
|
1976
|
-
console.log('[Checkout] 定金状态无变化,跳过更新');
|
|
1977
1952
|
return _context19.abrupt("return");
|
|
1978
|
-
case
|
|
1953
|
+
case 9:
|
|
1979
1954
|
deposit_amount = this.store.currentOrder.deposit_amount || '0.00'; // 如果原来没有 deposit_amount,则默认把待付金额置为 deposit_amount
|
|
1980
1955
|
if (!deposit_amount || Number(deposit_amount) === 0) {
|
|
1981
1956
|
deposit_amount = this.store.currentOrder.expect_amount;
|
|
@@ -1994,9 +1969,9 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1994
1969
|
// this.logInfo('订单从定金改为全款,清空定金金额');
|
|
1995
1970
|
// }
|
|
1996
1971
|
// 调用 Payment 模块更新订单
|
|
1997
|
-
_context19.next =
|
|
1972
|
+
_context19.next = 14;
|
|
1998
1973
|
return this.payment.updateOrderAsync(this.store.currentOrder.uuid, updateParams);
|
|
1999
|
-
case
|
|
1974
|
+
case 14:
|
|
2000
1975
|
// 更新本地缓存的订单对象
|
|
2001
1976
|
this.store.currentOrder = _objectSpread(_objectSpread({}, this.store.currentOrder), updateParams);
|
|
2002
1977
|
|
|
@@ -2010,31 +1985,31 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2010
1985
|
this.updateStateAmountToRemaining(false);
|
|
2011
1986
|
|
|
2012
1987
|
// 触发订单更新事件
|
|
2013
|
-
_context19.next =
|
|
1988
|
+
_context19.next = 20;
|
|
2014
1989
|
return this.core.effects.emit("".concat(this.name, ":onOrderCreated"), {
|
|
2015
1990
|
order: this.store.currentOrder,
|
|
2016
1991
|
timestamp: Date.now()
|
|
2017
1992
|
});
|
|
2018
|
-
case
|
|
1993
|
+
case 20:
|
|
2019
1994
|
this.logInfo('订单定金状态更新成功:', {
|
|
2020
1995
|
isDeposit: newDepositValue,
|
|
2021
1996
|
depositAmount: this.store.currentOrder.deposit_amount
|
|
2022
1997
|
});
|
|
2023
|
-
_context19.next =
|
|
1998
|
+
_context19.next = 29;
|
|
2024
1999
|
break;
|
|
2025
|
-
case
|
|
2026
|
-
_context19.prev =
|
|
2000
|
+
case 23:
|
|
2001
|
+
_context19.prev = 23;
|
|
2027
2002
|
_context19.t0 = _context19["catch"](0);
|
|
2028
2003
|
this.logError('更新订单定金状态失败:', _context19.t0);
|
|
2029
|
-
_context19.next =
|
|
2004
|
+
_context19.next = 28;
|
|
2030
2005
|
return this.handleError(_context19.t0, CheckoutErrorType.ValidationFailed);
|
|
2031
|
-
case
|
|
2006
|
+
case 28:
|
|
2032
2007
|
throw _context19.t0;
|
|
2033
|
-
case
|
|
2008
|
+
case 29:
|
|
2034
2009
|
case "end":
|
|
2035
2010
|
return _context19.stop();
|
|
2036
2011
|
}
|
|
2037
|
-
}, _callee19, this, [[0,
|
|
2012
|
+
}, _callee19, this, [[0, 23]]);
|
|
2038
2013
|
}));
|
|
2039
2014
|
function updateOrderDepositStatusAsync(_x19) {
|
|
2040
2015
|
return _updateOrderDepositStatusAsync.apply(this, arguments);
|
|
@@ -2189,7 +2164,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2189
2164
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2190
2165
|
while (1) switch (_context21.prev = _context21.next) {
|
|
2191
2166
|
case 0:
|
|
2192
|
-
console.log('manualSyncOrderAsync called');
|
|
2193
2167
|
this.logInfo('manualSyncOrderAsync called', {
|
|
2194
2168
|
hasCurrentOrder: !!this.store.currentOrder,
|
|
2195
2169
|
currentOrderId: (_this$store$currentOr15 = this.store.currentOrder) === null || _this$store$currentOr15 === void 0 ? void 0 : _this$store$currentOr15.order_id,
|
|
@@ -2198,16 +2172,16 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2198
2172
|
isOrderSynced: this.store.isOrderSynced,
|
|
2199
2173
|
isVirtualOrderId: this.store.currentOrder ? isVirtualOrderId(this.store.currentOrder.order_id) : false
|
|
2200
2174
|
});
|
|
2201
|
-
_context21.prev =
|
|
2175
|
+
_context21.prev = 1;
|
|
2202
2176
|
if (this.store.currentOrder) {
|
|
2203
|
-
_context21.next =
|
|
2177
|
+
_context21.next = 4;
|
|
2204
2178
|
break;
|
|
2205
2179
|
}
|
|
2206
2180
|
return _context21.abrupt("return", {
|
|
2207
2181
|
success: false,
|
|
2208
2182
|
message: '当前没有活跃订单,无法同步'
|
|
2209
2183
|
});
|
|
2210
|
-
case
|
|
2184
|
+
case 4:
|
|
2211
2185
|
orderUuid = this.store.currentOrder.uuid;
|
|
2212
2186
|
oldOrderId = this.store.currentOrder.order_id; // 检查订单是否已经同步
|
|
2213
2187
|
if (this.store.isOrderSynced) {
|
|
@@ -2217,9 +2191,9 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2217
2191
|
_context21.t1 = orderUuid;
|
|
2218
2192
|
_context21.t2 = oldOrderId;
|
|
2219
2193
|
_context21.t3 = this.store.currentOrder.total_amount;
|
|
2220
|
-
_context21.next =
|
|
2194
|
+
_context21.next = 13;
|
|
2221
2195
|
return this.calculateRemainingAmountAsync();
|
|
2222
|
-
case
|
|
2196
|
+
case 13:
|
|
2223
2197
|
_context21.t4 = _context21.sent;
|
|
2224
2198
|
_context21.t5 = {
|
|
2225
2199
|
orderUuid: _context21.t1,
|
|
@@ -2228,14 +2202,10 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2228
2202
|
remainingAmount: _context21.t4
|
|
2229
2203
|
};
|
|
2230
2204
|
_context21.t0.logInfo.call(_context21.t0, '开始手动同步订单到后端:', _context21.t5);
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
// 强制同步订单到后端,并获取完整响应数据
|
|
2234
|
-
_context21.next = 20;
|
|
2205
|
+
_context21.next = 18;
|
|
2235
2206
|
return this.syncOrderToBackendWithReturn(true);
|
|
2236
|
-
case
|
|
2207
|
+
case 18:
|
|
2237
2208
|
syncResult = _context21.sent;
|
|
2238
|
-
console.timeEnd('manualSyncOrderAsync');
|
|
2239
2209
|
this.logInfo('手动同步订单完成:', {
|
|
2240
2210
|
orderUuid: orderUuid,
|
|
2241
2211
|
syncResult: syncResult,
|
|
@@ -2256,13 +2226,13 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2256
2226
|
newRes = _objectSpread(_objectSpread({}, syncResult), {}, {
|
|
2257
2227
|
is_deposit: ((_this$store$currentOr18 = this.store.currentOrder) === null || _this$store$currentOr18 === void 0 ? void 0 : _this$store$currentOr18.is_deposit) || 0
|
|
2258
2228
|
});
|
|
2259
|
-
_context21.next =
|
|
2229
|
+
_context21.next = 27;
|
|
2260
2230
|
return this.updateStateAmountToRemaining(false);
|
|
2261
|
-
case
|
|
2231
|
+
case 27:
|
|
2262
2232
|
return _context21.abrupt("return", newRes);
|
|
2263
|
-
case
|
|
2264
|
-
_context21.prev =
|
|
2265
|
-
_context21.t6 = _context21["catch"](
|
|
2233
|
+
case 30:
|
|
2234
|
+
_context21.prev = 30;
|
|
2235
|
+
_context21.t6 = _context21["catch"](1);
|
|
2266
2236
|
this.logError('手动同步订单失败:', _context21.t6);
|
|
2267
2237
|
errorMessage = _context21.t6 instanceof Error ? _context21.t6.message : '同步失败';
|
|
2268
2238
|
return _context21.abrupt("return", {
|
|
@@ -2270,11 +2240,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2270
2240
|
message: "\u8BA2\u5355\u540C\u6B65\u5931\u8D25: ".concat(errorMessage),
|
|
2271
2241
|
orderUuid: (_this$store$currentOr19 = this.store.currentOrder) === null || _this$store$currentOr19 === void 0 ? void 0 : _this$store$currentOr19.uuid
|
|
2272
2242
|
});
|
|
2273
|
-
case
|
|
2243
|
+
case 35:
|
|
2274
2244
|
case "end":
|
|
2275
2245
|
return _context21.stop();
|
|
2276
2246
|
}
|
|
2277
|
-
}, _callee21, this, [[
|
|
2247
|
+
}, _callee21, this, [[1, 30]]);
|
|
2278
2248
|
}));
|
|
2279
2249
|
function manualSyncOrderAsync() {
|
|
2280
2250
|
return _manualSyncOrderAsync.apply(this, arguments);
|
|
@@ -2291,7 +2261,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2291
2261
|
key: "getOrderNote",
|
|
2292
2262
|
value: function getOrderNote() {
|
|
2293
2263
|
if (!this.store.localOrderData) {
|
|
2294
|
-
console.log('[Checkout] 没有本地订单数据,无法获取备注');
|
|
2295
2264
|
return '';
|
|
2296
2265
|
}
|
|
2297
2266
|
return this.store.localOrderData.shop_note || '';
|
|
@@ -2321,15 +2290,9 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2321
2290
|
value: function isCurrentOrderSynced() {
|
|
2322
2291
|
// 如果没有当前订单,返回false
|
|
2323
2292
|
if (!this.store.currentOrder) {
|
|
2324
|
-
console.log('[Checkout] 没有当前订单,同步状态为false');
|
|
2325
2293
|
return false;
|
|
2326
2294
|
}
|
|
2327
2295
|
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
|
-
});
|
|
2333
2296
|
return syncStatus;
|
|
2334
2297
|
}
|
|
2335
2298
|
|
|
@@ -2548,7 +2511,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2548
2511
|
key: "updateOrderNoteAsync",
|
|
2549
2512
|
value: (function () {
|
|
2550
2513
|
var _updateOrderNoteAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(note) {
|
|
2551
|
-
var _this$store$currentOr23,
|
|
2514
|
+
var _this$store$currentOr23, oldNote, orderInPayment;
|
|
2552
2515
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2553
2516
|
while (1) switch (_context24.prev = _context24.next) {
|
|
2554
2517
|
case 0:
|
|
@@ -2559,65 +2522,51 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2559
2522
|
}
|
|
2560
2523
|
throw createCheckoutError(CheckoutErrorType.ValidationFailed, '没有本地订单数据,无法更新备注');
|
|
2561
2524
|
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
|
-
|
|
2568
2525
|
// 更新备注
|
|
2569
2526
|
oldNote = this.store.localOrderData.shop_note;
|
|
2570
2527
|
this.store.localOrderData.shop_note = note;
|
|
2571
2528
|
|
|
2572
2529
|
// 如果有当前订单,也同步到Payment模块中的订单数据
|
|
2573
2530
|
if (!this.store.currentOrder) {
|
|
2574
|
-
_context24.next =
|
|
2531
|
+
_context24.next = 16;
|
|
2575
2532
|
break;
|
|
2576
2533
|
}
|
|
2577
|
-
_context24.prev =
|
|
2578
|
-
_context24.next =
|
|
2534
|
+
_context24.prev = 6;
|
|
2535
|
+
_context24.next = 9;
|
|
2579
2536
|
return this.payment.getPaymentOrderByUuidAsync(this.store.currentOrder.uuid);
|
|
2580
|
-
case
|
|
2537
|
+
case 9:
|
|
2581
2538
|
orderInPayment = _context24.sent;
|
|
2582
|
-
if (orderInPayment && orderInPayment.note !== undefined) {
|
|
2583
|
-
|
|
2584
|
-
// 这里可能需要根据Payment模块的实际API来调整
|
|
2585
|
-
console.log('[Checkout] 同步备注到Payment模块的订单数据中');
|
|
2586
|
-
}
|
|
2587
|
-
_context24.next = 17;
|
|
2539
|
+
if (orderInPayment && orderInPayment.note !== undefined) {}
|
|
2540
|
+
_context24.next = 16;
|
|
2588
2541
|
break;
|
|
2589
|
-
case
|
|
2590
|
-
_context24.prev =
|
|
2591
|
-
_context24.t0 = _context24["catch"](
|
|
2542
|
+
case 13:
|
|
2543
|
+
_context24.prev = 13;
|
|
2544
|
+
_context24.t0 = _context24["catch"](6);
|
|
2592
2545
|
console.warn('[Checkout] 同步备注到Payment模块失败,但本地更新成功:', _context24.t0);
|
|
2593
|
-
case
|
|
2594
|
-
_context24.next =
|
|
2546
|
+
case 16:
|
|
2547
|
+
_context24.next = 18;
|
|
2595
2548
|
return this.core.effects.emit("".concat(this.name, ":onOrderNoteChanged"), {
|
|
2596
|
-
orderUuid: (_this$store$
|
|
2549
|
+
orderUuid: (_this$store$currentOr23 = this.store.currentOrder) === null || _this$store$currentOr23 === void 0 ? void 0 : _this$store$currentOr23.uuid,
|
|
2597
2550
|
oldNote: oldNote,
|
|
2598
2551
|
newNote: note,
|
|
2599
2552
|
timestamp: Date.now()
|
|
2600
2553
|
});
|
|
2601
|
-
case
|
|
2602
|
-
|
|
2603
|
-
oldNote: oldNote,
|
|
2604
|
-
newNote: note
|
|
2605
|
-
});
|
|
2606
|
-
_context24.next = 28;
|
|
2554
|
+
case 18:
|
|
2555
|
+
_context24.next = 26;
|
|
2607
2556
|
break;
|
|
2608
|
-
case
|
|
2609
|
-
_context24.prev =
|
|
2557
|
+
case 20:
|
|
2558
|
+
_context24.prev = 20;
|
|
2610
2559
|
_context24.t1 = _context24["catch"](0);
|
|
2611
2560
|
console.error('[Checkout] 更新订单备注失败:', _context24.t1);
|
|
2612
|
-
_context24.next =
|
|
2561
|
+
_context24.next = 25;
|
|
2613
2562
|
return this.handleError(_context24.t1, CheckoutErrorType.ValidationFailed);
|
|
2614
|
-
case
|
|
2563
|
+
case 25:
|
|
2615
2564
|
throw _context24.t1;
|
|
2616
|
-
case
|
|
2565
|
+
case 26:
|
|
2617
2566
|
case "end":
|
|
2618
2567
|
return _context24.stop();
|
|
2619
2568
|
}
|
|
2620
|
-
}, _callee24, this, [[0,
|
|
2569
|
+
}, _callee24, this, [[0, 20], [6, 13]]);
|
|
2621
2570
|
}));
|
|
2622
2571
|
function updateOrderNoteAsync(_x22) {
|
|
2623
2572
|
return _updateOrderNoteAsync.apply(this, arguments);
|
|
@@ -2665,7 +2614,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2665
2614
|
key: "handlePaymentSuccess",
|
|
2666
2615
|
value: (function () {
|
|
2667
2616
|
var _handlePaymentSuccess = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(data) {
|
|
2668
|
-
var _this$store$
|
|
2617
|
+
var _this$store$currentOr24;
|
|
2669
2618
|
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2670
2619
|
while (1) switch (_context26.prev = _context26.next) {
|
|
2671
2620
|
case 0:
|
|
@@ -2676,7 +2625,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2676
2625
|
return this.core.effects.emit("".concat(this.name, ":onPaymentSuccess"), {
|
|
2677
2626
|
orderUuid: data.orderUuid,
|
|
2678
2627
|
paymentMethodCode: '',
|
|
2679
|
-
amount: ((_this$store$
|
|
2628
|
+
amount: ((_this$store$currentOr24 = this.store.currentOrder) === null || _this$store$currentOr24 === void 0 ? void 0 : _this$store$currentOr24.total_amount) || '0',
|
|
2680
2629
|
timestamp: data.timestamp
|
|
2681
2630
|
});
|
|
2682
2631
|
case 4:
|
|
@@ -2701,7 +2650,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2701
2650
|
key: "handlePaymentError",
|
|
2702
2651
|
value: (function () {
|
|
2703
2652
|
var _handlePaymentError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(data) {
|
|
2704
|
-
var _this$store$
|
|
2653
|
+
var _this$store$currentOr25;
|
|
2705
2654
|
var error;
|
|
2706
2655
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2707
2656
|
while (1) switch (_context27.prev = _context27.next) {
|
|
@@ -2714,7 +2663,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2714
2663
|
return this.core.effects.emit("".concat(this.name, ":onPaymentFailed"), {
|
|
2715
2664
|
orderUuid: data.orderUuid,
|
|
2716
2665
|
paymentMethodCode: '',
|
|
2717
|
-
amount: ((_this$store$
|
|
2666
|
+
amount: ((_this$store$currentOr25 = this.store.currentOrder) === null || _this$store$currentOr25 === void 0 ? void 0 : _this$store$currentOr25.total_amount) || '0',
|
|
2718
2667
|
timestamp: data.timestamp
|
|
2719
2668
|
});
|
|
2720
2669
|
case 5:
|
|
@@ -2748,7 +2697,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2748
2697
|
key: "processCashPaymentItem",
|
|
2749
2698
|
value: (function () {
|
|
2750
2699
|
var _processCashPaymentItem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(paymentItem) {
|
|
2751
|
-
var cashPayment, remainingAmountStr, remainingAmount, cashAmount, changeAmount, processedPaymentItem;
|
|
2700
|
+
var cashPayment, remainingAmountStr, remainingAmount, cashAmount, roundingAmount, chargeAmount, changeAmount, processedPaymentItem;
|
|
2752
2701
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2753
2702
|
while (1) switch (_context28.prev = _context28.next) {
|
|
2754
2703
|
case 0:
|
|
@@ -2766,41 +2715,35 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2766
2715
|
case 6:
|
|
2767
2716
|
remainingAmountStr = _context28.sent;
|
|
2768
2717
|
remainingAmount = new Decimal(remainingAmountStr);
|
|
2769
|
-
cashAmount = new Decimal(String(paymentItem.amount));
|
|
2718
|
+
cashAmount = new Decimal(String(paymentItem.amount));
|
|
2719
|
+
roundingAmount = new Decimal(String(paymentItem.rounding_amount || '0')); // 如果现金金额小于等于剩余待付金额,无需找零
|
|
2770
2720
|
if (!cashAmount.lte(remainingAmount)) {
|
|
2771
|
-
_context28.next =
|
|
2721
|
+
_context28.next = 12;
|
|
2772
2722
|
break;
|
|
2773
2723
|
}
|
|
2774
2724
|
return _context28.abrupt("return", paymentItem);
|
|
2775
|
-
case
|
|
2776
|
-
//
|
|
2777
|
-
|
|
2778
|
-
if (!(
|
|
2779
|
-
_context28.next =
|
|
2780
|
-
break;
|
|
2781
|
-
}
|
|
2782
|
-
if (!(Number(paymentItem.rounding_amount) === changeAmount.toNumber())) {
|
|
2783
|
-
_context28.next = 17;
|
|
2725
|
+
case 12:
|
|
2726
|
+
// 超付场景使用 rounding 回算应收金额(兼容 UI 已做抹零 + 允许超付)
|
|
2727
|
+
chargeAmount = Decimal.max(remainingAmount.add(roundingAmount), new Decimal(0));
|
|
2728
|
+
if (!cashAmount.lte(chargeAmount)) {
|
|
2729
|
+
_context28.next = 15;
|
|
2784
2730
|
break;
|
|
2785
2731
|
}
|
|
2786
2732
|
return _context28.abrupt("return", paymentItem);
|
|
2787
|
-
case
|
|
2788
|
-
//
|
|
2789
|
-
remainingAmount = remainingAmount.add(new Decimal(paymentItem.rounding_amount || '0'));
|
|
2790
|
-
case 18:
|
|
2791
|
-
// 创建包含找零信息的支付项
|
|
2733
|
+
case 15:
|
|
2734
|
+
changeAmount = cashAmount.sub(chargeAmount); // 创建包含找零信息的支付项
|
|
2792
2735
|
processedPaymentItem = _objectSpread(_objectSpread({}, paymentItem), {}, {
|
|
2793
|
-
amount:
|
|
2794
|
-
// 将 amount 设置为剩余待付金额,保留2位小数
|
|
2736
|
+
amount: chargeAmount.toFixed(2),
|
|
2795
2737
|
metadata: _objectSpread(_objectSpread({}, paymentItem.metadata), {}, {
|
|
2796
2738
|
actual_paid_amount: cashAmount.toNumber(),
|
|
2797
|
-
|
|
2798
|
-
change_given_amount: changeAmount.toNumber() // 找零金额
|
|
2739
|
+
change_given_amount: changeAmount.toNumber()
|
|
2799
2740
|
})
|
|
2800
2741
|
});
|
|
2801
2742
|
this.logInfo('Cash payment with change processed', {
|
|
2802
2743
|
originalAmount: cashAmount.toFixed(2),
|
|
2803
|
-
|
|
2744
|
+
remainingAmount: remainingAmount.toFixed(2),
|
|
2745
|
+
roundingAmount: roundingAmount.toFixed(2),
|
|
2746
|
+
chargedAmount: chargeAmount.toFixed(2),
|
|
2804
2747
|
changeAmount: changeAmount.toFixed(2),
|
|
2805
2748
|
paymentCode: paymentItem.code,
|
|
2806
2749
|
paymentType: paymentItem.type,
|
|
@@ -2808,21 +2751,23 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2808
2751
|
decimalPrecisionCheck: {
|
|
2809
2752
|
cashAmountPrecise: cashAmount.toString(),
|
|
2810
2753
|
remainingAmountPrecise: remainingAmount.toString(),
|
|
2754
|
+
roundingAmountPrecise: roundingAmount.toString(),
|
|
2755
|
+
chargeAmountPrecise: chargeAmount.toString(),
|
|
2811
2756
|
changeAmountPrecise: changeAmount.toString()
|
|
2812
2757
|
}
|
|
2813
2758
|
});
|
|
2814
2759
|
return _context28.abrupt("return", processedPaymentItem);
|
|
2815
|
-
case
|
|
2816
|
-
_context28.prev =
|
|
2760
|
+
case 21:
|
|
2761
|
+
_context28.prev = 21;
|
|
2817
2762
|
_context28.t0 = _context28["catch"](3);
|
|
2818
2763
|
this.logError('处理现金支付项时出错:', _context28.t0);
|
|
2819
2764
|
// 出错时返回原始支付项,避免中断支付流程
|
|
2820
2765
|
return _context28.abrupt("return", paymentItem);
|
|
2821
|
-
case
|
|
2766
|
+
case 25:
|
|
2822
2767
|
case "end":
|
|
2823
2768
|
return _context28.stop();
|
|
2824
2769
|
}
|
|
2825
|
-
}, _callee28, this, [[3,
|
|
2770
|
+
}, _callee28, this, [[3, 21]]);
|
|
2826
2771
|
}));
|
|
2827
2772
|
function processCashPaymentItem(_x27) {
|
|
2828
2773
|
return _processCashPaymentItem.apply(this, arguments);
|
|
@@ -2842,25 +2787,23 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2842
2787
|
while (1) switch (_context29.prev = _context29.next) {
|
|
2843
2788
|
case 0:
|
|
2844
2789
|
_context29.prev = 0;
|
|
2845
|
-
|
|
2846
|
-
_context29.next = 4;
|
|
2790
|
+
_context29.next = 3;
|
|
2847
2791
|
return this.payment.getPayMethodListAsync();
|
|
2848
|
-
case
|
|
2792
|
+
case 3:
|
|
2849
2793
|
methods = _context29.sent;
|
|
2850
2794
|
this.store.paymentMethods = methods;
|
|
2851
|
-
|
|
2852
|
-
_context29.next = 13;
|
|
2795
|
+
_context29.next = 11;
|
|
2853
2796
|
break;
|
|
2854
|
-
case
|
|
2855
|
-
_context29.prev =
|
|
2797
|
+
case 7:
|
|
2798
|
+
_context29.prev = 7;
|
|
2856
2799
|
_context29.t0 = _context29["catch"](0);
|
|
2857
2800
|
console.error('[Checkout] 预加载支付方式失败:', _context29.t0);
|
|
2858
2801
|
this.store.paymentMethods = [];
|
|
2859
|
-
case
|
|
2802
|
+
case 11:
|
|
2860
2803
|
case "end":
|
|
2861
2804
|
return _context29.stop();
|
|
2862
2805
|
}
|
|
2863
|
-
}, _callee29, this, [[0,
|
|
2806
|
+
}, _callee29, this, [[0, 7]]);
|
|
2864
2807
|
}));
|
|
2865
2808
|
function preloadPaymentMethods() {
|
|
2866
2809
|
return _preloadPaymentMethods.apply(this, arguments);
|
|
@@ -2872,6 +2815,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2872
2815
|
*
|
|
2873
2816
|
* 删除本地 IndexDB 中超过指定天数且已同步到后端的订单数据
|
|
2874
2817
|
*/
|
|
2818
|
+
/** @deprecated */
|
|
2875
2819
|
)
|
|
2876
2820
|
}, {
|
|
2877
2821
|
key: "cleanupExpiredOrdersAsync",
|
|
@@ -2888,48 +2832,43 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2888
2832
|
retentionDays = cleanupConfig.retentionDays || 7; // 默认保留7天
|
|
2889
2833
|
maxOrdersToDelete = cleanupConfig.maxOrdersToDelete || 100; // 默认最多删除100个订单
|
|
2890
2834
|
if (isCleanupEnabled) {
|
|
2891
|
-
_context30.next =
|
|
2835
|
+
_context30.next = 7;
|
|
2892
2836
|
break;
|
|
2893
2837
|
}
|
|
2894
|
-
console.log('[Checkout] 订单数据清理功能已禁用');
|
|
2895
2838
|
return _context30.abrupt("return");
|
|
2896
|
-
case
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
// 获取所有订单
|
|
2900
|
-
_context30.next = 11;
|
|
2839
|
+
case 7:
|
|
2840
|
+
_context30.next = 9;
|
|
2901
2841
|
return this.payment.getOrderListAsync();
|
|
2902
|
-
case
|
|
2842
|
+
case 9:
|
|
2903
2843
|
allOrders = _context30.sent;
|
|
2904
2844
|
if (!(!allOrders || allOrders.length === 0)) {
|
|
2905
|
-
_context30.next =
|
|
2845
|
+
_context30.next = 12;
|
|
2906
2846
|
break;
|
|
2907
2847
|
}
|
|
2908
|
-
console.log('[Checkout] 没有找到需要清理的订单数据');
|
|
2909
2848
|
return _context30.abrupt("return");
|
|
2910
|
-
case
|
|
2849
|
+
case 12:
|
|
2911
2850
|
thresholdDate = new Date();
|
|
2912
2851
|
thresholdDate.setDate(thresholdDate.getDate() - retentionDays);
|
|
2913
2852
|
deletedCount = 0;
|
|
2914
2853
|
ordersToDelete = [];
|
|
2915
2854
|
_iterator = _createForOfIteratorHelper(allOrders);
|
|
2916
|
-
_context30.prev =
|
|
2855
|
+
_context30.prev = 17;
|
|
2917
2856
|
_iterator.s();
|
|
2918
|
-
case
|
|
2857
|
+
case 19:
|
|
2919
2858
|
if ((_step = _iterator.n()).done) {
|
|
2920
|
-
_context30.next =
|
|
2859
|
+
_context30.next = 38;
|
|
2921
2860
|
break;
|
|
2922
2861
|
}
|
|
2923
2862
|
order = _step.value;
|
|
2924
|
-
_context30.prev =
|
|
2863
|
+
_context30.prev = 21;
|
|
2925
2864
|
// 检查订单是否已同步(订单ID不是虚拟ID)
|
|
2926
2865
|
isSynced = order.order_id && !isVirtualOrderId(order.order_id);
|
|
2927
2866
|
if (isSynced) {
|
|
2928
|
-
_context30.next =
|
|
2867
|
+
_context30.next = 25;
|
|
2929
2868
|
break;
|
|
2930
2869
|
}
|
|
2931
|
-
return _context30.abrupt("continue",
|
|
2932
|
-
case
|
|
2870
|
+
return _context30.abrupt("continue", 36);
|
|
2871
|
+
case 25:
|
|
2933
2872
|
// 检查创建时间
|
|
2934
2873
|
orderCreatedAt = null; // 尝试从 order_info.created_at 获取创建时间
|
|
2935
2874
|
if ((_order$order_info = order.order_info) !== null && _order$order_info !== void 0 && _order$order_info.created_at) {
|
|
@@ -2942,11 +2881,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2942
2881
|
|
|
2943
2882
|
// 如果无法获取创建时间,跳过此订单
|
|
2944
2883
|
if (!(!orderCreatedAt || isNaN(orderCreatedAt.getTime()))) {
|
|
2945
|
-
_context30.next =
|
|
2884
|
+
_context30.next = 29;
|
|
2946
2885
|
break;
|
|
2947
2886
|
}
|
|
2948
|
-
return _context30.abrupt("continue",
|
|
2949
|
-
case
|
|
2887
|
+
return _context30.abrupt("continue", 36);
|
|
2888
|
+
case 29:
|
|
2950
2889
|
// 检查是否超过指定天数
|
|
2951
2890
|
if (orderCreatedAt < thresholdDate) {
|
|
2952
2891
|
ordersToDelete.push({
|
|
@@ -2956,69 +2895,68 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2956
2895
|
daysSinceCreated: Math.floor((Date.now() - orderCreatedAt.getTime()) / (1000 * 60 * 60 * 24))
|
|
2957
2896
|
});
|
|
2958
2897
|
}
|
|
2959
|
-
_context30.next =
|
|
2898
|
+
_context30.next = 36;
|
|
2960
2899
|
break;
|
|
2961
|
-
case
|
|
2962
|
-
_context30.prev =
|
|
2963
|
-
_context30.t0 = _context30["catch"](
|
|
2900
|
+
case 32:
|
|
2901
|
+
_context30.prev = 32;
|
|
2902
|
+
_context30.t0 = _context30["catch"](21);
|
|
2964
2903
|
console.warn("[Checkout] \u5904\u7406\u8BA2\u5355 ".concat(order.uuid, " \u65F6\u51FA\u9519:"), _context30.t0);
|
|
2965
|
-
return _context30.abrupt("continue",
|
|
2966
|
-
case
|
|
2967
|
-
_context30.next =
|
|
2904
|
+
return _context30.abrupt("continue", 36);
|
|
2905
|
+
case 36:
|
|
2906
|
+
_context30.next = 19;
|
|
2968
2907
|
break;
|
|
2969
|
-
case
|
|
2970
|
-
_context30.next =
|
|
2908
|
+
case 38:
|
|
2909
|
+
_context30.next = 43;
|
|
2971
2910
|
break;
|
|
2911
|
+
case 40:
|
|
2912
|
+
_context30.prev = 40;
|
|
2913
|
+
_context30.t1 = _context30["catch"](17);
|
|
2914
|
+
_iterator.e(_context30.t1);
|
|
2972
2915
|
case 43:
|
|
2973
2916
|
_context30.prev = 43;
|
|
2974
|
-
_context30.t1 = _context30["catch"](20);
|
|
2975
|
-
_iterator.e(_context30.t1);
|
|
2976
|
-
case 46:
|
|
2977
|
-
_context30.prev = 46;
|
|
2978
2917
|
_iterator.f();
|
|
2979
|
-
return _context30.finish(
|
|
2980
|
-
case
|
|
2918
|
+
return _context30.finish(43);
|
|
2919
|
+
case 46:
|
|
2981
2920
|
// 按创建时间排序(最老的先删除)并限制删除数量
|
|
2982
2921
|
ordersToDelete.sort(function (a, b) {
|
|
2983
2922
|
return new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime();
|
|
2984
2923
|
});
|
|
2985
2924
|
actualOrdersToDelete = ordersToDelete.slice(0, maxOrdersToDelete); // 删除符合条件的订单
|
|
2986
2925
|
_iterator2 = _createForOfIteratorHelper(actualOrdersToDelete);
|
|
2987
|
-
_context30.prev =
|
|
2926
|
+
_context30.prev = 49;
|
|
2988
2927
|
_iterator2.s();
|
|
2989
|
-
case
|
|
2928
|
+
case 51:
|
|
2990
2929
|
if ((_step2 = _iterator2.n()).done) {
|
|
2991
|
-
_context30.next =
|
|
2930
|
+
_context30.next = 64;
|
|
2992
2931
|
break;
|
|
2993
2932
|
}
|
|
2994
2933
|
orderInfo = _step2.value;
|
|
2995
|
-
_context30.prev =
|
|
2996
|
-
_context30.next =
|
|
2934
|
+
_context30.prev = 53;
|
|
2935
|
+
_context30.next = 56;
|
|
2997
2936
|
return this.payment.deletePaymentOrderAsync(orderInfo.uuid);
|
|
2998
|
-
case
|
|
2937
|
+
case 56:
|
|
2999
2938
|
deletedCount++;
|
|
3000
|
-
|
|
3001
|
-
_context30.next = 66;
|
|
2939
|
+
_context30.next = 62;
|
|
3002
2940
|
break;
|
|
3003
|
-
case
|
|
3004
|
-
_context30.prev =
|
|
3005
|
-
_context30.t2 = _context30["catch"](
|
|
2941
|
+
case 59:
|
|
2942
|
+
_context30.prev = 59;
|
|
2943
|
+
_context30.t2 = _context30["catch"](53);
|
|
3006
2944
|
console.error("[Checkout] \u5220\u9664\u8BA2\u5355 ".concat(orderInfo.uuid, " \u5931\u8D25:"), _context30.t2);
|
|
3007
|
-
case
|
|
3008
|
-
_context30.next =
|
|
2945
|
+
case 62:
|
|
2946
|
+
_context30.next = 51;
|
|
3009
2947
|
break;
|
|
3010
|
-
case
|
|
3011
|
-
_context30.next =
|
|
2948
|
+
case 64:
|
|
2949
|
+
_context30.next = 69;
|
|
3012
2950
|
break;
|
|
3013
|
-
case
|
|
3014
|
-
_context30.prev =
|
|
3015
|
-
_context30.t3 = _context30["catch"](
|
|
2951
|
+
case 66:
|
|
2952
|
+
_context30.prev = 66;
|
|
2953
|
+
_context30.t3 = _context30["catch"](49);
|
|
3016
2954
|
_iterator2.e(_context30.t3);
|
|
3017
|
-
case
|
|
3018
|
-
_context30.prev =
|
|
2955
|
+
case 69:
|
|
2956
|
+
_context30.prev = 69;
|
|
3019
2957
|
_iterator2.f();
|
|
3020
|
-
return _context30.finish(
|
|
3021
|
-
case
|
|
2958
|
+
return _context30.finish(69);
|
|
2959
|
+
case 72:
|
|
3022
2960
|
summary = {
|
|
3023
2961
|
totalOrders: allOrders.length,
|
|
3024
2962
|
expiredSyncedOrders: ordersToDelete.length,
|
|
@@ -3030,26 +2968,22 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3030
2968
|
skippedOrders: Math.max(0, ordersToDelete.length - maxOrdersToDelete)
|
|
3031
2969
|
}; // 记录清理结果
|
|
3032
2970
|
this.logInfo('Expired orders cleanup completed', summary);
|
|
3033
|
-
if (ordersToDelete.length > maxOrdersToDelete) {
|
|
3034
|
-
|
|
3035
|
-
} else {
|
|
3036
|
-
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"));
|
|
3037
|
-
}
|
|
3038
|
-
_context30.next = 86;
|
|
2971
|
+
if (ordersToDelete.length > maxOrdersToDelete) {} else {}
|
|
2972
|
+
_context30.next = 82;
|
|
3039
2973
|
break;
|
|
3040
|
-
case
|
|
3041
|
-
_context30.prev =
|
|
2974
|
+
case 77:
|
|
2975
|
+
_context30.prev = 77;
|
|
3042
2976
|
_context30.t4 = _context30["catch"](0);
|
|
3043
2977
|
errorMessage = _context30.t4 instanceof Error ? _context30.t4.message : String(_context30.t4);
|
|
3044
2978
|
console.error('[Checkout] 清理过期订单数据失败:', _context30.t4);
|
|
3045
2979
|
this.logError('Expired orders cleanup failed', {
|
|
3046
2980
|
error: errorMessage
|
|
3047
2981
|
});
|
|
3048
|
-
case
|
|
2982
|
+
case 82:
|
|
3049
2983
|
case "end":
|
|
3050
2984
|
return _context30.stop();
|
|
3051
2985
|
}
|
|
3052
|
-
}, _callee30, this, [[0,
|
|
2986
|
+
}, _callee30, this, [[0, 77], [17, 40, 43, 46], [21, 32], [49, 66, 69, 72], [53, 59]]);
|
|
3053
2987
|
}));
|
|
3054
2988
|
function cleanupExpiredOrdersAsync() {
|
|
3055
2989
|
return _cleanupExpiredOrdersAsync.apply(this, arguments);
|
|
@@ -3447,22 +3381,19 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3447
3381
|
}
|
|
3448
3382
|
return _context36.abrupt("return");
|
|
3449
3383
|
case 4:
|
|
3450
|
-
|
|
3451
|
-
// 🚀 性能优化:一次性批量获取所有需要的数据
|
|
3452
|
-
_context36.next = 7;
|
|
3384
|
+
_context36.next = 6;
|
|
3453
3385
|
return this.fetchOrderDataBatch();
|
|
3454
|
-
case
|
|
3386
|
+
case 6:
|
|
3455
3387
|
_yield$this$fetchOrde3 = _context36.sent;
|
|
3456
3388
|
paymentItems = _yield$this$fetchOrde3.paymentItems;
|
|
3457
3389
|
_currentOrder3 = _yield$this$fetchOrde3.currentOrder;
|
|
3458
|
-
console.timeEnd('updateStateAmountToRemaining');
|
|
3459
3390
|
if (_currentOrder3) {
|
|
3460
|
-
_context36.next =
|
|
3391
|
+
_context36.next = 12;
|
|
3461
3392
|
break;
|
|
3462
3393
|
}
|
|
3463
3394
|
this.logWarning('updateStateAmountToRemaining: 未找到当前订单');
|
|
3464
3395
|
return _context36.abrupt("return");
|
|
3465
|
-
case
|
|
3396
|
+
case 12:
|
|
3466
3397
|
// 🚀 性能优化:一次性计算所有金额(纯计算,不查询数据库)
|
|
3467
3398
|
paidAmount = this.calculatePaidAmountFromItems(paymentItems); // 缓存已支付金额,供其他方法使用
|
|
3468
3399
|
this.calculationCache.paidAmount = paidAmount;
|
|
@@ -3498,20 +3429,19 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3498
3429
|
currentBalanceDueAmount = this.store.balanceDueAmount; // 批量更新状态,减少操作次数
|
|
3499
3430
|
hasStateChanged = false; // 如果需要更新定金状态
|
|
3500
3431
|
if (!needUpdateDepositStatus) {
|
|
3501
|
-
_context36.next =
|
|
3432
|
+
_context36.next = 26;
|
|
3502
3433
|
break;
|
|
3503
3434
|
}
|
|
3504
3435
|
this.store.currentOrder = _objectSpread(_objectSpread({}, this.store.currentOrder), {}, {
|
|
3505
3436
|
is_deposit: 0
|
|
3506
3437
|
});
|
|
3507
|
-
_context36.next =
|
|
3438
|
+
_context36.next = 25;
|
|
3508
3439
|
return this.payment.updateOrderAsync(this.store.currentOrder.uuid, {
|
|
3509
3440
|
is_deposit: 0
|
|
3510
3441
|
});
|
|
3511
|
-
case
|
|
3442
|
+
case 25:
|
|
3512
3443
|
hasStateChanged = true;
|
|
3513
|
-
case
|
|
3514
|
-
console.time('updateStateAmountToRemaining: remainingAmount');
|
|
3444
|
+
case 26:
|
|
3515
3445
|
// 更新 stateAmount
|
|
3516
3446
|
if (remainingAmount !== currentStateAmount) {
|
|
3517
3447
|
this.store.stateAmount = remainingAmount;
|
|
@@ -3530,8 +3460,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3530
3460
|
newAmount: remainingAmount
|
|
3531
3461
|
});
|
|
3532
3462
|
}
|
|
3533
|
-
console.timeEnd('updateStateAmountToRemaining: remainingAmount');
|
|
3534
|
-
console.time('updateStateAmountToRemaining: updateStateAmountToRemaining');
|
|
3535
3463
|
// 更新 balanceDueAmount
|
|
3536
3464
|
if (remainingAmount !== currentBalanceDueAmount) {
|
|
3537
3465
|
this.store.balanceDueAmount = remainingAmount;
|
|
@@ -3551,7 +3479,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3551
3479
|
newAmount: remainingAmount
|
|
3552
3480
|
});
|
|
3553
3481
|
}
|
|
3554
|
-
console.timeEnd('updateStateAmountToRemaining: updateStateAmountToRemaining');
|
|
3555
3482
|
if (!hasStateChanged) {
|
|
3556
3483
|
this.logInfo('状态无需更新,当前值已是最新:', {
|
|
3557
3484
|
stateAmount: currentStateAmount,
|
|
@@ -3561,28 +3488,28 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3561
3488
|
|
|
3562
3489
|
// 检查订单支付完成(复用已获取的数据)
|
|
3563
3490
|
if (!checkOrder) {
|
|
3564
|
-
_context36.next =
|
|
3491
|
+
_context36.next = 34;
|
|
3565
3492
|
break;
|
|
3566
3493
|
}
|
|
3567
|
-
_context36.next =
|
|
3494
|
+
_context36.next = 32;
|
|
3568
3495
|
return this.checkOrderPaymentCompletionOptimized(paymentItems, remainingAmount);
|
|
3569
|
-
case
|
|
3570
|
-
_context36.next =
|
|
3496
|
+
case 32:
|
|
3497
|
+
_context36.next = 35;
|
|
3571
3498
|
break;
|
|
3572
|
-
case
|
|
3499
|
+
case 34:
|
|
3573
3500
|
this.logInfo('外部传入无需 checkOrder,不执行订单支付完成检测和同步');
|
|
3574
|
-
case
|
|
3575
|
-
_context36.next =
|
|
3501
|
+
case 35:
|
|
3502
|
+
_context36.next = 40;
|
|
3576
3503
|
break;
|
|
3577
|
-
case
|
|
3578
|
-
_context36.prev =
|
|
3504
|
+
case 37:
|
|
3505
|
+
_context36.prev = 37;
|
|
3579
3506
|
_context36.t0 = _context36["catch"](1);
|
|
3580
3507
|
this.logError('更新 stateAmount 为剩余金额失败:', _context36.t0);
|
|
3581
|
-
case
|
|
3508
|
+
case 40:
|
|
3582
3509
|
case "end":
|
|
3583
3510
|
return _context36.stop();
|
|
3584
3511
|
}
|
|
3585
|
-
}, _callee36, this, [[1,
|
|
3512
|
+
}, _callee36, this, [[1, 37]]);
|
|
3586
3513
|
}));
|
|
3587
3514
|
function updateStateAmountToRemaining() {
|
|
3588
3515
|
return _updateStateAmountToRemaining.apply(this, arguments);
|
|
@@ -4213,11 +4140,11 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4213
4140
|
resolveInFlight,
|
|
4214
4141
|
rejectInFlight,
|
|
4215
4142
|
inFlightPromise,
|
|
4143
|
+
_this$store$currentOr26,
|
|
4216
4144
|
_this$store$currentOr27,
|
|
4217
|
-
_this$store$currentOr28,
|
|
4218
4145
|
_this$store$currentCu2,
|
|
4219
4146
|
_this$otherParams2,
|
|
4220
|
-
_this$store$
|
|
4147
|
+
_this$store$currentOr28,
|
|
4221
4148
|
_this$store$localOrde,
|
|
4222
4149
|
_this$store$localOrde2,
|
|
4223
4150
|
_checkoutResponse12,
|
|
@@ -4334,7 +4261,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4334
4261
|
})
|
|
4335
4262
|
});
|
|
4336
4263
|
}); // 确定最终的定金金额:优先使用手动设置的值,否则从支付项中计算
|
|
4337
|
-
manualDepositAmount = ((_this$store$
|
|
4264
|
+
manualDepositAmount = ((_this$store$currentOr26 = this.store.currentOrder) === null || _this$store$currentOr26 === void 0 ? void 0 : _this$store$currentOr26.deposit_amount) || '0.00'; // 优先级逻辑:手动设置的定金金额 > 从支付项计算的金额
|
|
4338
4265
|
manualDepositValue = new Decimal(manualDepositAmount);
|
|
4339
4266
|
if (manualDepositValue.gt(0)) {
|
|
4340
4267
|
// 如果手动设置了定金金额且大于0,使用手动设置的值
|
|
@@ -4394,7 +4321,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4394
4321
|
}),
|
|
4395
4322
|
manualDepositAmount: manualDepositAmount,
|
|
4396
4323
|
finalDepositAmount: finalDepositAmount,
|
|
4397
|
-
isDeposit: ((_this$store$
|
|
4324
|
+
isDeposit: ((_this$store$currentOr27 = this.store.currentOrder) === null || _this$store$currentOr27 === void 0 ? void 0 : _this$store$currentOr27.is_deposit) || 0
|
|
4398
4325
|
});
|
|
4399
4326
|
|
|
4400
4327
|
// 计算订单状态,优先读取外面传递的,如果没有则根据订单支付数据来
|
|
@@ -4442,7 +4369,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4442
4369
|
currency_symbol: this.otherParams.currency_symbol,
|
|
4443
4370
|
currency_format: this.otherParams.currency_format,
|
|
4444
4371
|
business_code: ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.business_code) || undefined,
|
|
4445
|
-
is_deposit: ((_this$store$
|
|
4372
|
+
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,
|
|
4446
4373
|
deposit_amount: finalDepositAmount,
|
|
4447
4374
|
// 使用最终确定的定金金额(手动设置优先)
|
|
4448
4375
|
product_tax_fee: this.store.localOrderData.tax_fee,
|
|
@@ -5085,8 +5012,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5085
5012
|
case 6:
|
|
5086
5013
|
// 取消注册模块
|
|
5087
5014
|
this.core.unregisterModule(this);
|
|
5088
|
-
|
|
5089
|
-
case 8:
|
|
5015
|
+
case 7:
|
|
5090
5016
|
case "end":
|
|
5091
5017
|
return _context46.stop();
|
|
5092
5018
|
}
|
|
@@ -5113,8 +5039,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5113
5039
|
uuid: this.store.currentOrder.uuid,
|
|
5114
5040
|
orderId: this.store.currentOrder.order_id
|
|
5115
5041
|
} : null;
|
|
5116
|
-
console.log('[Checkout] 重置 store 状态,准备创建新订单', prevOrderInfo);
|
|
5117
|
-
|
|
5118
5042
|
// 重置订单相关的 store 状态(保留 paymentMethods,因为支付方式数据变更不频繁)
|
|
5119
5043
|
this.store.currentOrder = undefined;
|
|
5120
5044
|
this.store.localOrderData = undefined;
|
|
@@ -5136,8 +5060,6 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5136
5060
|
|
|
5137
5061
|
// 注意:故意保留 this.store.paymentMethods,因为支付方式数据不易变更,保留在内存中提高性能
|
|
5138
5062
|
|
|
5139
|
-
console.log('[Checkout] Store 状态重置完成');
|
|
5140
|
-
|
|
5141
5063
|
// 🚀 性能优化:异步触发订单清理事件(不阻塞主流程)
|
|
5142
5064
|
// 使用 setTimeout 确保事件处理不会阻塞状态重置
|
|
5143
5065
|
if (prevOrderInfo) {
|