@pisell/pisellos 2.1.163 → 2.1.165
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/index.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/model/strategy/adapter/index.d.ts +0 -4
- package/dist/model/strategy/adapter/index.js +1 -5
- package/dist/modules/Discount/index.d.ts +2 -5
- package/dist/modules/Discount/index.js +1 -21
- package/dist/modules/Discount/types.d.ts +0 -4
- package/dist/modules/Order/index.d.ts +0 -1
- package/dist/modules/Order/index.js +6 -18
- package/dist/modules/Order/types.d.ts +0 -2
- package/dist/modules/ProductList/index.d.ts +1 -3
- package/dist/modules/ProductList/index.js +11 -22
- package/dist/modules/Schedule/getDateIsInSchedule.js +0 -5
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/ScanOrder/index.js +1 -1
- package/dist/solution/ShopDiscount/index.js +15 -16
- package/dist/solution/VenueBooking/index.d.ts +8 -23
- package/dist/solution/VenueBooking/index.js +476 -528
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/dist/solution/VenueBooking/utils/dateSummary.js +25 -12
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/dist/solution/VenueBooking/utils/timeSlot.js +4 -9
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/lib/model/strategy/adapter/index.d.ts +0 -4
- package/lib/model/strategy/adapter/index.js +2 -13
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/Discount/index.d.ts +2 -5
- package/lib/modules/Discount/index.js +1 -11
- package/lib/modules/Discount/types.d.ts +0 -4
- package/lib/modules/Order/index.d.ts +0 -1
- package/lib/modules/Order/index.js +1 -11
- package/lib/modules/Order/types.d.ts +0 -2
- package/lib/modules/ProductList/index.d.ts +1 -3
- package/lib/modules/ProductList/index.js +39 -45
- package/lib/modules/Schedule/getDateIsInSchedule.js +0 -4
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/ScanOrder/index.js +1 -1
- package/lib/solution/ShopDiscount/index.js +2 -3
- package/lib/solution/VenueBooking/index.d.ts +8 -23
- package/lib/solution/VenueBooking/index.js +87 -164
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/lib/solution/VenueBooking/utils/dateSummary.js +10 -5
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +4 -3
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/lib/solution/VenueBooking/utils/timeSlot.js +3 -7
- package/package.json +1 -1
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -780
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -148
- package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -233
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -583
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -148
- package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -180
|
@@ -45,7 +45,6 @@ import { extractResourceIds, buildResourceProductMap } from "./utils/resource";
|
|
|
45
45
|
import { buildTimeSlotGrid, isBusinessHoursCrossDay, generateTimeLabels } from "./utils/timeSlot";
|
|
46
46
|
import { buildDateRangeSummary } from "./utils/dateSummary";
|
|
47
47
|
import { mergeConsecutiveSlots, expandMergedSlotToIndividual, buildVenueIdentityKey, buildVenueBookingEntry, buildVenueResourceMetadata, buildPriceBreakdown } from "./utils/slotMerge";
|
|
48
|
-
import { buildSlotPriceMapByScheduleSegments, formatProductsWithDataVariant, getPriceForProductAtDatetime, getSlotPriceFromMap } from "./utils/smartPricing";
|
|
49
48
|
import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
|
|
50
49
|
import { OrderModule } from "../../modules/Order";
|
|
51
50
|
import { RegisterAndLoginHooks } from "../RegisterAndLogin/types";
|
|
@@ -102,10 +101,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
102
101
|
_defineProperty(_assertThisInitialized(_this), "loadAllProductsInFlight", null);
|
|
103
102
|
_defineProperty(_assertThisInitialized(_this), "productsLoaded", false);
|
|
104
103
|
_defineProperty(_assertThisInitialized(_this), "loadOpenDataConfigInFlight", null);
|
|
105
|
-
/** 按日期缓存 slot 智能定价 Map,避免同周重复 resolveProducts */
|
|
106
|
-
_defineProperty(_assertThisInitialized(_this), "slotPriceMapCache", new Map());
|
|
107
|
-
/** loadProducts 后缓存的全量商品(venue + addon),供分段算价复用 */
|
|
108
|
-
_defineProperty(_assertThisInitialized(_this), "smartPricingProductCatalog", []);
|
|
109
104
|
return _this;
|
|
110
105
|
}
|
|
111
106
|
_createClass(VenueBookingImpl, [{
|
|
@@ -400,28 +395,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
400
395
|
case 9:
|
|
401
396
|
this.customerLoginRefreshIdInFlight = params.customerId;
|
|
402
397
|
refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
398
|
+
var _this3$otherParams;
|
|
403
399
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
404
400
|
while (1) switch (_context4.prev = _context4.next) {
|
|
405
401
|
case 0:
|
|
406
|
-
|
|
402
|
+
if (!_this3.store.quotation) {
|
|
403
|
+
_context4.next = 3;
|
|
404
|
+
break;
|
|
405
|
+
}
|
|
406
|
+
_context4.next = 3;
|
|
407
|
+
return _this3.store.quotation.loadQuotations({
|
|
408
|
+
channel: (_this3$otherParams = _this3.otherParams) === null || _this3$otherParams === void 0 ? void 0 : _this3$otherParams.channel
|
|
409
|
+
});
|
|
410
|
+
case 3:
|
|
411
|
+
_this3.recalculateOrderPricesFromQuotation();
|
|
412
|
+
_context4.next = 6;
|
|
407
413
|
return _this3.store.order.loadDiscountConfig({
|
|
408
414
|
customerId: params.customerId
|
|
409
415
|
});
|
|
410
|
-
case
|
|
411
|
-
|
|
412
|
-
_this3.recalculateOrderPricesFromSmartPricing();
|
|
413
|
-
_context4.next = 6;
|
|
416
|
+
case 6:
|
|
417
|
+
_context4.next = 8;
|
|
414
418
|
return _this3.store.order.recalculateSummary({
|
|
415
419
|
createIfMissing: true
|
|
416
420
|
});
|
|
417
|
-
case
|
|
421
|
+
case 8:
|
|
418
422
|
_this3.store.order.persistTempOrder();
|
|
419
|
-
_context4.next = 9;
|
|
420
|
-
return _this3.refreshItemRuleQuantityLimits();
|
|
421
|
-
case 9:
|
|
422
423
|
_context4.next = 11;
|
|
423
|
-
return _this3.
|
|
424
|
+
return _this3.refreshItemRuleQuantityLimits();
|
|
424
425
|
case 11:
|
|
426
|
+
_context4.next = 13;
|
|
427
|
+
return _this3.refreshCartValidationPassed();
|
|
428
|
+
case 13:
|
|
425
429
|
case "end":
|
|
426
430
|
return _context4.stop();
|
|
427
431
|
}
|
|
@@ -478,6 +482,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
478
482
|
openDataModule,
|
|
479
483
|
_this$store$order,
|
|
480
484
|
_this$store$order2,
|
|
485
|
+
_this$store$quotation,
|
|
486
|
+
_this$otherParams6,
|
|
481
487
|
_args6 = arguments;
|
|
482
488
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
483
489
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -627,29 +633,34 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
627
633
|
return this.loadRuntimeConfigs();
|
|
628
634
|
case 56:
|
|
629
635
|
if (!this.store.schedule) {
|
|
630
|
-
_context6.next =
|
|
636
|
+
_context6.next = 61;
|
|
631
637
|
break;
|
|
632
638
|
}
|
|
633
639
|
_context6.next = 59;
|
|
634
640
|
return this.store.schedule.loadAllSchedule();
|
|
635
641
|
case 59:
|
|
636
|
-
|
|
637
|
-
|
|
642
|
+
this.injectScheduleResolverToQuotation();
|
|
643
|
+
(_this$store$quotation = this.store.quotation) === null || _this$store$quotation === void 0 || _this$store$quotation.loadQuotations({
|
|
644
|
+
channel: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.channel
|
|
645
|
+
});
|
|
638
646
|
case 61:
|
|
647
|
+
_context6.next = 63;
|
|
648
|
+
return this.refreshItemRuleQuantityLimits();
|
|
649
|
+
case 63:
|
|
639
650
|
this.store.status = 'ready';
|
|
640
651
|
console.log('[VenueBooking] 初始化完成');
|
|
641
|
-
_context6.next =
|
|
652
|
+
_context6.next = 67;
|
|
642
653
|
return this.core.effects.emit(VenueBookingHooks.onInited, {
|
|
643
654
|
status: this.store.status
|
|
644
655
|
});
|
|
645
|
-
case
|
|
656
|
+
case 67:
|
|
646
657
|
this.logMethodSuccess('initialize', {
|
|
647
658
|
status: this.store.status
|
|
648
659
|
});
|
|
649
|
-
_context6.next =
|
|
660
|
+
_context6.next = 77;
|
|
650
661
|
break;
|
|
651
|
-
case
|
|
652
|
-
_context6.prev =
|
|
662
|
+
case 70:
|
|
663
|
+
_context6.prev = 70;
|
|
653
664
|
_context6.t0 = _context6["catch"](50);
|
|
654
665
|
this.store.status = 'error';
|
|
655
666
|
this.store.error = _context6.t0 instanceof Error ? _context6.t0.message : '初始化失败';
|
|
@@ -658,11 +669,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
658
669
|
status: this.store.status
|
|
659
670
|
});
|
|
660
671
|
throw _context6.t0;
|
|
661
|
-
case
|
|
672
|
+
case 77:
|
|
662
673
|
case "end":
|
|
663
674
|
return _context6.stop();
|
|
664
675
|
}
|
|
665
|
-
}, _callee6, this, [[50,
|
|
676
|
+
}, _callee6, this, [[50, 70]]);
|
|
666
677
|
}));
|
|
667
678
|
function initialize(_x5) {
|
|
668
679
|
return _initialize.apply(this, arguments);
|
|
@@ -803,112 +814,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
803
814
|
};
|
|
804
815
|
}
|
|
805
816
|
|
|
806
|
-
/** 清除 slot 价格分段缓存(商品重载 / 登录后 customerId 变化时调用) */
|
|
807
|
-
}, {
|
|
808
|
-
key: "clearSlotPriceMapCache",
|
|
809
|
-
value: function clearSlotPriceMapCache() {
|
|
810
|
-
this.slotPriceMapCache.clear();
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
/** 读取当前登录 customerId */
|
|
814
|
-
}, {
|
|
815
|
-
key: "resolveCustomerIdForSmartPricing",
|
|
816
|
-
value: function resolveCustomerIdForSmartPricing() {
|
|
817
|
-
try {
|
|
818
|
-
var _this$core4, _userPlugin$get;
|
|
819
|
-
var userPlugin = (_this$core4 = this.core) === null || _this$core4 === void 0 ? void 0 : _this$core4.getPlugin('user');
|
|
820
|
-
var customerId = Number(userPlugin === null || userPlugin === void 0 || (_userPlugin$get = userPlugin.get) === null || _userPlugin$get === void 0 || (_userPlugin$get = _userPlugin$get.call(userPlugin)) === null || _userPlugin$get === void 0 ? void 0 : _userPlugin$get.id);
|
|
821
|
-
return Number.isFinite(customerId) && customerId > 0 ? customerId : undefined;
|
|
822
|
-
} catch (_unused2) {
|
|
823
|
-
return undefined;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
}, {
|
|
827
|
-
key: "resolveAvailableWalletIdsForSmartPricing",
|
|
828
|
-
value: function resolveAvailableWalletIdsForSmartPricing() {
|
|
829
|
-
var _this$store$order3, _this$store$order3$ge, _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
|
|
830
|
-
var orderWalletIds = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getAvailableWalletIds) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3);
|
|
831
|
-
var fallbackWalletIds = ((_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.available_wallet_ids) || ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.availableWalletIds) || ((_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 || (_this$otherParams8 = _this$otherParams8.strategy_context) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.available_wallet_ids) || ((_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 || (_this$otherParams9 = _this$otherParams9.strategy_context) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.availableWalletIds);
|
|
832
|
-
var source = Array.isArray(orderWalletIds) && orderWalletIds.length ? orderWalletIds : fallbackWalletIds;
|
|
833
|
-
if (!Array.isArray(source)) return [];
|
|
834
|
-
var ids = source.map(function (item) {
|
|
835
|
-
return Number(item);
|
|
836
|
-
}).filter(function (item) {
|
|
837
|
-
return Number.isFinite(item) && item > 0;
|
|
838
|
-
});
|
|
839
|
-
return Array.from(new Set(ids));
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
/** 读取 schedule 全量列表,供智能定价 schedule_match 使用 */
|
|
843
|
-
}, {
|
|
844
|
-
key: "getScheduleListForSmartPricing",
|
|
845
|
-
value: function getScheduleListForSmartPricing() {
|
|
846
|
-
var _store;
|
|
847
|
-
var scheduleModule = this.store.schedule;
|
|
848
|
-
var list = scheduleModule === null || scheduleModule === void 0 || (_store = scheduleModule.store) === null || _store === void 0 ? void 0 : _store.scheduleList;
|
|
849
|
-
return Array.isArray(list) ? list : [];
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
/** 构建智能定价上下文,对齐 OS Server buildProductFormatterContext */
|
|
853
|
-
}, {
|
|
854
|
-
key: "buildSmartPricingContext",
|
|
855
|
-
value: function buildSmartPricingContext(customerId) {
|
|
856
|
-
var _this$core5, _this$otherParams10, _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16;
|
|
857
|
-
var evaluator = (_this$core5 = this.core) === null || _this$core5 === void 0 || (_this$core5 = _this$core5.context) === null || _this$core5 === void 0 ? void 0 : _this$core5.dataVariantEvaluator;
|
|
858
|
-
return {
|
|
859
|
-
evaluator: evaluator,
|
|
860
|
-
scheduleList: this.getScheduleListForSmartPricing(),
|
|
861
|
-
menuList: ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.menuList) || ((_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 || (_this$otherParams11 = _this$otherParams11.openData) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.menuList) || [],
|
|
862
|
-
customerId: customerId !== null && customerId !== void 0 ? customerId : this.resolveCustomerIdForSmartPricing(),
|
|
863
|
-
availableWalletIds: this.resolveAvailableWalletIdsForSmartPricing(),
|
|
864
|
-
channel: (_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.channel,
|
|
865
|
-
businessCode: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.businessCode,
|
|
866
|
-
orderType: ((_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.orderType) || ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.type),
|
|
867
|
-
strategy_context: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.strategy_context
|
|
868
|
-
};
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
/** venue + addon 全量商品,供智能定价评估 */
|
|
872
|
-
}, {
|
|
873
|
-
key: "getAllProductsForSmartPricing",
|
|
874
|
-
value: function getAllProductsForSmartPricing() {
|
|
875
|
-
if (this.smartPricingProductCatalog.length) {
|
|
876
|
-
return this.smartPricingProductCatalog;
|
|
877
|
-
}
|
|
878
|
-
var venueList = this.getVenueProducts();
|
|
879
|
-
var addonList = this.getAddonProductsList();
|
|
880
|
-
return [].concat(_toConsumableArray(venueList), _toConsumableArray(addonList));
|
|
881
|
-
}
|
|
882
|
-
}, {
|
|
883
|
-
key: "getSlotPriceMapCacheKey",
|
|
884
|
-
value: function getSlotPriceMapCacheKey(date, context) {
|
|
885
|
-
var _context$customerId, _context$channel, _context$businessCode;
|
|
886
|
-
return [date, (_context$customerId = context.customerId) !== null && _context$customerId !== void 0 ? _context$customerId : '', (context.availableWalletIds || []).join(','), (_context$channel = context.channel) !== null && _context$channel !== void 0 ? _context$channel : '', (_context$businessCode = context.businessCode) !== null && _context$businessCode !== void 0 ? _context$businessCode : ''].join('|');
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
/**
|
|
890
|
-
* 按 schedule 分段构建 slot 价格 Map,带实例级缓存。
|
|
891
|
-
*/
|
|
892
|
-
}, {
|
|
893
|
-
key: "buildSlotPriceMapForDate",
|
|
894
|
-
value: function buildSlotPriceMapForDate(date, config, productIds) {
|
|
895
|
-
var context = this.buildSmartPricingContext();
|
|
896
|
-
var cacheKey = this.getSlotPriceMapCacheKey(date, context);
|
|
897
|
-
var cached = this.slotPriceMapCache.get(cacheKey);
|
|
898
|
-
if (cached) return cached;
|
|
899
|
-
var timeLabels = generateTimeLabels(config);
|
|
900
|
-
var slotPriceMap = buildSlotPriceMapByScheduleSegments({
|
|
901
|
-
products: this.getAllProductsForSmartPricing(),
|
|
902
|
-
productIds: productIds,
|
|
903
|
-
date: date,
|
|
904
|
-
timeLabels: timeLabels,
|
|
905
|
-
config: config,
|
|
906
|
-
context: context
|
|
907
|
-
});
|
|
908
|
-
this.slotPriceMapCache.set(cacheKey, slotPriceMap);
|
|
909
|
-
return slotPriceMap;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
817
|
// ─── 场地商品 & 附加商品 ───
|
|
913
818
|
}, {
|
|
914
819
|
key: "loadAllProducts",
|
|
@@ -943,7 +848,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
943
848
|
key: "_doLoadAllProducts",
|
|
944
849
|
value: function () {
|
|
945
850
|
var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
946
|
-
var _this$
|
|
851
|
+
var _this$otherParams7, _this$store$venueProd, associatedMenus, menuListIds, allProducts, list, venueList, addonList, venueStore;
|
|
947
852
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
948
853
|
while (1) switch (_context11.prev = _context11.next) {
|
|
949
854
|
case 0:
|
|
@@ -964,7 +869,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
964
869
|
_context11.next = 8;
|
|
965
870
|
return this.loadOpenDataConfig();
|
|
966
871
|
case 8:
|
|
967
|
-
associatedMenus = ((_this$
|
|
872
|
+
associatedMenus = ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 || (_this$otherParams7 = _this$otherParams7.openData) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7['menu.associated_menus']) || [];
|
|
968
873
|
if (associatedMenus.length) {
|
|
969
874
|
_context11.next = 12;
|
|
970
875
|
break;
|
|
@@ -980,16 +885,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
980
885
|
menu_list_ids: menuListIds,
|
|
981
886
|
cacheId: this.cacheId,
|
|
982
887
|
schedule_date: dayjs().format('YYYY-MM-DD'),
|
|
983
|
-
schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
984
|
-
with_extra: ['dataVariants']
|
|
888
|
+
schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
985
889
|
});
|
|
986
890
|
case 15:
|
|
987
891
|
allProducts = _context11.sent;
|
|
988
|
-
|
|
989
|
-
list = rawList;
|
|
990
|
-
this.smartPricingProductCatalog = rawList.slice();
|
|
991
|
-
list = formatProductsWithDataVariant(list, this.buildSmartPricingContext(), dayjs().format('YYYY-MM-DD HH:mm:ss'));
|
|
992
|
-
this.clearSlotPriceMapCache();
|
|
892
|
+
list = Array.isArray(allProducts) ? allProducts : [];
|
|
993
893
|
venueList = list.filter(function (p) {
|
|
994
894
|
return p.duration != null;
|
|
995
895
|
});
|
|
@@ -1015,16 +915,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1015
915
|
venueProducts: venueList,
|
|
1016
916
|
addonProducts: addonList
|
|
1017
917
|
});
|
|
1018
|
-
case
|
|
1019
|
-
_context11.prev =
|
|
918
|
+
case 28:
|
|
919
|
+
_context11.prev = 28;
|
|
1020
920
|
_context11.t0 = _context11["catch"](1);
|
|
1021
921
|
this.logMethodError('loadAllProducts', _context11.t0);
|
|
1022
922
|
throw _context11.t0;
|
|
1023
|
-
case
|
|
923
|
+
case 32:
|
|
1024
924
|
case "end":
|
|
1025
925
|
return _context11.stop();
|
|
1026
926
|
}
|
|
1027
|
-
}, _callee11, this, [[1,
|
|
927
|
+
}, _callee11, this, [[1, 28]]);
|
|
1028
928
|
}));
|
|
1029
929
|
function _doLoadAllProducts() {
|
|
1030
930
|
return _doLoadAllProducts2.apply(this, arguments);
|
|
@@ -1343,11 +1243,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1343
1243
|
config: this.baseSlotConfig,
|
|
1344
1244
|
rawResources: this.store.rawResourceData,
|
|
1345
1245
|
resourceProductMap: this.resourceProductMap,
|
|
1246
|
+
quotationModule: this.store.quotation,
|
|
1346
1247
|
resolveConfig: function resolveConfig(date) {
|
|
1347
1248
|
return _this6.resolveSlotConfigForDate(date);
|
|
1348
|
-
},
|
|
1349
|
-
buildSlotPriceMap: function buildSlotPriceMap(date, config, productIds) {
|
|
1350
|
-
return _this6.buildSlotPriceMapForDate(date, config, productIds);
|
|
1351
1249
|
}
|
|
1352
1250
|
});
|
|
1353
1251
|
}
|
|
@@ -1355,16 +1253,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1355
1253
|
key: "getTimeSlotGrid",
|
|
1356
1254
|
value: function getTimeSlotGrid(date) {
|
|
1357
1255
|
var resolvedSlotConfig = this.syncOperatingHoursToSlotConfig(date);
|
|
1358
|
-
var
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1256
|
+
var quotationPriceMap;
|
|
1257
|
+
if (this.store.quotation) {
|
|
1258
|
+
var productIds = _toConsumableArray(new Set(_toConsumableArray(this.resourceProductMap.values()).flat().map(function (m) {
|
|
1259
|
+
return m.productId;
|
|
1260
|
+
})));
|
|
1261
|
+
var timeLabels = generateTimeLabels(resolvedSlotConfig);
|
|
1262
|
+
var timePoints = timeLabels.map(function (label) {
|
|
1263
|
+
return "".concat(date, " ").concat(label);
|
|
1264
|
+
});
|
|
1265
|
+
quotationPriceMap = this.store.quotation.buildProductPriceMap({
|
|
1266
|
+
productIds: productIds,
|
|
1267
|
+
timePoints: timePoints
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1362
1270
|
return buildTimeSlotGrid({
|
|
1363
1271
|
date: date,
|
|
1364
1272
|
config: resolvedSlotConfig,
|
|
1365
1273
|
rawResources: this.store.rawResourceData,
|
|
1366
1274
|
resourceProductMap: this.resourceProductMap,
|
|
1367
|
-
|
|
1275
|
+
quotationPriceMap: quotationPriceMap
|
|
1368
1276
|
});
|
|
1369
1277
|
}
|
|
1370
1278
|
|
|
@@ -1464,8 +1372,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1464
1372
|
}, {
|
|
1465
1373
|
key: "getSelectedSlotsForResource",
|
|
1466
1374
|
value: function getSelectedSlotsForResource(resourceId, productId) {
|
|
1467
|
-
var _this$store$
|
|
1468
|
-
var tempOrder = (_this$store$
|
|
1375
|
+
var _this$store$order3;
|
|
1376
|
+
var tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 ? void 0 : _this$store$order3.getTempOrder();
|
|
1469
1377
|
if (!tempOrder) return [];
|
|
1470
1378
|
var venueProducts = tempOrder.products.filter(function (p) {
|
|
1471
1379
|
var _p$metadata, _p$metadata2;
|
|
@@ -1626,9 +1534,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1626
1534
|
}, {
|
|
1627
1535
|
key: "getAllSelectedSlots",
|
|
1628
1536
|
value: function getAllSelectedSlots() {
|
|
1629
|
-
var _this$store$
|
|
1537
|
+
var _this$store$order4;
|
|
1630
1538
|
var result = new Map();
|
|
1631
|
-
var tempOrder = (_this$store$
|
|
1539
|
+
var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
|
|
1632
1540
|
if (!tempOrder) return result;
|
|
1633
1541
|
var venueProducts = tempOrder.products.filter(function (p) {
|
|
1634
1542
|
var _p$metadata3;
|
|
@@ -1800,7 +1708,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1800
1708
|
booking_uid: bookingUuid,
|
|
1801
1709
|
price_breakdown: buildPriceBreakdown({
|
|
1802
1710
|
group: group,
|
|
1803
|
-
productId: mapping.productId
|
|
1711
|
+
productId: mapping.productId,
|
|
1712
|
+
quotation: this.store.quotation
|
|
1804
1713
|
})
|
|
1805
1714
|
},
|
|
1806
1715
|
_origin: {
|
|
@@ -1931,25 +1840,36 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1931
1840
|
_context18.next = 6;
|
|
1932
1841
|
return this.store.schedule.loadAllSchedule();
|
|
1933
1842
|
case 6:
|
|
1843
|
+
this.injectScheduleResolverToQuotation();
|
|
1934
1844
|
this.logMethodSuccess('loadSchedules');
|
|
1935
|
-
_context18.next =
|
|
1845
|
+
_context18.next = 14;
|
|
1936
1846
|
break;
|
|
1937
|
-
case
|
|
1938
|
-
_context18.prev =
|
|
1847
|
+
case 10:
|
|
1848
|
+
_context18.prev = 10;
|
|
1939
1849
|
_context18.t0 = _context18["catch"](1);
|
|
1940
1850
|
this.logMethodError('loadSchedules', _context18.t0);
|
|
1941
1851
|
throw _context18.t0;
|
|
1942
|
-
case
|
|
1852
|
+
case 14:
|
|
1943
1853
|
case "end":
|
|
1944
1854
|
return _context18.stop();
|
|
1945
1855
|
}
|
|
1946
|
-
}, _callee18, this, [[1,
|
|
1856
|
+
}, _callee18, this, [[1, 10]]);
|
|
1947
1857
|
}));
|
|
1948
1858
|
function loadSchedules() {
|
|
1949
1859
|
return _loadSchedules.apply(this, arguments);
|
|
1950
1860
|
}
|
|
1951
1861
|
return loadSchedules;
|
|
1952
1862
|
}()
|
|
1863
|
+
}, {
|
|
1864
|
+
key: "injectScheduleResolverToQuotation",
|
|
1865
|
+
value: function injectScheduleResolverToQuotation() {
|
|
1866
|
+
var _this9 = this;
|
|
1867
|
+
if (this.store.quotation && this.store.schedule) {
|
|
1868
|
+
this.store.quotation.setScheduleResolver(function (id) {
|
|
1869
|
+
return _this9.store.schedule.getScheduleListByIds([id])[0];
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1953
1873
|
}, {
|
|
1954
1874
|
key: "getScheduleListByIds",
|
|
1955
1875
|
value: function getScheduleListByIds(ids) {
|
|
@@ -1961,8 +1881,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1961
1881
|
}, {
|
|
1962
1882
|
key: "getTempOrder",
|
|
1963
1883
|
value: function getTempOrder() {
|
|
1964
|
-
var _this$store$
|
|
1965
|
-
var result = ((_this$store$
|
|
1884
|
+
var _this$store$order5;
|
|
1885
|
+
var result = ((_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder()) || null;
|
|
1966
1886
|
return result;
|
|
1967
1887
|
}
|
|
1968
1888
|
}, {
|
|
@@ -2021,16 +1941,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2021
1941
|
return onCustomerLogin;
|
|
2022
1942
|
}()
|
|
2023
1943
|
}, {
|
|
2024
|
-
key: "
|
|
2025
|
-
value: function
|
|
1944
|
+
key: "recalculateOrderPricesFromQuotation",
|
|
1945
|
+
value: function recalculateOrderPricesFromQuotation() {
|
|
2026
1946
|
var _tempOrder$products,
|
|
2027
|
-
|
|
2028
|
-
if (!this.store.order) return;
|
|
1947
|
+
_this10 = this;
|
|
1948
|
+
if (!this.store.order || !this.store.quotation) return;
|
|
2029
1949
|
var tempOrder = this.store.order.getTempOrder();
|
|
2030
1950
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
|
|
2031
1951
|
var now = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
2032
|
-
var catalog = this.getAllProductsForSmartPricing();
|
|
2033
|
-
var context = this.buildSmartPricingContext();
|
|
2034
1952
|
var _iterator12 = _createForOfIteratorHelper(tempOrder.products),
|
|
2035
1953
|
_step12;
|
|
2036
1954
|
try {
|
|
@@ -2038,40 +1956,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2038
1956
|
var _product$metadata2;
|
|
2039
1957
|
var product = _step12.value;
|
|
2040
1958
|
if ((_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.venue_booking) {
|
|
2041
|
-
var mappings =
|
|
1959
|
+
var mappings = _this10.resourceProductMap.get(product.metadata.resource_id);
|
|
2042
1960
|
if (!mappings || !mappings.length) return 0; // continue
|
|
2043
1961
|
var mapping = mappings.find(function (m) {
|
|
2044
1962
|
return Number(m.productId) === Number(product.product_id);
|
|
2045
1963
|
}) || mappings[0];
|
|
2046
1964
|
if (!mapping) return 0; // continue
|
|
2047
|
-
var slots = expandMergedSlotToIndividual(product,
|
|
2048
|
-
var uniqueDates = _toConsumableArray(new Set(slots.map(function (slot) {
|
|
2049
|
-
return dayjs(slot.startTime).format('YYYY-MM-DD');
|
|
2050
|
-
})));
|
|
2051
|
-
var slotPriceMaps = new Map();
|
|
2052
|
-
var _iterator13 = _createForOfIteratorHelper(uniqueDates),
|
|
2053
|
-
_step13;
|
|
2054
|
-
try {
|
|
2055
|
-
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
2056
|
-
var slotDate = _step13.value;
|
|
2057
|
-
slotPriceMaps.set(slotDate, _this9.buildSlotPriceMapForDate(slotDate, _this9.store.slotConfig, [mapping.productId]));
|
|
2058
|
-
}
|
|
2059
|
-
} catch (err) {
|
|
2060
|
-
_iterator13.e(err);
|
|
2061
|
-
} finally {
|
|
2062
|
-
_iterator13.f();
|
|
2063
|
-
}
|
|
1965
|
+
var slots = expandMergedSlotToIndividual(product, _this10.store.slotConfig.slotDurationMinutes);
|
|
2064
1966
|
var updatedSlots = slots.map(function (slot) {
|
|
2065
|
-
var
|
|
2066
|
-
var slotPriceMap = slotPriceMaps.get(slotDate);
|
|
1967
|
+
var _getPriceForProduct;
|
|
2067
1968
|
return _objectSpread(_objectSpread({}, slot), {}, {
|
|
2068
1969
|
productId: mapping.productId,
|
|
2069
|
-
price:
|
|
2070
|
-
slotPriceMap: slotPriceMap,
|
|
1970
|
+
price: (_getPriceForProduct = _this10.store.quotation.getPriceForProduct({
|
|
2071
1971
|
productId: mapping.productId,
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
}) : mapping.price
|
|
1972
|
+
datetime: slot.startTime
|
|
1973
|
+
})) !== null && _getPriceForProduct !== void 0 ? _getPriceForProduct : mapping.price
|
|
2075
1974
|
});
|
|
2076
1975
|
});
|
|
2077
1976
|
var merged = mergeConsecutiveSlots(updatedSlots);
|
|
@@ -2080,19 +1979,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2080
1979
|
product.original_price = merged[0].totalPrice;
|
|
2081
1980
|
product.metadata.price_breakdown = buildPriceBreakdown({
|
|
2082
1981
|
group: merged[0],
|
|
2083
|
-
productId: mapping.productId
|
|
1982
|
+
productId: mapping.productId,
|
|
1983
|
+
quotation: _this10.store.quotation
|
|
2084
1984
|
});
|
|
2085
1985
|
}
|
|
2086
1986
|
} else if (product.product_id != null) {
|
|
2087
|
-
var
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
datetime: now
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
1987
|
+
var _product$product_vari;
|
|
1988
|
+
var quotationPrice = _this10.store.quotation.getPriceForProduct({
|
|
1989
|
+
productId: product.product_id,
|
|
1990
|
+
variantId: (_product$product_vari = product.product_variant_id) !== null && _product$product_vari !== void 0 ? _product$product_vari : undefined,
|
|
1991
|
+
datetime: now
|
|
1992
|
+
});
|
|
1993
|
+
if (quotationPrice !== null) {
|
|
1994
|
+
product.selling_price = quotationPrice;
|
|
1995
|
+
product.original_price = quotationPrice;
|
|
1996
|
+
}
|
|
2096
1997
|
}
|
|
2097
1998
|
},
|
|
2098
1999
|
_ret;
|
|
@@ -2171,7 +2072,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2171
2072
|
key: "setDiscountSelected",
|
|
2172
2073
|
value: (function () {
|
|
2173
2074
|
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
|
|
2174
|
-
var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds,
|
|
2075
|
+
var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator13, _step13, d, selectedResourceIds, _iterator14, _step14, _product$_origin, _product$metadata$sou, _product$metadata3, _product$metadata4, _product$original_pri, product, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
|
|
2175
2076
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2176
2077
|
while (1) switch (_context21.prev = _context21.next) {
|
|
2177
2078
|
case 0:
|
|
@@ -2231,18 +2132,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2231
2132
|
}).map(function (d) {
|
|
2232
2133
|
return d.id;
|
|
2233
2134
|
}));
|
|
2234
|
-
|
|
2135
|
+
_iterator13 = _createForOfIteratorHelper(nextDiscountList);
|
|
2235
2136
|
try {
|
|
2236
|
-
for (
|
|
2237
|
-
d =
|
|
2137
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
2138
|
+
d = _step13.value;
|
|
2238
2139
|
if (d.isSelected && !beforeSelectedIds.has(d.id)) {
|
|
2239
2140
|
d.isSelected = false;
|
|
2240
2141
|
}
|
|
2241
2142
|
}
|
|
2242
2143
|
} catch (err) {
|
|
2243
|
-
|
|
2144
|
+
_iterator13.e(err);
|
|
2244
2145
|
} finally {
|
|
2245
|
-
|
|
2146
|
+
_iterator13.f();
|
|
2246
2147
|
}
|
|
2247
2148
|
}
|
|
2248
2149
|
}
|
|
@@ -2255,15 +2156,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2255
2156
|
// 都以 original_price - Σ (当前选中 discount_list.amount) 重算 selling_price。
|
|
2256
2157
|
// 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
|
|
2257
2158
|
// 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
|
|
2258
|
-
|
|
2159
|
+
_iterator14 = _createForOfIteratorHelper(tempOrder.products);
|
|
2259
2160
|
_context21.prev = 19;
|
|
2260
|
-
|
|
2161
|
+
_iterator14.s();
|
|
2261
2162
|
case 21:
|
|
2262
|
-
if ((
|
|
2163
|
+
if ((_step14 = _iterator14.n()).done) {
|
|
2263
2164
|
_context21.next = 35;
|
|
2264
2165
|
break;
|
|
2265
2166
|
}
|
|
2266
|
-
product =
|
|
2167
|
+
product = _step14.value;
|
|
2267
2168
|
if (!((_product$_origin = product._origin) !== null && _product$_origin !== void 0 && _product$_origin.isManualDiscount)) {
|
|
2268
2169
|
_context21.next = 25;
|
|
2269
2170
|
break;
|
|
@@ -2303,10 +2204,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2303
2204
|
case 37:
|
|
2304
2205
|
_context21.prev = 37;
|
|
2305
2206
|
_context21.t0 = _context21["catch"](19);
|
|
2306
|
-
|
|
2207
|
+
_iterator14.e(_context21.t0);
|
|
2307
2208
|
case 40:
|
|
2308
2209
|
_context21.prev = 40;
|
|
2309
|
-
|
|
2210
|
+
_iterator14.f();
|
|
2310
2211
|
return _context21.finish(40);
|
|
2311
2212
|
case 43:
|
|
2312
2213
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
@@ -2438,7 +2339,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2438
2339
|
key: "submitOrder",
|
|
2439
2340
|
value: function () {
|
|
2440
2341
|
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
2441
|
-
var _this$
|
|
2342
|
+
var _this$otherParams8, _this$otherParams9, _this$otherParams10, _this$otherParams11, _tempOrder$products2, result, tempOrder;
|
|
2442
2343
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2443
2344
|
while (1) switch (_context24.prev = _context24.next) {
|
|
2444
2345
|
case 0:
|
|
@@ -2456,10 +2357,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2456
2357
|
_context24.next = 8;
|
|
2457
2358
|
return this.store.order.submitTempOrder({
|
|
2458
2359
|
cacheId: this.cacheId,
|
|
2459
|
-
platform: (_this$
|
|
2460
|
-
businessCode: (_this$
|
|
2461
|
-
channel: (_this$
|
|
2462
|
-
type: (_this$
|
|
2360
|
+
platform: (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.platform,
|
|
2361
|
+
businessCode: (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.businessCode,
|
|
2362
|
+
channel: (_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.channel,
|
|
2363
|
+
type: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.type
|
|
2463
2364
|
});
|
|
2464
2365
|
case 8:
|
|
2465
2366
|
result = _context24.sent;
|
|
@@ -2484,64 +2385,111 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2484
2385
|
}
|
|
2485
2386
|
return submitOrder;
|
|
2486
2387
|
}()
|
|
2388
|
+
/**
|
|
2389
|
+
* 0 元订单免费领取(非定金场景)
|
|
2390
|
+
* 与 appointment getFreeProduct 同接口:POST /pay/order/free-pay/:id
|
|
2391
|
+
*/
|
|
2487
2392
|
}, {
|
|
2488
|
-
key: "
|
|
2489
|
-
value: function () {
|
|
2490
|
-
var
|
|
2491
|
-
var
|
|
2393
|
+
key: "submitFreeOrder",
|
|
2394
|
+
value: (function () {
|
|
2395
|
+
var _submitFreeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(id) {
|
|
2396
|
+
var res;
|
|
2492
2397
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2493
2398
|
while (1) switch (_context25.prev = _context25.next) {
|
|
2399
|
+
case 0:
|
|
2400
|
+
this.logMethodStart('submitFreeOrder', {
|
|
2401
|
+
id: id
|
|
2402
|
+
});
|
|
2403
|
+
_context25.prev = 1;
|
|
2404
|
+
if (id) {
|
|
2405
|
+
_context25.next = 4;
|
|
2406
|
+
break;
|
|
2407
|
+
}
|
|
2408
|
+
throw new Error('订单 ID 不能为空');
|
|
2409
|
+
case 4:
|
|
2410
|
+
_context25.next = 6;
|
|
2411
|
+
return this.request.post("/pay/order/free-pay/".concat(id));
|
|
2412
|
+
case 6:
|
|
2413
|
+
res = _context25.sent;
|
|
2414
|
+
this.logMethodSuccess('submitFreeOrder', {
|
|
2415
|
+
id: id,
|
|
2416
|
+
status: res === null || res === void 0 ? void 0 : res.status
|
|
2417
|
+
});
|
|
2418
|
+
return _context25.abrupt("return", res);
|
|
2419
|
+
case 11:
|
|
2420
|
+
_context25.prev = 11;
|
|
2421
|
+
_context25.t0 = _context25["catch"](1);
|
|
2422
|
+
this.logMethodError('submitFreeOrder', _context25.t0);
|
|
2423
|
+
throw _context25.t0;
|
|
2424
|
+
case 15:
|
|
2425
|
+
case "end":
|
|
2426
|
+
return _context25.stop();
|
|
2427
|
+
}
|
|
2428
|
+
}, _callee25, this, [[1, 11]]);
|
|
2429
|
+
}));
|
|
2430
|
+
function submitFreeOrder(_x16) {
|
|
2431
|
+
return _submitFreeOrder.apply(this, arguments);
|
|
2432
|
+
}
|
|
2433
|
+
return submitFreeOrder;
|
|
2434
|
+
}())
|
|
2435
|
+
}, {
|
|
2436
|
+
key: "addProductToOrder",
|
|
2437
|
+
value: function () {
|
|
2438
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(product) {
|
|
2439
|
+
var _product$metadata5, _product$product_vari2, quotationPrice, products;
|
|
2440
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2441
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2494
2442
|
case 0:
|
|
2495
2443
|
this.logMethodStart('addProductToOrder', {
|
|
2496
2444
|
product_id: product.product_id,
|
|
2497
2445
|
product_variant_id: product.product_variant_id
|
|
2498
2446
|
});
|
|
2499
|
-
|
|
2447
|
+
_context26.prev = 1;
|
|
2500
2448
|
if (this.store.order) {
|
|
2501
|
-
|
|
2449
|
+
_context26.next = 4;
|
|
2502
2450
|
break;
|
|
2503
2451
|
}
|
|
2504
2452
|
throw new Error('order 模块未初始化');
|
|
2505
2453
|
case 4:
|
|
2506
|
-
if (!((_product$metadata5 = product.metadata) !== null && _product$metadata5 !== void 0 && _product$metadata5.venue_booking) && product.product_id != null) {
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
datetime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
|
2512
|
-
fallbackPrice: product.selling_price
|
|
2454
|
+
if (!((_product$metadata5 = product.metadata) !== null && _product$metadata5 !== void 0 && _product$metadata5.venue_booking) && this.store.quotation && product.product_id != null) {
|
|
2455
|
+
quotationPrice = this.store.quotation.getPriceForProduct({
|
|
2456
|
+
productId: product.product_id,
|
|
2457
|
+
variantId: (_product$product_vari2 = product.product_variant_id) !== null && _product$product_vari2 !== void 0 ? _product$product_vari2 : undefined,
|
|
2458
|
+
datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
2513
2459
|
});
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2460
|
+
if (quotationPrice !== null) {
|
|
2461
|
+
product.selling_price = quotationPrice;
|
|
2462
|
+
product.original_price = quotationPrice;
|
|
2463
|
+
} else if (product.selling_price != null) {
|
|
2464
|
+
product.original_price = product.selling_price;
|
|
2465
|
+
}
|
|
2518
2466
|
}
|
|
2519
|
-
|
|
2467
|
+
_context26.next = 7;
|
|
2520
2468
|
return this.store.order.addProductToOrder(product);
|
|
2521
2469
|
case 7:
|
|
2522
|
-
products =
|
|
2523
|
-
|
|
2470
|
+
products = _context26.sent;
|
|
2471
|
+
_context26.next = 10;
|
|
2524
2472
|
return this.refreshItemRuleQuantityLimits();
|
|
2525
2473
|
case 10:
|
|
2526
|
-
|
|
2474
|
+
_context26.next = 12;
|
|
2527
2475
|
return this.refreshCartValidationPassed();
|
|
2528
2476
|
case 12:
|
|
2529
2477
|
this.logMethodSuccess('addProductToOrder', {
|
|
2530
2478
|
productCount: products.length
|
|
2531
2479
|
});
|
|
2532
|
-
return
|
|
2480
|
+
return _context26.abrupt("return", products);
|
|
2533
2481
|
case 16:
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
this.logMethodError('addProductToOrder',
|
|
2537
|
-
throw
|
|
2482
|
+
_context26.prev = 16;
|
|
2483
|
+
_context26.t0 = _context26["catch"](1);
|
|
2484
|
+
this.logMethodError('addProductToOrder', _context26.t0);
|
|
2485
|
+
throw _context26.t0;
|
|
2538
2486
|
case 20:
|
|
2539
2487
|
case "end":
|
|
2540
|
-
return
|
|
2488
|
+
return _context26.stop();
|
|
2541
2489
|
}
|
|
2542
|
-
},
|
|
2490
|
+
}, _callee26, this, [[1, 16]]);
|
|
2543
2491
|
}));
|
|
2544
|
-
function addProductToOrder(
|
|
2492
|
+
function addProductToOrder(_x17) {
|
|
2545
2493
|
return _addProductToOrder.apply(this, arguments);
|
|
2546
2494
|
}
|
|
2547
2495
|
return addProductToOrder;
|
|
@@ -2549,48 +2497,48 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2549
2497
|
}, {
|
|
2550
2498
|
key: "updateProductInOrder",
|
|
2551
2499
|
value: function () {
|
|
2552
|
-
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2500
|
+
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
|
|
2553
2501
|
var products;
|
|
2554
|
-
return _regeneratorRuntime().wrap(function
|
|
2555
|
-
while (1) switch (
|
|
2502
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2503
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2556
2504
|
case 0:
|
|
2557
2505
|
this.logMethodStart('updateProductInOrder', {
|
|
2558
2506
|
product_id: params.product_id,
|
|
2559
2507
|
product_variant_id: params.product_variant_id
|
|
2560
2508
|
});
|
|
2561
|
-
|
|
2509
|
+
_context27.prev = 1;
|
|
2562
2510
|
if (this.store.order) {
|
|
2563
|
-
|
|
2511
|
+
_context27.next = 4;
|
|
2564
2512
|
break;
|
|
2565
2513
|
}
|
|
2566
2514
|
throw new Error('order 模块未初始化');
|
|
2567
2515
|
case 4:
|
|
2568
|
-
|
|
2516
|
+
_context27.next = 6;
|
|
2569
2517
|
return this.store.order.updateProductInOrder(params);
|
|
2570
2518
|
case 6:
|
|
2571
|
-
products =
|
|
2572
|
-
|
|
2519
|
+
products = _context27.sent;
|
|
2520
|
+
_context27.next = 9;
|
|
2573
2521
|
return this.refreshItemRuleQuantityLimits();
|
|
2574
2522
|
case 9:
|
|
2575
|
-
|
|
2523
|
+
_context27.next = 11;
|
|
2576
2524
|
return this.refreshCartValidationPassed();
|
|
2577
2525
|
case 11:
|
|
2578
2526
|
this.logMethodSuccess('updateProductInOrder', {
|
|
2579
2527
|
productCount: products.length
|
|
2580
2528
|
});
|
|
2581
|
-
return
|
|
2529
|
+
return _context27.abrupt("return", products);
|
|
2582
2530
|
case 15:
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
this.logMethodError('updateProductInOrder',
|
|
2586
|
-
throw
|
|
2531
|
+
_context27.prev = 15;
|
|
2532
|
+
_context27.t0 = _context27["catch"](1);
|
|
2533
|
+
this.logMethodError('updateProductInOrder', _context27.t0);
|
|
2534
|
+
throw _context27.t0;
|
|
2587
2535
|
case 19:
|
|
2588
2536
|
case "end":
|
|
2589
|
-
return
|
|
2537
|
+
return _context27.stop();
|
|
2590
2538
|
}
|
|
2591
|
-
},
|
|
2539
|
+
}, _callee27, this, [[1, 15]]);
|
|
2592
2540
|
}));
|
|
2593
|
-
function updateProductInOrder(
|
|
2541
|
+
function updateProductInOrder(_x18) {
|
|
2594
2542
|
return _updateProductInOrder.apply(this, arguments);
|
|
2595
2543
|
}
|
|
2596
2544
|
return updateProductInOrder;
|
|
@@ -2598,66 +2546,66 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2598
2546
|
}, {
|
|
2599
2547
|
key: "removeProductFromOrder",
|
|
2600
2548
|
value: function () {
|
|
2601
|
-
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2602
|
-
var _this$store$order$get3, _this$store$
|
|
2603
|
-
return _regeneratorRuntime().wrap(function
|
|
2604
|
-
while (1) switch (
|
|
2549
|
+
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(identity) {
|
|
2550
|
+
var _this$store$order$get3, _this$store$order6, _this$store$order$ens, _this$store$order7, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator15, _step15, _product$metadata6, _product$metadata7, product, beforeBookingCount, _this$store$order$per, _this$store$order8;
|
|
2551
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2552
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2605
2553
|
case 0:
|
|
2606
2554
|
this.logMethodStart('removeProductFromOrder', {
|
|
2607
2555
|
product_id: identity.product_id,
|
|
2608
2556
|
product_variant_id: identity.product_variant_id
|
|
2609
2557
|
});
|
|
2610
|
-
|
|
2558
|
+
_context28.prev = 1;
|
|
2611
2559
|
if (this.store.order) {
|
|
2612
|
-
|
|
2560
|
+
_context28.next = 4;
|
|
2613
2561
|
break;
|
|
2614
2562
|
}
|
|
2615
2563
|
throw new Error('order 模块未初始化');
|
|
2616
2564
|
case 4:
|
|
2617
|
-
tempOrder = ((_this$store$order$get3 = (_this$store$
|
|
2618
|
-
|
|
2565
|
+
tempOrder = ((_this$store$order$get3 = (_this$store$order6 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order6)) || ((_this$store$order$ens = (_this$store$order7 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order7));
|
|
2566
|
+
_context28.next = 7;
|
|
2619
2567
|
return this.store.order.removeProductFromOrder(identity);
|
|
2620
2568
|
case 7:
|
|
2621
|
-
products =
|
|
2569
|
+
products = _context28.sent;
|
|
2622
2570
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
|
|
2623
|
-
|
|
2571
|
+
_context28.next = 33;
|
|
2624
2572
|
break;
|
|
2625
2573
|
}
|
|
2626
2574
|
venueProductUids = new Set();
|
|
2627
2575
|
venueBookingUids = new Set();
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2576
|
+
_iterator15 = _createForOfIteratorHelper(tempOrder.products || []);
|
|
2577
|
+
_context28.prev = 12;
|
|
2578
|
+
_iterator15.s();
|
|
2631
2579
|
case 14:
|
|
2632
|
-
if ((
|
|
2633
|
-
|
|
2580
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
2581
|
+
_context28.next = 22;
|
|
2634
2582
|
break;
|
|
2635
2583
|
}
|
|
2636
|
-
product =
|
|
2637
|
-
if (product !== null && product !== void 0 && (_product$
|
|
2638
|
-
|
|
2584
|
+
product = _step15.value;
|
|
2585
|
+
if (product !== null && product !== void 0 && (_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) {
|
|
2586
|
+
_context28.next = 18;
|
|
2639
2587
|
break;
|
|
2640
2588
|
}
|
|
2641
|
-
return
|
|
2589
|
+
return _context28.abrupt("continue", 20);
|
|
2642
2590
|
case 18:
|
|
2643
2591
|
if (product.identity_key) venueProductUids.add(String(product.identity_key));
|
|
2644
|
-
if ((_product$
|
|
2592
|
+
if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
|
|
2645
2593
|
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
2646
2594
|
}
|
|
2647
2595
|
case 20:
|
|
2648
|
-
|
|
2596
|
+
_context28.next = 14;
|
|
2649
2597
|
break;
|
|
2650
2598
|
case 22:
|
|
2651
|
-
|
|
2599
|
+
_context28.next = 27;
|
|
2652
2600
|
break;
|
|
2653
2601
|
case 24:
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2602
|
+
_context28.prev = 24;
|
|
2603
|
+
_context28.t0 = _context28["catch"](12);
|
|
2604
|
+
_iterator15.e(_context28.t0);
|
|
2657
2605
|
case 27:
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
return
|
|
2606
|
+
_context28.prev = 27;
|
|
2607
|
+
_iterator15.f();
|
|
2608
|
+
return _context28.finish(27);
|
|
2661
2609
|
case 30:
|
|
2662
2610
|
beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
|
|
2663
2611
|
tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
|
|
@@ -2671,31 +2619,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2671
2619
|
return true;
|
|
2672
2620
|
});
|
|
2673
2621
|
if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
|
|
2674
|
-
(_this$store$order$per = (_this$store$
|
|
2622
|
+
(_this$store$order$per = (_this$store$order8 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order8);
|
|
2675
2623
|
}
|
|
2676
2624
|
case 33:
|
|
2677
|
-
|
|
2625
|
+
_context28.next = 35;
|
|
2678
2626
|
return this.refreshItemRuleQuantityLimits();
|
|
2679
2627
|
case 35:
|
|
2680
|
-
|
|
2628
|
+
_context28.next = 37;
|
|
2681
2629
|
return this.refreshCartValidationPassed();
|
|
2682
2630
|
case 37:
|
|
2683
2631
|
this.logMethodSuccess('removeProductFromOrder', {
|
|
2684
2632
|
productCount: products.length
|
|
2685
2633
|
});
|
|
2686
|
-
return
|
|
2634
|
+
return _context28.abrupt("return", products);
|
|
2687
2635
|
case 41:
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
this.logMethodError('removeProductFromOrder',
|
|
2691
|
-
throw
|
|
2636
|
+
_context28.prev = 41;
|
|
2637
|
+
_context28.t1 = _context28["catch"](1);
|
|
2638
|
+
this.logMethodError('removeProductFromOrder', _context28.t1);
|
|
2639
|
+
throw _context28.t1;
|
|
2692
2640
|
case 45:
|
|
2693
2641
|
case "end":
|
|
2694
|
-
return
|
|
2642
|
+
return _context28.stop();
|
|
2695
2643
|
}
|
|
2696
|
-
},
|
|
2644
|
+
}, _callee28, this, [[1, 41], [12, 24, 27, 30]]);
|
|
2697
2645
|
}));
|
|
2698
|
-
function removeProductFromOrder(
|
|
2646
|
+
function removeProductFromOrder(_x19) {
|
|
2699
2647
|
return _removeProductFromOrder.apply(this, arguments);
|
|
2700
2648
|
}
|
|
2701
2649
|
return removeProductFromOrder;
|
|
@@ -2703,27 +2651,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2703
2651
|
}, {
|
|
2704
2652
|
key: "getProductList",
|
|
2705
2653
|
value: function () {
|
|
2706
|
-
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2654
|
+
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
2707
2655
|
var result;
|
|
2708
|
-
return _regeneratorRuntime().wrap(function
|
|
2709
|
-
while (1) switch (
|
|
2656
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2657
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2710
2658
|
case 0:
|
|
2711
2659
|
if (!this.productsLoaded) {
|
|
2712
|
-
|
|
2660
|
+
_context29.next = 2;
|
|
2713
2661
|
break;
|
|
2714
2662
|
}
|
|
2715
|
-
return
|
|
2663
|
+
return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
|
|
2716
2664
|
case 2:
|
|
2717
|
-
|
|
2665
|
+
_context29.next = 4;
|
|
2718
2666
|
return this.loadAllProducts();
|
|
2719
2667
|
case 4:
|
|
2720
|
-
result =
|
|
2721
|
-
return
|
|
2668
|
+
result = _context29.sent;
|
|
2669
|
+
return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
|
|
2722
2670
|
case 6:
|
|
2723
2671
|
case "end":
|
|
2724
|
-
return
|
|
2672
|
+
return _context29.stop();
|
|
2725
2673
|
}
|
|
2726
|
-
},
|
|
2674
|
+
}, _callee29, this);
|
|
2727
2675
|
}));
|
|
2728
2676
|
function getProductList() {
|
|
2729
2677
|
return _getProductList.apply(this, arguments);
|
|
@@ -2733,13 +2681,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2733
2681
|
}, {
|
|
2734
2682
|
key: "loadOpenDataConfig",
|
|
2735
2683
|
value: function () {
|
|
2736
|
-
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2684
|
+
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2737
2685
|
var lastFetchedAt, cachedData, openDataConfig;
|
|
2738
|
-
return _regeneratorRuntime().wrap(function
|
|
2739
|
-
while (1) switch (
|
|
2686
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2687
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2740
2688
|
case 0:
|
|
2741
2689
|
if (this.store.openData) {
|
|
2742
|
-
|
|
2690
|
+
_context30.next = 2;
|
|
2743
2691
|
break;
|
|
2744
2692
|
}
|
|
2745
2693
|
throw new Error('openData 模块未初始化');
|
|
@@ -2747,42 +2695,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2747
2695
|
lastFetchedAt = this.store.openData.getLastFetchedAt();
|
|
2748
2696
|
cachedData = this.store.openData.getOpenData();
|
|
2749
2697
|
if (!(cachedData && lastFetchedAt && Date.now() - lastFetchedAt < VenueBookingImpl.OPEN_DATA_CACHE_TTL)) {
|
|
2750
|
-
|
|
2698
|
+
_context30.next = 7;
|
|
2751
2699
|
break;
|
|
2752
2700
|
}
|
|
2753
2701
|
this.otherParams.openData = cachedData;
|
|
2754
|
-
return
|
|
2702
|
+
return _context30.abrupt("return", cachedData);
|
|
2755
2703
|
case 7:
|
|
2756
2704
|
if (!this.loadOpenDataConfigInFlight) {
|
|
2757
|
-
|
|
2705
|
+
_context30.next = 11;
|
|
2758
2706
|
break;
|
|
2759
2707
|
}
|
|
2760
|
-
|
|
2708
|
+
_context30.next = 10;
|
|
2761
2709
|
return this.loadOpenDataConfigInFlight;
|
|
2762
2710
|
case 10:
|
|
2763
|
-
return
|
|
2711
|
+
return _context30.abrupt("return", _context30.sent);
|
|
2764
2712
|
case 11:
|
|
2765
2713
|
this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
|
|
2766
2714
|
scope: 'board',
|
|
2767
2715
|
target: 'venue_booking+online_store',
|
|
2768
2716
|
section_code: [].concat(OPEN_DATA_SECTION_CODES)
|
|
2769
2717
|
});
|
|
2770
|
-
|
|
2771
|
-
|
|
2718
|
+
_context30.prev = 12;
|
|
2719
|
+
_context30.next = 15;
|
|
2772
2720
|
return this.loadOpenDataConfigInFlight;
|
|
2773
2721
|
case 15:
|
|
2774
|
-
openDataConfig =
|
|
2722
|
+
openDataConfig = _context30.sent;
|
|
2775
2723
|
this.otherParams.openData = openDataConfig;
|
|
2776
|
-
return
|
|
2724
|
+
return _context30.abrupt("return", openDataConfig);
|
|
2777
2725
|
case 18:
|
|
2778
|
-
|
|
2726
|
+
_context30.prev = 18;
|
|
2779
2727
|
this.loadOpenDataConfigInFlight = null;
|
|
2780
|
-
return
|
|
2728
|
+
return _context30.finish(18);
|
|
2781
2729
|
case 21:
|
|
2782
2730
|
case "end":
|
|
2783
|
-
return
|
|
2731
|
+
return _context30.stop();
|
|
2784
2732
|
}
|
|
2785
|
-
},
|
|
2733
|
+
}, _callee30, this, [[12,, 18, 21]]);
|
|
2786
2734
|
}));
|
|
2787
2735
|
function loadOpenDataConfig() {
|
|
2788
2736
|
return _loadOpenDataConfig.apply(this, arguments);
|
|
@@ -2792,29 +2740,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2792
2740
|
}, {
|
|
2793
2741
|
key: "loadRuntimeConfigs",
|
|
2794
2742
|
value: function () {
|
|
2795
|
-
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2743
|
+
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
2796
2744
|
var itemRuleConfigs;
|
|
2797
|
-
return _regeneratorRuntime().wrap(function
|
|
2798
|
-
while (1) switch (
|
|
2745
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2746
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2799
2747
|
case 0:
|
|
2800
|
-
|
|
2748
|
+
_context31.next = 2;
|
|
2801
2749
|
return this.loadOpenDataConfig();
|
|
2802
2750
|
case 2:
|
|
2803
|
-
|
|
2751
|
+
_context31.next = 4;
|
|
2804
2752
|
return this.ensureItemRuleConfigsLoaded();
|
|
2805
2753
|
case 4:
|
|
2806
|
-
itemRuleConfigs =
|
|
2754
|
+
itemRuleConfigs = _context31.sent;
|
|
2807
2755
|
this.logMethodSuccess('loadRuntimeConfigs', {
|
|
2808
2756
|
itemRuleCount: itemRuleConfigs.length
|
|
2809
2757
|
});
|
|
2810
|
-
return
|
|
2758
|
+
return _context31.abrupt("return", {
|
|
2811
2759
|
itemRuleConfigs: itemRuleConfigs
|
|
2812
2760
|
});
|
|
2813
2761
|
case 7:
|
|
2814
2762
|
case "end":
|
|
2815
|
-
return
|
|
2763
|
+
return _context31.stop();
|
|
2816
2764
|
}
|
|
2817
|
-
},
|
|
2765
|
+
}, _callee31, this);
|
|
2818
2766
|
}));
|
|
2819
2767
|
function loadRuntimeConfigs() {
|
|
2820
2768
|
return _loadRuntimeConfigs.apply(this, arguments);
|
|
@@ -2824,22 +2772,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2824
2772
|
}, {
|
|
2825
2773
|
key: "fetchItemRuleConfigsByModelIds",
|
|
2826
2774
|
value: function () {
|
|
2827
|
-
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2775
|
+
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(strategyModelIds) {
|
|
2828
2776
|
var result, configs;
|
|
2829
|
-
return _regeneratorRuntime().wrap(function
|
|
2830
|
-
while (1) switch (
|
|
2777
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2778
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2831
2779
|
case 0:
|
|
2832
2780
|
this.logMethodStart('fetchItemRuleConfigsByModelIds', {
|
|
2833
2781
|
strategyModelIds: strategyModelIds
|
|
2834
2782
|
});
|
|
2835
2783
|
if (strategyModelIds.length) {
|
|
2836
|
-
|
|
2784
|
+
_context32.next = 3;
|
|
2837
2785
|
break;
|
|
2838
2786
|
}
|
|
2839
|
-
return
|
|
2787
|
+
return _context32.abrupt("return", []);
|
|
2840
2788
|
case 3:
|
|
2841
|
-
|
|
2842
|
-
|
|
2789
|
+
_context32.prev = 3;
|
|
2790
|
+
_context32.next = 6;
|
|
2843
2791
|
return this.request.get('/promotion', {
|
|
2844
2792
|
skip: 1,
|
|
2845
2793
|
num: 99,
|
|
@@ -2847,7 +2795,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2847
2795
|
ids: strategyModelIds
|
|
2848
2796
|
});
|
|
2849
2797
|
case 6:
|
|
2850
|
-
result =
|
|
2798
|
+
result = _context32.sent;
|
|
2851
2799
|
configs = [];
|
|
2852
2800
|
if (result.code === 200) {
|
|
2853
2801
|
configs = result.data.list.map(function (item) {
|
|
@@ -2858,21 +2806,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2858
2806
|
strategyModelIds: strategyModelIds,
|
|
2859
2807
|
strategyCount: configs.length
|
|
2860
2808
|
});
|
|
2861
|
-
return
|
|
2809
|
+
return _context32.abrupt("return", configs);
|
|
2862
2810
|
case 13:
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
this.logMethodError('fetchItemRuleConfigsByModelIds',
|
|
2811
|
+
_context32.prev = 13;
|
|
2812
|
+
_context32.t0 = _context32["catch"](3);
|
|
2813
|
+
this.logMethodError('fetchItemRuleConfigsByModelIds', _context32.t0, {
|
|
2866
2814
|
strategyModelIds: strategyModelIds
|
|
2867
2815
|
});
|
|
2868
|
-
return
|
|
2816
|
+
return _context32.abrupt("return", []);
|
|
2869
2817
|
case 17:
|
|
2870
2818
|
case "end":
|
|
2871
|
-
return
|
|
2819
|
+
return _context32.stop();
|
|
2872
2820
|
}
|
|
2873
|
-
},
|
|
2821
|
+
}, _callee32, this, [[3, 13]]);
|
|
2874
2822
|
}));
|
|
2875
|
-
function fetchItemRuleConfigsByModelIds(
|
|
2823
|
+
function fetchItemRuleConfigsByModelIds(_x20) {
|
|
2876
2824
|
return _fetchItemRuleConfigsByModelIds.apply(this, arguments);
|
|
2877
2825
|
}
|
|
2878
2826
|
return fetchItemRuleConfigsByModelIds;
|
|
@@ -2880,22 +2828,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2880
2828
|
}, {
|
|
2881
2829
|
key: "buildPrefillProductSourceMap",
|
|
2882
2830
|
value: function () {
|
|
2883
|
-
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2831
|
+
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
|
|
2884
2832
|
var sourceMap, productList, visited, collectFromValue;
|
|
2885
|
-
return _regeneratorRuntime().wrap(function
|
|
2886
|
-
while (1) switch (
|
|
2833
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2834
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2887
2835
|
case 0:
|
|
2888
2836
|
sourceMap = new Map();
|
|
2889
|
-
|
|
2890
|
-
|
|
2837
|
+
_context33.prev = 1;
|
|
2838
|
+
_context33.next = 4;
|
|
2891
2839
|
return this.getProductList();
|
|
2892
2840
|
case 4:
|
|
2893
|
-
productList =
|
|
2841
|
+
productList = _context33.sent;
|
|
2894
2842
|
if (Array.isArray(productList)) {
|
|
2895
|
-
|
|
2843
|
+
_context33.next = 7;
|
|
2896
2844
|
break;
|
|
2897
2845
|
}
|
|
2898
|
-
return
|
|
2846
|
+
return _context33.abrupt("return", sourceMap);
|
|
2899
2847
|
case 7:
|
|
2900
2848
|
visited = new Set();
|
|
2901
2849
|
collectFromValue = function collectFromValue(value) {
|
|
@@ -2904,17 +2852,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2904
2852
|
if (visited.has(value)) return;
|
|
2905
2853
|
visited.add(value);
|
|
2906
2854
|
if (Array.isArray(value)) {
|
|
2907
|
-
var
|
|
2908
|
-
|
|
2855
|
+
var _iterator16 = _createForOfIteratorHelper(value),
|
|
2856
|
+
_step16;
|
|
2909
2857
|
try {
|
|
2910
|
-
for (
|
|
2911
|
-
var item =
|
|
2858
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
2859
|
+
var item = _step16.value;
|
|
2912
2860
|
collectFromValue(item);
|
|
2913
2861
|
}
|
|
2914
2862
|
} catch (err) {
|
|
2915
|
-
|
|
2863
|
+
_iterator16.e(err);
|
|
2916
2864
|
} finally {
|
|
2917
|
-
|
|
2865
|
+
_iterator16.f();
|
|
2918
2866
|
}
|
|
2919
2867
|
return;
|
|
2920
2868
|
}
|
|
@@ -2934,19 +2882,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2934
2882
|
}
|
|
2935
2883
|
};
|
|
2936
2884
|
collectFromValue(productList);
|
|
2937
|
-
|
|
2885
|
+
_context33.next = 15;
|
|
2938
2886
|
break;
|
|
2939
2887
|
case 12:
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
this.logMethodError('buildPrefillProductSourceMap',
|
|
2888
|
+
_context33.prev = 12;
|
|
2889
|
+
_context33.t0 = _context33["catch"](1);
|
|
2890
|
+
this.logMethodError('buildPrefillProductSourceMap', _context33.t0);
|
|
2943
2891
|
case 15:
|
|
2944
|
-
return
|
|
2892
|
+
return _context33.abrupt("return", sourceMap);
|
|
2945
2893
|
case 16:
|
|
2946
2894
|
case "end":
|
|
2947
|
-
return
|
|
2895
|
+
return _context33.stop();
|
|
2948
2896
|
}
|
|
2949
|
-
},
|
|
2897
|
+
}, _callee33, this, [[1, 12]]);
|
|
2950
2898
|
}));
|
|
2951
2899
|
function buildPrefillProductSourceMap() {
|
|
2952
2900
|
return _buildPrefillProductSourceMap.apply(this, arguments);
|
|
@@ -2961,56 +2909,56 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2961
2909
|
}, {
|
|
2962
2910
|
key: "ensureItemRuleConfigsLoaded",
|
|
2963
2911
|
value: function () {
|
|
2964
|
-
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2965
|
-
var
|
|
2966
|
-
return _regeneratorRuntime().wrap(function
|
|
2967
|
-
while (1) switch (
|
|
2912
|
+
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
2913
|
+
var _this11 = this;
|
|
2914
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2915
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2968
2916
|
case 0:
|
|
2969
2917
|
if (!(this.itemRuleConfigs.length > 0)) {
|
|
2970
|
-
|
|
2918
|
+
_context35.next = 2;
|
|
2971
2919
|
break;
|
|
2972
2920
|
}
|
|
2973
|
-
return
|
|
2921
|
+
return _context35.abrupt("return", this.itemRuleConfigs);
|
|
2974
2922
|
case 2:
|
|
2975
2923
|
if (!this.itemRuleConfigsPromise) {
|
|
2976
|
-
|
|
2924
|
+
_context35.next = 4;
|
|
2977
2925
|
break;
|
|
2978
2926
|
}
|
|
2979
|
-
return
|
|
2927
|
+
return _context35.abrupt("return", this.itemRuleConfigsPromise);
|
|
2980
2928
|
case 4:
|
|
2981
|
-
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2929
|
+
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2982
2930
|
var runtimeConfig, staticConfigs;
|
|
2983
|
-
return _regeneratorRuntime().wrap(function
|
|
2984
|
-
while (1) switch (
|
|
2931
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2932
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2985
2933
|
case 0:
|
|
2986
|
-
runtimeConfig =
|
|
2934
|
+
runtimeConfig = _this11.getItemRuleRuntimeConfig();
|
|
2987
2935
|
staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
|
|
2988
2936
|
if (!(staticConfigs.length > 0)) {
|
|
2989
|
-
|
|
2937
|
+
_context34.next = 6;
|
|
2990
2938
|
break;
|
|
2991
2939
|
}
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
return
|
|
2940
|
+
_this11.itemRuleConfigs = staticConfigs;
|
|
2941
|
+
_this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
|
|
2942
|
+
return _context34.abrupt("return", _this11.itemRuleConfigs);
|
|
2995
2943
|
case 6:
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
return
|
|
2944
|
+
_this11.itemRuleConfigs = [];
|
|
2945
|
+
_this11.itemRuleEvaluator.setStrategyConfigs([]);
|
|
2946
|
+
return _context34.abrupt("return", _this11.itemRuleConfigs);
|
|
2999
2947
|
case 9:
|
|
3000
2948
|
case "end":
|
|
3001
|
-
return
|
|
2949
|
+
return _context34.stop();
|
|
3002
2950
|
}
|
|
3003
|
-
},
|
|
2951
|
+
}, _callee34);
|
|
3004
2952
|
}))();
|
|
3005
|
-
|
|
2953
|
+
_context35.next = 7;
|
|
3006
2954
|
return this.itemRuleConfigsPromise;
|
|
3007
2955
|
case 7:
|
|
3008
|
-
return
|
|
2956
|
+
return _context35.abrupt("return", _context35.sent);
|
|
3009
2957
|
case 8:
|
|
3010
2958
|
case "end":
|
|
3011
|
-
return
|
|
2959
|
+
return _context35.stop();
|
|
3012
2960
|
}
|
|
3013
|
-
},
|
|
2961
|
+
}, _callee35, this);
|
|
3014
2962
|
}));
|
|
3015
2963
|
function ensureItemRuleConfigsLoaded() {
|
|
3016
2964
|
return _ensureItemRuleConfigsLoaded.apply(this, arguments);
|
|
@@ -3020,22 +2968,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3020
2968
|
}, {
|
|
3021
2969
|
key: "refreshItemRuleQuantityLimits",
|
|
3022
2970
|
value: function () {
|
|
3023
|
-
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2971
|
+
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
3024
2972
|
var strategyConfigs, businessData, limits;
|
|
3025
|
-
return _regeneratorRuntime().wrap(function
|
|
3026
|
-
while (1) switch (
|
|
2973
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
2974
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
3027
2975
|
case 0:
|
|
3028
|
-
|
|
3029
|
-
|
|
2976
|
+
_context36.prev = 0;
|
|
2977
|
+
_context36.next = 3;
|
|
3030
2978
|
return this.ensureItemRuleConfigsLoaded();
|
|
3031
2979
|
case 3:
|
|
3032
|
-
strategyConfigs =
|
|
2980
|
+
strategyConfigs = _context36.sent;
|
|
3033
2981
|
if (strategyConfigs.length) {
|
|
3034
|
-
|
|
2982
|
+
_context36.next = 7;
|
|
3035
2983
|
break;
|
|
3036
2984
|
}
|
|
3037
2985
|
this.store.itemRuleQuantityLimits = [];
|
|
3038
|
-
return
|
|
2986
|
+
return _context36.abrupt("return", []);
|
|
3039
2987
|
case 7:
|
|
3040
2988
|
businessData = buildItemRuleBusinessData({
|
|
3041
2989
|
tempOrder: this.ensureTempOrder(),
|
|
@@ -3047,18 +2995,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3047
2995
|
this.logMethodSuccess('refreshItemRuleQuantityLimits', {
|
|
3048
2996
|
limitCount: limits.length
|
|
3049
2997
|
});
|
|
3050
|
-
return
|
|
2998
|
+
return _context36.abrupt("return", limits);
|
|
3051
2999
|
case 14:
|
|
3052
|
-
|
|
3053
|
-
|
|
3000
|
+
_context36.prev = 14;
|
|
3001
|
+
_context36.t0 = _context36["catch"](0);
|
|
3054
3002
|
this.store.itemRuleQuantityLimits = [];
|
|
3055
|
-
this.logMethodError('refreshItemRuleQuantityLimits',
|
|
3056
|
-
return
|
|
3003
|
+
this.logMethodError('refreshItemRuleQuantityLimits', _context36.t0);
|
|
3004
|
+
return _context36.abrupt("return", []);
|
|
3057
3005
|
case 19:
|
|
3058
3006
|
case "end":
|
|
3059
|
-
return
|
|
3007
|
+
return _context36.stop();
|
|
3060
3008
|
}
|
|
3061
|
-
},
|
|
3009
|
+
}, _callee36, this, [[0, 14]]);
|
|
3062
3010
|
}));
|
|
3063
3011
|
function refreshItemRuleQuantityLimits() {
|
|
3064
3012
|
return _refreshItemRuleQuantityLimits.apply(this, arguments);
|
|
@@ -3068,32 +3016,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3068
3016
|
}, {
|
|
3069
3017
|
key: "applyPrefillByItemRule",
|
|
3070
3018
|
value: function () {
|
|
3071
|
-
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3072
|
-
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges,
|
|
3073
|
-
return _regeneratorRuntime().wrap(function
|
|
3074
|
-
while (1) switch (
|
|
3019
|
+
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
|
|
3020
|
+
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator17, _step17, _prefillItem$product_, _targetProduct$_origi, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, sellingPrice, targetProduct, existedQuantity, delta, nextProduct;
|
|
3021
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3022
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
3075
3023
|
case 0:
|
|
3076
3024
|
if (!this.itemRulePrefillApplied) {
|
|
3077
|
-
|
|
3025
|
+
_context37.next = 2;
|
|
3078
3026
|
break;
|
|
3079
3027
|
}
|
|
3080
|
-
return
|
|
3028
|
+
return _context37.abrupt("return");
|
|
3081
3029
|
case 2:
|
|
3082
3030
|
if (this.store.order) {
|
|
3083
|
-
|
|
3031
|
+
_context37.next = 4;
|
|
3084
3032
|
break;
|
|
3085
3033
|
}
|
|
3086
|
-
return
|
|
3034
|
+
return _context37.abrupt("return");
|
|
3087
3035
|
case 4:
|
|
3088
|
-
|
|
3036
|
+
_context37.next = 6;
|
|
3089
3037
|
return this.ensureItemRuleConfigsLoaded();
|
|
3090
3038
|
case 6:
|
|
3091
|
-
strategyConfigs =
|
|
3039
|
+
strategyConfigs = _context37.sent;
|
|
3092
3040
|
if (strategyConfigs.length) {
|
|
3093
|
-
|
|
3041
|
+
_context37.next = 9;
|
|
3094
3042
|
break;
|
|
3095
3043
|
}
|
|
3096
|
-
return
|
|
3044
|
+
return _context37.abrupt("return");
|
|
3097
3045
|
case 9:
|
|
3098
3046
|
businessData = buildItemRuleBusinessData({
|
|
3099
3047
|
tempOrder: this.ensureTempOrder(),
|
|
@@ -3102,41 +3050,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3102
3050
|
});
|
|
3103
3051
|
prefillItems = this.itemRuleEvaluator.getPrefillItems(businessData);
|
|
3104
3052
|
if (prefillItems.length) {
|
|
3105
|
-
|
|
3053
|
+
_context37.next = 14;
|
|
3106
3054
|
break;
|
|
3107
3055
|
}
|
|
3108
3056
|
this.itemRulePrefillApplied = true;
|
|
3109
|
-
return
|
|
3057
|
+
return _context37.abrupt("return");
|
|
3110
3058
|
case 14:
|
|
3111
|
-
|
|
3059
|
+
_context37.next = 16;
|
|
3112
3060
|
return this.buildPrefillProductSourceMap();
|
|
3113
3061
|
case 16:
|
|
3114
|
-
productSourceMap =
|
|
3062
|
+
productSourceMap = _context37.sent;
|
|
3115
3063
|
tempOrder = this.ensureTempOrder();
|
|
3116
3064
|
hasChanges = false;
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3065
|
+
_iterator17 = _createForOfIteratorHelper(prefillItems);
|
|
3066
|
+
_context37.prev = 20;
|
|
3067
|
+
_iterator17.s();
|
|
3120
3068
|
case 22:
|
|
3121
|
-
if ((
|
|
3122
|
-
|
|
3069
|
+
if ((_step17 = _iterator17.n()).done) {
|
|
3070
|
+
_context37.next = 45;
|
|
3123
3071
|
break;
|
|
3124
3072
|
}
|
|
3125
|
-
prefillItem =
|
|
3073
|
+
prefillItem = _step17.value;
|
|
3126
3074
|
productId = Number(prefillItem.product_id);
|
|
3127
3075
|
productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
|
|
3128
3076
|
targetQuantity = toNonNegativeInt(prefillItem.quantity);
|
|
3129
3077
|
if (!(!Number.isFinite(productId) || targetQuantity <= 0)) {
|
|
3130
|
-
|
|
3078
|
+
_context37.next = 29;
|
|
3131
3079
|
break;
|
|
3132
3080
|
}
|
|
3133
|
-
return
|
|
3081
|
+
return _context37.abrupt("continue", 43);
|
|
3134
3082
|
case 29:
|
|
3135
3083
|
if (!Number.isNaN(productVariantId)) {
|
|
3136
|
-
|
|
3084
|
+
_context37.next = 31;
|
|
3137
3085
|
break;
|
|
3138
3086
|
}
|
|
3139
|
-
return
|
|
3087
|
+
return _context37.abrupt("continue", 43);
|
|
3140
3088
|
case 31:
|
|
3141
3089
|
sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
|
|
3142
3090
|
productIndex = getProductIdentityIndex(tempOrder.products, {
|
|
@@ -3144,7 +3092,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3144
3092
|
product_variant_id: productVariantId
|
|
3145
3093
|
});
|
|
3146
3094
|
if (!(productIndex === -1)) {
|
|
3147
|
-
|
|
3095
|
+
_context37.next = 38;
|
|
3148
3096
|
break;
|
|
3149
3097
|
}
|
|
3150
3098
|
sellingPrice = toPriceString((_sourceItem$price = sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _sourceItem$price !== void 0 ? _sourceItem$price : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.selling_price, '0.00');
|
|
@@ -3164,7 +3112,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3164
3112
|
})
|
|
3165
3113
|
}));
|
|
3166
3114
|
hasChanges = true;
|
|
3167
|
-
return
|
|
3115
|
+
return _context37.abrupt("continue", 43);
|
|
3168
3116
|
case 38:
|
|
3169
3117
|
targetProduct = tempOrder.products[productIndex];
|
|
3170
3118
|
existedQuantity = toNonNegativeInt(targetProduct.num);
|
|
@@ -3183,34 +3131,34 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3183
3131
|
hasChanges = true;
|
|
3184
3132
|
}
|
|
3185
3133
|
case 43:
|
|
3186
|
-
|
|
3134
|
+
_context37.next = 22;
|
|
3187
3135
|
break;
|
|
3188
3136
|
case 45:
|
|
3189
|
-
|
|
3137
|
+
_context37.next = 50;
|
|
3190
3138
|
break;
|
|
3191
3139
|
case 47:
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3140
|
+
_context37.prev = 47;
|
|
3141
|
+
_context37.t0 = _context37["catch"](20);
|
|
3142
|
+
_iterator17.e(_context37.t0);
|
|
3195
3143
|
case 50:
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
return
|
|
3144
|
+
_context37.prev = 50;
|
|
3145
|
+
_iterator17.f();
|
|
3146
|
+
return _context37.finish(50);
|
|
3199
3147
|
case 53:
|
|
3200
3148
|
if (!hasChanges) {
|
|
3201
|
-
|
|
3149
|
+
_context37.next = 58;
|
|
3202
3150
|
break;
|
|
3203
3151
|
}
|
|
3204
3152
|
// Prefill 属于 products CRUD 的一种形式:新增后让 Rules 重算,以支持自动应用可用优惠券。
|
|
3205
3153
|
this.store.order.applyDiscount();
|
|
3206
|
-
|
|
3154
|
+
_context37.next = 57;
|
|
3207
3155
|
return this.store.order.recalculateSummary({
|
|
3208
3156
|
createIfMissing: true
|
|
3209
3157
|
});
|
|
3210
3158
|
case 57:
|
|
3211
3159
|
this.store.order.persistTempOrder();
|
|
3212
3160
|
case 58:
|
|
3213
|
-
|
|
3161
|
+
_context37.next = 60;
|
|
3214
3162
|
return this.refreshItemRuleQuantityLimits();
|
|
3215
3163
|
case 60:
|
|
3216
3164
|
this.itemRulePrefillApplied = true;
|
|
@@ -3220,9 +3168,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3220
3168
|
});
|
|
3221
3169
|
case 62:
|
|
3222
3170
|
case "end":
|
|
3223
|
-
return
|
|
3171
|
+
return _context37.stop();
|
|
3224
3172
|
}
|
|
3225
|
-
},
|
|
3173
|
+
}, _callee37, this, [[20, 47, 50, 53]]);
|
|
3226
3174
|
}));
|
|
3227
3175
|
function applyPrefillByItemRule() {
|
|
3228
3176
|
return _applyPrefillByItemRule.apply(this, arguments);
|
|
@@ -3232,24 +3180,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3232
3180
|
}, {
|
|
3233
3181
|
key: "applyItemRulePrefill",
|
|
3234
3182
|
value: function () {
|
|
3235
|
-
var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3236
|
-
return _regeneratorRuntime().wrap(function
|
|
3237
|
-
while (1) switch (
|
|
3183
|
+
var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
|
|
3184
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
3185
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
3238
3186
|
case 0:
|
|
3239
3187
|
this.logMethodStart('applyItemRulePrefill');
|
|
3240
|
-
|
|
3188
|
+
_context38.next = 3;
|
|
3241
3189
|
return this.applyPrefillByItemRule();
|
|
3242
3190
|
case 3:
|
|
3243
|
-
|
|
3191
|
+
_context38.next = 5;
|
|
3244
3192
|
return this.refreshItemRuleQuantityLimits();
|
|
3245
3193
|
case 5:
|
|
3246
|
-
|
|
3194
|
+
_context38.next = 7;
|
|
3247
3195
|
return this.refreshCartValidationPassed();
|
|
3248
3196
|
case 7:
|
|
3249
3197
|
case "end":
|
|
3250
|
-
return
|
|
3198
|
+
return _context38.stop();
|
|
3251
3199
|
}
|
|
3252
|
-
},
|
|
3200
|
+
}, _callee38, this);
|
|
3253
3201
|
}));
|
|
3254
3202
|
function applyItemRulePrefill() {
|
|
3255
3203
|
return _applyItemRulePrefill.apply(this, arguments);
|
|
@@ -3259,20 +3207,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3259
3207
|
}, {
|
|
3260
3208
|
key: "evaluateCartValidationByItemRule",
|
|
3261
3209
|
value: function () {
|
|
3262
|
-
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3210
|
+
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
|
|
3263
3211
|
var strategyConfigs, businessData;
|
|
3264
|
-
return _regeneratorRuntime().wrap(function
|
|
3265
|
-
while (1) switch (
|
|
3212
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
3213
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
3266
3214
|
case 0:
|
|
3267
|
-
|
|
3215
|
+
_context39.next = 2;
|
|
3268
3216
|
return this.ensureItemRuleConfigsLoaded();
|
|
3269
3217
|
case 2:
|
|
3270
|
-
strategyConfigs =
|
|
3218
|
+
strategyConfigs = _context39.sent;
|
|
3271
3219
|
if (strategyConfigs.length) {
|
|
3272
|
-
|
|
3220
|
+
_context39.next = 5;
|
|
3273
3221
|
break;
|
|
3274
3222
|
}
|
|
3275
|
-
return
|
|
3223
|
+
return _context39.abrupt("return", {
|
|
3276
3224
|
passed: true,
|
|
3277
3225
|
failures: []
|
|
3278
3226
|
});
|
|
@@ -3282,12 +3230,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3282
3230
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
3283
3231
|
itemRuleConfigs: this.itemRuleConfigs
|
|
3284
3232
|
});
|
|
3285
|
-
return
|
|
3233
|
+
return _context39.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
|
|
3286
3234
|
case 7:
|
|
3287
3235
|
case "end":
|
|
3288
|
-
return
|
|
3236
|
+
return _context39.stop();
|
|
3289
3237
|
}
|
|
3290
|
-
},
|
|
3238
|
+
}, _callee39, this);
|
|
3291
3239
|
}));
|
|
3292
3240
|
function evaluateCartValidationByItemRule() {
|
|
3293
3241
|
return _evaluateCartValidationByItemRule.apply(this, arguments);
|
|
@@ -3297,20 +3245,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3297
3245
|
}, {
|
|
3298
3246
|
key: "validateBeforeSubmitByItemRule",
|
|
3299
3247
|
value: function () {
|
|
3300
|
-
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3248
|
+
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
|
|
3301
3249
|
var validationResult, firstFailure, errorMessage, error;
|
|
3302
|
-
return _regeneratorRuntime().wrap(function
|
|
3303
|
-
while (1) switch (
|
|
3250
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3251
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
3304
3252
|
case 0:
|
|
3305
|
-
|
|
3253
|
+
_context40.next = 2;
|
|
3306
3254
|
return this.evaluateCartValidationByItemRule();
|
|
3307
3255
|
case 2:
|
|
3308
|
-
validationResult =
|
|
3256
|
+
validationResult = _context40.sent;
|
|
3309
3257
|
if (!validationResult.passed) {
|
|
3310
|
-
|
|
3258
|
+
_context40.next = 5;
|
|
3311
3259
|
break;
|
|
3312
3260
|
}
|
|
3313
|
-
return
|
|
3261
|
+
return _context40.abrupt("return");
|
|
3314
3262
|
case 5:
|
|
3315
3263
|
firstFailure = validationResult.failures[0];
|
|
3316
3264
|
errorMessage = (firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '当前购物车未满足商品规则,请调整后再提交';
|
|
@@ -3319,9 +3267,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3319
3267
|
throw error;
|
|
3320
3268
|
case 10:
|
|
3321
3269
|
case "end":
|
|
3322
|
-
return
|
|
3270
|
+
return _context40.stop();
|
|
3323
3271
|
}
|
|
3324
|
-
},
|
|
3272
|
+
}, _callee40, this);
|
|
3325
3273
|
}));
|
|
3326
3274
|
function validateBeforeSubmitByItemRule() {
|
|
3327
3275
|
return _validateBeforeSubmitByItemRule.apply(this, arguments);
|
|
@@ -3331,10 +3279,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3331
3279
|
}, {
|
|
3332
3280
|
key: "refreshCartValidationPassed",
|
|
3333
3281
|
value: function () {
|
|
3334
|
-
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3282
|
+
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
|
|
3335
3283
|
var previous, nextState, validationResult, changed;
|
|
3336
|
-
return _regeneratorRuntime().wrap(function
|
|
3337
|
-
while (1) switch (
|
|
3284
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
3285
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
3338
3286
|
case 0:
|
|
3339
3287
|
previous = this.store.cartValidation || {
|
|
3340
3288
|
passed: null,
|
|
@@ -3344,20 +3292,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3344
3292
|
passed: null,
|
|
3345
3293
|
failures: []
|
|
3346
3294
|
};
|
|
3347
|
-
|
|
3348
|
-
|
|
3295
|
+
_context41.prev = 2;
|
|
3296
|
+
_context41.next = 5;
|
|
3349
3297
|
return this.evaluateCartValidationByItemRule();
|
|
3350
3298
|
case 5:
|
|
3351
|
-
validationResult =
|
|
3299
|
+
validationResult = _context41.sent;
|
|
3352
3300
|
nextState = {
|
|
3353
3301
|
passed: validationResult.passed,
|
|
3354
3302
|
failures: validationResult.failures || []
|
|
3355
3303
|
};
|
|
3356
|
-
|
|
3304
|
+
_context41.next = 12;
|
|
3357
3305
|
break;
|
|
3358
3306
|
case 9:
|
|
3359
|
-
|
|
3360
|
-
|
|
3307
|
+
_context41.prev = 9;
|
|
3308
|
+
_context41.t0 = _context41["catch"](2);
|
|
3361
3309
|
nextState = {
|
|
3362
3310
|
passed: false,
|
|
3363
3311
|
failures: []
|
|
@@ -3366,21 +3314,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3366
3314
|
this.store.cartValidation = nextState;
|
|
3367
3315
|
changed = previous.passed !== nextState.passed || previous.failures !== nextState.failures;
|
|
3368
3316
|
if (!changed) {
|
|
3369
|
-
|
|
3317
|
+
_context41.next = 17;
|
|
3370
3318
|
break;
|
|
3371
3319
|
}
|
|
3372
|
-
|
|
3320
|
+
_context41.next = 17;
|
|
3373
3321
|
return this.core.effects.emit(VenueBookingHooks.onCartValidationChanged, {
|
|
3374
3322
|
cartValidation: nextState,
|
|
3375
3323
|
cartValidationPassed: nextState.passed
|
|
3376
3324
|
});
|
|
3377
3325
|
case 17:
|
|
3378
|
-
return
|
|
3326
|
+
return _context41.abrupt("return", nextState.passed);
|
|
3379
3327
|
case 18:
|
|
3380
3328
|
case "end":
|
|
3381
|
-
return
|
|
3329
|
+
return _context41.stop();
|
|
3382
3330
|
}
|
|
3383
|
-
},
|
|
3331
|
+
}, _callee41, this, [[2, 9]]);
|
|
3384
3332
|
}));
|
|
3385
3333
|
function refreshCartValidationPassed() {
|
|
3386
3334
|
return _refreshCartValidationPassed.apply(this, arguments);
|
|
@@ -3390,14 +3338,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3390
3338
|
}, {
|
|
3391
3339
|
key: "setItemRuleRuntimeConfig",
|
|
3392
3340
|
value: function () {
|
|
3393
|
-
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3341
|
+
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
|
|
3394
3342
|
var _this$itemRuleRuntime, _this$itemRuleRuntime2;
|
|
3395
3343
|
var config,
|
|
3396
|
-
|
|
3397
|
-
return _regeneratorRuntime().wrap(function
|
|
3398
|
-
while (1) switch (
|
|
3344
|
+
_args42 = arguments;
|
|
3345
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
3346
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
3399
3347
|
case 0:
|
|
3400
|
-
config =
|
|
3348
|
+
config = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
|
|
3401
3349
|
this.logMethodStart('setItemRuleRuntimeConfig');
|
|
3402
3350
|
this.itemRuleRuntimeConfig = _objectSpread(_objectSpread(_objectSpread({}, this.itemRuleRuntimeConfig), config), {}, {
|
|
3403
3351
|
pax: _objectSpread(_objectSpread({}, ((_this$itemRuleRuntime = this.itemRuleRuntimeConfig) === null || _this$itemRuleRuntime === void 0 ? void 0 : _this$itemRuleRuntime.pax) || {}), (config === null || config === void 0 ? void 0 : config.pax) || {}),
|
|
@@ -3409,10 +3357,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3409
3357
|
this.itemRuleEvaluator.setStrategyConfigs([]);
|
|
3410
3358
|
}
|
|
3411
3359
|
this.itemRulePrefillApplied = false;
|
|
3412
|
-
|
|
3360
|
+
_context42.next = 7;
|
|
3413
3361
|
return this.refreshItemRuleQuantityLimits();
|
|
3414
3362
|
case 7:
|
|
3415
|
-
|
|
3363
|
+
_context42.next = 9;
|
|
3416
3364
|
return this.refreshCartValidationPassed();
|
|
3417
3365
|
case 9:
|
|
3418
3366
|
this.logMethodSuccess('setItemRuleRuntimeConfig', {
|
|
@@ -3420,9 +3368,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3420
3368
|
});
|
|
3421
3369
|
case 10:
|
|
3422
3370
|
case "end":
|
|
3423
|
-
return
|
|
3371
|
+
return _context42.stop();
|
|
3424
3372
|
}
|
|
3425
|
-
},
|
|
3373
|
+
}, _callee42, this);
|
|
3426
3374
|
}));
|
|
3427
3375
|
function setItemRuleRuntimeConfig() {
|
|
3428
3376
|
return _setItemRuleRuntimeConfig.apply(this, arguments);
|
|
@@ -3456,7 +3404,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3456
3404
|
var raw = this.window.sessionStorage.getItem(key) || '{}';
|
|
3457
3405
|
var parsed = JSON.parse(raw);
|
|
3458
3406
|
return parsed && _typeof(parsed) === 'object' ? parsed : {};
|
|
3459
|
-
} catch (
|
|
3407
|
+
} catch (_unused3) {
|
|
3460
3408
|
return {};
|
|
3461
3409
|
}
|
|
3462
3410
|
}
|
|
@@ -3511,25 +3459,25 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3511
3459
|
}, {
|
|
3512
3460
|
key: "checkOpenDataAvailability",
|
|
3513
3461
|
value: function () {
|
|
3514
|
-
var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3515
|
-
return _regeneratorRuntime().wrap(function
|
|
3516
|
-
while (1) switch (
|
|
3462
|
+
var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43() {
|
|
3463
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3464
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
3517
3465
|
case 0:
|
|
3518
3466
|
if (this.store.openData) {
|
|
3519
|
-
|
|
3467
|
+
_context43.next = 2;
|
|
3520
3468
|
break;
|
|
3521
3469
|
}
|
|
3522
3470
|
throw new Error('openData 模块未初始化');
|
|
3523
3471
|
case 2:
|
|
3524
|
-
|
|
3472
|
+
_context43.next = 4;
|
|
3525
3473
|
return this.loadOpenDataConfig();
|
|
3526
3474
|
case 4:
|
|
3527
|
-
return
|
|
3475
|
+
return _context43.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
|
|
3528
3476
|
case 5:
|
|
3529
3477
|
case "end":
|
|
3530
|
-
return
|
|
3478
|
+
return _context43.stop();
|
|
3531
3479
|
}
|
|
3532
|
-
},
|
|
3480
|
+
}, _callee43, this);
|
|
3533
3481
|
}));
|
|
3534
3482
|
function checkOpenDataAvailability() {
|
|
3535
3483
|
return _checkOpenDataAvailability.apply(this, arguments);
|
|
@@ -3539,15 +3487,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3539
3487
|
}, {
|
|
3540
3488
|
key: "setOtherParams",
|
|
3541
3489
|
value: function () {
|
|
3542
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3490
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
|
|
3543
3491
|
var _ref5,
|
|
3544
3492
|
_ref5$cover,
|
|
3545
3493
|
cover,
|
|
3546
|
-
|
|
3547
|
-
return _regeneratorRuntime().wrap(function
|
|
3548
|
-
while (1) switch (
|
|
3494
|
+
_args44 = arguments;
|
|
3495
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context44) {
|
|
3496
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
3549
3497
|
case 0:
|
|
3550
|
-
_ref5 =
|
|
3498
|
+
_ref5 = _args44.length > 1 && _args44[1] !== undefined ? _args44[1] : {}, _ref5$cover = _ref5.cover, cover = _ref5$cover === void 0 ? false : _ref5$cover;
|
|
3551
3499
|
if (cover) {
|
|
3552
3500
|
this.otherParams = params;
|
|
3553
3501
|
} else {
|
|
@@ -3555,11 +3503,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3555
3503
|
}
|
|
3556
3504
|
case 2:
|
|
3557
3505
|
case "end":
|
|
3558
|
-
return
|
|
3506
|
+
return _context44.stop();
|
|
3559
3507
|
}
|
|
3560
|
-
},
|
|
3508
|
+
}, _callee44, this);
|
|
3561
3509
|
}));
|
|
3562
|
-
function setOtherParams(
|
|
3510
|
+
function setOtherParams(_x21) {
|
|
3563
3511
|
return _setOtherParams.apply(this, arguments);
|
|
3564
3512
|
}
|
|
3565
3513
|
return setOtherParams;
|