@pisell/pisellos 0.0.569 → 0.10.2
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 +10 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +7 -5
- package/dist/model/strategy/adapter/walletPass/example.js +26 -3
- package/dist/model/strategy/adapter/walletPass/index.js +5 -5
- package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +17 -92
- package/dist/model/strategy/strategy-example.js +19 -5
- package/dist/modules/BaseModule.d.ts +1 -1
- package/dist/modules/BaseModule.js +8 -10
- package/dist/modules/Cart/index.js +3 -0
- package/dist/modules/Cart/utils/cartProduct.js +1 -0
- package/dist/modules/Cart/utils/cartResource.js +0 -2
- package/dist/modules/Cart/utils/changePrice.js +9 -16
- package/dist/modules/Date/index.js +5 -1
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +7 -22
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -0
- package/dist/modules/Order/index.js +70 -40
- package/dist/modules/Payment/index.js +162 -97
- package/dist/modules/Payment/types.d.ts +4 -8
- package/dist/modules/Payment/walletpass.d.ts +0 -2
- package/dist/modules/Payment/walletpass.js +5 -4
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +3 -12
- package/dist/modules/ProductList/types.d.ts +0 -1
- package/dist/modules/Rules/index.js +126 -427
- package/dist/modules/SalesSummary/utils.js +1 -2
- package/dist/modules/Schedule/getDateIsInSchedule.js +0 -5
- package/dist/modules/Schedule/index.js +1 -0
- package/dist/modules/Schedule/utils.js +1 -0
- package/dist/modules/Step/index.js +1 -0
- package/dist/modules/Summary/utils.js +22 -43
- package/dist/plugins/request.js +4 -1
- package/dist/plugins/window.js +6 -2
- package/dist/server/index.js +129 -97
- package/dist/server/modules/menu/index.js +41 -32
- package/dist/server/modules/order/index.js +4 -2
- package/dist/server/modules/products/index.js +42 -24
- package/dist/server/modules/quotation/index.js +38 -29
- package/dist/server/modules/resource/index.js +4 -3
- package/dist/server/modules/schedule/index.js +35 -27
- package/dist/server/utils/product.js +1 -0
- package/dist/solution/BaseSales/index.js +41 -38
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +60 -11
- package/dist/solution/BookingByStep/utils/capacity.js +11 -1
- package/dist/solution/BookingByStep/utils/resources.js +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +43 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +2 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +7 -6
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +31 -25
- package/dist/solution/BookingTicket/utils/scan/index.js +10 -6
- package/dist/solution/BuyTickets/index.js +12 -9
- package/dist/solution/Checkout/index.js +252 -177
- package/dist/solution/Checkout/utils/index.js +16 -4
- package/dist/solution/RegisterAndLogin/index.js +76 -30
- package/dist/solution/ScanOrder/index.js +60 -50
- package/dist/solution/ShopDiscount/index.js +14 -15
- package/dist/solution/ShopDiscount/types.d.ts +4 -5
- package/dist/solution/ShopDiscount/utils.d.ts +0 -9
- package/dist/solution/ShopDiscount/utils.js +0 -9
- package/dist/solution/VenueBooking/index.d.ts +3 -31
- package/dist/solution/VenueBooking/index.js +496 -651
- package/dist/solution/VenueBooking/types.d.ts +1 -3
- package/dist/solution/VenueBooking/types.js +0 -1
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/dist/solution/VenueBooking/utils/dateSummary.js +25 -12
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/dist/solution/VenueBooking/utils/timeSlot.js +4 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/task.js +18 -15
- package/dist/utils/watch.js +1 -0
- package/lib/apis/picoding.js +0 -2
- package/lib/core/index.js +132 -130
- package/lib/effects/index.js +57 -46
- package/lib/index.d.ts +0 -1
- package/lib/index.js +50 -92
- package/lib/model/index.js +21 -14
- package/lib/model/strategy/adapter/dataVariant/adapter.js +50 -38
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +236 -162
- package/lib/model/strategy/adapter/dataVariant/examples.js +237 -229
- package/lib/model/strategy/adapter/dataVariant/index.js +34 -39
- package/lib/model/strategy/adapter/dataVariant/type.js +28 -57
- package/lib/model/strategy/adapter/index.js +64 -100
- package/lib/model/strategy/adapter/itemRule/adapter.js +144 -156
- package/lib/model/strategy/adapter/itemRule/evaluator.js +48 -36
- package/lib/model/strategy/adapter/itemRule/examples.js +225 -295
- package/lib/model/strategy/adapter/itemRule/index.js +57 -83
- package/lib/model/strategy/adapter/itemRule/type.js +36 -97
- package/lib/model/strategy/adapter/promotion/adapter.js +63 -84
- package/lib/model/strategy/adapter/promotion/evaluator.js +231 -381
- package/lib/model/strategy/adapter/promotion/examples.js +159 -139
- package/lib/model/strategy/adapter/promotion/index.js +49 -1
- package/lib/model/strategy/adapter/promotion/type.js +35 -199
- package/lib/model/strategy/adapter/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/evaluator.js +152 -180
- package/lib/model/strategy/adapter/walletPass/example.js +190 -217
- package/lib/model/strategy/adapter/walletPass/index.js +51 -75
- package/lib/model/strategy/adapter/walletPass/locales.js +58 -36
- package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/lib/model/strategy/adapter/walletPass/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/lib/model/strategy/adapter/walletPass/utils.js +383 -678
- package/lib/model/strategy/engine.js +168 -270
- package/lib/model/strategy/index.js +34 -49
- package/lib/model/strategy/strategy-example.js +239 -243
- package/lib/model/strategy/type.js +40 -100
- package/lib/modules/Account/index.js +53 -39
- package/lib/modules/Account/types.js +33 -20
- package/lib/modules/AccountList/index.js +154 -116
- package/lib/modules/AccountList/types.js +31 -30
- package/lib/modules/AccountList/utils.js +30 -18
- package/lib/modules/BaseModule.d.ts +1 -1
- package/lib/modules/BaseModule.js +46 -25
- package/lib/modules/BookingContext/index.js +136 -158
- package/lib/modules/BookingContext/types.js +32 -46
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +143 -131
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +82 -75
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +150 -170
- package/lib/modules/BookingContext/utils/flexible.js +55 -38
- package/lib/modules/BookingContext/utils/formatResourceList.js +34 -19
- package/lib/modules/BookingContext/utils/index.js +41 -124
- package/lib/modules/BookingContext/utils/noResource.js +70 -58
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +41 -14
- package/lib/modules/BookingContext/utils/productExtend.js +155 -202
- package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
- package/lib/modules/BookingContext/utils/resourceSelection.js +41 -19
- package/lib/modules/BookingContext/utils/resources.js +167 -209
- package/lib/modules/BookingContext/utils/serviceTimes.js +116 -115
- package/lib/modules/BookingContext/utils/timeSlices.js +80 -70
- package/lib/modules/Cart/index.js +124 -170
- package/lib/modules/Cart/types.js +51 -46
- package/lib/modules/Cart/utils/cartAccount.js +39 -40
- package/lib/modules/Cart/utils/cartDate.js +61 -56
- package/lib/modules/Cart/utils/cartDiscount.js +33 -28
- package/lib/modules/Cart/utils/cartNote.js +32 -27
- package/lib/modules/Cart/utils/cartProduct.js +251 -321
- package/lib/modules/Cart/utils/cartRelationForms.js +35 -29
- package/lib/modules/Cart/utils/cartResource.js +78 -72
- package/lib/modules/Cart/utils/changePrice.js +50 -28
- package/lib/modules/Cart/utils/index.js +48 -106
- package/lib/modules/Customer/constants.js +34 -13
- package/lib/modules/Customer/index.js +169 -232
- package/lib/modules/Customer/types.js +35 -38
- package/lib/modules/Date/index.js +115 -116
- package/lib/modules/Date/types.js +28 -16
- package/lib/modules/Date/utils.js +123 -174
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +128 -130
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/Discount/types.js +31 -9
- package/lib/modules/Guests/index.js +56 -30
- package/lib/modules/Guests/types.js +33 -23
- package/lib/modules/Holder/index.js +189 -209
- package/lib/modules/Holder/types.js +16 -4
- package/lib/modules/Holder/utils.js +49 -20
- package/lib/modules/OpenData/index.js +76 -69
- package/lib/modules/OpenData/types.js +16 -4
- package/lib/modules/OpenData/utils.js +78 -44
- package/lib/modules/Order/index.js +1909 -1572
- package/lib/modules/Order/types.js +35 -78
- package/lib/modules/Order/utils/bundleDiscountHydration.js +74 -41
- package/lib/modules/Order/utils/manualProductDiscount.js +123 -124
- package/lib/modules/Order/utils/orderCollectionIdentity.js +210 -148
- package/lib/modules/Order/utils.js +634 -799
- package/lib/modules/Payment/cash.js +33 -20
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +76 -145
- package/lib/modules/Payment/eftpos.js +30 -16
- package/lib/modules/Payment/index.js +378 -518
- package/lib/modules/Payment/mx51.js +0 -1
- package/lib/modules/Payment/types.d.ts +4 -8
- package/lib/modules/Payment/types.js +107 -216
- package/lib/modules/Payment/utils.js +48 -51
- package/lib/modules/Payment/walletpass.d.ts +0 -2
- package/lib/modules/Payment/walletpass.js +211 -226
- package/lib/modules/Product/index.js +46 -51
- package/lib/modules/Product/types.js +16 -4
- package/lib/modules/Product/utils.js +33 -32
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +117 -117
- package/lib/modules/ProductList/types.d.ts +0 -1
- package/lib/modules/ProductList/types.js +31 -9
- package/lib/modules/Quotation/index.js +100 -66
- package/lib/modules/Quotation/types.js +16 -4
- package/lib/modules/Resource/index.js +59 -27
- package/lib/modules/Resource/types.js +32 -22
- package/lib/modules/Resource/utils.js +38 -30
- package/lib/modules/ResourcePlanner/index.js +61 -60
- package/lib/modules/ResourcePlanner/planner.js +384 -346
- package/lib/modules/ResourcePlanner/types.js +16 -4
- package/lib/modules/Rules/index.js +903 -1475
- package/lib/modules/Rules/types.js +40 -17
- package/lib/modules/SalesSummary/index.js +90 -85
- package/lib/modules/SalesSummary/types.js +16 -4
- package/lib/modules/SalesSummary/utils.js +427 -351
- package/lib/modules/ScanOrderLogger/index.js +79 -59
- package/lib/modules/ScanOrderLogger/providers/feishu.js +78 -54
- package/lib/modules/ScanOrderLogger/providers/grafana.js +36 -13
- package/lib/modules/ScanOrderLogger/types.js +16 -4
- package/lib/modules/Schedule/getDateIsInSchedule.js +163 -339
- package/lib/modules/Schedule/index.js +114 -100
- package/lib/modules/Schedule/type.js +16 -4
- package/lib/modules/Schedule/types.js +16 -4
- package/lib/modules/Schedule/utils.js +291 -433
- package/lib/modules/Step/index.js +52 -40
- package/lib/modules/Step/tyeps.js +16 -4
- package/lib/modules/Summary/index.js +71 -66
- package/lib/modules/Summary/types.js +16 -4
- package/lib/modules/Summary/utils.js +418 -791
- package/lib/modules/SurchargeList/index.js +60 -46
- package/lib/modules/SurchargeList/types.js +16 -4
- package/lib/modules/index.js +63 -245
- package/lib/plugins/app.js +16 -4
- package/lib/plugins/index.js +25 -36
- package/lib/plugins/request.js +126 -137
- package/lib/plugins/shopStore.js +16 -4
- package/lib/plugins/user.js +16 -4
- package/lib/plugins/window.js +179 -171
- package/lib/server/index.js +2337 -2675
- package/lib/server/modules/floor-plan/index.js +123 -102
- package/lib/server/modules/floor-plan/types.js +30 -15
- package/lib/server/modules/index.js +68 -106
- package/lib/server/modules/menu/index.js +122 -146
- package/lib/server/modules/menu/types.js +31 -18
- package/lib/server/modules/order/index.js +642 -567
- package/lib/server/modules/order/types.js +32 -117
- package/lib/server/modules/order/utils/filterBookings.js +194 -219
- package/lib/server/modules/order/utils/filterOrders.js +92 -118
- package/lib/server/modules/payment/index.js +83 -59
- package/lib/server/modules/payment/types.js +16 -4
- package/lib/server/modules/products/index.js +459 -575
- package/lib/server/modules/products/types.js +34 -44
- package/lib/server/modules/quotation/index.js +172 -137
- package/lib/server/modules/quotation/types.js +31 -21
- package/lib/server/modules/resource/index.js +184 -213
- package/lib/server/modules/resource/types.js +33 -42
- package/lib/server/modules/schedule/index.js +123 -135
- package/lib/server/modules/schedule/types.js +21 -14
- package/lib/server/modules/schedule/utils.js +163 -334
- package/lib/server/types.js +16 -4
- package/lib/server/utils/index.js +23 -25
- package/lib/server/utils/product.js +139 -196
- package/lib/server/utils/schedule.js +41 -34
- package/lib/server/utils/small-ticket.js +456 -478
- package/lib/server/utils/time.js +49 -40
- package/lib/solution/BaseSales/index.js +1016 -850
- package/lib/solution/BaseSales/types.js +37 -41
- package/lib/solution/BaseSales/utils/cartPromotion.js +460 -611
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +105 -85
- package/lib/solution/BaseSales/utils/quotationPrice.js +114 -56
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +143 -102
- package/lib/solution/BaseSales/utils.js +140 -155
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1340 -1530
- package/lib/solution/BookingByStep/types.js +99 -40
- package/lib/solution/BookingByStep/utils/capacity.js +160 -192
- package/lib/solution/BookingByStep/utils/products.js +52 -42
- package/lib/solution/BookingByStep/utils/resources.js +330 -527
- package/lib/solution/BookingByStep/utils/stock.js +44 -65
- package/lib/solution/BookingByStep/utils/timeslots.js +131 -129
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +459 -543
- package/lib/solution/BookingTicket/types.js +77 -99
- package/lib/solution/BookingTicket/utils/addProductDecision.js +184 -219
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +89 -58
- package/lib/solution/BookingTicket/utils/bookingStatus.js +78 -107
- package/lib/solution/BookingTicket/utils/cartView.js +94 -110
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -185
- package/lib/solution/BookingTicket/utils/orderCustomer.js +41 -18
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +86 -219
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +93 -144
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +91 -79
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +41 -54
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +81 -84
- package/lib/solution/BookingTicket/utils/scan/index.js +104 -98
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +43 -90
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +64 -52
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +58 -56
- package/lib/solution/BuyTickets/index.js +70 -67
- package/lib/solution/BuyTickets/types.js +38 -22
- package/lib/solution/Checkout/index.js +1158 -1451
- package/lib/solution/Checkout/types.js +61 -91
- package/lib/solution/Checkout/utils/index.js +156 -228
- package/lib/solution/PlaceOrder/index.js +0 -55
- package/lib/solution/RegisterAndLogin/config.js +460 -493
- package/lib/solution/RegisterAndLogin/index.js +630 -633
- package/lib/solution/RegisterAndLogin/types.js +76 -189
- package/lib/solution/RegisterAndLogin/utils.js +125 -183
- package/lib/solution/Sales/index.js +320 -317
- package/lib/solution/Sales/types.js +33 -27
- package/lib/solution/ScanOrder/index.js +862 -831
- package/lib/solution/ScanOrder/types.js +34 -33
- package/lib/solution/ScanOrder/utils.js +371 -406
- package/lib/solution/ShopDiscount/index.js +233 -235
- package/lib/solution/ShopDiscount/types.d.ts +4 -5
- package/lib/solution/ShopDiscount/types.js +37 -15
- package/lib/solution/ShopDiscount/utils.d.ts +0 -9
- package/lib/solution/ShopDiscount/utils.js +172 -309
- package/lib/solution/UnifiedBookingSales/index.js +405 -379
- package/lib/solution/UnifiedBookingSales/types.js +31 -12
- package/lib/solution/VenueBooking/index.d.ts +3 -31
- package/lib/solution/VenueBooking/index.js +916 -967
- package/lib/solution/VenueBooking/types.d.ts +1 -3
- package/lib/solution/VenueBooking/types.js +39 -20
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/lib/solution/VenueBooking/utils/dateSummary.js +62 -25
- package/lib/solution/VenueBooking/utils/resource.js +54 -31
- package/lib/solution/VenueBooking/utils/slotMerge.js +107 -94
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -138
- package/lib/solution/VenueBooking/utils.js +67 -130
- package/lib/solution/index.js +41 -124
- package/lib/store/createStore.js +29 -32
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +16 -4
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +47 -81
- package/package.json +2 -4
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -233
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -192
|
@@ -23,8 +23,8 @@ function _updateAllCartItemPrice() {
|
|
|
23
23
|
_iterator = _createForOfIteratorHelper(cartItems);
|
|
24
24
|
_context2.prev = 1;
|
|
25
25
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
|
|
26
|
-
var _item$_productOrigin
|
|
27
|
-
var item, targetProduct, cartProduct, productInfo,
|
|
26
|
+
var _item$_productOrigin, _bundle;
|
|
27
|
+
var item, targetProduct, cartProduct, productInfo, bundle, _productInfo$variant;
|
|
28
28
|
return _regeneratorRuntime().wrap(function _loop$(_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|
|
@@ -40,17 +40,10 @@ function _updateAllCartItemPrice() {
|
|
|
40
40
|
if (!productInfo) {
|
|
41
41
|
productInfo = item._productOrigin;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return Number(variant.id) === Number(variantId);
|
|
48
|
-
});
|
|
49
|
-
bundle = item._bundleOrigin; // productInfo.price = targetProduct?.price;
|
|
50
|
-
// productInfo.base_price = targetProduct?.base_price;
|
|
51
|
-
productInfo.price = (_ref = (_targetVariant$price = targetVariant === null || targetVariant === void 0 ? void 0 : targetVariant.price) !== null && _targetVariant$price !== void 0 ? _targetVariant$price : targetProduct === null || targetProduct === void 0 ? void 0 : targetProduct.price) !== null && _ref !== void 0 ? _ref : productInfo.price;
|
|
52
|
-
productInfo.base_price = (_ref2 = (_targetVariant$base_p = targetVariant === null || targetVariant === void 0 ? void 0 : targetVariant.base_price) !== null && _targetVariant$base_p !== void 0 ? _targetVariant$base_p : targetProduct === null || targetProduct === void 0 ? void 0 : targetProduct.base_price) !== null && _ref2 !== void 0 ? _ref2 : productInfo.base_price;
|
|
53
|
-
productInfo.product_variant_id = (_item$_productOrigin2 = item._productOrigin) === null || _item$_productOrigin2 === void 0 ? void 0 : _item$_productOrigin2.product_variant_id;
|
|
43
|
+
bundle = item._bundleOrigin;
|
|
44
|
+
productInfo.price = targetProduct === null || targetProduct === void 0 ? void 0 : targetProduct.price;
|
|
45
|
+
productInfo.base_price = targetProduct === null || targetProduct === void 0 ? void 0 : targetProduct.base_price;
|
|
46
|
+
productInfo.product_variant_id = (_item$_productOrigin = item._productOrigin) === null || _item$_productOrigin === void 0 ? void 0 : _item$_productOrigin.product_variant_id;
|
|
54
47
|
bundle = (_bundle = bundle) === null || _bundle === void 0 ? void 0 : _bundle.map(function (n) {
|
|
55
48
|
var _targetProduct$bundle;
|
|
56
49
|
// 更新 bundle 的价格
|
|
@@ -82,8 +75,8 @@ function _updateAllCartItemPrice() {
|
|
|
82
75
|
// 如果有返回variant,则把对应variant的数据也补充进去
|
|
83
76
|
if (targetProduct !== null && targetProduct !== void 0 && targetProduct.variant) {
|
|
84
77
|
productInfo.variant = (_productInfo$variant = productInfo.variant) === null || _productInfo$variant === void 0 ? void 0 : _productInfo$variant.map(function (n) {
|
|
85
|
-
var _targetProduct$
|
|
86
|
-
var targetVariant = (_targetProduct$
|
|
78
|
+
var _targetProduct$varian;
|
|
79
|
+
var targetVariant = (_targetProduct$varian = targetProduct.variant) === null || _targetProduct$varian === void 0 ? void 0 : _targetProduct$varian.find(function (m) {
|
|
87
80
|
return m.id === n.id;
|
|
88
81
|
});
|
|
89
82
|
if (targetVariant) {
|
|
@@ -106,7 +99,7 @@ function _updateAllCartItemPrice() {
|
|
|
106
99
|
bundle: bundle,
|
|
107
100
|
options: item._optionsOrigin
|
|
108
101
|
});
|
|
109
|
-
case
|
|
102
|
+
case 15:
|
|
110
103
|
case "end":
|
|
111
104
|
return _context.stop();
|
|
112
105
|
}
|
|
@@ -294,6 +294,8 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
294
294
|
// 将 start_time 向上取整到下一个10分钟整数
|
|
295
295
|
var roundedStartTime = _this3.roundUpToNext10Minutes(resourceStartTime);
|
|
296
296
|
var roundedStartTimeDayjs = dayjs(roundedStartTime);
|
|
297
|
+
console.log("[DateModule] \u4FEE\u6B63\u65F6\u95F4\u6BB5\u5F00\u59CB\u65F6\u95F4: ".concat(timeSlot.start_at, " -> ").concat(roundedStartTime, " (\u8D44\u6E90ID: ").concat(resource.id, ", \u539F\u59CBstart_time: ").concat(resource.start_time, ")"));
|
|
298
|
+
|
|
297
299
|
// 将 start_at 修正为向上取整后的时间
|
|
298
300
|
var correctedTimeSlot = _objectSpread(_objectSpread({}, timeSlot), {}, {
|
|
299
301
|
start_at: roundedStartTime
|
|
@@ -301,6 +303,7 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
301
303
|
|
|
302
304
|
// 检查修正后的 end_at 是否也早于修正后的 start_time
|
|
303
305
|
if (endAt.isBefore(roundedStartTimeDayjs)) {
|
|
306
|
+
console.log("[DateModule] \u65F6\u95F4\u6BB5\u65E0\u6548\uFF0C\u5C06\u88AB\u5220\u9664: ".concat(timeSlot.start_at, " - ").concat(timeSlot.end_at, " (\u8D44\u6E90ID: ").concat(resource.id, ", \u4FEE\u6B63\u540Estart_time: ").concat(roundedStartTime, ")"));
|
|
304
307
|
return null; // 标记为删除
|
|
305
308
|
}
|
|
306
309
|
return correctedTimeSlot;
|
|
@@ -363,8 +366,9 @@ export var DateModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
363
366
|
case 18:
|
|
364
367
|
_context4.prev = 18;
|
|
365
368
|
_context4.t0 = _context4["catch"](7);
|
|
369
|
+
console.log('getAvailableTimeList_error', _context4.t0);
|
|
366
370
|
return _context4.abrupt("return", disableAllDates(dates));
|
|
367
|
-
case
|
|
371
|
+
case 22:
|
|
368
372
|
case "end":
|
|
369
373
|
return _context4.stop();
|
|
370
374
|
}
|
|
@@ -28,7 +28,6 @@ export declare class DiscountModule extends BaseModule implements Module, Discou
|
|
|
28
28
|
request_timezone: string;
|
|
29
29
|
order_id?: number | string;
|
|
30
30
|
}): Promise<DiscountPrepareConfigResult>;
|
|
31
|
-
private extractAvailableWalletIds;
|
|
32
31
|
batchSearch(code: string, options?: {
|
|
33
32
|
customerId?: number;
|
|
34
33
|
orderId?: number;
|
|
@@ -191,7 +191,7 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
191
191
|
goodPassList = this.filterEnabledDiscountList(rawDiscountList) || []; // this.setDiscountList(goodPassList);
|
|
192
192
|
return _context4.abrupt("return", {
|
|
193
193
|
discountList: goodPassList,
|
|
194
|
-
availableWalletIds:
|
|
194
|
+
availableWalletIds: availableWalletIds
|
|
195
195
|
});
|
|
196
196
|
case 10:
|
|
197
197
|
case "end":
|
|
@@ -204,23 +204,6 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
204
204
|
}
|
|
205
205
|
return loadPrepareConfig;
|
|
206
206
|
}()
|
|
207
|
-
}, {
|
|
208
|
-
key: "extractAvailableWalletIds",
|
|
209
|
-
value: function extractAvailableWalletIds(data) {
|
|
210
|
-
var availableWalletList = Array.isArray(data === null || data === void 0 ? void 0 : data.avaiable_wallet_list) ? data.avaiable_wallet_list : Array.isArray(data === null || data === void 0 ? void 0 : data.available_wallet_list) ? data.available_wallet_list : [];
|
|
211
|
-
var availableWalletPassList = Array.isArray(data === null || data === void 0 ? void 0 : data.available_wallet_pass_list) ? data.available_wallet_pass_list : [];
|
|
212
|
-
var walletIds = availableWalletList.map(function (item) {
|
|
213
|
-
return Number(item === null || item === void 0 ? void 0 : item.id);
|
|
214
|
-
}).filter(function (id) {
|
|
215
|
-
return Number.isFinite(id) && id > 0;
|
|
216
|
-
});
|
|
217
|
-
var walletPassProductIds = availableWalletPassList.map(function (item) {
|
|
218
|
-
return Number(item === null || item === void 0 ? void 0 : item.product_id);
|
|
219
|
-
}).filter(function (id) {
|
|
220
|
-
return Number.isFinite(id) && id > 0;
|
|
221
|
-
});
|
|
222
|
-
return Array.from(new Set([].concat(_toConsumableArray(walletIds), _toConsumableArray(walletPassProductIds))));
|
|
223
|
-
}
|
|
224
207
|
}, {
|
|
225
208
|
key: "batchSearch",
|
|
226
209
|
value: function () {
|
|
@@ -239,11 +222,11 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
239
222
|
relation_product: 1,
|
|
240
223
|
with: ['extensionData', 'customScheduleSnapshot', 'holder.detail'],
|
|
241
224
|
order_behavior_count: 1,
|
|
242
|
-
order_behavior_count_customer_id: customerId || 1
|
|
243
|
-
unified_status_info_flag: 1
|
|
225
|
+
order_behavior_count_customer_id: customerId || 1
|
|
244
226
|
}, orderId ? {
|
|
245
227
|
order_behavior_count_order_id: orderId
|
|
246
228
|
} : {}), {}, {
|
|
229
|
+
unified_status_info_flag: 1,
|
|
247
230
|
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
248
231
|
}));
|
|
249
232
|
case 3:
|
|
@@ -485,8 +468,9 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
485
468
|
_context7.next = 4;
|
|
486
469
|
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
487
470
|
case 4:
|
|
471
|
+
console.log('[Discount] 已销毁');
|
|
488
472
|
_get(_getPrototypeOf(DiscountModule.prototype), "destroy", this).call(this);
|
|
489
|
-
case
|
|
473
|
+
case 6:
|
|
490
474
|
case "end":
|
|
491
475
|
return _context7.stop();
|
|
492
476
|
}
|
|
@@ -506,7 +490,8 @@ export var DiscountModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
506
490
|
case 0:
|
|
507
491
|
this.store.discountList = [];
|
|
508
492
|
this.store.originalDiscountList = [];
|
|
509
|
-
|
|
493
|
+
console.log('[Discount] clear');
|
|
494
|
+
case 3:
|
|
510
495
|
case "end":
|
|
511
496
|
return _context8.stop();
|
|
512
497
|
}
|
|
@@ -100,7 +100,6 @@ export interface Discount {
|
|
|
100
100
|
balance: string;
|
|
101
101
|
format_title: Formattitle;
|
|
102
102
|
metadata?: {
|
|
103
|
-
num?: number;
|
|
104
103
|
discount_card_type?: 'fixed_amount' | 'percent';
|
|
105
104
|
custom_product_bundle_map_id?: string;
|
|
106
105
|
validity_type?: "custom_schedule_validity" | "fixed_validity";
|
|
@@ -656,7 +656,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
656
656
|
key: "scanCode",
|
|
657
657
|
value: function () {
|
|
658
658
|
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(code, customerId) {
|
|
659
|
-
var _this$store$discount11, _tempOrder$holder, _this$store$summary
|
|
659
|
+
var _this$store$discount11, _tempOrder$holder, _this$store$summary;
|
|
660
660
|
var resultDiscountWithReason, resultDiscountList, unavailableReasonKey, rulesModule, withScanList, currentSelected, tempOrder, holders, _ref13, isAvailable, newDiscountList, unavailableReason, _this$store$discount12;
|
|
661
661
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
662
662
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -737,7 +737,9 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
737
737
|
newDiscountList: withScanList,
|
|
738
738
|
orderTotalAmount: Number(((_this$store$summary = this.store.summary) === null || _this$store$summary === void 0 ? void 0 : _this$store$summary.total_amount) || 0),
|
|
739
739
|
holders: holders,
|
|
740
|
-
isFormSubject:
|
|
740
|
+
isFormSubject: function isFormSubject(product) {
|
|
741
|
+
return resolveIsFormSubject(tempOrder, product);
|
|
742
|
+
}
|
|
741
743
|
}) || {
|
|
742
744
|
isAvailable: false,
|
|
743
745
|
discountList: this.getDiscountList()
|
|
@@ -2634,7 +2636,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2634
2636
|
}, {
|
|
2635
2637
|
key: "buildTempOrderHolderFromBookings",
|
|
2636
2638
|
value: function buildTempOrderHolderFromBookings(tempOrder) {
|
|
2637
|
-
var _baseHolder$customer_, _baseHolder, _ref46, _baseHolder$form_id, _baseHolder2, _tempOrder$
|
|
2639
|
+
var _baseHolder$customer_, _baseHolder, _ref46, _baseHolder$form_id, _baseHolder2, _tempOrder$holder2, _baseHolder3, _this$otherParams;
|
|
2638
2640
|
var holderRecords = [];
|
|
2639
2641
|
var holderNames = [];
|
|
2640
2642
|
var baseHolder = null;
|
|
@@ -2681,7 +2683,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
2681
2683
|
}
|
|
2682
2684
|
var nextHolder = {
|
|
2683
2685
|
customer_id: (_baseHolder$customer_ = (_baseHolder = baseHolder) === null || _baseHolder === void 0 ? void 0 : _baseHolder.customer_id) !== null && _baseHolder$customer_ !== void 0 ? _baseHolder$customer_ : tempOrder.customer_id,
|
|
2684
|
-
form_id: (_ref46 = (_baseHolder$form_id = (_baseHolder2 = baseHolder) === null || _baseHolder2 === void 0 ? void 0 : _baseHolder2.form_id) !== null && _baseHolder$form_id !== void 0 ? _baseHolder$form_id : (_tempOrder$
|
|
2686
|
+
form_id: (_ref46 = (_baseHolder$form_id = (_baseHolder2 = baseHolder) === null || _baseHolder2 === void 0 ? void 0 : _baseHolder2.form_id) !== null && _baseHolder$form_id !== void 0 ? _baseHolder$form_id : (_tempOrder$holder2 = tempOrder.holder) === null || _tempOrder$holder2 === void 0 ? void 0 : _tempOrder$holder2.form_id) !== null && _ref46 !== void 0 ? _ref46 : 0,
|
|
2685
2687
|
form_record: holderRecords
|
|
2686
2688
|
};
|
|
2687
2689
|
if (holderNames.length) {
|
|
@@ -4823,6 +4825,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4823
4825
|
request_unique_idempotency_token: params === null || params === void 0 ? void 0 : params.request_unique_idempotency_token,
|
|
4824
4826
|
enhance: enhancePayload
|
|
4825
4827
|
});
|
|
4828
|
+
console.log('[Order.runSubmitTempOrder.payload]', payload);
|
|
4826
4829
|
if (params !== null && params !== void 0 && params.syncMode) {
|
|
4827
4830
|
payload.sync_mode = true;
|
|
4828
4831
|
}
|
|
@@ -4830,10 +4833,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4830
4833
|
if (!payload.created_at) {
|
|
4831
4834
|
payload.created_at = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4832
4835
|
}
|
|
4833
|
-
_context33.next =
|
|
4836
|
+
_context33.next = 26;
|
|
4834
4837
|
return this.saveDraft();
|
|
4835
|
-
case
|
|
4836
|
-
_context33.prev =
|
|
4838
|
+
case 26:
|
|
4839
|
+
_context33.prev = 26;
|
|
4837
4840
|
this.logInfo('submitTempOrder calling sales checkout', {
|
|
4838
4841
|
orderId: payload.order_id,
|
|
4839
4842
|
externalSaleNumber: payload.external_sale_number,
|
|
@@ -4843,26 +4846,26 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4843
4846
|
smallTicketDataFlag: payload.small_ticket_data_flag,
|
|
4844
4847
|
syncMode: payload.sync_mode
|
|
4845
4848
|
});
|
|
4846
|
-
_context33.next =
|
|
4849
|
+
_context33.next = 30;
|
|
4847
4850
|
return this.submitSalesOrder({
|
|
4848
4851
|
query: payload
|
|
4849
4852
|
});
|
|
4850
|
-
case
|
|
4853
|
+
case 30:
|
|
4851
4854
|
result = _context33.sent;
|
|
4852
|
-
_context33.next =
|
|
4855
|
+
_context33.next = 43;
|
|
4853
4856
|
break;
|
|
4854
|
-
case
|
|
4855
|
-
_context33.prev =
|
|
4856
|
-
_context33.t2 = _context33["catch"](
|
|
4857
|
+
case 33:
|
|
4858
|
+
_context33.prev = 33;
|
|
4859
|
+
_context33.t2 = _context33["catch"](26);
|
|
4857
4860
|
backendErrorResponse = this.extractSubmitErrorResponse(_context33.t2);
|
|
4858
4861
|
if (!backendErrorResponse) {
|
|
4859
|
-
_context33.next =
|
|
4862
|
+
_context33.next = 40;
|
|
4860
4863
|
break;
|
|
4861
4864
|
}
|
|
4862
4865
|
this.store.syncState = 'failed';
|
|
4863
4866
|
this.logSubmitBackendRejected(backendErrorResponse, payload);
|
|
4864
4867
|
return _context33.abrupt("return", backendErrorResponse);
|
|
4865
|
-
case
|
|
4868
|
+
case 40:
|
|
4866
4869
|
this.store.syncState = 'failed';
|
|
4867
4870
|
this.logError('submitTempOrder failed', {
|
|
4868
4871
|
error: _context33.t2 instanceof Error ? _context33.t2.message : String(_context33.t2),
|
|
@@ -4872,15 +4875,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4872
4875
|
paymentsCount: ((_payload$payments2 = payload.payments) === null || _payload$payments2 === void 0 ? void 0 : _payload$payments2.length) || 0
|
|
4873
4876
|
});
|
|
4874
4877
|
throw _context33.t2;
|
|
4875
|
-
case
|
|
4878
|
+
case 43:
|
|
4876
4879
|
if (!this.isSubmitResponseRejected(result)) {
|
|
4877
|
-
_context33.next =
|
|
4880
|
+
_context33.next = 47;
|
|
4878
4881
|
break;
|
|
4879
4882
|
}
|
|
4880
4883
|
this.store.syncState = 'failed';
|
|
4881
4884
|
this.logSubmitBackendRejected(result, payload);
|
|
4882
4885
|
return _context33.abrupt("return", result);
|
|
4883
|
-
case
|
|
4886
|
+
case 47:
|
|
4884
4887
|
submittedOrderId = this.extractOrderIdFromSubmitResult(result);
|
|
4885
4888
|
this.logInfo('runSubmitTempOrder: 提交成功', {
|
|
4886
4889
|
submittedOrderId: submittedOrderId,
|
|
@@ -4890,29 +4893,29 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
4890
4893
|
})
|
|
4891
4894
|
});
|
|
4892
4895
|
if (!(submittedOrderId !== null && submittedOrderId !== undefined)) {
|
|
4893
|
-
_context33.next =
|
|
4896
|
+
_context33.next = 56;
|
|
4894
4897
|
break;
|
|
4895
4898
|
}
|
|
4896
4899
|
tempOrder.order_id = submittedOrderId;
|
|
4897
4900
|
resultRecord = result;
|
|
4898
|
-
_context33.next =
|
|
4901
|
+
_context33.next = 54;
|
|
4899
4902
|
return this.markLocalOrderSynced(submittedOrderId, (resultRecord === null || resultRecord === void 0 ? void 0 : resultRecord.data) || resultRecord || {});
|
|
4900
|
-
case
|
|
4901
|
-
_context33.next =
|
|
4903
|
+
case 54:
|
|
4904
|
+
_context33.next = 57;
|
|
4902
4905
|
break;
|
|
4903
|
-
case
|
|
4906
|
+
case 56:
|
|
4904
4907
|
if (this.isLocalPendingSubmitResult(result)) {
|
|
4905
4908
|
this.store.syncState = 'local';
|
|
4906
4909
|
} else {
|
|
4907
4910
|
this.store.syncState = 'submitted';
|
|
4908
4911
|
}
|
|
4909
|
-
case 56:
|
|
4910
|
-
return _context33.abrupt("return", result);
|
|
4911
4912
|
case 57:
|
|
4913
|
+
return _context33.abrupt("return", result);
|
|
4914
|
+
case 58:
|
|
4912
4915
|
case "end":
|
|
4913
4916
|
return _context33.stop();
|
|
4914
4917
|
}
|
|
4915
|
-
}, _callee30, this, [[
|
|
4918
|
+
}, _callee30, this, [[26, 33]]);
|
|
4916
4919
|
}));
|
|
4917
4920
|
function runSubmitTempOrder(_x34) {
|
|
4918
4921
|
return _runSubmitTempOrder.apply(this, arguments);
|
|
@@ -5317,8 +5320,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5317
5320
|
key: "createOrderByCheckout",
|
|
5318
5321
|
value: (function () {
|
|
5319
5322
|
var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(params) {
|
|
5320
|
-
var _params$payments, _params$bookings2, _params$relation_prod2, _params$payments2, _params$payments3;
|
|
5321
|
-
var onlineStorePaymentCodeList, _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, orderData, response;
|
|
5323
|
+
var _params$payments, _params$bookings2, _params$relation_prod2, _params$payments2, _params$payments3, _params$bookings3, _params$relation_prod3, _params$payments4;
|
|
5324
|
+
var onlineStorePaymentCodeList, _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, _orderData$bookings2, _orderData$relation_p2, _orderData$payments4, _orderData$payments5, _response$data, orderData, response;
|
|
5322
5325
|
return _regeneratorRuntime().wrap(function _callee36$(_context39) {
|
|
5323
5326
|
while (1) switch (_context39.prev = _context39.next) {
|
|
5324
5327
|
case 0:
|
|
@@ -5345,7 +5348,16 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5345
5348
|
return p.code;
|
|
5346
5349
|
})) || []
|
|
5347
5350
|
});
|
|
5348
|
-
|
|
5351
|
+
console.log('[Order] createOrderByCheckout 开始创建订单:', {
|
|
5352
|
+
type: params.type,
|
|
5353
|
+
platform: params.platform,
|
|
5354
|
+
is_deposit: params.is_deposit,
|
|
5355
|
+
customer_id: params.customer_id,
|
|
5356
|
+
bookingsCount: ((_params$bookings3 = params.bookings) === null || _params$bookings3 === void 0 ? void 0 : _params$bookings3.length) || 0,
|
|
5357
|
+
relationProductsCount: ((_params$relation_prod3 = params.relation_products) === null || _params$relation_prod3 === void 0 ? void 0 : _params$relation_prod3.length) || 0,
|
|
5358
|
+
paymentsCount: ((_params$payments4 = params.payments) === null || _params$payments4 === void 0 ? void 0 : _params$payments4.length) || 0
|
|
5359
|
+
});
|
|
5360
|
+
_context39.prev = 4;
|
|
5349
5361
|
// 构建订单数据,设置默认值并允许 params 覆盖
|
|
5350
5362
|
orderData = _objectSpread({
|
|
5351
5363
|
sales_channel: 'my_pisel',
|
|
@@ -5367,18 +5379,32 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5367
5379
|
if (!params.order_id && !orderData.schedule_date) {
|
|
5368
5380
|
orderData.schedule_date = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
5369
5381
|
}
|
|
5370
|
-
|
|
5371
|
-
this.logInfo('Calling backend checkout API', {
|
|
5382
|
+
console.log('[Order] 调用后端接口创建订单:', {
|
|
5372
5383
|
url: '/shop/order/checkout',
|
|
5373
5384
|
orderType: orderData.type,
|
|
5374
5385
|
platform: orderData.platform,
|
|
5375
5386
|
isDeposit: orderData.is_deposit,
|
|
5376
5387
|
customerId: orderData.customer_id,
|
|
5377
|
-
depositAmount: orderData.deposit_amount,
|
|
5378
5388
|
bookingsCount: ((_orderData$bookings = orderData.bookings) === null || _orderData$bookings === void 0 ? void 0 : _orderData$bookings.length) || 0,
|
|
5379
5389
|
relationProductsCount: ((_orderData$relation_p = orderData.relation_products) === null || _orderData$relation_p === void 0 ? void 0 : _orderData$relation_p.length) || 0,
|
|
5380
5390
|
paymentsCount: ((_orderData$payments2 = orderData.payments) === null || _orderData$payments2 === void 0 ? void 0 : _orderData$payments2.length) || 0,
|
|
5381
|
-
|
|
5391
|
+
paymentsMethods: ((_orderData$payments3 = orderData.payments) === null || _orderData$payments3 === void 0 ? void 0 : _orderData$payments3.map(function (p) {
|
|
5392
|
+
return p.code;
|
|
5393
|
+
})) || []
|
|
5394
|
+
});
|
|
5395
|
+
|
|
5396
|
+
// 记录接口调用详情
|
|
5397
|
+
this.logInfo('Calling backend checkout API', {
|
|
5398
|
+
url: '/shop/order/checkout',
|
|
5399
|
+
orderType: orderData.type,
|
|
5400
|
+
platform: orderData.platform,
|
|
5401
|
+
isDeposit: orderData.is_deposit,
|
|
5402
|
+
customerId: orderData.customer_id,
|
|
5403
|
+
depositAmount: orderData.deposit_amount,
|
|
5404
|
+
bookingsCount: ((_orderData$bookings2 = orderData.bookings) === null || _orderData$bookings2 === void 0 ? void 0 : _orderData$bookings2.length) || 0,
|
|
5405
|
+
relationProductsCount: ((_orderData$relation_p2 = orderData.relation_products) === null || _orderData$relation_p2 === void 0 ? void 0 : _orderData$relation_p2.length) || 0,
|
|
5406
|
+
paymentsCount: ((_orderData$payments4 = orderData.payments) === null || _orderData$payments4 === void 0 ? void 0 : _orderData$payments4.length) || 0,
|
|
5407
|
+
paymentMethods: ((_orderData$payments5 = orderData.payments) === null || _orderData$payments5 === void 0 ? void 0 : _orderData$payments5.map(function (p) {
|
|
5382
5408
|
return {
|
|
5383
5409
|
code: p.code,
|
|
5384
5410
|
amount: p.amount,
|
|
@@ -5393,30 +5419,34 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5393
5419
|
hasOrderId: !!orderData.order_id,
|
|
5394
5420
|
smallTicketDataFlag: orderData.small_ticket_data_flag
|
|
5395
5421
|
});
|
|
5396
|
-
_context39.next =
|
|
5422
|
+
_context39.next = 12;
|
|
5397
5423
|
return this.request.post('/order/checkout', orderData, {
|
|
5398
5424
|
osServer: true,
|
|
5399
5425
|
customToast: function customToast() {}
|
|
5400
5426
|
});
|
|
5401
|
-
case
|
|
5427
|
+
case 12:
|
|
5402
5428
|
response = _context39.sent;
|
|
5403
5429
|
this.logInfo('Order API called successfully', {
|
|
5404
5430
|
response: response
|
|
5405
5431
|
});
|
|
5432
|
+
console.log('[Order] 订单创建成功,后端响应:', {
|
|
5433
|
+
success: !!response,
|
|
5434
|
+
hasOrderId: !!(response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.order_id || response !== null && response !== void 0 && response.order_id)
|
|
5435
|
+
});
|
|
5406
5436
|
return _context39.abrupt("return", response);
|
|
5407
|
-
case
|
|
5408
|
-
_context39.prev =
|
|
5409
|
-
_context39.t0 = _context39["catch"](
|
|
5437
|
+
case 18:
|
|
5438
|
+
_context39.prev = 18;
|
|
5439
|
+
_context39.t0 = _context39["catch"](4);
|
|
5410
5440
|
console.error('[Order] createOrderByCheckout 创建订单失败:', _context39.t0);
|
|
5411
5441
|
this.logInfo('Order API called failed', {
|
|
5412
5442
|
error: _context39.t0 instanceof Error ? _context39.t0.message : String(_context39.t0)
|
|
5413
5443
|
});
|
|
5414
5444
|
throw _context39.t0;
|
|
5415
|
-
case
|
|
5445
|
+
case 23:
|
|
5416
5446
|
case "end":
|
|
5417
5447
|
return _context39.stop();
|
|
5418
5448
|
}
|
|
5419
|
-
}, _callee36, this, [[
|
|
5449
|
+
}, _callee36, this, [[4, 18]]);
|
|
5420
5450
|
}));
|
|
5421
5451
|
function createOrderByCheckout(_x41) {
|
|
5422
5452
|
return _createOrderByCheckout.apply(this, arguments);
|