@pisell/pisellos 2.1.125 → 2.1.127
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/model/strategy/adapter/itemRule/adapter.d.ts +8 -0
- package/dist/model/strategy/adapter/itemRule/adapter.js +52 -8
- package/dist/model/strategy/adapter/itemRule/examples.d.ts +15 -0
- package/dist/model/strategy/adapter/itemRule/examples.js +68 -1
- package/dist/model/strategy/adapter/itemRule/index.d.ts +1 -1
- package/dist/model/strategy/adapter/itemRule/index.js +1 -1
- package/dist/model/strategy/adapter/itemRule/type.d.ts +20 -1
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/index.js +6 -40
- package/dist/modules/Order/utils.d.ts +24 -0
- package/dist/modules/Order/utils.js +87 -11
- package/dist/modules/SalesSummary/types.d.ts +2 -1
- package/dist/modules/SalesSummary/utils.js +10 -10
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/index.d.ts +5 -0
- package/dist/solution/ScanOrder/index.js +205 -64
- package/dist/solution/ScanOrder/types.d.ts +19 -5
- package/dist/solution/ScanOrder/utils.d.ts +15 -0
- package/dist/solution/ScanOrder/utils.js +142 -62
- package/dist/solution/VenueBooking/index.d.ts +4 -0
- package/dist/solution/VenueBooking/index.js +219 -141
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +6 -4
- package/lib/model/strategy/adapter/itemRule/adapter.d.ts +8 -0
- package/lib/model/strategy/adapter/itemRule/adapter.js +41 -2
- package/lib/model/strategy/adapter/itemRule/examples.d.ts +15 -0
- package/lib/model/strategy/adapter/itemRule/examples.js +47 -0
- package/lib/model/strategy/adapter/itemRule/index.d.ts +1 -1
- package/lib/model/strategy/adapter/itemRule/index.js +2 -0
- package/lib/model/strategy/adapter/itemRule/type.d.ts +20 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/index.js +4 -37
- package/lib/modules/Order/utils.d.ts +24 -0
- package/lib/modules/Order/utils.js +65 -4
- package/lib/modules/SalesSummary/types.d.ts +2 -1
- package/lib/modules/SalesSummary/utils.js +2 -2
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/index.d.ts +5 -0
- package/lib/solution/ScanOrder/index.js +94 -18
- package/lib/solution/ScanOrder/types.d.ts +19 -5
- package/lib/solution/ScanOrder/utils.d.ts +15 -0
- package/lib/solution/ScanOrder/utils.js +86 -19
- package/lib/solution/VenueBooking/index.d.ts +4 -0
- package/lib/solution/VenueBooking/index.js +85 -25
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +13 -4
- package/package.json +1 -1
|
@@ -35,6 +35,7 @@ import { createModule } from "../BookingByStep/types";
|
|
|
35
35
|
import { ProductList } from "../../modules/ProductList";
|
|
36
36
|
import { DateModule } from "../../modules/Date";
|
|
37
37
|
import { ScheduleModule } from "../../modules/Schedule";
|
|
38
|
+
import { calcMinTimeMaxTimeBySchedules } from "../../modules/Schedule/utils";
|
|
38
39
|
import { QuotationModule } from "../../modules/Quotation";
|
|
39
40
|
import { OpenDataModule } from "../../modules/OpenData";
|
|
40
41
|
import { AccountHooks } from "../../modules/Account/types";
|
|
@@ -87,6 +88,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
87
88
|
_defineProperty(_assertThisInitialized(_this), "cacheId", void 0);
|
|
88
89
|
_defineProperty(_assertThisInitialized(_this), "window", void 0);
|
|
89
90
|
_defineProperty(_assertThisInitialized(_this), "request", void 0);
|
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "baseSlotConfig", _objectSpread({}, DEFAULT_SLOT_CONFIG));
|
|
90
92
|
_defineProperty(_assertThisInitialized(_this), "itemRuleEvaluator", new ItemRuleEvaluator());
|
|
91
93
|
_defineProperty(_assertThisInitialized(_this), "itemRuleConfigs", []);
|
|
92
94
|
_defineProperty(_assertThisInitialized(_this), "itemRuleConfigsPromise", null);
|
|
@@ -460,7 +462,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
460
462
|
this.store.status = 'initializing';
|
|
461
463
|
this.store.error = null;
|
|
462
464
|
this.store.rawResourceData = [];
|
|
463
|
-
this.
|
|
465
|
+
this.baseSlotConfig = _objectSpread(_objectSpread({}, DEFAULT_SLOT_CONFIG), ((_options$otherParams2 = options.otherParams) === null || _options$otherParams2 === void 0 ? void 0 : _options$otherParams2.slotConfig) || {});
|
|
466
|
+
this.store.slotConfig = _objectSpread({}, this.baseSlotConfig);
|
|
464
467
|
this.otherParams = options.otherParams || {};
|
|
465
468
|
this.cacheId = (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.cacheId;
|
|
466
469
|
this.itemRuleRuntimeConfig = ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.venueBookingItemRule) || ((_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.itemRule) || {};
|
|
@@ -475,19 +478,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
475
478
|
this.window = core.getPlugin('window');
|
|
476
479
|
this.request = core.getPlugin('request');
|
|
477
480
|
if (this.window) {
|
|
478
|
-
_context6.next =
|
|
481
|
+
_context6.next = 24;
|
|
479
482
|
break;
|
|
480
483
|
}
|
|
481
484
|
this.logMethodError('initialize', 'window plugin missing');
|
|
482
485
|
throw new Error('venueBooking解决方案需要 window 插件支持');
|
|
483
|
-
case
|
|
486
|
+
case 24:
|
|
484
487
|
if (this.request) {
|
|
485
|
-
_context6.next =
|
|
488
|
+
_context6.next = 27;
|
|
486
489
|
break;
|
|
487
490
|
}
|
|
488
491
|
this.logMethodError('initialize', 'request plugin missing');
|
|
489
492
|
throw new Error('venueBooking解决方案需要 request 插件支持');
|
|
490
|
-
case
|
|
493
|
+
case 27:
|
|
491
494
|
// 注册基础模块(order, salesSummary, products, logger)
|
|
492
495
|
baseModules = ['scanOrderLogger', 'products', 'order', 'salesSummary'];
|
|
493
496
|
baseModules.forEach(function (step) {
|
|
@@ -581,46 +584,46 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
581
584
|
}
|
|
582
585
|
this.registerCustomerLoginListeners();
|
|
583
586
|
console.log('[VenueBooking] 初始化开始');
|
|
584
|
-
_context6.prev =
|
|
585
|
-
_context6.next =
|
|
587
|
+
_context6.prev = 50;
|
|
588
|
+
_context6.next = 53;
|
|
586
589
|
return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
|
|
587
590
|
createIfMissing: false
|
|
588
591
|
});
|
|
589
|
-
case
|
|
592
|
+
case 53:
|
|
590
593
|
(_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
|
|
591
|
-
_context6.next =
|
|
594
|
+
_context6.next = 56;
|
|
592
595
|
return this.loadRuntimeConfigs();
|
|
593
|
-
case
|
|
596
|
+
case 56:
|
|
594
597
|
if (!this.store.schedule) {
|
|
595
|
-
_context6.next =
|
|
598
|
+
_context6.next = 61;
|
|
596
599
|
break;
|
|
597
600
|
}
|
|
598
|
-
_context6.next =
|
|
601
|
+
_context6.next = 59;
|
|
599
602
|
return this.store.schedule.loadAllSchedule();
|
|
600
|
-
case
|
|
603
|
+
case 59:
|
|
601
604
|
this.injectScheduleResolverToQuotation();
|
|
602
605
|
(_this$store$quotation = this.store.quotation) === null || _this$store$quotation === void 0 || _this$store$quotation.loadQuotations({
|
|
603
606
|
channel: (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.channel
|
|
604
607
|
});
|
|
605
|
-
case
|
|
606
|
-
_context6.next =
|
|
608
|
+
case 61:
|
|
609
|
+
_context6.next = 63;
|
|
607
610
|
return this.refreshItemRuleQuantityLimits();
|
|
608
|
-
case
|
|
611
|
+
case 63:
|
|
609
612
|
this.store.status = 'ready';
|
|
610
613
|
console.log('[VenueBooking] 初始化完成');
|
|
611
|
-
_context6.next =
|
|
614
|
+
_context6.next = 67;
|
|
612
615
|
return this.core.effects.emit(VenueBookingHooks.onInited, {
|
|
613
616
|
status: this.store.status
|
|
614
617
|
});
|
|
615
|
-
case
|
|
618
|
+
case 67:
|
|
616
619
|
this.logMethodSuccess('initialize', {
|
|
617
620
|
status: this.store.status
|
|
618
621
|
});
|
|
619
|
-
_context6.next =
|
|
622
|
+
_context6.next = 77;
|
|
620
623
|
break;
|
|
621
|
-
case
|
|
622
|
-
_context6.prev =
|
|
623
|
-
_context6.t0 = _context6["catch"](
|
|
624
|
+
case 70:
|
|
625
|
+
_context6.prev = 70;
|
|
626
|
+
_context6.t0 = _context6["catch"](50);
|
|
624
627
|
this.store.status = 'error';
|
|
625
628
|
this.store.error = _context6.t0 instanceof Error ? _context6.t0.message : '初始化失败';
|
|
626
629
|
console.error('[VenueBooking] 初始化失败', _context6.t0);
|
|
@@ -628,11 +631,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
628
631
|
status: this.store.status
|
|
629
632
|
});
|
|
630
633
|
throw _context6.t0;
|
|
631
|
-
case
|
|
634
|
+
case 77:
|
|
632
635
|
case "end":
|
|
633
636
|
return _context6.stop();
|
|
634
637
|
}
|
|
635
|
-
}, _callee6, this, [[
|
|
638
|
+
}, _callee6, this, [[50, 70]]);
|
|
636
639
|
}));
|
|
637
640
|
function initialize(_x5) {
|
|
638
641
|
return _initialize.apply(this, arguments);
|
|
@@ -1094,27 +1097,105 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1094
1097
|
}
|
|
1095
1098
|
return fetchResourceAvailability;
|
|
1096
1099
|
}() // ─── 日期概览 & 时间槽矩阵(纯计算,不发请求) ───
|
|
1100
|
+
}, {
|
|
1101
|
+
key: "getOperatingHoursScheduleIds",
|
|
1102
|
+
value: function getOperatingHoursScheduleIds() {
|
|
1103
|
+
var _this$store$openData, _this$store$openData$;
|
|
1104
|
+
var openData = this.otherParams.openData || ((_this$store$openData = this.store.openData) === null || _this$store$openData === void 0 || (_this$store$openData$ = _this$store$openData.getOpenData) === null || _this$store$openData$ === void 0 ? void 0 : _this$store$openData$.call(_this$store$openData)) || null;
|
|
1105
|
+
var rawIds = openData === null || openData === void 0 ? void 0 : openData['availability.operating_hours'];
|
|
1106
|
+
if (!Array.isArray(rawIds)) return [];
|
|
1107
|
+
return _toConsumableArray(new Set(rawIds.map(function (id) {
|
|
1108
|
+
return Number(id);
|
|
1109
|
+
}).filter(function (id) {
|
|
1110
|
+
return Number.isFinite(id) && id > 0;
|
|
1111
|
+
}).map(function (id) {
|
|
1112
|
+
return Math.floor(id);
|
|
1113
|
+
})));
|
|
1114
|
+
}
|
|
1115
|
+
}, {
|
|
1116
|
+
key: "resolveSlotConfigForDate",
|
|
1117
|
+
value: function resolveSlotConfigForDate(date) {
|
|
1118
|
+
var nextSlotConfig = _objectSpread({}, this.baseSlotConfig);
|
|
1119
|
+
if (!date || !this.store.schedule) return nextSlotConfig;
|
|
1120
|
+
var operatingHoursScheduleIds = this.getOperatingHoursScheduleIds();
|
|
1121
|
+
if (!operatingHoursScheduleIds.length) return nextSlotConfig;
|
|
1122
|
+
var scheduleList = this.store.schedule.getScheduleListByIds(operatingHoursScheduleIds);
|
|
1123
|
+
if (!scheduleList.length) return nextSlotConfig;
|
|
1124
|
+
var timeRangeMap = calcMinTimeMaxTimeBySchedules(scheduleList, undefined, date);
|
|
1125
|
+
var earliestStart = null;
|
|
1126
|
+
var latestEnd = null;
|
|
1127
|
+
var _iterator3 = _createForOfIteratorHelper(scheduleList),
|
|
1128
|
+
_step3;
|
|
1129
|
+
try {
|
|
1130
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1131
|
+
var _timeRangeMap$schedul;
|
|
1132
|
+
var schedule = _step3.value;
|
|
1133
|
+
var dateRangeList = (timeRangeMap === null || timeRangeMap === void 0 || (_timeRangeMap$schedul = timeRangeMap[schedule.id]) === null || _timeRangeMap$schedul === void 0 ? void 0 : _timeRangeMap$schedul.dateRangeFormat) || [];
|
|
1134
|
+
var _iterator4 = _createForOfIteratorHelper(dateRangeList),
|
|
1135
|
+
_step4;
|
|
1136
|
+
try {
|
|
1137
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1138
|
+
var range = _step4.value;
|
|
1139
|
+
var start = dayjs(range === null || range === void 0 ? void 0 : range.start);
|
|
1140
|
+
var end = dayjs(range === null || range === void 0 ? void 0 : range.end);
|
|
1141
|
+
if (!start.isValid() || !end.isValid()) continue;
|
|
1142
|
+
if (!earliestStart || start.isBefore(earliestStart)) {
|
|
1143
|
+
earliestStart = start;
|
|
1144
|
+
}
|
|
1145
|
+
if (!latestEnd || end.isAfter(latestEnd)) {
|
|
1146
|
+
latestEnd = end;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
} catch (err) {
|
|
1150
|
+
_iterator4.e(err);
|
|
1151
|
+
} finally {
|
|
1152
|
+
_iterator4.f();
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
} catch (err) {
|
|
1156
|
+
_iterator3.e(err);
|
|
1157
|
+
} finally {
|
|
1158
|
+
_iterator3.f();
|
|
1159
|
+
}
|
|
1160
|
+
if (!earliestStart || !latestEnd) return nextSlotConfig;
|
|
1161
|
+
return _objectSpread(_objectSpread({}, nextSlotConfig), {}, {
|
|
1162
|
+
businessStartTime: earliestStart.format('HH:mm'),
|
|
1163
|
+
businessEndTime: latestEnd.format('HH:mm')
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
}, {
|
|
1167
|
+
key: "syncOperatingHoursToSlotConfig",
|
|
1168
|
+
value: function syncOperatingHoursToSlotConfig(date) {
|
|
1169
|
+
var resolvedSlotConfig = this.resolveSlotConfigForDate(date);
|
|
1170
|
+
this.store.slotConfig = resolvedSlotConfig;
|
|
1171
|
+
return resolvedSlotConfig;
|
|
1172
|
+
}
|
|
1097
1173
|
}, {
|
|
1098
1174
|
key: "getDateRangeSummary",
|
|
1099
1175
|
value: function getDateRangeSummary(params) {
|
|
1176
|
+
var _this6 = this;
|
|
1100
1177
|
return buildDateRangeSummary({
|
|
1101
1178
|
startDate: params.startDate,
|
|
1102
1179
|
endDate: params.endDate,
|
|
1103
|
-
config: this.
|
|
1180
|
+
config: this.baseSlotConfig,
|
|
1104
1181
|
rawResources: this.store.rawResourceData,
|
|
1105
1182
|
resourceProductMap: this.resourceProductMap,
|
|
1106
|
-
quotationModule: this.store.quotation
|
|
1183
|
+
quotationModule: this.store.quotation,
|
|
1184
|
+
resolveConfig: function resolveConfig(date) {
|
|
1185
|
+
return _this6.resolveSlotConfigForDate(date);
|
|
1186
|
+
}
|
|
1107
1187
|
});
|
|
1108
1188
|
}
|
|
1109
1189
|
}, {
|
|
1110
1190
|
key: "getTimeSlotGrid",
|
|
1111
1191
|
value: function getTimeSlotGrid(date) {
|
|
1192
|
+
var resolvedSlotConfig = this.syncOperatingHoursToSlotConfig(date);
|
|
1112
1193
|
var quotationPriceMap;
|
|
1113
1194
|
if (this.store.quotation) {
|
|
1114
1195
|
var productIds = _toConsumableArray(new Set(_toConsumableArray(this.resourceProductMap.values()).map(function (m) {
|
|
1115
1196
|
return m.productId;
|
|
1116
1197
|
})));
|
|
1117
|
-
var timeLabels = generateTimeLabels(
|
|
1198
|
+
var timeLabels = generateTimeLabels(resolvedSlotConfig);
|
|
1118
1199
|
var timePoints = timeLabels.map(function (label) {
|
|
1119
1200
|
return "".concat(date, " ").concat(label);
|
|
1120
1201
|
});
|
|
@@ -1125,7 +1206,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1125
1206
|
}
|
|
1126
1207
|
return buildTimeSlotGrid({
|
|
1127
1208
|
date: date,
|
|
1128
|
-
config:
|
|
1209
|
+
config: resolvedSlotConfig,
|
|
1129
1210
|
rawResources: this.store.rawResourceData,
|
|
1130
1211
|
resourceProductMap: this.resourceProductMap,
|
|
1131
1212
|
quotationPriceMap: quotationPriceMap
|
|
@@ -1222,17 +1303,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1222
1303
|
});
|
|
1223
1304
|
var slotDuration = this.store.slotConfig.slotDurationMinutes;
|
|
1224
1305
|
var slots = [];
|
|
1225
|
-
var
|
|
1226
|
-
|
|
1306
|
+
var _iterator5 = _createForOfIteratorHelper(venueProducts),
|
|
1307
|
+
_step5;
|
|
1227
1308
|
try {
|
|
1228
|
-
for (
|
|
1229
|
-
var product =
|
|
1309
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1310
|
+
var product = _step5.value;
|
|
1230
1311
|
slots.push.apply(slots, _toConsumableArray(expandMergedSlotToIndividual(product, slotDuration)));
|
|
1231
1312
|
}
|
|
1232
1313
|
} catch (err) {
|
|
1233
|
-
|
|
1314
|
+
_iterator5.e(err);
|
|
1234
1315
|
} finally {
|
|
1235
|
-
|
|
1316
|
+
_iterator5.f();
|
|
1236
1317
|
}
|
|
1237
1318
|
return slots.sort(function (a, b) {
|
|
1238
1319
|
return a.startTime.localeCompare(b.startTime);
|
|
@@ -1265,12 +1346,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1265
1346
|
return (_p$metadata3 = p.metadata) === null || _p$metadata3 === void 0 ? void 0 : _p$metadata3.venue_booking;
|
|
1266
1347
|
});
|
|
1267
1348
|
var slotDuration = this.store.slotConfig.slotDurationMinutes;
|
|
1268
|
-
var
|
|
1269
|
-
|
|
1349
|
+
var _iterator6 = _createForOfIteratorHelper(venueProducts),
|
|
1350
|
+
_step6;
|
|
1270
1351
|
try {
|
|
1271
|
-
for (
|
|
1352
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1272
1353
|
var _product$metadata;
|
|
1273
|
-
var product =
|
|
1354
|
+
var product = _step6.value;
|
|
1274
1355
|
var resourceId = (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.resource_id;
|
|
1275
1356
|
if (resourceId == null) continue;
|
|
1276
1357
|
var existing = result.get(resourceId) || [];
|
|
@@ -1278,25 +1359,25 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1278
1359
|
result.set(resourceId, existing);
|
|
1279
1360
|
}
|
|
1280
1361
|
} catch (err) {
|
|
1281
|
-
|
|
1362
|
+
_iterator6.e(err);
|
|
1282
1363
|
} finally {
|
|
1283
|
-
|
|
1364
|
+
_iterator6.f();
|
|
1284
1365
|
}
|
|
1285
|
-
var
|
|
1286
|
-
|
|
1366
|
+
var _iterator7 = _createForOfIteratorHelper(result),
|
|
1367
|
+
_step7;
|
|
1287
1368
|
try {
|
|
1288
|
-
for (
|
|
1289
|
-
var
|
|
1290
|
-
key =
|
|
1291
|
-
slots =
|
|
1369
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1370
|
+
var _step7$value = _slicedToArray(_step7.value, 2),
|
|
1371
|
+
key = _step7$value[0],
|
|
1372
|
+
slots = _step7$value[1];
|
|
1292
1373
|
result.set(key, slots.sort(function (a, b) {
|
|
1293
1374
|
return a.startTime.localeCompare(b.startTime);
|
|
1294
1375
|
}));
|
|
1295
1376
|
}
|
|
1296
1377
|
} catch (err) {
|
|
1297
|
-
|
|
1378
|
+
_iterator7.e(err);
|
|
1298
1379
|
} finally {
|
|
1299
|
-
|
|
1380
|
+
_iterator7.f();
|
|
1300
1381
|
}
|
|
1301
1382
|
return result;
|
|
1302
1383
|
}
|
|
@@ -1365,7 +1446,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1365
1446
|
num: 1,
|
|
1366
1447
|
selling_price: group.totalPrice,
|
|
1367
1448
|
original_price: group.totalPrice,
|
|
1368
|
-
payment_price: group.totalPrice,
|
|
1369
1449
|
is_charge_tax: (_venueProduct$is_char = venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.is_charge_tax) !== null && _venueProduct$is_char !== void 0 ? _venueProduct$is_char : 0,
|
|
1370
1450
|
metadata: {
|
|
1371
1451
|
venue_booking: true,
|
|
@@ -1459,7 +1539,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1459
1539
|
}, {
|
|
1460
1540
|
key: "setSlotConfig",
|
|
1461
1541
|
value: function setSlotConfig(config) {
|
|
1462
|
-
this.
|
|
1542
|
+
this.baseSlotConfig = _objectSpread(_objectSpread({}, this.baseSlotConfig), config);
|
|
1543
|
+
this.store.slotConfig = _objectSpread({}, this.baseSlotConfig);
|
|
1463
1544
|
}
|
|
1464
1545
|
}, {
|
|
1465
1546
|
key: "getSlotConfig",
|
|
@@ -1509,10 +1590,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1509
1590
|
}, {
|
|
1510
1591
|
key: "injectScheduleResolverToQuotation",
|
|
1511
1592
|
value: function injectScheduleResolverToQuotation() {
|
|
1512
|
-
var
|
|
1593
|
+
var _this7 = this;
|
|
1513
1594
|
if (this.store.quotation && this.store.schedule) {
|
|
1514
1595
|
this.store.quotation.setScheduleResolver(function (id) {
|
|
1515
|
-
return
|
|
1596
|
+
return _this7.store.schedule.getScheduleListByIds([id])[0];
|
|
1516
1597
|
});
|
|
1517
1598
|
}
|
|
1518
1599
|
}
|
|
@@ -1590,25 +1671,25 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1590
1671
|
key: "recalculateOrderPricesFromQuotation",
|
|
1591
1672
|
value: function recalculateOrderPricesFromQuotation() {
|
|
1592
1673
|
var _tempOrder$products,
|
|
1593
|
-
|
|
1674
|
+
_this8 = this;
|
|
1594
1675
|
if (!this.store.order || !this.store.quotation) return;
|
|
1595
1676
|
var tempOrder = this.store.order.getTempOrder();
|
|
1596
1677
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
|
|
1597
1678
|
var now = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
1598
|
-
var
|
|
1599
|
-
|
|
1679
|
+
var _iterator8 = _createForOfIteratorHelper(tempOrder.products),
|
|
1680
|
+
_step8;
|
|
1600
1681
|
try {
|
|
1601
1682
|
var _loop = function _loop() {
|
|
1602
1683
|
var _product$metadata2;
|
|
1603
|
-
var product =
|
|
1684
|
+
var product = _step8.value;
|
|
1604
1685
|
if ((_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.venue_booking) {
|
|
1605
|
-
var mapping =
|
|
1686
|
+
var mapping = _this8.resourceProductMap.get(product.metadata.resource_id);
|
|
1606
1687
|
if (!mapping) return 1; // continue
|
|
1607
|
-
var slots = expandMergedSlotToIndividual(product,
|
|
1688
|
+
var slots = expandMergedSlotToIndividual(product, _this8.store.slotConfig.slotDurationMinutes);
|
|
1608
1689
|
var updatedSlots = slots.map(function (slot) {
|
|
1609
1690
|
var _getPriceForProduct;
|
|
1610
1691
|
return _objectSpread(_objectSpread({}, slot), {}, {
|
|
1611
|
-
price: (_getPriceForProduct =
|
|
1692
|
+
price: (_getPriceForProduct = _this8.store.quotation.getPriceForProduct({
|
|
1612
1693
|
productId: mapping.productId,
|
|
1613
1694
|
datetime: slot.startTime
|
|
1614
1695
|
})) !== null && _getPriceForProduct !== void 0 ? _getPriceForProduct : mapping.price
|
|
@@ -1617,33 +1698,33 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1617
1698
|
var merged = mergeConsecutiveSlots(updatedSlots);
|
|
1618
1699
|
if (merged.length === 1) {
|
|
1619
1700
|
product.selling_price = merged[0].totalPrice;
|
|
1620
|
-
product.
|
|
1701
|
+
product.original_price = merged[0].totalPrice;
|
|
1621
1702
|
product.metadata.price_breakdown = buildPriceBreakdown({
|
|
1622
1703
|
group: merged[0],
|
|
1623
1704
|
productId: mapping.productId,
|
|
1624
|
-
quotation:
|
|
1705
|
+
quotation: _this8.store.quotation
|
|
1625
1706
|
});
|
|
1626
1707
|
}
|
|
1627
1708
|
} else if (product.product_id != null) {
|
|
1628
1709
|
var _product$product_vari;
|
|
1629
|
-
var quotationPrice =
|
|
1710
|
+
var quotationPrice = _this8.store.quotation.getPriceForProduct({
|
|
1630
1711
|
productId: product.product_id,
|
|
1631
1712
|
variantId: (_product$product_vari = product.product_variant_id) !== null && _product$product_vari !== void 0 ? _product$product_vari : undefined,
|
|
1632
1713
|
datetime: now
|
|
1633
1714
|
});
|
|
1634
1715
|
if (quotationPrice !== null) {
|
|
1635
1716
|
product.selling_price = quotationPrice;
|
|
1636
|
-
product.
|
|
1717
|
+
product.original_price = quotationPrice;
|
|
1637
1718
|
}
|
|
1638
1719
|
}
|
|
1639
1720
|
};
|
|
1640
|
-
for (
|
|
1721
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1641
1722
|
if (_loop()) continue;
|
|
1642
1723
|
}
|
|
1643
1724
|
} catch (err) {
|
|
1644
|
-
|
|
1725
|
+
_iterator8.e(err);
|
|
1645
1726
|
} finally {
|
|
1646
|
-
|
|
1727
|
+
_iterator8.f();
|
|
1647
1728
|
}
|
|
1648
1729
|
}
|
|
1649
1730
|
}, {
|
|
@@ -1711,7 +1792,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1711
1792
|
key: "setDiscountSelected",
|
|
1712
1793
|
value: (function () {
|
|
1713
1794
|
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
|
|
1714
|
-
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,
|
|
1795
|
+
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, _iterator9, _step9, d, selectedResourceIds, _iterator10, _step10, _product$discount_lis, product, before, totalPerUnitDiscount, newSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
|
|
1715
1796
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1716
1797
|
while (1) switch (_context21.prev = _context21.next) {
|
|
1717
1798
|
case 0:
|
|
@@ -1771,18 +1852,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1771
1852
|
}).map(function (d) {
|
|
1772
1853
|
return d.id;
|
|
1773
1854
|
}));
|
|
1774
|
-
|
|
1855
|
+
_iterator9 = _createForOfIteratorHelper(nextDiscountList);
|
|
1775
1856
|
try {
|
|
1776
|
-
for (
|
|
1777
|
-
d =
|
|
1857
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
1858
|
+
d = _step9.value;
|
|
1778
1859
|
if (d.isSelected && !beforeSelectedIds.has(d.id)) {
|
|
1779
1860
|
d.isSelected = false;
|
|
1780
1861
|
}
|
|
1781
1862
|
}
|
|
1782
1863
|
} catch (err) {
|
|
1783
|
-
|
|
1864
|
+
_iterator9.e(err);
|
|
1784
1865
|
} finally {
|
|
1785
|
-
|
|
1866
|
+
_iterator9.f();
|
|
1786
1867
|
}
|
|
1787
1868
|
}
|
|
1788
1869
|
}
|
|
@@ -1792,15 +1873,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1792
1873
|
}).map(function (d) {
|
|
1793
1874
|
return d.id;
|
|
1794
1875
|
}));
|
|
1795
|
-
|
|
1876
|
+
_iterator10 = _createForOfIteratorHelper(tempOrder.products);
|
|
1796
1877
|
_context21.prev = 19;
|
|
1797
|
-
|
|
1878
|
+
_iterator10.s();
|
|
1798
1879
|
case 21:
|
|
1799
|
-
if ((
|
|
1880
|
+
if ((_step10 = _iterator10.n()).done) {
|
|
1800
1881
|
_context21.next = 30;
|
|
1801
1882
|
break;
|
|
1802
1883
|
}
|
|
1803
|
-
product =
|
|
1884
|
+
product = _step10.value;
|
|
1804
1885
|
if ((_product$discount_lis = product.discount_list) !== null && _product$discount_lis !== void 0 && _product$discount_lis.length) {
|
|
1805
1886
|
_context21.next = 25;
|
|
1806
1887
|
break;
|
|
@@ -1814,14 +1895,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1814
1895
|
return rid != null && selectedResourceIds.has(rid);
|
|
1815
1896
|
});
|
|
1816
1897
|
if (product.discount_list.length < before) {
|
|
1817
|
-
|
|
1898
|
+
// 基于剩余的 discount_list 重算 selling_price。
|
|
1899
|
+
// 约定:pd.amount 为 per-unit 折扣额,remaining 加总即单品券后总折扣。
|
|
1900
|
+
totalPerUnitDiscount = product.discount_list.reduce(function (sum, pd) {
|
|
1818
1901
|
return sum + (pd.amount || 0);
|
|
1819
1902
|
}, 0);
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
product.payment_price = paymentStr;
|
|
1903
|
+
newSellingPrice = new Decimal(product.original_price || product.selling_price || 0).minus(totalPerUnitDiscount).toDecimalPlaces(2).toString();
|
|
1904
|
+
product.selling_price = newSellingPrice;
|
|
1823
1905
|
if (product.metadata) {
|
|
1824
|
-
product.metadata.main_product_selling_price =
|
|
1906
|
+
product.metadata.main_product_selling_price = newSellingPrice;
|
|
1825
1907
|
}
|
|
1826
1908
|
}
|
|
1827
1909
|
case 28:
|
|
@@ -1833,10 +1915,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1833
1915
|
case 32:
|
|
1834
1916
|
_context21.prev = 32;
|
|
1835
1917
|
_context21.t0 = _context21["catch"](19);
|
|
1836
|
-
|
|
1918
|
+
_iterator10.e(_context21.t0);
|
|
1837
1919
|
case 35:
|
|
1838
1920
|
_context21.prev = 35;
|
|
1839
|
-
|
|
1921
|
+
_iterator10.f();
|
|
1840
1922
|
return _context21.finish(35);
|
|
1841
1923
|
case 38:
|
|
1842
1924
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
@@ -2041,10 +2123,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2041
2123
|
});
|
|
2042
2124
|
if (quotationPrice !== null) {
|
|
2043
2125
|
product.selling_price = quotationPrice;
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
product.payment_price = quotationPrice;
|
|
2126
|
+
product.original_price = quotationPrice;
|
|
2127
|
+
} else if (product.selling_price != null) {
|
|
2128
|
+
product.original_price = product.selling_price;
|
|
2048
2129
|
}
|
|
2049
2130
|
}
|
|
2050
2131
|
_context25.next = 7;
|
|
@@ -2209,7 +2290,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2209
2290
|
key: "loadOpenDataConfig",
|
|
2210
2291
|
value: function () {
|
|
2211
2292
|
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
2212
|
-
var
|
|
2293
|
+
var _this9 = this;
|
|
2213
2294
|
var lastFetchedAt, cachedData;
|
|
2214
2295
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2215
2296
|
while (1) switch (_context29.prev = _context29.next) {
|
|
@@ -2240,10 +2321,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2240
2321
|
target: 'venue_booking+online_store',
|
|
2241
2322
|
section_code: [].concat(OPEN_DATA_SECTION_CODES)
|
|
2242
2323
|
}).then(function (openDataConfig) {
|
|
2243
|
-
|
|
2324
|
+
_this9.otherParams.openData = openDataConfig;
|
|
2244
2325
|
return openDataConfig;
|
|
2245
2326
|
}).finally(function () {
|
|
2246
|
-
|
|
2327
|
+
_this9.loadOpenDataConfigInFlight = null;
|
|
2247
2328
|
});
|
|
2248
2329
|
return _context29.abrupt("return", this.loadOpenDataConfigInFlight);
|
|
2249
2330
|
case 11:
|
|
@@ -2372,17 +2453,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2372
2453
|
if (visited.has(value)) return;
|
|
2373
2454
|
visited.add(value);
|
|
2374
2455
|
if (Array.isArray(value)) {
|
|
2375
|
-
var
|
|
2376
|
-
|
|
2456
|
+
var _iterator11 = _createForOfIteratorHelper(value),
|
|
2457
|
+
_step11;
|
|
2377
2458
|
try {
|
|
2378
|
-
for (
|
|
2379
|
-
var item =
|
|
2459
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
2460
|
+
var item = _step11.value;
|
|
2380
2461
|
collectFromValue(item);
|
|
2381
2462
|
}
|
|
2382
2463
|
} catch (err) {
|
|
2383
|
-
|
|
2464
|
+
_iterator11.e(err);
|
|
2384
2465
|
} finally {
|
|
2385
|
-
|
|
2466
|
+
_iterator11.f();
|
|
2386
2467
|
}
|
|
2387
2468
|
return;
|
|
2388
2469
|
}
|
|
@@ -2430,7 +2511,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2430
2511
|
key: "ensureItemRuleConfigsLoaded",
|
|
2431
2512
|
value: function () {
|
|
2432
2513
|
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2433
|
-
var
|
|
2514
|
+
var _this10 = this;
|
|
2434
2515
|
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2435
2516
|
while (1) switch (_context34.prev = _context34.next) {
|
|
2436
2517
|
case 0:
|
|
@@ -2451,19 +2532,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2451
2532
|
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2452
2533
|
while (1) switch (_context33.prev = _context33.next) {
|
|
2453
2534
|
case 0:
|
|
2454
|
-
runtimeConfig =
|
|
2535
|
+
runtimeConfig = _this10.getItemRuleRuntimeConfig();
|
|
2455
2536
|
staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
|
|
2456
2537
|
if (!(staticConfigs.length > 0)) {
|
|
2457
2538
|
_context33.next = 6;
|
|
2458
2539
|
break;
|
|
2459
2540
|
}
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
return _context33.abrupt("return",
|
|
2541
|
+
_this10.itemRuleConfigs = staticConfigs;
|
|
2542
|
+
_this10.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
|
|
2543
|
+
return _context33.abrupt("return", _this10.itemRuleConfigs);
|
|
2463
2544
|
case 6:
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
return _context33.abrupt("return",
|
|
2545
|
+
_this10.itemRuleConfigs = [];
|
|
2546
|
+
_this10.itemRuleEvaluator.setStrategyConfigs([]);
|
|
2547
|
+
return _context33.abrupt("return", _this10.itemRuleConfigs);
|
|
2467
2548
|
case 9:
|
|
2468
2549
|
case "end":
|
|
2469
2550
|
return _context33.stop();
|
|
@@ -2537,7 +2618,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2537
2618
|
key: "applyPrefillByItemRule",
|
|
2538
2619
|
value: function () {
|
|
2539
2620
|
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
2540
|
-
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges,
|
|
2621
|
+
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator12, _step12, _prefillItem$product_, _targetProduct$_origi, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, sellingPrice, targetProduct, existedQuantity, delta, nextProduct;
|
|
2541
2622
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
2542
2623
|
while (1) switch (_context36.prev = _context36.next) {
|
|
2543
2624
|
case 0:
|
|
@@ -2582,15 +2663,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2582
2663
|
productSourceMap = _context36.sent;
|
|
2583
2664
|
tempOrder = this.ensureTempOrder();
|
|
2584
2665
|
hasChanges = false;
|
|
2585
|
-
|
|
2666
|
+
_iterator12 = _createForOfIteratorHelper(prefillItems);
|
|
2586
2667
|
_context36.prev = 20;
|
|
2587
|
-
|
|
2668
|
+
_iterator12.s();
|
|
2588
2669
|
case 22:
|
|
2589
|
-
if ((
|
|
2590
|
-
_context36.next =
|
|
2670
|
+
if ((_step12 = _iterator12.n()).done) {
|
|
2671
|
+
_context36.next = 45;
|
|
2591
2672
|
break;
|
|
2592
2673
|
}
|
|
2593
|
-
prefillItem =
|
|
2674
|
+
prefillItem = _step12.value;
|
|
2594
2675
|
productId = Number(prefillItem.product_id);
|
|
2595
2676
|
productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
|
|
2596
2677
|
targetQuantity = toNonNegativeInt(prefillItem.quantity);
|
|
@@ -2598,13 +2679,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2598
2679
|
_context36.next = 29;
|
|
2599
2680
|
break;
|
|
2600
2681
|
}
|
|
2601
|
-
return _context36.abrupt("continue",
|
|
2682
|
+
return _context36.abrupt("continue", 43);
|
|
2602
2683
|
case 29:
|
|
2603
2684
|
if (!Number.isNaN(productVariantId)) {
|
|
2604
2685
|
_context36.next = 31;
|
|
2605
2686
|
break;
|
|
2606
2687
|
}
|
|
2607
|
-
return _context36.abrupt("continue",
|
|
2688
|
+
return _context36.abrupt("continue", 43);
|
|
2608
2689
|
case 31:
|
|
2609
2690
|
sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
|
|
2610
2691
|
productIndex = getProductIdentityIndex(tempOrder.products, {
|
|
@@ -2612,19 +2693,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2612
2693
|
product_variant_id: productVariantId
|
|
2613
2694
|
});
|
|
2614
2695
|
if (!(productIndex === -1)) {
|
|
2615
|
-
_context36.next =
|
|
2696
|
+
_context36.next = 38;
|
|
2616
2697
|
break;
|
|
2617
2698
|
}
|
|
2618
2699
|
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');
|
|
2619
|
-
originalPrice = toPriceString((_ref5 = (_sourceItem$original_ = sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.original_price) !== null && _sourceItem$original_ !== void 0 ? _sourceItem$original_ : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _ref5 !== void 0 ? _ref5 : sellingPrice, sellingPrice);
|
|
2620
|
-
paymentPrice = toPriceString((_ref6 = (_sourceItem$payment_p = sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.payment_price) !== null && _sourceItem$payment_p !== void 0 ? _sourceItem$payment_p : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _ref6 !== void 0 ? _ref6 : sellingPrice, sellingPrice);
|
|
2621
2700
|
tempOrder.products.push(normalizeOrderProduct({
|
|
2622
2701
|
product_id: productId,
|
|
2623
2702
|
product_variant_id: productVariantId,
|
|
2624
2703
|
num: targetQuantity,
|
|
2625
2704
|
selling_price: sellingPrice,
|
|
2626
|
-
original_price:
|
|
2627
|
-
payment_price: paymentPrice,
|
|
2705
|
+
original_price: sellingPrice,
|
|
2628
2706
|
metadata: {
|
|
2629
2707
|
item_rule_prefill: true,
|
|
2630
2708
|
item_rule_id: prefillItem.ruleId
|
|
@@ -2635,8 +2713,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2635
2713
|
})
|
|
2636
2714
|
}));
|
|
2637
2715
|
hasChanges = true;
|
|
2638
|
-
return _context36.abrupt("continue",
|
|
2639
|
-
case
|
|
2716
|
+
return _context36.abrupt("continue", 43);
|
|
2717
|
+
case 38:
|
|
2640
2718
|
targetProduct = tempOrder.products[productIndex];
|
|
2641
2719
|
existedQuantity = toNonNegativeInt(targetProduct.num);
|
|
2642
2720
|
delta = targetQuantity - existedQuantity;
|
|
@@ -2653,45 +2731,45 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2653
2731
|
tempOrder.products[productIndex] = nextProduct;
|
|
2654
2732
|
hasChanges = true;
|
|
2655
2733
|
}
|
|
2656
|
-
case
|
|
2734
|
+
case 43:
|
|
2657
2735
|
_context36.next = 22;
|
|
2658
2736
|
break;
|
|
2659
|
-
case
|
|
2660
|
-
_context36.next =
|
|
2737
|
+
case 45:
|
|
2738
|
+
_context36.next = 50;
|
|
2661
2739
|
break;
|
|
2662
|
-
case
|
|
2663
|
-
_context36.prev =
|
|
2740
|
+
case 47:
|
|
2741
|
+
_context36.prev = 47;
|
|
2664
2742
|
_context36.t0 = _context36["catch"](20);
|
|
2665
|
-
|
|
2666
|
-
case
|
|
2667
|
-
_context36.prev =
|
|
2668
|
-
|
|
2669
|
-
return _context36.finish(
|
|
2670
|
-
case
|
|
2743
|
+
_iterator12.e(_context36.t0);
|
|
2744
|
+
case 50:
|
|
2745
|
+
_context36.prev = 50;
|
|
2746
|
+
_iterator12.f();
|
|
2747
|
+
return _context36.finish(50);
|
|
2748
|
+
case 53:
|
|
2671
2749
|
if (!hasChanges) {
|
|
2672
|
-
_context36.next =
|
|
2750
|
+
_context36.next = 57;
|
|
2673
2751
|
break;
|
|
2674
2752
|
}
|
|
2675
|
-
_context36.next =
|
|
2753
|
+
_context36.next = 56;
|
|
2676
2754
|
return this.store.order.recalculateSummary({
|
|
2677
2755
|
createIfMissing: true
|
|
2678
2756
|
});
|
|
2679
|
-
case
|
|
2757
|
+
case 56:
|
|
2680
2758
|
this.store.order.persistTempOrder();
|
|
2681
|
-
case
|
|
2682
|
-
_context36.next =
|
|
2759
|
+
case 57:
|
|
2760
|
+
_context36.next = 59;
|
|
2683
2761
|
return this.refreshItemRuleQuantityLimits();
|
|
2684
|
-
case
|
|
2762
|
+
case 59:
|
|
2685
2763
|
this.itemRulePrefillApplied = true;
|
|
2686
2764
|
this.logMethodSuccess('applyPrefillByItemRule', {
|
|
2687
2765
|
prefillCount: prefillItems.length,
|
|
2688
2766
|
hasChanges: hasChanges
|
|
2689
2767
|
});
|
|
2690
|
-
case
|
|
2768
|
+
case 61:
|
|
2691
2769
|
case "end":
|
|
2692
2770
|
return _context36.stop();
|
|
2693
2771
|
}
|
|
2694
|
-
}, _callee36, this, [[20,
|
|
2772
|
+
}, _callee36, this, [[20, 47, 50, 53]]);
|
|
2695
2773
|
}));
|
|
2696
2774
|
function applyPrefillByItemRule() {
|
|
2697
2775
|
return _applyPrefillByItemRule.apply(this, arguments);
|
|
@@ -2996,14 +3074,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2996
3074
|
key: "setOtherParams",
|
|
2997
3075
|
value: function () {
|
|
2998
3076
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
|
|
2999
|
-
var
|
|
3000
|
-
|
|
3077
|
+
var _ref5,
|
|
3078
|
+
_ref5$cover,
|
|
3001
3079
|
cover,
|
|
3002
3080
|
_args43 = arguments;
|
|
3003
3081
|
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3004
3082
|
while (1) switch (_context43.prev = _context43.next) {
|
|
3005
3083
|
case 0:
|
|
3006
|
-
|
|
3084
|
+
_ref5 = _args43.length > 1 && _args43[1] !== undefined ? _args43[1] : {}, _ref5$cover = _ref5.cover, cover = _ref5$cover === void 0 ? false : _ref5$cover;
|
|
3007
3085
|
if (cover) {
|
|
3008
3086
|
this.otherParams = params;
|
|
3009
3087
|
} else {
|