@pisell/pisellos 3.0.93 → 3.0.95
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/modules/Cart/utils/changePrice.js +16 -9
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/Order/index.d.ts +1 -0
- package/dist/modules/Order/index.js +18 -1
- package/dist/modules/Order/types.d.ts +2 -0
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +35 -3
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/Product/types.d.ts +7 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +2 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.d.ts +16 -1
- package/dist/solution/BookingByStep/index.js +276 -204
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/ScanOrder/types.d.ts +1 -0
- package/dist/solution/VenueBooking/index.d.ts +19 -0
- package/dist/solution/VenueBooking/index.js +978 -748
- package/dist/solution/VenueBooking/types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/lib/modules/Cart/utils/changePrice.js +13 -9
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/Order/index.d.ts +1 -0
- package/lib/modules/Order/index.js +14 -0
- package/lib/modules/Order/types.d.ts +2 -0
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +36 -5
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/Product/types.d.ts +7 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +3 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.d.ts +16 -1
- package/lib/solution/BookingByStep/index.js +39 -0
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/ScanOrder/types.d.ts +1 -0
- package/lib/solution/VenueBooking/index.d.ts +19 -0
- package/lib/solution/VenueBooking/index.js +134 -16
- package/lib/solution/VenueBooking/types.d.ts +2 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -49,6 +49,8 @@ import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../module
|
|
|
49
49
|
import { OrderModule } from "../../modules/Order";
|
|
50
50
|
import { RegisterAndLoginHooks } from "../RegisterAndLogin/types";
|
|
51
51
|
import Decimal from 'decimal.js';
|
|
52
|
+
import { HolderModule } from "../../modules/Holder";
|
|
53
|
+
import { getFormIdFromHolderConfig, getProductHolderConfig } from "../../modules/Holder/utils";
|
|
52
54
|
export * from "./types";
|
|
53
55
|
var OPEN_DATA_SECTION_CODES = ['basic', 'fulfillment', 'reservation', 'sale', 'menu', 'availability', 'workflow', 'checkout'];
|
|
54
56
|
function cloneCustomDepositData(customDepositData) {
|
|
@@ -288,20 +290,115 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
288
290
|
}
|
|
289
291
|
return null;
|
|
290
292
|
}
|
|
293
|
+
}, {
|
|
294
|
+
key: "resolveHolderCustomerId",
|
|
295
|
+
value: function resolveHolderCustomerId() {
|
|
296
|
+
var _this$window, _this$window$getLocal;
|
|
297
|
+
var customer = JSON.parse(((_this$window = this.window) === null || _this$window === void 0 || (_this$window$getLocal = _this$window.getLocalStorage) === null || _this$window$getLocal === void 0 ? void 0 : _this$window$getLocal.call(_this$window, 'customer')) || '{}');
|
|
298
|
+
if (customer !== null && customer !== void 0 && customer.id) return Number(customer.id);
|
|
299
|
+
return undefined;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* 按商品 holder_config 预加载表单数据到 holderMap。
|
|
304
|
+
* appointment_booking 在加购时触发;venueBooking 在商品加载后预加载,避免 getHolderFormMap 为空。
|
|
305
|
+
*/
|
|
306
|
+
}, {
|
|
307
|
+
key: "preloadHolderForms",
|
|
308
|
+
value: (function () {
|
|
309
|
+
var _preloadHolderForms = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(products) {
|
|
310
|
+
var seenFormIds, _iterator, _step, _item$_origin, item, holderConfig, formId, _item$_origin2, _item$_origin3;
|
|
311
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
312
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
313
|
+
case 0:
|
|
314
|
+
if (!(!this.store.holder || !products.length)) {
|
|
315
|
+
_context3.next = 2;
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
return _context3.abrupt("return");
|
|
319
|
+
case 2:
|
|
320
|
+
seenFormIds = new Set();
|
|
321
|
+
_iterator = _createForOfIteratorHelper(products);
|
|
322
|
+
_context3.prev = 4;
|
|
323
|
+
_iterator.s();
|
|
324
|
+
case 6:
|
|
325
|
+
if ((_step = _iterator.n()).done) {
|
|
326
|
+
_context3.next = 25;
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
item = _step.value;
|
|
330
|
+
holderConfig = getProductHolderConfig(item === null || item === void 0 || (_item$_origin = item._origin) === null || _item$_origin === void 0 ? void 0 : _item$_origin.product);
|
|
331
|
+
if (holderConfig) {
|
|
332
|
+
_context3.next = 11;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
return _context3.abrupt("continue", 23);
|
|
336
|
+
case 11:
|
|
337
|
+
formId = getFormIdFromHolderConfig(holderConfig);
|
|
338
|
+
if (!seenFormIds.has(formId)) {
|
|
339
|
+
_context3.next = 14;
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
return _context3.abrupt("continue", 23);
|
|
343
|
+
case 14:
|
|
344
|
+
seenFormIds.add(formId);
|
|
345
|
+
_context3.prev = 15;
|
|
346
|
+
_context3.next = 18;
|
|
347
|
+
return this.store.holder.ensureFormByProduct({
|
|
348
|
+
product: (item === null || item === void 0 || (_item$_origin2 = item._origin) === null || _item$_origin2 === void 0 ? void 0 : _item$_origin2.product) || {},
|
|
349
|
+
customer_id: this.resolveHolderCustomerId(),
|
|
350
|
+
shop_id: item === null || item === void 0 || (_item$_origin3 = item._origin) === null || _item$_origin3 === void 0 || (_item$_origin3 = _item$_origin3.product) === null || _item$_origin3 === void 0 ? void 0 : _item$_origin3.shop_id,
|
|
351
|
+
useCache: true
|
|
352
|
+
});
|
|
353
|
+
case 18:
|
|
354
|
+
_context3.next = 23;
|
|
355
|
+
break;
|
|
356
|
+
case 20:
|
|
357
|
+
_context3.prev = 20;
|
|
358
|
+
_context3.t0 = _context3["catch"](15);
|
|
359
|
+
console.error('[VenueBooking] 预加载 holder 表单失败', {
|
|
360
|
+
formId: formId,
|
|
361
|
+
error: _context3.t0
|
|
362
|
+
});
|
|
363
|
+
case 23:
|
|
364
|
+
_context3.next = 6;
|
|
365
|
+
break;
|
|
366
|
+
case 25:
|
|
367
|
+
_context3.next = 30;
|
|
368
|
+
break;
|
|
369
|
+
case 27:
|
|
370
|
+
_context3.prev = 27;
|
|
371
|
+
_context3.t1 = _context3["catch"](4);
|
|
372
|
+
_iterator.e(_context3.t1);
|
|
373
|
+
case 30:
|
|
374
|
+
_context3.prev = 30;
|
|
375
|
+
_iterator.f();
|
|
376
|
+
return _context3.finish(30);
|
|
377
|
+
case 33:
|
|
378
|
+
case "end":
|
|
379
|
+
return _context3.stop();
|
|
380
|
+
}
|
|
381
|
+
}, _callee3, this, [[4, 27, 30, 33], [15, 20]]);
|
|
382
|
+
}));
|
|
383
|
+
function preloadHolderForms(_x3) {
|
|
384
|
+
return _preloadHolderForms.apply(this, arguments);
|
|
385
|
+
}
|
|
386
|
+
return preloadHolderForms;
|
|
387
|
+
}())
|
|
291
388
|
}, {
|
|
292
389
|
key: "clearLoginEffectListeners",
|
|
293
390
|
value: function clearLoginEffectListeners() {
|
|
294
|
-
var
|
|
295
|
-
|
|
391
|
+
var _iterator2 = _createForOfIteratorHelper(this.loginEffectDisposers),
|
|
392
|
+
_step2;
|
|
296
393
|
try {
|
|
297
|
-
for (
|
|
298
|
-
var dispose =
|
|
394
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
395
|
+
var dispose = _step2.value;
|
|
299
396
|
dispose();
|
|
300
397
|
}
|
|
301
398
|
} catch (err) {
|
|
302
|
-
|
|
399
|
+
_iterator2.e(err);
|
|
303
400
|
} finally {
|
|
304
|
-
|
|
401
|
+
_iterator2.f();
|
|
305
402
|
}
|
|
306
403
|
this.loginEffectDisposers = [];
|
|
307
404
|
}
|
|
@@ -332,29 +429,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
332
429
|
var currentAccount = (accountModule === null || accountModule === void 0 || (_accountModule$getCur = accountModule.getCurrentAccount) === null || _accountModule$getCur === void 0 ? void 0 : _accountModule$getCur.call(accountModule)) || (accountModule === null || accountModule === void 0 || (_accountModule$getAcc = accountModule.getAccount) === null || _accountModule$getAcc === void 0 ? void 0 : _accountModule$getAcc.call(accountModule)) || null;
|
|
333
430
|
var createHandleLogin = function createHandleLogin(eventName) {
|
|
334
431
|
return /*#__PURE__*/function () {
|
|
335
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
432
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(payload) {
|
|
336
433
|
var customerId;
|
|
337
|
-
return _regeneratorRuntime().wrap(function
|
|
338
|
-
while (1) switch (
|
|
434
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
435
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
339
436
|
case 0:
|
|
340
437
|
customerId = _this2.resolveCustomerIdFromLoginPayload(payload);
|
|
341
438
|
if (customerId) {
|
|
342
|
-
|
|
439
|
+
_context4.next = 3;
|
|
343
440
|
break;
|
|
344
441
|
}
|
|
345
|
-
return
|
|
442
|
+
return _context4.abrupt("return");
|
|
346
443
|
case 3:
|
|
347
|
-
|
|
444
|
+
_context4.next = 5;
|
|
348
445
|
return _this2.refreshOrderMarketingAfterLogin({
|
|
349
446
|
customerId: customerId
|
|
350
447
|
});
|
|
351
448
|
case 5:
|
|
352
449
|
case "end":
|
|
353
|
-
return
|
|
450
|
+
return _context4.stop();
|
|
354
451
|
}
|
|
355
|
-
},
|
|
452
|
+
}, _callee4);
|
|
356
453
|
}));
|
|
357
|
-
return function (
|
|
454
|
+
return function (_x4) {
|
|
358
455
|
return _ref.apply(this, arguments);
|
|
359
456
|
};
|
|
360
457
|
}();
|
|
@@ -365,97 +462,107 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
365
462
|
}, {
|
|
366
463
|
key: "refreshOrderMarketingAfterLogin",
|
|
367
464
|
value: function () {
|
|
368
|
-
var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
465
|
+
var _refreshOrderMarketingAfterLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
369
466
|
var _this3 = this;
|
|
370
467
|
var refreshTask;
|
|
371
|
-
return _regeneratorRuntime().wrap(function
|
|
372
|
-
while (1) switch (
|
|
468
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
469
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
373
470
|
case 0:
|
|
374
471
|
if (this.store.order) {
|
|
375
|
-
|
|
472
|
+
_context6.next = 2;
|
|
376
473
|
break;
|
|
377
474
|
}
|
|
378
475
|
throw new Error('order 模块未初始化');
|
|
379
476
|
case 2:
|
|
380
477
|
if (!this.customerLoginRefreshInFlight) {
|
|
381
|
-
|
|
478
|
+
_context6.next = 9;
|
|
382
479
|
break;
|
|
383
480
|
}
|
|
384
481
|
if (!(this.customerLoginRefreshIdInFlight === params.customerId)) {
|
|
385
|
-
|
|
482
|
+
_context6.next = 7;
|
|
386
483
|
break;
|
|
387
484
|
}
|
|
388
|
-
|
|
485
|
+
_context6.next = 6;
|
|
389
486
|
return this.customerLoginRefreshInFlight;
|
|
390
487
|
case 6:
|
|
391
|
-
return
|
|
488
|
+
return _context6.abrupt("return");
|
|
392
489
|
case 7:
|
|
393
|
-
|
|
490
|
+
_context6.next = 9;
|
|
394
491
|
return this.customerLoginRefreshInFlight;
|
|
395
492
|
case 9:
|
|
396
493
|
this.customerLoginRefreshIdInFlight = params.customerId;
|
|
397
|
-
refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
494
|
+
refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
398
495
|
var _this3$otherParams;
|
|
399
|
-
return _regeneratorRuntime().wrap(function
|
|
400
|
-
while (1) switch (
|
|
496
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
497
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
401
498
|
case 0:
|
|
499
|
+
if (!_this3.store.holder) {
|
|
500
|
+
_context5.next = 3;
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
_context5.next = 3;
|
|
504
|
+
return _this3.store.holder.refreshAllFormRecords({
|
|
505
|
+
customer_id: params.customerId,
|
|
506
|
+
useCache: false
|
|
507
|
+
});
|
|
508
|
+
case 3:
|
|
402
509
|
if (!_this3.store.quotation) {
|
|
403
|
-
|
|
510
|
+
_context5.next = 6;
|
|
404
511
|
break;
|
|
405
512
|
}
|
|
406
|
-
|
|
513
|
+
_context5.next = 6;
|
|
407
514
|
return _this3.store.quotation.loadQuotations({
|
|
408
515
|
channel: (_this3$otherParams = _this3.otherParams) === null || _this3$otherParams === void 0 ? void 0 : _this3$otherParams.channel
|
|
409
516
|
});
|
|
410
|
-
case
|
|
517
|
+
case 6:
|
|
411
518
|
_this3.recalculateOrderPricesFromQuotation();
|
|
412
|
-
|
|
519
|
+
_context5.next = 9;
|
|
413
520
|
return _this3.store.order.loadDiscountConfig({
|
|
414
521
|
customerId: params.customerId
|
|
415
522
|
});
|
|
416
|
-
case
|
|
417
|
-
|
|
523
|
+
case 9:
|
|
524
|
+
_context5.next = 11;
|
|
418
525
|
return _this3.store.order.recalculateSummary({
|
|
419
526
|
createIfMissing: true
|
|
420
527
|
});
|
|
421
|
-
case
|
|
528
|
+
case 11:
|
|
422
529
|
_this3.store.order.persistTempOrder();
|
|
423
|
-
|
|
530
|
+
_context5.next = 14;
|
|
424
531
|
return _this3.refreshItemRuleQuantityLimits();
|
|
425
|
-
case
|
|
426
|
-
|
|
532
|
+
case 14:
|
|
533
|
+
_context5.next = 16;
|
|
427
534
|
return _this3.refreshCartValidationPassed();
|
|
428
|
-
case
|
|
535
|
+
case 16:
|
|
429
536
|
case "end":
|
|
430
|
-
return
|
|
537
|
+
return _context5.stop();
|
|
431
538
|
}
|
|
432
|
-
},
|
|
539
|
+
}, _callee5);
|
|
433
540
|
}))();
|
|
434
541
|
this.customerLoginRefreshInFlight = refreshTask;
|
|
435
|
-
|
|
436
|
-
|
|
542
|
+
_context6.prev = 12;
|
|
543
|
+
_context6.next = 15;
|
|
437
544
|
return refreshTask;
|
|
438
545
|
case 15:
|
|
439
|
-
|
|
546
|
+
_context6.next = 20;
|
|
440
547
|
break;
|
|
441
548
|
case 17:
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
throw
|
|
549
|
+
_context6.prev = 17;
|
|
550
|
+
_context6.t0 = _context6["catch"](12);
|
|
551
|
+
throw _context6.t0;
|
|
445
552
|
case 20:
|
|
446
|
-
|
|
553
|
+
_context6.prev = 20;
|
|
447
554
|
if (this.customerLoginRefreshInFlight === refreshTask) {
|
|
448
555
|
this.customerLoginRefreshInFlight = null;
|
|
449
556
|
this.customerLoginRefreshIdInFlight = null;
|
|
450
557
|
}
|
|
451
|
-
return
|
|
558
|
+
return _context6.finish(20);
|
|
452
559
|
case 23:
|
|
453
560
|
case "end":
|
|
454
|
-
return
|
|
561
|
+
return _context6.stop();
|
|
455
562
|
}
|
|
456
|
-
},
|
|
563
|
+
}, _callee6, this, [[12, 17, 20, 23]]);
|
|
457
564
|
}));
|
|
458
|
-
function refreshOrderMarketingAfterLogin(
|
|
565
|
+
function refreshOrderMarketingAfterLogin(_x5) {
|
|
459
566
|
return _refreshOrderMarketingAfterLogin.apply(this, arguments);
|
|
460
567
|
}
|
|
461
568
|
return refreshOrderMarketingAfterLogin;
|
|
@@ -463,7 +570,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
463
570
|
}, {
|
|
464
571
|
key: "initialize",
|
|
465
572
|
value: function () {
|
|
466
|
-
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
573
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(core) {
|
|
467
574
|
var _options$otherParams,
|
|
468
575
|
_options$otherParams2,
|
|
469
576
|
_this$otherParams,
|
|
@@ -471,7 +578,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
471
578
|
_this$otherParams3,
|
|
472
579
|
_this4 = this,
|
|
473
580
|
_this$otherParams4,
|
|
474
|
-
_this$otherParams5
|
|
581
|
+
_this$otherParams5,
|
|
582
|
+
_this$otherParams6,
|
|
583
|
+
_this$otherParams7,
|
|
584
|
+
_this$otherParams8;
|
|
475
585
|
var options,
|
|
476
586
|
baseModules,
|
|
477
587
|
venueProductsModule,
|
|
@@ -480,15 +590,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
480
590
|
scheduleModule,
|
|
481
591
|
quotationModule,
|
|
482
592
|
openDataModule,
|
|
593
|
+
holderCacheState,
|
|
594
|
+
sessionData,
|
|
595
|
+
_data$this$otherParam,
|
|
596
|
+
data,
|
|
597
|
+
holderModule,
|
|
483
598
|
_this$store$order,
|
|
484
599
|
_this$store$order2,
|
|
485
600
|
_this$store$quotation,
|
|
486
|
-
_this$
|
|
487
|
-
|
|
488
|
-
return _regeneratorRuntime().wrap(function
|
|
489
|
-
while (1) switch (
|
|
601
|
+
_this$otherParams9,
|
|
602
|
+
_args7 = arguments;
|
|
603
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
604
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
490
605
|
case 0:
|
|
491
|
-
options =
|
|
606
|
+
options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
|
|
492
607
|
this.logMethodStart('initialize');
|
|
493
608
|
this.core = core;
|
|
494
609
|
this.initializeOptions = options || {};
|
|
@@ -513,14 +628,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
513
628
|
this.window = core.getPlugin('window');
|
|
514
629
|
this.request = core.getPlugin('request');
|
|
515
630
|
if (this.window) {
|
|
516
|
-
|
|
631
|
+
_context7.next = 24;
|
|
517
632
|
break;
|
|
518
633
|
}
|
|
519
634
|
this.logMethodError('initialize', 'window plugin missing');
|
|
520
635
|
throw new Error('venueBooking解决方案需要 window 插件支持');
|
|
521
636
|
case 24:
|
|
522
637
|
if (this.request) {
|
|
523
|
-
|
|
638
|
+
_context7.next = 27;
|
|
524
639
|
break;
|
|
525
640
|
}
|
|
526
641
|
this.logMethodError('initialize', 'request plugin missing');
|
|
@@ -617,65 +732,86 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
617
732
|
cacheId: (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.cacheId
|
|
618
733
|
})
|
|
619
734
|
});
|
|
735
|
+
if ((_this$otherParams6 = this.otherParams) !== null && _this$otherParams6 !== void 0 && _this$otherParams6.cacheId) {
|
|
736
|
+
sessionData = this.window.sessionStorage.getItem(this.name);
|
|
737
|
+
if (sessionData) {
|
|
738
|
+
try {
|
|
739
|
+
data = JSON.parse(sessionData);
|
|
740
|
+
holderCacheState = (_data$this$otherParam = data[this.otherParams.cacheId]) === null || _data$this$otherParam === void 0 ? void 0 : _data$this$otherParam["".concat(this.name, "_holder")];
|
|
741
|
+
} catch (_unused2) {
|
|
742
|
+
// ignore invalid session cache
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
holderModule = new HolderModule("".concat(this.name, "_holder"));
|
|
747
|
+
this.store.holder = holderModule;
|
|
748
|
+
this.core.registerModule(holderModule, {
|
|
749
|
+
initialState: holderCacheState,
|
|
750
|
+
otherParams: _objectSpread(_objectSpread({}, this.otherParams), {}, {
|
|
751
|
+
fatherModule: this.name,
|
|
752
|
+
openCache: !!((_this$otherParams7 = this.otherParams) !== null && _this$otherParams7 !== void 0 && _this$otherParams7.cacheId),
|
|
753
|
+
cacheId: (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.cacheId
|
|
754
|
+
})
|
|
755
|
+
});
|
|
620
756
|
if (this.store.scanOrderLogger) {
|
|
621
757
|
this.store.scanOrderLogger.setContext(this.getLoggerContext());
|
|
622
758
|
}
|
|
623
759
|
this.registerCustomerLoginListeners();
|
|
624
760
|
console.log('[VenueBooking] 初始化开始');
|
|
625
|
-
|
|
626
|
-
|
|
761
|
+
_context7.prev = 54;
|
|
762
|
+
_context7.next = 57;
|
|
627
763
|
return (_this$store$order = this.store.order) === null || _this$store$order === void 0 ? void 0 : _this$store$order.recalculateSummary({
|
|
628
764
|
createIfMissing: false
|
|
629
765
|
});
|
|
630
|
-
case
|
|
766
|
+
case 57:
|
|
631
767
|
(_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || _this$store$order2.persistTempOrder();
|
|
632
|
-
|
|
768
|
+
_context7.next = 60;
|
|
633
769
|
return this.loadRuntimeConfigs();
|
|
634
|
-
case
|
|
770
|
+
case 60:
|
|
635
771
|
if (!this.store.schedule) {
|
|
636
|
-
|
|
772
|
+
_context7.next = 65;
|
|
637
773
|
break;
|
|
638
774
|
}
|
|
639
|
-
|
|
775
|
+
_context7.next = 63;
|
|
640
776
|
return this.store.schedule.loadAllSchedule();
|
|
641
|
-
case
|
|
777
|
+
case 63:
|
|
642
778
|
this.injectScheduleResolverToQuotation();
|
|
643
779
|
(_this$store$quotation = this.store.quotation) === null || _this$store$quotation === void 0 || _this$store$quotation.loadQuotations({
|
|
644
|
-
channel: (_this$
|
|
780
|
+
channel: (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.channel
|
|
645
781
|
});
|
|
646
|
-
case
|
|
647
|
-
|
|
782
|
+
case 65:
|
|
783
|
+
_context7.next = 67;
|
|
648
784
|
return this.refreshItemRuleQuantityLimits();
|
|
649
|
-
case
|
|
785
|
+
case 67:
|
|
650
786
|
this.store.status = 'ready';
|
|
651
787
|
console.log('[VenueBooking] 初始化完成');
|
|
652
|
-
|
|
788
|
+
_context7.next = 71;
|
|
653
789
|
return this.core.effects.emit(VenueBookingHooks.onInited, {
|
|
654
790
|
status: this.store.status
|
|
655
791
|
});
|
|
656
|
-
case
|
|
792
|
+
case 71:
|
|
657
793
|
this.logMethodSuccess('initialize', {
|
|
658
794
|
status: this.store.status
|
|
659
795
|
});
|
|
660
|
-
|
|
796
|
+
_context7.next = 81;
|
|
661
797
|
break;
|
|
662
|
-
case
|
|
663
|
-
|
|
664
|
-
|
|
798
|
+
case 74:
|
|
799
|
+
_context7.prev = 74;
|
|
800
|
+
_context7.t0 = _context7["catch"](54);
|
|
665
801
|
this.store.status = 'error';
|
|
666
|
-
this.store.error =
|
|
667
|
-
console.error('[VenueBooking] 初始化失败',
|
|
668
|
-
this.logMethodError('initialize',
|
|
802
|
+
this.store.error = _context7.t0 instanceof Error ? _context7.t0.message : '初始化失败';
|
|
803
|
+
console.error('[VenueBooking] 初始化失败', _context7.t0);
|
|
804
|
+
this.logMethodError('initialize', _context7.t0, {
|
|
669
805
|
status: this.store.status
|
|
670
806
|
});
|
|
671
|
-
throw
|
|
672
|
-
case
|
|
807
|
+
throw _context7.t0;
|
|
808
|
+
case 81:
|
|
673
809
|
case "end":
|
|
674
|
-
return
|
|
810
|
+
return _context7.stop();
|
|
675
811
|
}
|
|
676
|
-
},
|
|
812
|
+
}, _callee7, this, [[54, 74]]);
|
|
677
813
|
}));
|
|
678
|
-
function initialize(
|
|
814
|
+
function initialize(_x6) {
|
|
679
815
|
return _initialize.apply(this, arguments);
|
|
680
816
|
}
|
|
681
817
|
return initialize;
|
|
@@ -683,22 +819,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
683
819
|
}, {
|
|
684
820
|
key: "destroy",
|
|
685
821
|
value: function () {
|
|
686
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
687
|
-
return _regeneratorRuntime().wrap(function
|
|
688
|
-
while (1) switch (
|
|
822
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
823
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
824
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
689
825
|
case 0:
|
|
690
826
|
this.logMethodStart('destroy');
|
|
691
827
|
this.clearLoginEffectListeners();
|
|
692
|
-
|
|
828
|
+
_context8.next = 4;
|
|
693
829
|
return this.core.effects.emit(VenueBookingHooks.onDestroy, {});
|
|
694
830
|
case 4:
|
|
695
831
|
console.log('[VenueBooking] 已销毁');
|
|
696
832
|
this.logMethodSuccess('destroy');
|
|
697
833
|
case 6:
|
|
698
834
|
case "end":
|
|
699
|
-
return
|
|
835
|
+
return _context8.stop();
|
|
700
836
|
}
|
|
701
|
-
},
|
|
837
|
+
}, _callee8, this);
|
|
702
838
|
}));
|
|
703
839
|
function destroy() {
|
|
704
840
|
return _destroy.apply(this, arguments);
|
|
@@ -708,32 +844,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
708
844
|
}, {
|
|
709
845
|
key: "retryInit",
|
|
710
846
|
value: function () {
|
|
711
|
-
var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
712
|
-
return _regeneratorRuntime().wrap(function
|
|
713
|
-
while (1) switch (
|
|
847
|
+
var _retryInit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
848
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
849
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
714
850
|
case 0:
|
|
715
851
|
this.logMethodStart('retryInit');
|
|
716
852
|
console.log('[VenueBooking] retryInit 调用');
|
|
717
|
-
|
|
853
|
+
_context9.next = 4;
|
|
718
854
|
return this.core.effects.emit(VenueBookingHooks.onRetryInit, {});
|
|
719
855
|
case 4:
|
|
720
|
-
|
|
721
|
-
|
|
856
|
+
_context9.prev = 4;
|
|
857
|
+
_context9.next = 7;
|
|
722
858
|
return this.initialize(this.core, this.initializeOptions);
|
|
723
859
|
case 7:
|
|
724
860
|
this.logMethodSuccess('retryInit');
|
|
725
|
-
|
|
861
|
+
_context9.next = 14;
|
|
726
862
|
break;
|
|
727
863
|
case 10:
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
this.logMethodError('retryInit',
|
|
731
|
-
throw
|
|
864
|
+
_context9.prev = 10;
|
|
865
|
+
_context9.t0 = _context9["catch"](4);
|
|
866
|
+
this.logMethodError('retryInit', _context9.t0);
|
|
867
|
+
throw _context9.t0;
|
|
732
868
|
case 14:
|
|
733
869
|
case "end":
|
|
734
|
-
return
|
|
870
|
+
return _context9.stop();
|
|
735
871
|
}
|
|
736
|
-
},
|
|
872
|
+
}, _callee9, this, [[4, 10]]);
|
|
737
873
|
}));
|
|
738
874
|
function retryInit() {
|
|
739
875
|
return _retryInit.apply(this, arguments);
|
|
@@ -743,22 +879,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
743
879
|
}, {
|
|
744
880
|
key: "refresh",
|
|
745
881
|
value: function () {
|
|
746
|
-
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
747
|
-
return _regeneratorRuntime().wrap(function
|
|
748
|
-
while (1) switch (
|
|
882
|
+
var _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
883
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
884
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
749
885
|
case 0:
|
|
750
886
|
this.logMethodStart('refresh');
|
|
751
887
|
console.log('[VenueBooking] refresh 调用');
|
|
752
|
-
|
|
888
|
+
_context10.prev = 2;
|
|
753
889
|
this.store.status = 'initializing';
|
|
754
|
-
|
|
890
|
+
_context10.next = 6;
|
|
755
891
|
return this.loadRuntimeConfigs();
|
|
756
892
|
case 6:
|
|
757
|
-
|
|
893
|
+
_context10.next = 8;
|
|
758
894
|
return this.refreshItemRuleQuantityLimits();
|
|
759
895
|
case 8:
|
|
760
896
|
this.store.status = 'ready';
|
|
761
|
-
|
|
897
|
+
_context10.next = 11;
|
|
762
898
|
return this.core.effects.emit(VenueBookingHooks.onRefresh, {
|
|
763
899
|
status: this.store.status
|
|
764
900
|
});
|
|
@@ -766,18 +902,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
766
902
|
this.logMethodSuccess('refresh', {
|
|
767
903
|
status: this.store.status
|
|
768
904
|
});
|
|
769
|
-
|
|
905
|
+
_context10.next = 18;
|
|
770
906
|
break;
|
|
771
907
|
case 14:
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
this.logMethodError('refresh',
|
|
775
|
-
throw
|
|
908
|
+
_context10.prev = 14;
|
|
909
|
+
_context10.t0 = _context10["catch"](2);
|
|
910
|
+
this.logMethodError('refresh', _context10.t0);
|
|
911
|
+
throw _context10.t0;
|
|
776
912
|
case 18:
|
|
777
913
|
case "end":
|
|
778
|
-
return
|
|
914
|
+
return _context10.stop();
|
|
779
915
|
}
|
|
780
|
-
},
|
|
916
|
+
}, _callee10, this, [[2, 14]]);
|
|
781
917
|
}));
|
|
782
918
|
function refresh() {
|
|
783
919
|
return _refresh.apply(this, arguments);
|
|
@@ -818,26 +954,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
818
954
|
}, {
|
|
819
955
|
key: "loadAllProducts",
|
|
820
956
|
value: function () {
|
|
821
|
-
var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
957
|
+
var _loadAllProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
822
958
|
var _this5 = this;
|
|
823
|
-
return _regeneratorRuntime().wrap(function
|
|
824
|
-
while (1) switch (
|
|
959
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
960
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
825
961
|
case 0:
|
|
826
962
|
if (!this.loadAllProductsInFlight) {
|
|
827
|
-
|
|
963
|
+
_context11.next = 2;
|
|
828
964
|
break;
|
|
829
965
|
}
|
|
830
|
-
return
|
|
966
|
+
return _context11.abrupt("return", this.loadAllProductsInFlight);
|
|
831
967
|
case 2:
|
|
832
968
|
this.loadAllProductsInFlight = this._doLoadAllProducts().finally(function () {
|
|
833
969
|
_this5.loadAllProductsInFlight = null;
|
|
834
970
|
});
|
|
835
|
-
return
|
|
971
|
+
return _context11.abrupt("return", this.loadAllProductsInFlight);
|
|
836
972
|
case 4:
|
|
837
973
|
case "end":
|
|
838
|
-
return
|
|
974
|
+
return _context11.stop();
|
|
839
975
|
}
|
|
840
|
-
},
|
|
976
|
+
}, _callee11, this);
|
|
841
977
|
}));
|
|
842
978
|
function loadAllProducts() {
|
|
843
979
|
return _loadAllProducts.apply(this, arguments);
|
|
@@ -847,31 +983,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
847
983
|
}, {
|
|
848
984
|
key: "_doLoadAllProducts",
|
|
849
985
|
value: function () {
|
|
850
|
-
var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
851
|
-
var _this$
|
|
852
|
-
return _regeneratorRuntime().wrap(function
|
|
853
|
-
while (1) switch (
|
|
986
|
+
var _doLoadAllProducts2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
987
|
+
var _this$otherParams10, _this$store$venueProd, associatedMenus, menuListIds, allProducts, list, venueList, addonList, venueStore, _this$store$order3, _this$store$order3$ge, products;
|
|
988
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
989
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
854
990
|
case 0:
|
|
855
991
|
this.logMethodStart('loadAllProducts');
|
|
856
|
-
|
|
992
|
+
_context12.prev = 1;
|
|
857
993
|
if (this.store.venueProducts) {
|
|
858
|
-
|
|
994
|
+
_context12.next = 4;
|
|
859
995
|
break;
|
|
860
996
|
}
|
|
861
997
|
throw new Error('venueProducts 模块未初始化');
|
|
862
998
|
case 4:
|
|
863
999
|
if (this.store.addonProducts) {
|
|
864
|
-
|
|
1000
|
+
_context12.next = 6;
|
|
865
1001
|
break;
|
|
866
1002
|
}
|
|
867
1003
|
throw new Error('addonProducts 模块未初始化');
|
|
868
1004
|
case 6:
|
|
869
|
-
|
|
1005
|
+
_context12.next = 8;
|
|
870
1006
|
return this.loadOpenDataConfig();
|
|
871
1007
|
case 8:
|
|
872
|
-
associatedMenus = ((_this$
|
|
1008
|
+
associatedMenus = ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 || (_this$otherParams10 = _this$otherParams10.openData) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10['menu.associated_menus']) || [];
|
|
873
1009
|
if (associatedMenus.length) {
|
|
874
|
-
|
|
1010
|
+
_context12.next = 12;
|
|
875
1011
|
break;
|
|
876
1012
|
}
|
|
877
1013
|
this.logMethodError('loadAllProducts', new Error('未获取到餐牌配置(menu.associated_menus),请检查 OpenData 配置'));
|
|
@@ -880,7 +1016,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
880
1016
|
menuListIds = associatedMenus.map(function (n) {
|
|
881
1017
|
return Number(n.value);
|
|
882
1018
|
});
|
|
883
|
-
|
|
1019
|
+
_context12.next = 15;
|
|
884
1020
|
return this.store.venueProducts.loadProducts({
|
|
885
1021
|
menu_list_ids: menuListIds,
|
|
886
1022
|
cacheId: this.cacheId,
|
|
@@ -888,7 +1024,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
888
1024
|
schedule_datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
889
1025
|
});
|
|
890
1026
|
case 15:
|
|
891
|
-
allProducts =
|
|
1027
|
+
allProducts = _context12.sent;
|
|
892
1028
|
list = Array.isArray(allProducts) ? allProducts : [];
|
|
893
1029
|
venueList = list.filter(function (p) {
|
|
894
1030
|
return p.duration != null;
|
|
@@ -904,6 +1040,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
904
1040
|
}
|
|
905
1041
|
this.store.addonProducts.addProduct(addonList);
|
|
906
1042
|
this.resourceProductMap = buildResourceProductMap(venueList);
|
|
1043
|
+
|
|
1044
|
+
// 加载 holder 表单
|
|
1045
|
+
if (!this.store.order) {
|
|
1046
|
+
_context12.next = 27;
|
|
1047
|
+
break;
|
|
1048
|
+
}
|
|
1049
|
+
products = ((_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getOrderProducts) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3)) || [];
|
|
1050
|
+
_context12.next = 27;
|
|
1051
|
+
return this.preloadHolderForms(products);
|
|
1052
|
+
case 27:
|
|
907
1053
|
this.productsLoaded = true;
|
|
908
1054
|
this.logMethodSuccess('loadAllProducts', {
|
|
909
1055
|
total: list.length,
|
|
@@ -911,20 +1057,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
911
1057
|
addonCount: addonList.length,
|
|
912
1058
|
resourceCount: this.resourceProductMap.size
|
|
913
1059
|
});
|
|
914
|
-
return
|
|
1060
|
+
return _context12.abrupt("return", {
|
|
915
1061
|
venueProducts: venueList,
|
|
916
1062
|
addonProducts: addonList
|
|
917
1063
|
});
|
|
918
|
-
case 28:
|
|
919
|
-
_context11.prev = 28;
|
|
920
|
-
_context11.t0 = _context11["catch"](1);
|
|
921
|
-
this.logMethodError('loadAllProducts', _context11.t0);
|
|
922
|
-
throw _context11.t0;
|
|
923
1064
|
case 32:
|
|
1065
|
+
_context12.prev = 32;
|
|
1066
|
+
_context12.t0 = _context12["catch"](1);
|
|
1067
|
+
this.logMethodError('loadAllProducts', _context12.t0);
|
|
1068
|
+
throw _context12.t0;
|
|
1069
|
+
case 36:
|
|
924
1070
|
case "end":
|
|
925
|
-
return
|
|
1071
|
+
return _context12.stop();
|
|
926
1072
|
}
|
|
927
|
-
},
|
|
1073
|
+
}, _callee12, this, [[1, 32]]);
|
|
928
1074
|
}));
|
|
929
1075
|
function _doLoadAllProducts() {
|
|
930
1076
|
return _doLoadAllProducts2.apply(this, arguments);
|
|
@@ -934,21 +1080,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
934
1080
|
}, {
|
|
935
1081
|
key: "loadVenueProducts",
|
|
936
1082
|
value: function () {
|
|
937
|
-
var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1083
|
+
var _loadVenueProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
938
1084
|
var result;
|
|
939
|
-
return _regeneratorRuntime().wrap(function
|
|
940
|
-
while (1) switch (
|
|
1085
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1086
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
941
1087
|
case 0:
|
|
942
|
-
|
|
1088
|
+
_context13.next = 2;
|
|
943
1089
|
return this.loadAllProducts();
|
|
944
1090
|
case 2:
|
|
945
|
-
result =
|
|
946
|
-
return
|
|
1091
|
+
result = _context13.sent;
|
|
1092
|
+
return _context13.abrupt("return", result.venueProducts);
|
|
947
1093
|
case 4:
|
|
948
1094
|
case "end":
|
|
949
|
-
return
|
|
1095
|
+
return _context13.stop();
|
|
950
1096
|
}
|
|
951
|
-
},
|
|
1097
|
+
}, _callee13, this);
|
|
952
1098
|
}));
|
|
953
1099
|
function loadVenueProducts() {
|
|
954
1100
|
return _loadVenueProducts.apply(this, arguments);
|
|
@@ -958,21 +1104,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
958
1104
|
}, {
|
|
959
1105
|
key: "loadAddonProducts",
|
|
960
1106
|
value: function () {
|
|
961
|
-
var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1107
|
+
var _loadAddonProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
962
1108
|
var result;
|
|
963
|
-
return _regeneratorRuntime().wrap(function
|
|
964
|
-
while (1) switch (
|
|
1109
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1110
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
965
1111
|
case 0:
|
|
966
|
-
|
|
1112
|
+
_context14.next = 2;
|
|
967
1113
|
return this.loadAllProducts();
|
|
968
1114
|
case 2:
|
|
969
|
-
result =
|
|
970
|
-
return
|
|
1115
|
+
result = _context14.sent;
|
|
1116
|
+
return _context14.abrupt("return", result.addonProducts);
|
|
971
1117
|
case 4:
|
|
972
1118
|
case "end":
|
|
973
|
-
return
|
|
1119
|
+
return _context14.stop();
|
|
974
1120
|
}
|
|
975
|
-
},
|
|
1121
|
+
}, _callee14, this);
|
|
976
1122
|
}));
|
|
977
1123
|
function loadAddonProducts() {
|
|
978
1124
|
return _loadAddonProducts.apply(this, arguments);
|
|
@@ -996,38 +1142,38 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
996
1142
|
}, {
|
|
997
1143
|
key: "loadQuotations",
|
|
998
1144
|
value: function () {
|
|
999
|
-
var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1000
|
-
return _regeneratorRuntime().wrap(function
|
|
1001
|
-
while (1) switch (
|
|
1145
|
+
var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
|
|
1146
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1147
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1002
1148
|
case 0:
|
|
1003
1149
|
this.logMethodStart('loadQuotations');
|
|
1004
|
-
|
|
1150
|
+
_context15.prev = 1;
|
|
1005
1151
|
if (this.store.quotation) {
|
|
1006
|
-
|
|
1152
|
+
_context15.next = 4;
|
|
1007
1153
|
break;
|
|
1008
1154
|
}
|
|
1009
1155
|
throw new Error('quotation 模块未初始化');
|
|
1010
1156
|
case 4:
|
|
1011
|
-
|
|
1157
|
+
_context15.next = 6;
|
|
1012
1158
|
return this.store.quotation.loadQuotations(params);
|
|
1013
1159
|
case 6:
|
|
1014
1160
|
this.logMethodSuccess('loadQuotations', {
|
|
1015
1161
|
count: this.store.quotation.getQuotationList().length
|
|
1016
1162
|
});
|
|
1017
|
-
|
|
1163
|
+
_context15.next = 13;
|
|
1018
1164
|
break;
|
|
1019
1165
|
case 9:
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
this.logMethodError('loadQuotations',
|
|
1023
|
-
throw
|
|
1166
|
+
_context15.prev = 9;
|
|
1167
|
+
_context15.t0 = _context15["catch"](1);
|
|
1168
|
+
this.logMethodError('loadQuotations', _context15.t0);
|
|
1169
|
+
throw _context15.t0;
|
|
1024
1170
|
case 13:
|
|
1025
1171
|
case "end":
|
|
1026
|
-
return
|
|
1172
|
+
return _context15.stop();
|
|
1027
1173
|
}
|
|
1028
|
-
},
|
|
1174
|
+
}, _callee15, this, [[1, 9]]);
|
|
1029
1175
|
}));
|
|
1030
|
-
function loadQuotations(
|
|
1176
|
+
function loadQuotations(_x7) {
|
|
1031
1177
|
return _loadQuotations.apply(this, arguments);
|
|
1032
1178
|
}
|
|
1033
1179
|
return loadQuotations;
|
|
@@ -1035,46 +1181,46 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1035
1181
|
}, {
|
|
1036
1182
|
key: "fetchResourceAvailability",
|
|
1037
1183
|
value: function () {
|
|
1038
|
-
var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1039
|
-
var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData,
|
|
1040
|
-
return _regeneratorRuntime().wrap(function
|
|
1041
|
-
while (1) switch (
|
|
1184
|
+
var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
|
|
1185
|
+
var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator3, _step3, item, _i3, _rawData, _item, mappings, _iterator4, _step4, mapping;
|
|
1186
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1187
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1042
1188
|
case 0:
|
|
1043
1189
|
this.logMethodStart('fetchResourceAvailability', params);
|
|
1044
|
-
|
|
1190
|
+
_context16.prev = 1;
|
|
1045
1191
|
venueProducts = this.getVenueProducts();
|
|
1046
1192
|
if (venueProducts.length) {
|
|
1047
|
-
|
|
1193
|
+
_context16.next = 7;
|
|
1048
1194
|
break;
|
|
1049
1195
|
}
|
|
1050
1196
|
this.store.rawResourceData = [];
|
|
1051
1197
|
this.logMethodSuccess('fetchResourceAvailability', {
|
|
1052
1198
|
resourceCount: 0
|
|
1053
1199
|
});
|
|
1054
|
-
return
|
|
1200
|
+
return _context16.abrupt("return");
|
|
1055
1201
|
case 7:
|
|
1056
1202
|
resourceIds = extractResourceIds(venueProducts);
|
|
1057
1203
|
if (resourceIds.length) {
|
|
1058
|
-
|
|
1204
|
+
_context16.next = 12;
|
|
1059
1205
|
break;
|
|
1060
1206
|
}
|
|
1061
1207
|
this.store.rawResourceData = [];
|
|
1062
1208
|
this.logMethodSuccess('fetchResourceAvailability', {
|
|
1063
1209
|
resourceIds: []
|
|
1064
1210
|
});
|
|
1065
|
-
return
|
|
1211
|
+
return _context16.abrupt("return");
|
|
1066
1212
|
case 12:
|
|
1067
1213
|
// 跨天营业时,endDate 扩展一天以覆盖次日凌晨时段
|
|
1068
1214
|
config = this.store.slotConfig;
|
|
1069
1215
|
crossDay = isBusinessHoursCrossDay(config);
|
|
1070
1216
|
effectiveEndDate = crossDay ? dayjs(params.endDate).add(1, 'day').format('YYYY-MM-DD') : params.endDate;
|
|
1071
1217
|
if (this.store.date) {
|
|
1072
|
-
|
|
1218
|
+
_context16.next = 17;
|
|
1073
1219
|
break;
|
|
1074
1220
|
}
|
|
1075
1221
|
throw new Error('date 模块未初始化');
|
|
1076
1222
|
case 17:
|
|
1077
|
-
|
|
1223
|
+
_context16.next = 19;
|
|
1078
1224
|
return this.store.date.fetchResourceDates({
|
|
1079
1225
|
query: {
|
|
1080
1226
|
start_date: params.startDate,
|
|
@@ -1084,13 +1230,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1084
1230
|
useCache: false
|
|
1085
1231
|
});
|
|
1086
1232
|
case 19:
|
|
1087
|
-
res =
|
|
1233
|
+
res = _context16.sent;
|
|
1088
1234
|
rawData = [];
|
|
1089
1235
|
if (res !== null && res !== void 0 && res.data && Array.isArray(res.data)) {
|
|
1090
|
-
|
|
1236
|
+
_iterator3 = _createForOfIteratorHelper(res.data);
|
|
1091
1237
|
try {
|
|
1092
|
-
for (
|
|
1093
|
-
item =
|
|
1238
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
1239
|
+
item = _step3.value;
|
|
1094
1240
|
rawData.push(_objectSpread({
|
|
1095
1241
|
resourceId: item.id,
|
|
1096
1242
|
formId: item.form_id,
|
|
@@ -1098,41 +1244,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1098
1244
|
}, item));
|
|
1099
1245
|
}
|
|
1100
1246
|
} catch (err) {
|
|
1101
|
-
|
|
1247
|
+
_iterator3.e(err);
|
|
1102
1248
|
} finally {
|
|
1103
|
-
|
|
1249
|
+
_iterator3.f();
|
|
1104
1250
|
}
|
|
1105
1251
|
}
|
|
1106
1252
|
this.store.rawResourceData = rawData;
|
|
1107
1253
|
_i3 = 0, _rawData = rawData;
|
|
1108
1254
|
case 24:
|
|
1109
1255
|
if (!(_i3 < _rawData.length)) {
|
|
1110
|
-
|
|
1256
|
+
_context16.next = 34;
|
|
1111
1257
|
break;
|
|
1112
1258
|
}
|
|
1113
1259
|
_item = _rawData[_i3];
|
|
1114
1260
|
mappings = this.resourceProductMap.get(_item.resourceId);
|
|
1115
1261
|
if (mappings) {
|
|
1116
|
-
|
|
1262
|
+
_context16.next = 29;
|
|
1117
1263
|
break;
|
|
1118
1264
|
}
|
|
1119
|
-
return
|
|
1265
|
+
return _context16.abrupt("continue", 31);
|
|
1120
1266
|
case 29:
|
|
1121
|
-
|
|
1267
|
+
_iterator4 = _createForOfIteratorHelper(mappings);
|
|
1122
1268
|
try {
|
|
1123
|
-
for (
|
|
1124
|
-
mapping =
|
|
1269
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
1270
|
+
mapping = _step4.value;
|
|
1125
1271
|
if (_item.main_field) mapping.resourceName = _item.main_field;
|
|
1126
1272
|
if (_item.resource_form_id) mapping.formId = _item.resource_form_id;
|
|
1127
1273
|
}
|
|
1128
1274
|
} catch (err) {
|
|
1129
|
-
|
|
1275
|
+
_iterator4.e(err);
|
|
1130
1276
|
} finally {
|
|
1131
|
-
|
|
1277
|
+
_iterator4.f();
|
|
1132
1278
|
}
|
|
1133
1279
|
case 31:
|
|
1134
1280
|
_i3++;
|
|
1135
|
-
|
|
1281
|
+
_context16.next = 24;
|
|
1136
1282
|
break;
|
|
1137
1283
|
case 34:
|
|
1138
1284
|
this.logMethodSuccess('fetchResourceAvailability', {
|
|
@@ -1141,21 +1287,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1141
1287
|
return sum + r.times.length;
|
|
1142
1288
|
}, 0)
|
|
1143
1289
|
});
|
|
1144
|
-
|
|
1290
|
+
_context16.next = 42;
|
|
1145
1291
|
break;
|
|
1146
1292
|
case 37:
|
|
1147
|
-
|
|
1148
|
-
|
|
1293
|
+
_context16.prev = 37;
|
|
1294
|
+
_context16.t0 = _context16["catch"](1);
|
|
1149
1295
|
this.store.rawResourceData = [];
|
|
1150
|
-
this.logMethodError('fetchResourceAvailability',
|
|
1151
|
-
throw
|
|
1296
|
+
this.logMethodError('fetchResourceAvailability', _context16.t0);
|
|
1297
|
+
throw _context16.t0;
|
|
1152
1298
|
case 42:
|
|
1153
1299
|
case "end":
|
|
1154
|
-
return
|
|
1300
|
+
return _context16.stop();
|
|
1155
1301
|
}
|
|
1156
|
-
},
|
|
1302
|
+
}, _callee16, this, [[1, 37]]);
|
|
1157
1303
|
}));
|
|
1158
|
-
function fetchResourceAvailability(
|
|
1304
|
+
function fetchResourceAvailability(_x8) {
|
|
1159
1305
|
return _fetchResourceAvailability.apply(this, arguments);
|
|
1160
1306
|
}
|
|
1161
1307
|
return fetchResourceAvailability;
|
|
@@ -1187,18 +1333,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1187
1333
|
var timeRangeMap = calcMinTimeMaxTimeBySchedules(scheduleList, undefined, date);
|
|
1188
1334
|
var earliestStart = null;
|
|
1189
1335
|
var latestEnd = null;
|
|
1190
|
-
var
|
|
1191
|
-
|
|
1336
|
+
var _iterator5 = _createForOfIteratorHelper(scheduleList),
|
|
1337
|
+
_step5;
|
|
1192
1338
|
try {
|
|
1193
|
-
for (
|
|
1339
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
1194
1340
|
var _timeRangeMap$schedul;
|
|
1195
|
-
var schedule =
|
|
1341
|
+
var schedule = _step5.value;
|
|
1196
1342
|
var dateRangeList = (timeRangeMap === null || timeRangeMap === void 0 || (_timeRangeMap$schedul = timeRangeMap[schedule.id]) === null || _timeRangeMap$schedul === void 0 ? void 0 : _timeRangeMap$schedul.dateRangeFormat) || [];
|
|
1197
|
-
var
|
|
1198
|
-
|
|
1343
|
+
var _iterator6 = _createForOfIteratorHelper(dateRangeList),
|
|
1344
|
+
_step6;
|
|
1199
1345
|
try {
|
|
1200
|
-
for (
|
|
1201
|
-
var range =
|
|
1346
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
1347
|
+
var range = _step6.value;
|
|
1202
1348
|
var start = dayjs(range === null || range === void 0 ? void 0 : range.start);
|
|
1203
1349
|
var end = dayjs(range === null || range === void 0 ? void 0 : range.end);
|
|
1204
1350
|
if (!start.isValid() || !end.isValid()) continue;
|
|
@@ -1210,15 +1356,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1210
1356
|
}
|
|
1211
1357
|
}
|
|
1212
1358
|
} catch (err) {
|
|
1213
|
-
|
|
1359
|
+
_iterator6.e(err);
|
|
1214
1360
|
} finally {
|
|
1215
|
-
|
|
1361
|
+
_iterator6.f();
|
|
1216
1362
|
}
|
|
1217
1363
|
}
|
|
1218
1364
|
} catch (err) {
|
|
1219
|
-
|
|
1365
|
+
_iterator5.e(err);
|
|
1220
1366
|
} finally {
|
|
1221
|
-
|
|
1367
|
+
_iterator5.f();
|
|
1222
1368
|
}
|
|
1223
1369
|
if (!earliestStart || !latestEnd) return nextSlotConfig;
|
|
1224
1370
|
return _objectSpread(_objectSpread({}, nextSlotConfig), {}, {
|
|
@@ -1288,20 +1434,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1288
1434
|
}, {
|
|
1289
1435
|
key: "toggleSlot",
|
|
1290
1436
|
value: function () {
|
|
1291
|
-
var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1437
|
+
var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(slot) {
|
|
1292
1438
|
var mappings, mapping, currentSlots, existIndex, nextSlots, products;
|
|
1293
|
-
return _regeneratorRuntime().wrap(function
|
|
1294
|
-
while (1) switch (
|
|
1439
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1440
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1295
1441
|
case 0:
|
|
1296
1442
|
this.logMethodStart('toggleSlot', {
|
|
1297
1443
|
resourceId: slot.resourceId,
|
|
1298
1444
|
productId: slot.productId,
|
|
1299
1445
|
startTime: slot.startTime
|
|
1300
1446
|
});
|
|
1301
|
-
|
|
1447
|
+
_context17.prev = 1;
|
|
1302
1448
|
mappings = this.resourceProductMap.get(slot.resourceId);
|
|
1303
1449
|
if (!(!mappings || !mappings.length)) {
|
|
1304
|
-
|
|
1450
|
+
_context17.next = 5;
|
|
1305
1451
|
break;
|
|
1306
1452
|
}
|
|
1307
1453
|
throw new Error("\u672A\u627E\u5230\u8D44\u6E90 ".concat(slot.resourceId, " \u7684\u5546\u54C1\u6620\u5C04"));
|
|
@@ -1310,13 +1456,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1310
1456
|
return m.productId === slot.productId;
|
|
1311
1457
|
});
|
|
1312
1458
|
if (mapping) {
|
|
1313
|
-
|
|
1459
|
+
_context17.next = 8;
|
|
1314
1460
|
break;
|
|
1315
1461
|
}
|
|
1316
1462
|
throw new Error("\u8D44\u6E90 ".concat(slot.resourceId, " \u672A\u5173\u8054\u5546\u54C1 ").concat(slot.productId));
|
|
1317
1463
|
case 8:
|
|
1318
1464
|
if (this.store.order) {
|
|
1319
|
-
|
|
1465
|
+
_context17.next = 10;
|
|
1320
1466
|
break;
|
|
1321
1467
|
}
|
|
1322
1468
|
throw new Error('order 模块未初始化');
|
|
@@ -1332,14 +1478,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1332
1478
|
} else {
|
|
1333
1479
|
nextSlots = [].concat(_toConsumableArray(currentSlots), [slot]);
|
|
1334
1480
|
}
|
|
1335
|
-
|
|
1481
|
+
_context17.next = 15;
|
|
1336
1482
|
return this.reconcileOrderForResourceProduct(slot.resourceId, slot.productId, nextSlots);
|
|
1337
1483
|
case 15:
|
|
1338
1484
|
products = this.store.order.getOrderProducts();
|
|
1339
|
-
|
|
1485
|
+
_context17.next = 18;
|
|
1340
1486
|
return this.refreshItemRuleQuantityLimits();
|
|
1341
1487
|
case 18:
|
|
1342
|
-
|
|
1488
|
+
_context17.next = 20;
|
|
1343
1489
|
return this.refreshCartValidationPassed();
|
|
1344
1490
|
case 20:
|
|
1345
1491
|
this.logMethodSuccess('toggleSlot', {
|
|
@@ -1348,19 +1494,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1348
1494
|
productId: slot.productId,
|
|
1349
1495
|
slotCount: nextSlots.length
|
|
1350
1496
|
});
|
|
1351
|
-
return
|
|
1497
|
+
return _context17.abrupt("return", products);
|
|
1352
1498
|
case 24:
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
this.logMethodError('toggleSlot',
|
|
1356
|
-
throw
|
|
1499
|
+
_context17.prev = 24;
|
|
1500
|
+
_context17.t0 = _context17["catch"](1);
|
|
1501
|
+
this.logMethodError('toggleSlot', _context17.t0);
|
|
1502
|
+
throw _context17.t0;
|
|
1357
1503
|
case 28:
|
|
1358
1504
|
case "end":
|
|
1359
|
-
return
|
|
1505
|
+
return _context17.stop();
|
|
1360
1506
|
}
|
|
1361
|
-
},
|
|
1507
|
+
}, _callee17, this, [[1, 24]]);
|
|
1362
1508
|
}));
|
|
1363
|
-
function toggleSlot(
|
|
1509
|
+
function toggleSlot(_x9) {
|
|
1364
1510
|
return _toggleSlot.apply(this, arguments);
|
|
1365
1511
|
}
|
|
1366
1512
|
return toggleSlot;
|
|
@@ -1372,8 +1518,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1372
1518
|
}, {
|
|
1373
1519
|
key: "getSelectedSlotsForResource",
|
|
1374
1520
|
value: function getSelectedSlotsForResource(resourceId, productId) {
|
|
1375
|
-
var _this$store$
|
|
1376
|
-
var tempOrder = (_this$store$
|
|
1521
|
+
var _this$store$order4;
|
|
1522
|
+
var tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder();
|
|
1377
1523
|
if (!tempOrder) return [];
|
|
1378
1524
|
var venueProducts = tempOrder.products.filter(function (p) {
|
|
1379
1525
|
var _p$metadata, _p$metadata2;
|
|
@@ -1384,24 +1530,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1384
1530
|
});
|
|
1385
1531
|
var slotDuration = this.store.slotConfig.slotDurationMinutes;
|
|
1386
1532
|
var slots = [];
|
|
1387
|
-
var
|
|
1388
|
-
|
|
1533
|
+
var _iterator7 = _createForOfIteratorHelper(venueProducts),
|
|
1534
|
+
_step7;
|
|
1389
1535
|
try {
|
|
1390
1536
|
var _loop = function _loop() {
|
|
1391
|
-
var product =
|
|
1537
|
+
var product = _step7.value;
|
|
1392
1538
|
slots.push.apply(slots, _toConsumableArray(expandMergedSlotToIndividual(product, slotDuration).map(function (s) {
|
|
1393
1539
|
return _objectSpread(_objectSpread({}, s), {}, {
|
|
1394
1540
|
productId: Number(product.product_id)
|
|
1395
1541
|
});
|
|
1396
1542
|
})));
|
|
1397
1543
|
};
|
|
1398
|
-
for (
|
|
1544
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
1399
1545
|
_loop();
|
|
1400
1546
|
}
|
|
1401
1547
|
} catch (err) {
|
|
1402
|
-
|
|
1548
|
+
_iterator7.e(err);
|
|
1403
1549
|
} finally {
|
|
1404
|
-
|
|
1550
|
+
_iterator7.f();
|
|
1405
1551
|
}
|
|
1406
1552
|
return slots.sort(function (a, b) {
|
|
1407
1553
|
return a.startTime.localeCompare(b.startTime);
|
|
@@ -1474,28 +1620,28 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1474
1620
|
|
|
1475
1621
|
// 规则 2:当前是组合资源,任一子资源被选 → 禁用
|
|
1476
1622
|
if (currentIsCombined) {
|
|
1477
|
-
var
|
|
1478
|
-
|
|
1623
|
+
var _iterator8 = _createForOfIteratorHelper(currentChildIds),
|
|
1624
|
+
_step8;
|
|
1479
1625
|
try {
|
|
1480
|
-
for (
|
|
1481
|
-
var childId =
|
|
1626
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
1627
|
+
var childId = _step8.value;
|
|
1482
1628
|
if (getSelectedAt(childId).length > 0) return true;
|
|
1483
1629
|
}
|
|
1484
1630
|
} catch (err) {
|
|
1485
|
-
|
|
1631
|
+
_iterator8.e(err);
|
|
1486
1632
|
} finally {
|
|
1487
|
-
|
|
1633
|
+
_iterator8.f();
|
|
1488
1634
|
}
|
|
1489
1635
|
}
|
|
1490
1636
|
|
|
1491
1637
|
// 规则 3 & 4:扫描所有已选的 (resId),若是组合资源,检查其 children 是否包含当前 resourceId 或与当前 child 集合有交集
|
|
1492
|
-
var
|
|
1493
|
-
|
|
1638
|
+
var _iterator9 = _createForOfIteratorHelper(allSelected),
|
|
1639
|
+
_step9;
|
|
1494
1640
|
try {
|
|
1495
|
-
for (
|
|
1496
|
-
var
|
|
1497
|
-
selectedResId =
|
|
1498
|
-
slots =
|
|
1641
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
1642
|
+
var _step9$value = _slicedToArray(_step9.value, 2),
|
|
1643
|
+
selectedResId = _step9$value[0],
|
|
1644
|
+
slots = _step9$value[1];
|
|
1499
1645
|
if (!slots.some(function (s) {
|
|
1500
1646
|
return s.startTime === startTime;
|
|
1501
1647
|
})) continue;
|
|
@@ -1521,9 +1667,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1521
1667
|
}
|
|
1522
1668
|
}
|
|
1523
1669
|
} catch (err) {
|
|
1524
|
-
|
|
1670
|
+
_iterator9.e(err);
|
|
1525
1671
|
} finally {
|
|
1526
|
-
|
|
1672
|
+
_iterator9.f();
|
|
1527
1673
|
}
|
|
1528
1674
|
return false;
|
|
1529
1675
|
}
|
|
@@ -1534,21 +1680,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1534
1680
|
}, {
|
|
1535
1681
|
key: "getAllSelectedSlots",
|
|
1536
1682
|
value: function getAllSelectedSlots() {
|
|
1537
|
-
var _this$store$
|
|
1683
|
+
var _this$store$order5;
|
|
1538
1684
|
var result = new Map();
|
|
1539
|
-
var tempOrder = (_this$store$
|
|
1685
|
+
var tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder();
|
|
1540
1686
|
if (!tempOrder) return result;
|
|
1541
1687
|
var venueProducts = tempOrder.products.filter(function (p) {
|
|
1542
1688
|
var _p$metadata3;
|
|
1543
1689
|
return (_p$metadata3 = p.metadata) === null || _p$metadata3 === void 0 ? void 0 : _p$metadata3.venue_booking;
|
|
1544
1690
|
});
|
|
1545
1691
|
var slotDuration = this.store.slotConfig.slotDurationMinutes;
|
|
1546
|
-
var
|
|
1547
|
-
|
|
1692
|
+
var _iterator10 = _createForOfIteratorHelper(venueProducts),
|
|
1693
|
+
_step10;
|
|
1548
1694
|
try {
|
|
1549
1695
|
var _loop2 = function _loop2() {
|
|
1550
1696
|
var _product$metadata;
|
|
1551
|
-
var product =
|
|
1697
|
+
var product = _step10.value;
|
|
1552
1698
|
var resourceId = (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.resource_id;
|
|
1553
1699
|
if (resourceId == null) return 1; // continue
|
|
1554
1700
|
var productId = Number(product.product_id);
|
|
@@ -1560,29 +1706,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1560
1706
|
})));
|
|
1561
1707
|
result.set(resourceId, existing);
|
|
1562
1708
|
};
|
|
1563
|
-
for (
|
|
1709
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
1564
1710
|
if (_loop2()) continue;
|
|
1565
1711
|
}
|
|
1566
1712
|
} catch (err) {
|
|
1567
|
-
|
|
1713
|
+
_iterator10.e(err);
|
|
1568
1714
|
} finally {
|
|
1569
|
-
|
|
1715
|
+
_iterator10.f();
|
|
1570
1716
|
}
|
|
1571
|
-
var
|
|
1572
|
-
|
|
1717
|
+
var _iterator11 = _createForOfIteratorHelper(result),
|
|
1718
|
+
_step11;
|
|
1573
1719
|
try {
|
|
1574
|
-
for (
|
|
1575
|
-
var
|
|
1576
|
-
key =
|
|
1577
|
-
slots =
|
|
1720
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
1721
|
+
var _step11$value = _slicedToArray(_step11.value, 2),
|
|
1722
|
+
key = _step11$value[0],
|
|
1723
|
+
slots = _step11$value[1];
|
|
1578
1724
|
result.set(key, slots.sort(function (a, b) {
|
|
1579
1725
|
return a.startTime.localeCompare(b.startTime);
|
|
1580
1726
|
}));
|
|
1581
1727
|
}
|
|
1582
1728
|
} catch (err) {
|
|
1583
|
-
|
|
1729
|
+
_iterator11.e(err);
|
|
1584
1730
|
} finally {
|
|
1585
|
-
|
|
1731
|
+
_iterator11.f();
|
|
1586
1732
|
}
|
|
1587
1733
|
return result;
|
|
1588
1734
|
}
|
|
@@ -1595,26 +1741,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1595
1741
|
}, {
|
|
1596
1742
|
key: "reconcileOrderForResourceProduct",
|
|
1597
1743
|
value: (function () {
|
|
1598
|
-
var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1599
|
-
var
|
|
1600
|
-
|
|
1601
|
-
|
|
1744
|
+
var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(resourceId, productId, slots) {
|
|
1745
|
+
var _this$store$order6, _this$store$order6$ge;
|
|
1746
|
+
var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, resourceEntry, booking, products;
|
|
1747
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1748
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1602
1749
|
case 0:
|
|
1603
1750
|
mappings = this.resourceProductMap.get(resourceId);
|
|
1604
1751
|
if (!(!mappings || !mappings.length || !this.store.order)) {
|
|
1605
|
-
|
|
1752
|
+
_context18.next = 3;
|
|
1606
1753
|
break;
|
|
1607
1754
|
}
|
|
1608
|
-
return
|
|
1755
|
+
return _context18.abrupt("return");
|
|
1609
1756
|
case 3:
|
|
1610
1757
|
mapping = mappings.find(function (m) {
|
|
1611
1758
|
return m.productId === productId;
|
|
1612
1759
|
});
|
|
1613
1760
|
if (mapping) {
|
|
1614
|
-
|
|
1761
|
+
_context18.next = 6;
|
|
1615
1762
|
break;
|
|
1616
1763
|
}
|
|
1617
|
-
return
|
|
1764
|
+
return _context18.abrupt("return");
|
|
1618
1765
|
case 6:
|
|
1619
1766
|
tempOrder = this.store.order.ensureTempOrder();
|
|
1620
1767
|
matchesCurrent = function matchesCurrent(meta, pid) {
|
|
@@ -1632,17 +1779,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1632
1779
|
return Number(bookingProductId) !== Number(productId);
|
|
1633
1780
|
});
|
|
1634
1781
|
if (slots.length) {
|
|
1635
|
-
|
|
1782
|
+
_context18.next = 16;
|
|
1636
1783
|
break;
|
|
1637
1784
|
}
|
|
1638
1785
|
this.store.order.applyDiscount();
|
|
1639
|
-
|
|
1786
|
+
_context18.next = 14;
|
|
1640
1787
|
return this.store.order.recalculateSummary({
|
|
1641
1788
|
createIfMissing: true
|
|
1642
1789
|
});
|
|
1643
1790
|
case 14:
|
|
1644
1791
|
this.store.order.persistTempOrder();
|
|
1645
|
-
return
|
|
1792
|
+
return _context18.abrupt("return");
|
|
1646
1793
|
case 16:
|
|
1647
1794
|
merged = mergeConsecutiveSlots(slots);
|
|
1648
1795
|
rawResource = this.store.rawResourceData.find(function (r) {
|
|
@@ -1729,7 +1876,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1729
1876
|
product_option_item: [],
|
|
1730
1877
|
discount_list: [],
|
|
1731
1878
|
custom_deposit_data: customDepositData,
|
|
1732
|
-
metadata: {}
|
|
1879
|
+
metadata: {},
|
|
1880
|
+
holder_config: venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.holder_config,
|
|
1881
|
+
bookingUuid: bookingUuid,
|
|
1882
|
+
shop_id: (venueProduct === null || venueProduct === void 0 ? void 0 : venueProduct.shop_id) || 0
|
|
1733
1883
|
},
|
|
1734
1884
|
sub_type: 'minutes',
|
|
1735
1885
|
duration: duration,
|
|
@@ -1759,20 +1909,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1759
1909
|
});
|
|
1760
1910
|
tempOrder.bookings.push(booking);
|
|
1761
1911
|
}
|
|
1912
|
+
|
|
1913
|
+
// 获取表单信息
|
|
1914
|
+
products = ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 || (_this$store$order6$ge = _this$store$order6.getOrderProducts) === null || _this$store$order6$ge === void 0 ? void 0 : _this$store$order6$ge.call(_this$store$order6)) || [];
|
|
1915
|
+
_context18.next = 25;
|
|
1916
|
+
return this.preloadHolderForms(products);
|
|
1917
|
+
case 25:
|
|
1762
1918
|
this.store.order.applyDiscount();
|
|
1763
|
-
|
|
1919
|
+
_context18.next = 28;
|
|
1764
1920
|
return this.store.order.recalculateSummary({
|
|
1765
1921
|
createIfMissing: true
|
|
1766
1922
|
});
|
|
1767
|
-
case
|
|
1923
|
+
case 28:
|
|
1768
1924
|
this.store.order.persistTempOrder();
|
|
1769
|
-
case
|
|
1925
|
+
case 29:
|
|
1770
1926
|
case "end":
|
|
1771
|
-
return
|
|
1927
|
+
return _context18.stop();
|
|
1772
1928
|
}
|
|
1773
|
-
},
|
|
1929
|
+
}, _callee18, this);
|
|
1774
1930
|
}));
|
|
1775
|
-
function reconcileOrderForResourceProduct(
|
|
1931
|
+
function reconcileOrderForResourceProduct(_x10, _x11, _x12) {
|
|
1776
1932
|
return _reconcileOrderForResourceProduct.apply(this, arguments);
|
|
1777
1933
|
}
|
|
1778
1934
|
return reconcileOrderForResourceProduct;
|
|
@@ -1787,23 +1943,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1787
1943
|
return undefined;
|
|
1788
1944
|
}
|
|
1789
1945
|
var children = [];
|
|
1790
|
-
var
|
|
1791
|
-
|
|
1946
|
+
var _iterator12 = _createForOfIteratorHelper(combined.resource_ids),
|
|
1947
|
+
_step12;
|
|
1792
1948
|
try {
|
|
1793
1949
|
var _loop3 = function _loop3() {
|
|
1794
|
-
var id =
|
|
1950
|
+
var id = _step12.value;
|
|
1795
1951
|
var child = _this8.store.rawResourceData.find(function (r) {
|
|
1796
1952
|
return String(r.resourceId) === String(id);
|
|
1797
1953
|
});
|
|
1798
1954
|
if (child) children.push(child);
|
|
1799
1955
|
};
|
|
1800
|
-
for (
|
|
1956
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
1801
1957
|
_loop3();
|
|
1802
1958
|
}
|
|
1803
1959
|
} catch (err) {
|
|
1804
|
-
|
|
1960
|
+
_iterator12.e(err);
|
|
1805
1961
|
} finally {
|
|
1806
|
-
|
|
1962
|
+
_iterator12.f();
|
|
1807
1963
|
}
|
|
1808
1964
|
return children.length ? children : undefined;
|
|
1809
1965
|
}
|
|
@@ -1825,35 +1981,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1825
1981
|
}, {
|
|
1826
1982
|
key: "loadSchedules",
|
|
1827
1983
|
value: function () {
|
|
1828
|
-
var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1829
|
-
return _regeneratorRuntime().wrap(function
|
|
1830
|
-
while (1) switch (
|
|
1984
|
+
var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
1985
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1986
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1831
1987
|
case 0:
|
|
1832
1988
|
this.logMethodStart('loadSchedules');
|
|
1833
|
-
|
|
1989
|
+
_context19.prev = 1;
|
|
1834
1990
|
if (this.store.schedule) {
|
|
1835
|
-
|
|
1991
|
+
_context19.next = 4;
|
|
1836
1992
|
break;
|
|
1837
1993
|
}
|
|
1838
1994
|
throw new Error('schedule 模块未初始化');
|
|
1839
1995
|
case 4:
|
|
1840
|
-
|
|
1996
|
+
_context19.next = 6;
|
|
1841
1997
|
return this.store.schedule.loadAllSchedule();
|
|
1842
1998
|
case 6:
|
|
1843
1999
|
this.injectScheduleResolverToQuotation();
|
|
1844
2000
|
this.logMethodSuccess('loadSchedules');
|
|
1845
|
-
|
|
2001
|
+
_context19.next = 14;
|
|
1846
2002
|
break;
|
|
1847
2003
|
case 10:
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
this.logMethodError('loadSchedules',
|
|
1851
|
-
throw
|
|
2004
|
+
_context19.prev = 10;
|
|
2005
|
+
_context19.t0 = _context19["catch"](1);
|
|
2006
|
+
this.logMethodError('loadSchedules', _context19.t0);
|
|
2007
|
+
throw _context19.t0;
|
|
1852
2008
|
case 14:
|
|
1853
2009
|
case "end":
|
|
1854
|
-
return
|
|
2010
|
+
return _context19.stop();
|
|
1855
2011
|
}
|
|
1856
|
-
},
|
|
2012
|
+
}, _callee19, this, [[1, 10]]);
|
|
1857
2013
|
}));
|
|
1858
2014
|
function loadSchedules() {
|
|
1859
2015
|
return _loadSchedules.apply(this, arguments);
|
|
@@ -1881,8 +2037,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1881
2037
|
}, {
|
|
1882
2038
|
key: "getTempOrder",
|
|
1883
2039
|
value: function getTempOrder() {
|
|
1884
|
-
var _this$store$
|
|
1885
|
-
var result = ((_this$store$
|
|
2040
|
+
var _this$store$order7;
|
|
2041
|
+
var result = ((_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 ? void 0 : _this$store$order7.getTempOrder()) || null;
|
|
1886
2042
|
return result;
|
|
1887
2043
|
}
|
|
1888
2044
|
}, {
|
|
@@ -1906,15 +2062,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1906
2062
|
}, {
|
|
1907
2063
|
key: "onCustomerLogin",
|
|
1908
2064
|
value: function () {
|
|
1909
|
-
var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1910
|
-
return _regeneratorRuntime().wrap(function
|
|
1911
|
-
while (1) switch (
|
|
2065
|
+
var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params) {
|
|
2066
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
2067
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1912
2068
|
case 0:
|
|
1913
2069
|
this.logMethodStart('onCustomerLogin', {
|
|
1914
2070
|
customerId: params.customerId
|
|
1915
2071
|
});
|
|
1916
|
-
|
|
1917
|
-
|
|
2072
|
+
_context20.prev = 1;
|
|
2073
|
+
_context20.next = 4;
|
|
1918
2074
|
return this.refreshOrderMarketingAfterLogin({
|
|
1919
2075
|
customerId: params.customerId
|
|
1920
2076
|
});
|
|
@@ -1922,20 +2078,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1922
2078
|
this.logMethodSuccess('onCustomerLogin', {
|
|
1923
2079
|
customerId: params.customerId
|
|
1924
2080
|
});
|
|
1925
|
-
|
|
2081
|
+
_context20.next = 11;
|
|
1926
2082
|
break;
|
|
1927
2083
|
case 7:
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
this.logMethodError('onCustomerLogin',
|
|
1931
|
-
throw
|
|
2084
|
+
_context20.prev = 7;
|
|
2085
|
+
_context20.t0 = _context20["catch"](1);
|
|
2086
|
+
this.logMethodError('onCustomerLogin', _context20.t0);
|
|
2087
|
+
throw _context20.t0;
|
|
1932
2088
|
case 11:
|
|
1933
2089
|
case "end":
|
|
1934
|
-
return
|
|
2090
|
+
return _context20.stop();
|
|
1935
2091
|
}
|
|
1936
|
-
},
|
|
2092
|
+
}, _callee20, this, [[1, 7]]);
|
|
1937
2093
|
}));
|
|
1938
|
-
function onCustomerLogin(
|
|
2094
|
+
function onCustomerLogin(_x13) {
|
|
1939
2095
|
return _onCustomerLogin.apply(this, arguments);
|
|
1940
2096
|
}
|
|
1941
2097
|
return onCustomerLogin;
|
|
@@ -1949,12 +2105,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1949
2105
|
var tempOrder = this.store.order.getTempOrder();
|
|
1950
2106
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
|
|
1951
2107
|
var now = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
1952
|
-
var
|
|
1953
|
-
|
|
2108
|
+
var _iterator13 = _createForOfIteratorHelper(tempOrder.products),
|
|
2109
|
+
_step13;
|
|
1954
2110
|
try {
|
|
1955
2111
|
var _loop4 = function _loop4() {
|
|
1956
2112
|
var _product$metadata2;
|
|
1957
|
-
var product =
|
|
2113
|
+
var product = _step13.value;
|
|
1958
2114
|
if ((_product$metadata2 = product.metadata) !== null && _product$metadata2 !== void 0 && _product$metadata2.venue_booking) {
|
|
1959
2115
|
var mappings = _this10.resourceProductMap.get(product.metadata.resource_id);
|
|
1960
2116
|
if (!mappings || !mappings.length) return 0; // continue
|
|
@@ -1997,43 +2153,43 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1997
2153
|
}
|
|
1998
2154
|
},
|
|
1999
2155
|
_ret;
|
|
2000
|
-
for (
|
|
2156
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
2001
2157
|
_ret = _loop4();
|
|
2002
2158
|
if (_ret === 0) continue;
|
|
2003
2159
|
}
|
|
2004
2160
|
} catch (err) {
|
|
2005
|
-
|
|
2161
|
+
_iterator13.e(err);
|
|
2006
2162
|
} finally {
|
|
2007
|
-
|
|
2163
|
+
_iterator13.f();
|
|
2008
2164
|
}
|
|
2009
2165
|
}
|
|
2010
2166
|
}, {
|
|
2011
2167
|
key: "scanCode",
|
|
2012
2168
|
value: function () {
|
|
2013
|
-
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2169
|
+
var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(code, customerId) {
|
|
2014
2170
|
var result;
|
|
2015
|
-
return _regeneratorRuntime().wrap(function
|
|
2016
|
-
while (1) switch (
|
|
2171
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2172
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
2017
2173
|
case 0:
|
|
2018
2174
|
this.logMethodStart('scanCode', {
|
|
2019
2175
|
code: code
|
|
2020
2176
|
});
|
|
2021
|
-
|
|
2177
|
+
_context21.prev = 1;
|
|
2022
2178
|
if (this.store.order) {
|
|
2023
|
-
|
|
2179
|
+
_context21.next = 4;
|
|
2024
2180
|
break;
|
|
2025
2181
|
}
|
|
2026
2182
|
throw new Error('order 模块未初始化');
|
|
2027
2183
|
case 4:
|
|
2028
|
-
|
|
2184
|
+
_context21.next = 6;
|
|
2029
2185
|
return this.store.order.scanCode(code, customerId);
|
|
2030
2186
|
case 6:
|
|
2031
|
-
result =
|
|
2187
|
+
result = _context21.sent;
|
|
2032
2188
|
if (!result.isAvailable) {
|
|
2033
|
-
|
|
2189
|
+
_context21.next = 11;
|
|
2034
2190
|
break;
|
|
2035
2191
|
}
|
|
2036
|
-
|
|
2192
|
+
_context21.next = 10;
|
|
2037
2193
|
return this.store.order.recalculateSummary({
|
|
2038
2194
|
createIfMissing: true
|
|
2039
2195
|
});
|
|
@@ -2043,19 +2199,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2043
2199
|
this.logMethodSuccess('scanCode', {
|
|
2044
2200
|
isAvailable: result.isAvailable
|
|
2045
2201
|
});
|
|
2046
|
-
return
|
|
2202
|
+
return _context21.abrupt("return", result);
|
|
2047
2203
|
case 15:
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
this.logMethodError('scanCode',
|
|
2051
|
-
throw
|
|
2204
|
+
_context21.prev = 15;
|
|
2205
|
+
_context21.t0 = _context21["catch"](1);
|
|
2206
|
+
this.logMethodError('scanCode', _context21.t0);
|
|
2207
|
+
throw _context21.t0;
|
|
2052
2208
|
case 19:
|
|
2053
2209
|
case "end":
|
|
2054
|
-
return
|
|
2210
|
+
return _context21.stop();
|
|
2055
2211
|
}
|
|
2056
|
-
},
|
|
2212
|
+
}, _callee21, this, [[1, 15]]);
|
|
2057
2213
|
}));
|
|
2058
|
-
function scanCode(
|
|
2214
|
+
function scanCode(_x14, _x15) {
|
|
2059
2215
|
return _scanCode.apply(this, arguments);
|
|
2060
2216
|
}
|
|
2061
2217
|
return scanCode;
|
|
@@ -2071,15 +2227,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2071
2227
|
}, {
|
|
2072
2228
|
key: "setDiscountSelected",
|
|
2073
2229
|
value: (function () {
|
|
2074
|
-
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
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,
|
|
2076
|
-
return _regeneratorRuntime().wrap(function
|
|
2077
|
-
while (1) switch (
|
|
2230
|
+
var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
|
|
2231
|
+
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, _iterator14, _step14, d, selectedResourceIds, _iterator15, _step15, _product$_origin, _product$metadata$sou, _product$metadata3, _product$metadata4, _product$original_pri, product, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
|
|
2232
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2233
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
2078
2234
|
case 0:
|
|
2079
2235
|
this.logMethodStart('setDiscountSelected', params);
|
|
2080
|
-
|
|
2236
|
+
_context22.prev = 1;
|
|
2081
2237
|
if (this.store.order) {
|
|
2082
|
-
|
|
2238
|
+
_context22.next = 4;
|
|
2083
2239
|
break;
|
|
2084
2240
|
}
|
|
2085
2241
|
throw new Error('order 模块未初始化');
|
|
@@ -2105,7 +2261,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2105
2261
|
form_record_id: tempOrder.holder.form_record_id
|
|
2106
2262
|
}] : [];
|
|
2107
2263
|
nextDiscountList = updated;
|
|
2108
|
-
|
|
2264
|
+
_context22.next = 16;
|
|
2109
2265
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(updated);
|
|
2110
2266
|
case 16:
|
|
2111
2267
|
if (rulesModule) {
|
|
@@ -2132,18 +2288,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2132
2288
|
}).map(function (d) {
|
|
2133
2289
|
return d.id;
|
|
2134
2290
|
}));
|
|
2135
|
-
|
|
2291
|
+
_iterator14 = _createForOfIteratorHelper(nextDiscountList);
|
|
2136
2292
|
try {
|
|
2137
|
-
for (
|
|
2138
|
-
d =
|
|
2293
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
2294
|
+
d = _step14.value;
|
|
2139
2295
|
if (d.isSelected && !beforeSelectedIds.has(d.id)) {
|
|
2140
2296
|
d.isSelected = false;
|
|
2141
2297
|
}
|
|
2142
2298
|
}
|
|
2143
2299
|
} catch (err) {
|
|
2144
|
-
|
|
2300
|
+
_iterator14.e(err);
|
|
2145
2301
|
} finally {
|
|
2146
|
-
|
|
2302
|
+
_iterator14.f();
|
|
2147
2303
|
}
|
|
2148
2304
|
}
|
|
2149
2305
|
}
|
|
@@ -2156,20 +2312,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2156
2312
|
// 都以 original_price - Σ (当前选中 discount_list.amount) 重算 selling_price。
|
|
2157
2313
|
// 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
|
|
2158
2314
|
// 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2315
|
+
_iterator15 = _createForOfIteratorHelper(tempOrder.products);
|
|
2316
|
+
_context22.prev = 19;
|
|
2317
|
+
_iterator15.s();
|
|
2162
2318
|
case 21:
|
|
2163
|
-
if ((
|
|
2164
|
-
|
|
2319
|
+
if ((_step15 = _iterator15.n()).done) {
|
|
2320
|
+
_context22.next = 35;
|
|
2165
2321
|
break;
|
|
2166
2322
|
}
|
|
2167
|
-
product =
|
|
2323
|
+
product = _step15.value;
|
|
2168
2324
|
if (!((_product$_origin = product._origin) !== null && _product$_origin !== void 0 && _product$_origin.isManualDiscount)) {
|
|
2169
|
-
|
|
2325
|
+
_context22.next = 25;
|
|
2170
2326
|
break;
|
|
2171
2327
|
}
|
|
2172
|
-
return
|
|
2328
|
+
return _context22.abrupt("continue", 33);
|
|
2173
2329
|
case 25:
|
|
2174
2330
|
// 1. 把 product.discount_list 和当前选中的 discount 对齐(剔除已取消的券)
|
|
2175
2331
|
product.discount_list = (product.discount_list || []).filter(function (pd) {
|
|
@@ -2196,22 +2352,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2196
2352
|
bundle: product.product_bundle
|
|
2197
2353
|
});
|
|
2198
2354
|
case 33:
|
|
2199
|
-
|
|
2355
|
+
_context22.next = 21;
|
|
2200
2356
|
break;
|
|
2201
2357
|
case 35:
|
|
2202
|
-
|
|
2358
|
+
_context22.next = 40;
|
|
2203
2359
|
break;
|
|
2204
2360
|
case 37:
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2361
|
+
_context22.prev = 37;
|
|
2362
|
+
_context22.t0 = _context22["catch"](19);
|
|
2363
|
+
_iterator15.e(_context22.t0);
|
|
2208
2364
|
case 40:
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
return
|
|
2365
|
+
_context22.prev = 40;
|
|
2366
|
+
_iterator15.f();
|
|
2367
|
+
return _context22.finish(40);
|
|
2212
2368
|
case 43:
|
|
2213
2369
|
OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
|
|
2214
|
-
|
|
2370
|
+
_context22.next = 46;
|
|
2215
2371
|
return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
|
|
2216
2372
|
case 46:
|
|
2217
2373
|
tempOrder.discount_list = (nextDiscountList || []).filter(function (d) {
|
|
@@ -2220,7 +2376,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2220
2376
|
afterApplyTarget = this.store.order.getDiscountList().find(function (d) {
|
|
2221
2377
|
return d.id === params.discountId;
|
|
2222
2378
|
}) || null;
|
|
2223
|
-
|
|
2379
|
+
_context22.next = 50;
|
|
2224
2380
|
return this.store.order.recalculateSummary({
|
|
2225
2381
|
createIfMissing: true
|
|
2226
2382
|
});
|
|
@@ -2232,19 +2388,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2232
2388
|
finalTarget = this.store.order.getDiscountList().find(function (d) {
|
|
2233
2389
|
return d.id === params.discountId;
|
|
2234
2390
|
}) || null;
|
|
2235
|
-
return
|
|
2391
|
+
return _context22.abrupt("return", this.store.order.getDiscountList());
|
|
2236
2392
|
case 58:
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
this.logMethodError('setDiscountSelected',
|
|
2240
|
-
throw
|
|
2393
|
+
_context22.prev = 58;
|
|
2394
|
+
_context22.t1 = _context22["catch"](1);
|
|
2395
|
+
this.logMethodError('setDiscountSelected', _context22.t1);
|
|
2396
|
+
throw _context22.t1;
|
|
2241
2397
|
case 62:
|
|
2242
2398
|
case "end":
|
|
2243
|
-
return
|
|
2399
|
+
return _context22.stop();
|
|
2244
2400
|
}
|
|
2245
|
-
},
|
|
2401
|
+
}, _callee22, this, [[1, 58], [19, 37, 40, 43]]);
|
|
2246
2402
|
}));
|
|
2247
|
-
function setDiscountSelected(
|
|
2403
|
+
function setDiscountSelected(_x16) {
|
|
2248
2404
|
return _setDiscountSelected.apply(this, arguments);
|
|
2249
2405
|
}
|
|
2250
2406
|
return setDiscountSelected;
|
|
@@ -2252,37 +2408,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2252
2408
|
}, {
|
|
2253
2409
|
key: "addNewOrder",
|
|
2254
2410
|
value: function () {
|
|
2255
|
-
var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2411
|
+
var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2256
2412
|
var tempOrder;
|
|
2257
|
-
return _regeneratorRuntime().wrap(function
|
|
2258
|
-
while (1) switch (
|
|
2413
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2414
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2259
2415
|
case 0:
|
|
2260
2416
|
this.logMethodStart('addNewOrder');
|
|
2261
|
-
|
|
2417
|
+
_context23.prev = 1;
|
|
2262
2418
|
if (this.store.order) {
|
|
2263
|
-
|
|
2419
|
+
_context23.next = 4;
|
|
2264
2420
|
break;
|
|
2265
2421
|
}
|
|
2266
2422
|
throw new Error('order 模块未初始化');
|
|
2267
2423
|
case 4:
|
|
2268
|
-
|
|
2424
|
+
_context23.next = 6;
|
|
2269
2425
|
return this.store.order.addNewOrder();
|
|
2270
2426
|
case 6:
|
|
2271
|
-
tempOrder =
|
|
2427
|
+
tempOrder = _context23.sent;
|
|
2272
2428
|
this.logMethodSuccess('addNewOrder', {
|
|
2273
2429
|
productCount: tempOrder.products.length
|
|
2274
2430
|
});
|
|
2275
|
-
return
|
|
2431
|
+
return _context23.abrupt("return", tempOrder);
|
|
2276
2432
|
case 11:
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
this.logMethodError('addNewOrder',
|
|
2280
|
-
throw
|
|
2433
|
+
_context23.prev = 11;
|
|
2434
|
+
_context23.t0 = _context23["catch"](1);
|
|
2435
|
+
this.logMethodError('addNewOrder', _context23.t0);
|
|
2436
|
+
throw _context23.t0;
|
|
2281
2437
|
case 15:
|
|
2282
2438
|
case "end":
|
|
2283
|
-
return
|
|
2439
|
+
return _context23.stop();
|
|
2284
2440
|
}
|
|
2285
|
-
},
|
|
2441
|
+
}, _callee23, this, [[1, 11]]);
|
|
2286
2442
|
}));
|
|
2287
2443
|
function addNewOrder() {
|
|
2288
2444
|
return _addNewOrder.apply(this, arguments);
|
|
@@ -2298,37 +2454,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2298
2454
|
}, {
|
|
2299
2455
|
key: "getSummary",
|
|
2300
2456
|
value: function () {
|
|
2301
|
-
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2457
|
+
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
2302
2458
|
var summary;
|
|
2303
|
-
return _regeneratorRuntime().wrap(function
|
|
2304
|
-
while (1) switch (
|
|
2459
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2460
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
2305
2461
|
case 0:
|
|
2306
2462
|
this.logMethodStart('getSummary');
|
|
2307
|
-
|
|
2463
|
+
_context24.prev = 1;
|
|
2308
2464
|
if (this.store.order) {
|
|
2309
|
-
|
|
2465
|
+
_context24.next = 4;
|
|
2310
2466
|
break;
|
|
2311
2467
|
}
|
|
2312
2468
|
throw new Error('order 模块未初始化');
|
|
2313
2469
|
case 4:
|
|
2314
|
-
|
|
2470
|
+
_context24.next = 6;
|
|
2315
2471
|
return this.store.order.getScanOrderSummary();
|
|
2316
2472
|
case 6:
|
|
2317
|
-
summary =
|
|
2473
|
+
summary = _context24.sent;
|
|
2318
2474
|
this.logMethodSuccess('getSummary', {
|
|
2319
2475
|
totalAmount: summary.total_amount
|
|
2320
2476
|
});
|
|
2321
|
-
return
|
|
2477
|
+
return _context24.abrupt("return", summary);
|
|
2322
2478
|
case 11:
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
this.logMethodError('getSummary',
|
|
2326
|
-
throw
|
|
2479
|
+
_context24.prev = 11;
|
|
2480
|
+
_context24.t0 = _context24["catch"](1);
|
|
2481
|
+
this.logMethodError('getSummary', _context24.t0);
|
|
2482
|
+
throw _context24.t0;
|
|
2327
2483
|
case 15:
|
|
2328
2484
|
case "end":
|
|
2329
|
-
return
|
|
2485
|
+
return _context24.stop();
|
|
2330
2486
|
}
|
|
2331
|
-
},
|
|
2487
|
+
}, _callee24, this, [[1, 11]]);
|
|
2332
2488
|
}));
|
|
2333
2489
|
function getSummary() {
|
|
2334
2490
|
return _getSummary.apply(this, arguments);
|
|
@@ -2338,47 +2494,47 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2338
2494
|
}, {
|
|
2339
2495
|
key: "submitOrder",
|
|
2340
2496
|
value: function () {
|
|
2341
|
-
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2342
|
-
var _this$
|
|
2343
|
-
return _regeneratorRuntime().wrap(function
|
|
2344
|
-
while (1) switch (
|
|
2497
|
+
var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
2498
|
+
var _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14, _tempOrder$products2, result, tempOrder;
|
|
2499
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2500
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
2345
2501
|
case 0:
|
|
2346
2502
|
this.logMethodStart('submitOrder');
|
|
2347
|
-
|
|
2348
|
-
|
|
2503
|
+
_context25.prev = 1;
|
|
2504
|
+
_context25.next = 4;
|
|
2349
2505
|
return this.validateBeforeSubmitByItemRule();
|
|
2350
2506
|
case 4:
|
|
2351
2507
|
if (this.store.order) {
|
|
2352
|
-
|
|
2508
|
+
_context25.next = 6;
|
|
2353
2509
|
break;
|
|
2354
2510
|
}
|
|
2355
2511
|
throw new Error('venueBooking解决方案需要 order 模块支持');
|
|
2356
2512
|
case 6:
|
|
2357
|
-
|
|
2513
|
+
_context25.next = 8;
|
|
2358
2514
|
return this.store.order.submitTempOrder({
|
|
2359
2515
|
cacheId: this.cacheId,
|
|
2360
|
-
platform: (_this$
|
|
2361
|
-
businessCode: (_this$
|
|
2362
|
-
channel: (_this$
|
|
2363
|
-
type: (_this$
|
|
2516
|
+
platform: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform,
|
|
2517
|
+
businessCode: (_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.businessCode,
|
|
2518
|
+
channel: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.channel,
|
|
2519
|
+
type: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.type
|
|
2364
2520
|
});
|
|
2365
2521
|
case 8:
|
|
2366
|
-
result =
|
|
2522
|
+
result = _context25.sent;
|
|
2367
2523
|
tempOrder = this.store.order.getTempOrder();
|
|
2368
2524
|
this.logMethodSuccess('submitOrder', {
|
|
2369
2525
|
productCount: (tempOrder === null || tempOrder === void 0 || (_tempOrder$products2 = tempOrder.products) === null || _tempOrder$products2 === void 0 ? void 0 : _tempOrder$products2.length) || 0
|
|
2370
2526
|
});
|
|
2371
|
-
return
|
|
2527
|
+
return _context25.abrupt("return", result);
|
|
2372
2528
|
case 14:
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
this.logMethodError('submitOrder',
|
|
2376
|
-
throw
|
|
2529
|
+
_context25.prev = 14;
|
|
2530
|
+
_context25.t0 = _context25["catch"](1);
|
|
2531
|
+
this.logMethodError('submitOrder', _context25.t0);
|
|
2532
|
+
throw _context25.t0;
|
|
2377
2533
|
case 18:
|
|
2378
2534
|
case "end":
|
|
2379
|
-
return
|
|
2535
|
+
return _context25.stop();
|
|
2380
2536
|
}
|
|
2381
|
-
},
|
|
2537
|
+
}, _callee25, this, [[1, 14]]);
|
|
2382
2538
|
}));
|
|
2383
2539
|
function submitOrder() {
|
|
2384
2540
|
return _submitOrder.apply(this, arguments);
|
|
@@ -2392,42 +2548,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2392
2548
|
}, {
|
|
2393
2549
|
key: "submitFreeOrder",
|
|
2394
2550
|
value: (function () {
|
|
2395
|
-
var _submitFreeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2551
|
+
var _submitFreeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(id) {
|
|
2396
2552
|
var res;
|
|
2397
|
-
return _regeneratorRuntime().wrap(function
|
|
2398
|
-
while (1) switch (
|
|
2553
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2554
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2399
2555
|
case 0:
|
|
2400
2556
|
this.logMethodStart('submitFreeOrder', {
|
|
2401
2557
|
id: id
|
|
2402
2558
|
});
|
|
2403
|
-
|
|
2559
|
+
_context26.prev = 1;
|
|
2404
2560
|
if (id) {
|
|
2405
|
-
|
|
2561
|
+
_context26.next = 4;
|
|
2406
2562
|
break;
|
|
2407
2563
|
}
|
|
2408
2564
|
throw new Error('订单 ID 不能为空');
|
|
2409
2565
|
case 4:
|
|
2410
|
-
|
|
2566
|
+
_context26.next = 6;
|
|
2411
2567
|
return this.request.post("/pay/order/free-pay/".concat(id));
|
|
2412
2568
|
case 6:
|
|
2413
|
-
res =
|
|
2569
|
+
res = _context26.sent;
|
|
2414
2570
|
this.logMethodSuccess('submitFreeOrder', {
|
|
2415
2571
|
id: id,
|
|
2416
2572
|
status: res === null || res === void 0 ? void 0 : res.status
|
|
2417
2573
|
});
|
|
2418
|
-
return
|
|
2574
|
+
return _context26.abrupt("return", res);
|
|
2419
2575
|
case 11:
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
this.logMethodError('submitFreeOrder',
|
|
2423
|
-
throw
|
|
2576
|
+
_context26.prev = 11;
|
|
2577
|
+
_context26.t0 = _context26["catch"](1);
|
|
2578
|
+
this.logMethodError('submitFreeOrder', _context26.t0);
|
|
2579
|
+
throw _context26.t0;
|
|
2424
2580
|
case 15:
|
|
2425
2581
|
case "end":
|
|
2426
|
-
return
|
|
2582
|
+
return _context26.stop();
|
|
2427
2583
|
}
|
|
2428
|
-
},
|
|
2584
|
+
}, _callee26, this, [[1, 11]]);
|
|
2429
2585
|
}));
|
|
2430
|
-
function submitFreeOrder(
|
|
2586
|
+
function submitFreeOrder(_x17) {
|
|
2431
2587
|
return _submitFreeOrder.apply(this, arguments);
|
|
2432
2588
|
}
|
|
2433
2589
|
return submitFreeOrder;
|
|
@@ -2435,18 +2591,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2435
2591
|
}, {
|
|
2436
2592
|
key: "addProductToOrder",
|
|
2437
2593
|
value: function () {
|
|
2438
|
-
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2594
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(product) {
|
|
2439
2595
|
var _product$metadata5, _product$product_vari2, quotationPrice, products;
|
|
2440
|
-
return _regeneratorRuntime().wrap(function
|
|
2441
|
-
while (1) switch (
|
|
2596
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2597
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2442
2598
|
case 0:
|
|
2443
2599
|
this.logMethodStart('addProductToOrder', {
|
|
2444
2600
|
product_id: product.product_id,
|
|
2445
2601
|
product_variant_id: product.product_variant_id
|
|
2446
2602
|
});
|
|
2447
|
-
|
|
2603
|
+
_context27.prev = 1;
|
|
2448
2604
|
if (this.store.order) {
|
|
2449
|
-
|
|
2605
|
+
_context27.next = 4;
|
|
2450
2606
|
break;
|
|
2451
2607
|
}
|
|
2452
2608
|
throw new Error('order 模块未初始化');
|
|
@@ -2464,32 +2620,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2464
2620
|
product.original_price = product.selling_price;
|
|
2465
2621
|
}
|
|
2466
2622
|
}
|
|
2467
|
-
|
|
2623
|
+
_context27.next = 7;
|
|
2468
2624
|
return this.store.order.addProductToOrder(product);
|
|
2469
2625
|
case 7:
|
|
2470
|
-
products =
|
|
2471
|
-
|
|
2626
|
+
products = _context27.sent;
|
|
2627
|
+
_context27.next = 10;
|
|
2472
2628
|
return this.refreshItemRuleQuantityLimits();
|
|
2473
2629
|
case 10:
|
|
2474
|
-
|
|
2630
|
+
_context27.next = 12;
|
|
2475
2631
|
return this.refreshCartValidationPassed();
|
|
2476
2632
|
case 12:
|
|
2477
2633
|
this.logMethodSuccess('addProductToOrder', {
|
|
2478
2634
|
productCount: products.length
|
|
2479
2635
|
});
|
|
2480
|
-
return
|
|
2636
|
+
return _context27.abrupt("return", products);
|
|
2481
2637
|
case 16:
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
this.logMethodError('addProductToOrder',
|
|
2485
|
-
throw
|
|
2638
|
+
_context27.prev = 16;
|
|
2639
|
+
_context27.t0 = _context27["catch"](1);
|
|
2640
|
+
this.logMethodError('addProductToOrder', _context27.t0);
|
|
2641
|
+
throw _context27.t0;
|
|
2486
2642
|
case 20:
|
|
2487
2643
|
case "end":
|
|
2488
|
-
return
|
|
2644
|
+
return _context27.stop();
|
|
2489
2645
|
}
|
|
2490
|
-
},
|
|
2646
|
+
}, _callee27, this, [[1, 16]]);
|
|
2491
2647
|
}));
|
|
2492
|
-
function addProductToOrder(
|
|
2648
|
+
function addProductToOrder(_x18) {
|
|
2493
2649
|
return _addProductToOrder.apply(this, arguments);
|
|
2494
2650
|
}
|
|
2495
2651
|
return addProductToOrder;
|
|
@@ -2497,48 +2653,48 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2497
2653
|
}, {
|
|
2498
2654
|
key: "updateProductInOrder",
|
|
2499
2655
|
value: function () {
|
|
2500
|
-
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2656
|
+
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
2501
2657
|
var products;
|
|
2502
|
-
return _regeneratorRuntime().wrap(function
|
|
2503
|
-
while (1) switch (
|
|
2658
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2659
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2504
2660
|
case 0:
|
|
2505
2661
|
this.logMethodStart('updateProductInOrder', {
|
|
2506
2662
|
product_id: params.product_id,
|
|
2507
2663
|
product_variant_id: params.product_variant_id
|
|
2508
2664
|
});
|
|
2509
|
-
|
|
2665
|
+
_context28.prev = 1;
|
|
2510
2666
|
if (this.store.order) {
|
|
2511
|
-
|
|
2667
|
+
_context28.next = 4;
|
|
2512
2668
|
break;
|
|
2513
2669
|
}
|
|
2514
2670
|
throw new Error('order 模块未初始化');
|
|
2515
2671
|
case 4:
|
|
2516
|
-
|
|
2672
|
+
_context28.next = 6;
|
|
2517
2673
|
return this.store.order.updateProductInOrder(params);
|
|
2518
2674
|
case 6:
|
|
2519
|
-
products =
|
|
2520
|
-
|
|
2675
|
+
products = _context28.sent;
|
|
2676
|
+
_context28.next = 9;
|
|
2521
2677
|
return this.refreshItemRuleQuantityLimits();
|
|
2522
2678
|
case 9:
|
|
2523
|
-
|
|
2679
|
+
_context28.next = 11;
|
|
2524
2680
|
return this.refreshCartValidationPassed();
|
|
2525
2681
|
case 11:
|
|
2526
2682
|
this.logMethodSuccess('updateProductInOrder', {
|
|
2527
2683
|
productCount: products.length
|
|
2528
2684
|
});
|
|
2529
|
-
return
|
|
2685
|
+
return _context28.abrupt("return", products);
|
|
2530
2686
|
case 15:
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
this.logMethodError('updateProductInOrder',
|
|
2534
|
-
throw
|
|
2687
|
+
_context28.prev = 15;
|
|
2688
|
+
_context28.t0 = _context28["catch"](1);
|
|
2689
|
+
this.logMethodError('updateProductInOrder', _context28.t0);
|
|
2690
|
+
throw _context28.t0;
|
|
2535
2691
|
case 19:
|
|
2536
2692
|
case "end":
|
|
2537
|
-
return
|
|
2693
|
+
return _context28.stop();
|
|
2538
2694
|
}
|
|
2539
|
-
},
|
|
2695
|
+
}, _callee28, this, [[1, 15]]);
|
|
2540
2696
|
}));
|
|
2541
|
-
function updateProductInOrder(
|
|
2697
|
+
function updateProductInOrder(_x19) {
|
|
2542
2698
|
return _updateProductInOrder.apply(this, arguments);
|
|
2543
2699
|
}
|
|
2544
2700
|
return updateProductInOrder;
|
|
@@ -2546,66 +2702,66 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2546
2702
|
}, {
|
|
2547
2703
|
key: "removeProductFromOrder",
|
|
2548
2704
|
value: function () {
|
|
2549
|
-
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2550
|
-
var _this$store$order$get3, _this$store$
|
|
2551
|
-
return _regeneratorRuntime().wrap(function
|
|
2552
|
-
while (1) switch (
|
|
2705
|
+
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(identity) {
|
|
2706
|
+
var _this$store$order$get3, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata6, _product$metadata7, product, beforeBookingCount, _this$store$order$per, _this$store$order10;
|
|
2707
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2708
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2553
2709
|
case 0:
|
|
2554
2710
|
this.logMethodStart('removeProductFromOrder', {
|
|
2555
2711
|
product_id: identity.product_id,
|
|
2556
2712
|
product_variant_id: identity.product_variant_id
|
|
2557
2713
|
});
|
|
2558
|
-
|
|
2714
|
+
_context29.prev = 1;
|
|
2559
2715
|
if (this.store.order) {
|
|
2560
|
-
|
|
2716
|
+
_context29.next = 4;
|
|
2561
2717
|
break;
|
|
2562
2718
|
}
|
|
2563
2719
|
throw new Error('order 模块未初始化');
|
|
2564
2720
|
case 4:
|
|
2565
|
-
tempOrder = ((_this$store$order$get3 = (_this$store$
|
|
2566
|
-
|
|
2721
|
+
tempOrder = ((_this$store$order$get3 = (_this$store$order8 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order8)) || ((_this$store$order$ens = (_this$store$order9 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order9));
|
|
2722
|
+
_context29.next = 7;
|
|
2567
2723
|
return this.store.order.removeProductFromOrder(identity);
|
|
2568
2724
|
case 7:
|
|
2569
|
-
products =
|
|
2725
|
+
products = _context29.sent;
|
|
2570
2726
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
|
|
2571
|
-
|
|
2727
|
+
_context29.next = 33;
|
|
2572
2728
|
break;
|
|
2573
2729
|
}
|
|
2574
2730
|
venueProductUids = new Set();
|
|
2575
2731
|
venueBookingUids = new Set();
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2732
|
+
_iterator16 = _createForOfIteratorHelper(tempOrder.products || []);
|
|
2733
|
+
_context29.prev = 12;
|
|
2734
|
+
_iterator16.s();
|
|
2579
2735
|
case 14:
|
|
2580
|
-
if ((
|
|
2581
|
-
|
|
2736
|
+
if ((_step16 = _iterator16.n()).done) {
|
|
2737
|
+
_context29.next = 22;
|
|
2582
2738
|
break;
|
|
2583
2739
|
}
|
|
2584
|
-
product =
|
|
2740
|
+
product = _step16.value;
|
|
2585
2741
|
if (product !== null && product !== void 0 && (_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) {
|
|
2586
|
-
|
|
2742
|
+
_context29.next = 18;
|
|
2587
2743
|
break;
|
|
2588
2744
|
}
|
|
2589
|
-
return
|
|
2745
|
+
return _context29.abrupt("continue", 20);
|
|
2590
2746
|
case 18:
|
|
2591
2747
|
if (product.identity_key) venueProductUids.add(String(product.identity_key));
|
|
2592
2748
|
if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
|
|
2593
2749
|
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
2594
2750
|
}
|
|
2595
2751
|
case 20:
|
|
2596
|
-
|
|
2752
|
+
_context29.next = 14;
|
|
2597
2753
|
break;
|
|
2598
2754
|
case 22:
|
|
2599
|
-
|
|
2755
|
+
_context29.next = 27;
|
|
2600
2756
|
break;
|
|
2601
2757
|
case 24:
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2758
|
+
_context29.prev = 24;
|
|
2759
|
+
_context29.t0 = _context29["catch"](12);
|
|
2760
|
+
_iterator16.e(_context29.t0);
|
|
2605
2761
|
case 27:
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
return
|
|
2762
|
+
_context29.prev = 27;
|
|
2763
|
+
_iterator16.f();
|
|
2764
|
+
return _context29.finish(27);
|
|
2609
2765
|
case 30:
|
|
2610
2766
|
beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
|
|
2611
2767
|
tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
|
|
@@ -2619,31 +2775,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2619
2775
|
return true;
|
|
2620
2776
|
});
|
|
2621
2777
|
if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
|
|
2622
|
-
(_this$store$order$per = (_this$store$
|
|
2778
|
+
(_this$store$order$per = (_this$store$order10 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order10);
|
|
2623
2779
|
}
|
|
2624
2780
|
case 33:
|
|
2625
|
-
|
|
2781
|
+
_context29.next = 35;
|
|
2626
2782
|
return this.refreshItemRuleQuantityLimits();
|
|
2627
2783
|
case 35:
|
|
2628
|
-
|
|
2784
|
+
_context29.next = 37;
|
|
2629
2785
|
return this.refreshCartValidationPassed();
|
|
2630
2786
|
case 37:
|
|
2631
2787
|
this.logMethodSuccess('removeProductFromOrder', {
|
|
2632
2788
|
productCount: products.length
|
|
2633
2789
|
});
|
|
2634
|
-
return
|
|
2790
|
+
return _context29.abrupt("return", products);
|
|
2635
2791
|
case 41:
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
this.logMethodError('removeProductFromOrder',
|
|
2639
|
-
throw
|
|
2792
|
+
_context29.prev = 41;
|
|
2793
|
+
_context29.t1 = _context29["catch"](1);
|
|
2794
|
+
this.logMethodError('removeProductFromOrder', _context29.t1);
|
|
2795
|
+
throw _context29.t1;
|
|
2640
2796
|
case 45:
|
|
2641
2797
|
case "end":
|
|
2642
|
-
return
|
|
2798
|
+
return _context29.stop();
|
|
2643
2799
|
}
|
|
2644
|
-
},
|
|
2800
|
+
}, _callee29, this, [[1, 41], [12, 24, 27, 30]]);
|
|
2645
2801
|
}));
|
|
2646
|
-
function removeProductFromOrder(
|
|
2802
|
+
function removeProductFromOrder(_x20) {
|
|
2647
2803
|
return _removeProductFromOrder.apply(this, arguments);
|
|
2648
2804
|
}
|
|
2649
2805
|
return removeProductFromOrder;
|
|
@@ -2651,27 +2807,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2651
2807
|
}, {
|
|
2652
2808
|
key: "getProductList",
|
|
2653
2809
|
value: function () {
|
|
2654
|
-
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2810
|
+
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2655
2811
|
var result;
|
|
2656
|
-
return _regeneratorRuntime().wrap(function
|
|
2657
|
-
while (1) switch (
|
|
2812
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2813
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2658
2814
|
case 0:
|
|
2659
2815
|
if (!this.productsLoaded) {
|
|
2660
|
-
|
|
2816
|
+
_context30.next = 2;
|
|
2661
2817
|
break;
|
|
2662
2818
|
}
|
|
2663
|
-
return
|
|
2819
|
+
return _context30.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
|
|
2664
2820
|
case 2:
|
|
2665
|
-
|
|
2821
|
+
_context30.next = 4;
|
|
2666
2822
|
return this.loadAllProducts();
|
|
2667
2823
|
case 4:
|
|
2668
|
-
result =
|
|
2669
|
-
return
|
|
2824
|
+
result = _context30.sent;
|
|
2825
|
+
return _context30.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
|
|
2670
2826
|
case 6:
|
|
2671
2827
|
case "end":
|
|
2672
|
-
return
|
|
2828
|
+
return _context30.stop();
|
|
2673
2829
|
}
|
|
2674
|
-
},
|
|
2830
|
+
}, _callee30, this);
|
|
2675
2831
|
}));
|
|
2676
2832
|
function getProductList() {
|
|
2677
2833
|
return _getProductList.apply(this, arguments);
|
|
@@ -2681,13 +2837,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2681
2837
|
}, {
|
|
2682
2838
|
key: "loadOpenDataConfig",
|
|
2683
2839
|
value: function () {
|
|
2684
|
-
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2840
|
+
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
2685
2841
|
var lastFetchedAt, cachedData, openDataConfig;
|
|
2686
|
-
return _regeneratorRuntime().wrap(function
|
|
2687
|
-
while (1) switch (
|
|
2842
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2843
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2688
2844
|
case 0:
|
|
2689
2845
|
if (this.store.openData) {
|
|
2690
|
-
|
|
2846
|
+
_context31.next = 2;
|
|
2691
2847
|
break;
|
|
2692
2848
|
}
|
|
2693
2849
|
throw new Error('openData 模块未初始化');
|
|
@@ -2695,42 +2851,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2695
2851
|
lastFetchedAt = this.store.openData.getLastFetchedAt();
|
|
2696
2852
|
cachedData = this.store.openData.getOpenData();
|
|
2697
2853
|
if (!(cachedData && lastFetchedAt && Date.now() - lastFetchedAt < VenueBookingImpl.OPEN_DATA_CACHE_TTL)) {
|
|
2698
|
-
|
|
2854
|
+
_context31.next = 7;
|
|
2699
2855
|
break;
|
|
2700
2856
|
}
|
|
2701
2857
|
this.otherParams.openData = cachedData;
|
|
2702
|
-
return
|
|
2858
|
+
return _context31.abrupt("return", cachedData);
|
|
2703
2859
|
case 7:
|
|
2704
2860
|
if (!this.loadOpenDataConfigInFlight) {
|
|
2705
|
-
|
|
2861
|
+
_context31.next = 11;
|
|
2706
2862
|
break;
|
|
2707
2863
|
}
|
|
2708
|
-
|
|
2864
|
+
_context31.next = 10;
|
|
2709
2865
|
return this.loadOpenDataConfigInFlight;
|
|
2710
2866
|
case 10:
|
|
2711
|
-
return
|
|
2867
|
+
return _context31.abrupt("return", _context31.sent);
|
|
2712
2868
|
case 11:
|
|
2713
2869
|
this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
|
|
2714
2870
|
scope: 'board',
|
|
2715
2871
|
target: 'venue_booking+online_store',
|
|
2716
2872
|
section_code: [].concat(OPEN_DATA_SECTION_CODES)
|
|
2717
2873
|
});
|
|
2718
|
-
|
|
2719
|
-
|
|
2874
|
+
_context31.prev = 12;
|
|
2875
|
+
_context31.next = 15;
|
|
2720
2876
|
return this.loadOpenDataConfigInFlight;
|
|
2721
2877
|
case 15:
|
|
2722
|
-
openDataConfig =
|
|
2878
|
+
openDataConfig = _context31.sent;
|
|
2723
2879
|
this.otherParams.openData = openDataConfig;
|
|
2724
|
-
return
|
|
2880
|
+
return _context31.abrupt("return", openDataConfig);
|
|
2725
2881
|
case 18:
|
|
2726
|
-
|
|
2882
|
+
_context31.prev = 18;
|
|
2727
2883
|
this.loadOpenDataConfigInFlight = null;
|
|
2728
|
-
return
|
|
2884
|
+
return _context31.finish(18);
|
|
2729
2885
|
case 21:
|
|
2730
2886
|
case "end":
|
|
2731
|
-
return
|
|
2887
|
+
return _context31.stop();
|
|
2732
2888
|
}
|
|
2733
|
-
},
|
|
2889
|
+
}, _callee31, this, [[12,, 18, 21]]);
|
|
2734
2890
|
}));
|
|
2735
2891
|
function loadOpenDataConfig() {
|
|
2736
2892
|
return _loadOpenDataConfig.apply(this, arguments);
|
|
@@ -2740,29 +2896,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2740
2896
|
}, {
|
|
2741
2897
|
key: "loadRuntimeConfigs",
|
|
2742
2898
|
value: function () {
|
|
2743
|
-
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2899
|
+
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
|
|
2744
2900
|
var itemRuleConfigs;
|
|
2745
|
-
return _regeneratorRuntime().wrap(function
|
|
2746
|
-
while (1) switch (
|
|
2901
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2902
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2747
2903
|
case 0:
|
|
2748
|
-
|
|
2904
|
+
_context32.next = 2;
|
|
2749
2905
|
return this.loadOpenDataConfig();
|
|
2750
2906
|
case 2:
|
|
2751
|
-
|
|
2907
|
+
_context32.next = 4;
|
|
2752
2908
|
return this.ensureItemRuleConfigsLoaded();
|
|
2753
2909
|
case 4:
|
|
2754
|
-
itemRuleConfigs =
|
|
2910
|
+
itemRuleConfigs = _context32.sent;
|
|
2755
2911
|
this.logMethodSuccess('loadRuntimeConfigs', {
|
|
2756
2912
|
itemRuleCount: itemRuleConfigs.length
|
|
2757
2913
|
});
|
|
2758
|
-
return
|
|
2914
|
+
return _context32.abrupt("return", {
|
|
2759
2915
|
itemRuleConfigs: itemRuleConfigs
|
|
2760
2916
|
});
|
|
2761
2917
|
case 7:
|
|
2762
2918
|
case "end":
|
|
2763
|
-
return
|
|
2919
|
+
return _context32.stop();
|
|
2764
2920
|
}
|
|
2765
|
-
},
|
|
2921
|
+
}, _callee32, this);
|
|
2766
2922
|
}));
|
|
2767
2923
|
function loadRuntimeConfigs() {
|
|
2768
2924
|
return _loadRuntimeConfigs.apply(this, arguments);
|
|
@@ -2772,22 +2928,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2772
2928
|
}, {
|
|
2773
2929
|
key: "fetchItemRuleConfigsByModelIds",
|
|
2774
2930
|
value: function () {
|
|
2775
|
-
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2931
|
+
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(strategyModelIds) {
|
|
2776
2932
|
var result, configs;
|
|
2777
|
-
return _regeneratorRuntime().wrap(function
|
|
2778
|
-
while (1) switch (
|
|
2933
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2934
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2779
2935
|
case 0:
|
|
2780
2936
|
this.logMethodStart('fetchItemRuleConfigsByModelIds', {
|
|
2781
2937
|
strategyModelIds: strategyModelIds
|
|
2782
2938
|
});
|
|
2783
2939
|
if (strategyModelIds.length) {
|
|
2784
|
-
|
|
2940
|
+
_context33.next = 3;
|
|
2785
2941
|
break;
|
|
2786
2942
|
}
|
|
2787
|
-
return
|
|
2943
|
+
return _context33.abrupt("return", []);
|
|
2788
2944
|
case 3:
|
|
2789
|
-
|
|
2790
|
-
|
|
2945
|
+
_context33.prev = 3;
|
|
2946
|
+
_context33.next = 6;
|
|
2791
2947
|
return this.request.get('/promotion', {
|
|
2792
2948
|
skip: 1,
|
|
2793
2949
|
num: 99,
|
|
@@ -2795,7 +2951,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2795
2951
|
ids: strategyModelIds
|
|
2796
2952
|
});
|
|
2797
2953
|
case 6:
|
|
2798
|
-
result =
|
|
2954
|
+
result = _context33.sent;
|
|
2799
2955
|
configs = [];
|
|
2800
2956
|
if (result.code === 200) {
|
|
2801
2957
|
configs = result.data.list.map(function (item) {
|
|
@@ -2806,21 +2962,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2806
2962
|
strategyModelIds: strategyModelIds,
|
|
2807
2963
|
strategyCount: configs.length
|
|
2808
2964
|
});
|
|
2809
|
-
return
|
|
2965
|
+
return _context33.abrupt("return", configs);
|
|
2810
2966
|
case 13:
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
this.logMethodError('fetchItemRuleConfigsByModelIds',
|
|
2967
|
+
_context33.prev = 13;
|
|
2968
|
+
_context33.t0 = _context33["catch"](3);
|
|
2969
|
+
this.logMethodError('fetchItemRuleConfigsByModelIds', _context33.t0, {
|
|
2814
2970
|
strategyModelIds: strategyModelIds
|
|
2815
2971
|
});
|
|
2816
|
-
return
|
|
2972
|
+
return _context33.abrupt("return", []);
|
|
2817
2973
|
case 17:
|
|
2818
2974
|
case "end":
|
|
2819
|
-
return
|
|
2975
|
+
return _context33.stop();
|
|
2820
2976
|
}
|
|
2821
|
-
},
|
|
2977
|
+
}, _callee33, this, [[3, 13]]);
|
|
2822
2978
|
}));
|
|
2823
|
-
function fetchItemRuleConfigsByModelIds(
|
|
2979
|
+
function fetchItemRuleConfigsByModelIds(_x21) {
|
|
2824
2980
|
return _fetchItemRuleConfigsByModelIds.apply(this, arguments);
|
|
2825
2981
|
}
|
|
2826
2982
|
return fetchItemRuleConfigsByModelIds;
|
|
@@ -2828,22 +2984,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2828
2984
|
}, {
|
|
2829
2985
|
key: "buildPrefillProductSourceMap",
|
|
2830
2986
|
value: function () {
|
|
2831
|
-
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2987
|
+
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2832
2988
|
var sourceMap, productList, visited, collectFromValue;
|
|
2833
|
-
return _regeneratorRuntime().wrap(function
|
|
2834
|
-
while (1) switch (
|
|
2989
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2990
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2835
2991
|
case 0:
|
|
2836
2992
|
sourceMap = new Map();
|
|
2837
|
-
|
|
2838
|
-
|
|
2993
|
+
_context34.prev = 1;
|
|
2994
|
+
_context34.next = 4;
|
|
2839
2995
|
return this.getProductList();
|
|
2840
2996
|
case 4:
|
|
2841
|
-
productList =
|
|
2997
|
+
productList = _context34.sent;
|
|
2842
2998
|
if (Array.isArray(productList)) {
|
|
2843
|
-
|
|
2999
|
+
_context34.next = 7;
|
|
2844
3000
|
break;
|
|
2845
3001
|
}
|
|
2846
|
-
return
|
|
3002
|
+
return _context34.abrupt("return", sourceMap);
|
|
2847
3003
|
case 7:
|
|
2848
3004
|
visited = new Set();
|
|
2849
3005
|
collectFromValue = function collectFromValue(value) {
|
|
@@ -2852,17 +3008,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2852
3008
|
if (visited.has(value)) return;
|
|
2853
3009
|
visited.add(value);
|
|
2854
3010
|
if (Array.isArray(value)) {
|
|
2855
|
-
var
|
|
2856
|
-
|
|
3011
|
+
var _iterator17 = _createForOfIteratorHelper(value),
|
|
3012
|
+
_step17;
|
|
2857
3013
|
try {
|
|
2858
|
-
for (
|
|
2859
|
-
var item =
|
|
3014
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
|
3015
|
+
var item = _step17.value;
|
|
2860
3016
|
collectFromValue(item);
|
|
2861
3017
|
}
|
|
2862
3018
|
} catch (err) {
|
|
2863
|
-
|
|
3019
|
+
_iterator17.e(err);
|
|
2864
3020
|
} finally {
|
|
2865
|
-
|
|
3021
|
+
_iterator17.f();
|
|
2866
3022
|
}
|
|
2867
3023
|
return;
|
|
2868
3024
|
}
|
|
@@ -2882,19 +3038,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2882
3038
|
}
|
|
2883
3039
|
};
|
|
2884
3040
|
collectFromValue(productList);
|
|
2885
|
-
|
|
3041
|
+
_context34.next = 15;
|
|
2886
3042
|
break;
|
|
2887
3043
|
case 12:
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
this.logMethodError('buildPrefillProductSourceMap',
|
|
3044
|
+
_context34.prev = 12;
|
|
3045
|
+
_context34.t0 = _context34["catch"](1);
|
|
3046
|
+
this.logMethodError('buildPrefillProductSourceMap', _context34.t0);
|
|
2891
3047
|
case 15:
|
|
2892
|
-
return
|
|
3048
|
+
return _context34.abrupt("return", sourceMap);
|
|
2893
3049
|
case 16:
|
|
2894
3050
|
case "end":
|
|
2895
|
-
return
|
|
3051
|
+
return _context34.stop();
|
|
2896
3052
|
}
|
|
2897
|
-
},
|
|
3053
|
+
}, _callee34, this, [[1, 12]]);
|
|
2898
3054
|
}));
|
|
2899
3055
|
function buildPrefillProductSourceMap() {
|
|
2900
3056
|
return _buildPrefillProductSourceMap.apply(this, arguments);
|
|
@@ -2909,56 +3065,56 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2909
3065
|
}, {
|
|
2910
3066
|
key: "ensureItemRuleConfigsLoaded",
|
|
2911
3067
|
value: function () {
|
|
2912
|
-
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3068
|
+
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
2913
3069
|
var _this11 = this;
|
|
2914
|
-
return _regeneratorRuntime().wrap(function
|
|
2915
|
-
while (1) switch (
|
|
3070
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
3071
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2916
3072
|
case 0:
|
|
2917
3073
|
if (!(this.itemRuleConfigs.length > 0)) {
|
|
2918
|
-
|
|
3074
|
+
_context36.next = 2;
|
|
2919
3075
|
break;
|
|
2920
3076
|
}
|
|
2921
|
-
return
|
|
3077
|
+
return _context36.abrupt("return", this.itemRuleConfigs);
|
|
2922
3078
|
case 2:
|
|
2923
3079
|
if (!this.itemRuleConfigsPromise) {
|
|
2924
|
-
|
|
3080
|
+
_context36.next = 4;
|
|
2925
3081
|
break;
|
|
2926
3082
|
}
|
|
2927
|
-
return
|
|
3083
|
+
return _context36.abrupt("return", this.itemRuleConfigsPromise);
|
|
2928
3084
|
case 4:
|
|
2929
|
-
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3085
|
+
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
2930
3086
|
var runtimeConfig, staticConfigs;
|
|
2931
|
-
return _regeneratorRuntime().wrap(function
|
|
2932
|
-
while (1) switch (
|
|
3087
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
3088
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2933
3089
|
case 0:
|
|
2934
3090
|
runtimeConfig = _this11.getItemRuleRuntimeConfig();
|
|
2935
3091
|
staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
|
|
2936
3092
|
if (!(staticConfigs.length > 0)) {
|
|
2937
|
-
|
|
3093
|
+
_context35.next = 6;
|
|
2938
3094
|
break;
|
|
2939
3095
|
}
|
|
2940
3096
|
_this11.itemRuleConfigs = staticConfigs;
|
|
2941
3097
|
_this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
|
|
2942
|
-
return
|
|
3098
|
+
return _context35.abrupt("return", _this11.itemRuleConfigs);
|
|
2943
3099
|
case 6:
|
|
2944
3100
|
_this11.itemRuleConfigs = [];
|
|
2945
3101
|
_this11.itemRuleEvaluator.setStrategyConfigs([]);
|
|
2946
|
-
return
|
|
3102
|
+
return _context35.abrupt("return", _this11.itemRuleConfigs);
|
|
2947
3103
|
case 9:
|
|
2948
3104
|
case "end":
|
|
2949
|
-
return
|
|
3105
|
+
return _context35.stop();
|
|
2950
3106
|
}
|
|
2951
|
-
},
|
|
3107
|
+
}, _callee35);
|
|
2952
3108
|
}))();
|
|
2953
|
-
|
|
3109
|
+
_context36.next = 7;
|
|
2954
3110
|
return this.itemRuleConfigsPromise;
|
|
2955
3111
|
case 7:
|
|
2956
|
-
return
|
|
3112
|
+
return _context36.abrupt("return", _context36.sent);
|
|
2957
3113
|
case 8:
|
|
2958
3114
|
case "end":
|
|
2959
|
-
return
|
|
3115
|
+
return _context36.stop();
|
|
2960
3116
|
}
|
|
2961
|
-
},
|
|
3117
|
+
}, _callee36, this);
|
|
2962
3118
|
}));
|
|
2963
3119
|
function ensureItemRuleConfigsLoaded() {
|
|
2964
3120
|
return _ensureItemRuleConfigsLoaded.apply(this, arguments);
|
|
@@ -2968,22 +3124,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2968
3124
|
}, {
|
|
2969
3125
|
key: "refreshItemRuleQuantityLimits",
|
|
2970
3126
|
value: function () {
|
|
2971
|
-
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3127
|
+
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
|
|
2972
3128
|
var strategyConfigs, businessData, limits;
|
|
2973
|
-
return _regeneratorRuntime().wrap(function
|
|
2974
|
-
while (1) switch (
|
|
3129
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3130
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2975
3131
|
case 0:
|
|
2976
|
-
|
|
2977
|
-
|
|
3132
|
+
_context37.prev = 0;
|
|
3133
|
+
_context37.next = 3;
|
|
2978
3134
|
return this.ensureItemRuleConfigsLoaded();
|
|
2979
3135
|
case 3:
|
|
2980
|
-
strategyConfigs =
|
|
3136
|
+
strategyConfigs = _context37.sent;
|
|
2981
3137
|
if (strategyConfigs.length) {
|
|
2982
|
-
|
|
3138
|
+
_context37.next = 7;
|
|
2983
3139
|
break;
|
|
2984
3140
|
}
|
|
2985
3141
|
this.store.itemRuleQuantityLimits = [];
|
|
2986
|
-
return
|
|
3142
|
+
return _context37.abrupt("return", []);
|
|
2987
3143
|
case 7:
|
|
2988
3144
|
businessData = buildItemRuleBusinessData({
|
|
2989
3145
|
tempOrder: this.ensureTempOrder(),
|
|
@@ -2995,18 +3151,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2995
3151
|
this.logMethodSuccess('refreshItemRuleQuantityLimits', {
|
|
2996
3152
|
limitCount: limits.length
|
|
2997
3153
|
});
|
|
2998
|
-
return
|
|
3154
|
+
return _context37.abrupt("return", limits);
|
|
2999
3155
|
case 14:
|
|
3000
|
-
|
|
3001
|
-
|
|
3156
|
+
_context37.prev = 14;
|
|
3157
|
+
_context37.t0 = _context37["catch"](0);
|
|
3002
3158
|
this.store.itemRuleQuantityLimits = [];
|
|
3003
|
-
this.logMethodError('refreshItemRuleQuantityLimits',
|
|
3004
|
-
return
|
|
3159
|
+
this.logMethodError('refreshItemRuleQuantityLimits', _context37.t0);
|
|
3160
|
+
return _context37.abrupt("return", []);
|
|
3005
3161
|
case 19:
|
|
3006
3162
|
case "end":
|
|
3007
|
-
return
|
|
3163
|
+
return _context37.stop();
|
|
3008
3164
|
}
|
|
3009
|
-
},
|
|
3165
|
+
}, _callee37, this, [[0, 14]]);
|
|
3010
3166
|
}));
|
|
3011
3167
|
function refreshItemRuleQuantityLimits() {
|
|
3012
3168
|
return _refreshItemRuleQuantityLimits.apply(this, arguments);
|
|
@@ -3016,32 +3172,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3016
3172
|
}, {
|
|
3017
3173
|
key: "applyPrefillByItemRule",
|
|
3018
3174
|
value: function () {
|
|
3019
|
-
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3020
|
-
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges,
|
|
3021
|
-
return _regeneratorRuntime().wrap(function
|
|
3022
|
-
while (1) switch (
|
|
3175
|
+
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
|
|
3176
|
+
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator18, _step18, _prefillItem$product_, _targetProduct$_origi, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, sellingPrice, targetProduct, existedQuantity, delta, nextProduct;
|
|
3177
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
3178
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
3023
3179
|
case 0:
|
|
3024
3180
|
if (!this.itemRulePrefillApplied) {
|
|
3025
|
-
|
|
3181
|
+
_context38.next = 2;
|
|
3026
3182
|
break;
|
|
3027
3183
|
}
|
|
3028
|
-
return
|
|
3184
|
+
return _context38.abrupt("return");
|
|
3029
3185
|
case 2:
|
|
3030
3186
|
if (this.store.order) {
|
|
3031
|
-
|
|
3187
|
+
_context38.next = 4;
|
|
3032
3188
|
break;
|
|
3033
3189
|
}
|
|
3034
|
-
return
|
|
3190
|
+
return _context38.abrupt("return");
|
|
3035
3191
|
case 4:
|
|
3036
|
-
|
|
3192
|
+
_context38.next = 6;
|
|
3037
3193
|
return this.ensureItemRuleConfigsLoaded();
|
|
3038
3194
|
case 6:
|
|
3039
|
-
strategyConfigs =
|
|
3195
|
+
strategyConfigs = _context38.sent;
|
|
3040
3196
|
if (strategyConfigs.length) {
|
|
3041
|
-
|
|
3197
|
+
_context38.next = 9;
|
|
3042
3198
|
break;
|
|
3043
3199
|
}
|
|
3044
|
-
return
|
|
3200
|
+
return _context38.abrupt("return");
|
|
3045
3201
|
case 9:
|
|
3046
3202
|
businessData = buildItemRuleBusinessData({
|
|
3047
3203
|
tempOrder: this.ensureTempOrder(),
|
|
@@ -3050,41 +3206,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3050
3206
|
});
|
|
3051
3207
|
prefillItems = this.itemRuleEvaluator.getPrefillItems(businessData);
|
|
3052
3208
|
if (prefillItems.length) {
|
|
3053
|
-
|
|
3209
|
+
_context38.next = 14;
|
|
3054
3210
|
break;
|
|
3055
3211
|
}
|
|
3056
3212
|
this.itemRulePrefillApplied = true;
|
|
3057
|
-
return
|
|
3213
|
+
return _context38.abrupt("return");
|
|
3058
3214
|
case 14:
|
|
3059
|
-
|
|
3215
|
+
_context38.next = 16;
|
|
3060
3216
|
return this.buildPrefillProductSourceMap();
|
|
3061
3217
|
case 16:
|
|
3062
|
-
productSourceMap =
|
|
3218
|
+
productSourceMap = _context38.sent;
|
|
3063
3219
|
tempOrder = this.ensureTempOrder();
|
|
3064
3220
|
hasChanges = false;
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3221
|
+
_iterator18 = _createForOfIteratorHelper(prefillItems);
|
|
3222
|
+
_context38.prev = 20;
|
|
3223
|
+
_iterator18.s();
|
|
3068
3224
|
case 22:
|
|
3069
|
-
if ((
|
|
3070
|
-
|
|
3225
|
+
if ((_step18 = _iterator18.n()).done) {
|
|
3226
|
+
_context38.next = 45;
|
|
3071
3227
|
break;
|
|
3072
3228
|
}
|
|
3073
|
-
prefillItem =
|
|
3229
|
+
prefillItem = _step18.value;
|
|
3074
3230
|
productId = Number(prefillItem.product_id);
|
|
3075
3231
|
productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
|
|
3076
3232
|
targetQuantity = toNonNegativeInt(prefillItem.quantity);
|
|
3077
3233
|
if (!(!Number.isFinite(productId) || targetQuantity <= 0)) {
|
|
3078
|
-
|
|
3234
|
+
_context38.next = 29;
|
|
3079
3235
|
break;
|
|
3080
3236
|
}
|
|
3081
|
-
return
|
|
3237
|
+
return _context38.abrupt("continue", 43);
|
|
3082
3238
|
case 29:
|
|
3083
3239
|
if (!Number.isNaN(productVariantId)) {
|
|
3084
|
-
|
|
3240
|
+
_context38.next = 31;
|
|
3085
3241
|
break;
|
|
3086
3242
|
}
|
|
3087
|
-
return
|
|
3243
|
+
return _context38.abrupt("continue", 43);
|
|
3088
3244
|
case 31:
|
|
3089
3245
|
sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
|
|
3090
3246
|
productIndex = getProductIdentityIndex(tempOrder.products, {
|
|
@@ -3092,7 +3248,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3092
3248
|
product_variant_id: productVariantId
|
|
3093
3249
|
});
|
|
3094
3250
|
if (!(productIndex === -1)) {
|
|
3095
|
-
|
|
3251
|
+
_context38.next = 38;
|
|
3096
3252
|
break;
|
|
3097
3253
|
}
|
|
3098
3254
|
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');
|
|
@@ -3112,7 +3268,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3112
3268
|
})
|
|
3113
3269
|
}));
|
|
3114
3270
|
hasChanges = true;
|
|
3115
|
-
return
|
|
3271
|
+
return _context38.abrupt("continue", 43);
|
|
3116
3272
|
case 38:
|
|
3117
3273
|
targetProduct = tempOrder.products[productIndex];
|
|
3118
3274
|
existedQuantity = toNonNegativeInt(targetProduct.num);
|
|
@@ -3131,34 +3287,34 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3131
3287
|
hasChanges = true;
|
|
3132
3288
|
}
|
|
3133
3289
|
case 43:
|
|
3134
|
-
|
|
3290
|
+
_context38.next = 22;
|
|
3135
3291
|
break;
|
|
3136
3292
|
case 45:
|
|
3137
|
-
|
|
3293
|
+
_context38.next = 50;
|
|
3138
3294
|
break;
|
|
3139
3295
|
case 47:
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3296
|
+
_context38.prev = 47;
|
|
3297
|
+
_context38.t0 = _context38["catch"](20);
|
|
3298
|
+
_iterator18.e(_context38.t0);
|
|
3143
3299
|
case 50:
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
return
|
|
3300
|
+
_context38.prev = 50;
|
|
3301
|
+
_iterator18.f();
|
|
3302
|
+
return _context38.finish(50);
|
|
3147
3303
|
case 53:
|
|
3148
3304
|
if (!hasChanges) {
|
|
3149
|
-
|
|
3305
|
+
_context38.next = 58;
|
|
3150
3306
|
break;
|
|
3151
3307
|
}
|
|
3152
3308
|
// Prefill 属于 products CRUD 的一种形式:新增后让 Rules 重算,以支持自动应用可用优惠券。
|
|
3153
3309
|
this.store.order.applyDiscount();
|
|
3154
|
-
|
|
3310
|
+
_context38.next = 57;
|
|
3155
3311
|
return this.store.order.recalculateSummary({
|
|
3156
3312
|
createIfMissing: true
|
|
3157
3313
|
});
|
|
3158
3314
|
case 57:
|
|
3159
3315
|
this.store.order.persistTempOrder();
|
|
3160
3316
|
case 58:
|
|
3161
|
-
|
|
3317
|
+
_context38.next = 60;
|
|
3162
3318
|
return this.refreshItemRuleQuantityLimits();
|
|
3163
3319
|
case 60:
|
|
3164
3320
|
this.itemRulePrefillApplied = true;
|
|
@@ -3168,9 +3324,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3168
3324
|
});
|
|
3169
3325
|
case 62:
|
|
3170
3326
|
case "end":
|
|
3171
|
-
return
|
|
3327
|
+
return _context38.stop();
|
|
3172
3328
|
}
|
|
3173
|
-
},
|
|
3329
|
+
}, _callee38, this, [[20, 47, 50, 53]]);
|
|
3174
3330
|
}));
|
|
3175
3331
|
function applyPrefillByItemRule() {
|
|
3176
3332
|
return _applyPrefillByItemRule.apply(this, arguments);
|
|
@@ -3180,24 +3336,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3180
3336
|
}, {
|
|
3181
3337
|
key: "applyItemRulePrefill",
|
|
3182
3338
|
value: function () {
|
|
3183
|
-
var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3184
|
-
return _regeneratorRuntime().wrap(function
|
|
3185
|
-
while (1) switch (
|
|
3339
|
+
var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
|
|
3340
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
3341
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
3186
3342
|
case 0:
|
|
3187
3343
|
this.logMethodStart('applyItemRulePrefill');
|
|
3188
|
-
|
|
3344
|
+
_context39.next = 3;
|
|
3189
3345
|
return this.applyPrefillByItemRule();
|
|
3190
3346
|
case 3:
|
|
3191
|
-
|
|
3347
|
+
_context39.next = 5;
|
|
3192
3348
|
return this.refreshItemRuleQuantityLimits();
|
|
3193
3349
|
case 5:
|
|
3194
|
-
|
|
3350
|
+
_context39.next = 7;
|
|
3195
3351
|
return this.refreshCartValidationPassed();
|
|
3196
3352
|
case 7:
|
|
3197
3353
|
case "end":
|
|
3198
|
-
return
|
|
3354
|
+
return _context39.stop();
|
|
3199
3355
|
}
|
|
3200
|
-
},
|
|
3356
|
+
}, _callee39, this);
|
|
3201
3357
|
}));
|
|
3202
3358
|
function applyItemRulePrefill() {
|
|
3203
3359
|
return _applyItemRulePrefill.apply(this, arguments);
|
|
@@ -3207,20 +3363,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3207
3363
|
}, {
|
|
3208
3364
|
key: "evaluateCartValidationByItemRule",
|
|
3209
3365
|
value: function () {
|
|
3210
|
-
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3366
|
+
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
|
|
3211
3367
|
var strategyConfigs, businessData;
|
|
3212
|
-
return _regeneratorRuntime().wrap(function
|
|
3213
|
-
while (1) switch (
|
|
3368
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3369
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
3214
3370
|
case 0:
|
|
3215
|
-
|
|
3371
|
+
_context40.next = 2;
|
|
3216
3372
|
return this.ensureItemRuleConfigsLoaded();
|
|
3217
3373
|
case 2:
|
|
3218
|
-
strategyConfigs =
|
|
3374
|
+
strategyConfigs = _context40.sent;
|
|
3219
3375
|
if (strategyConfigs.length) {
|
|
3220
|
-
|
|
3376
|
+
_context40.next = 5;
|
|
3221
3377
|
break;
|
|
3222
3378
|
}
|
|
3223
|
-
return
|
|
3379
|
+
return _context40.abrupt("return", {
|
|
3224
3380
|
passed: true,
|
|
3225
3381
|
failures: []
|
|
3226
3382
|
});
|
|
@@ -3230,12 +3386,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3230
3386
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
3231
3387
|
itemRuleConfigs: this.itemRuleConfigs
|
|
3232
3388
|
});
|
|
3233
|
-
return
|
|
3389
|
+
return _context40.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
|
|
3234
3390
|
case 7:
|
|
3235
3391
|
case "end":
|
|
3236
|
-
return
|
|
3392
|
+
return _context40.stop();
|
|
3237
3393
|
}
|
|
3238
|
-
},
|
|
3394
|
+
}, _callee40, this);
|
|
3239
3395
|
}));
|
|
3240
3396
|
function evaluateCartValidationByItemRule() {
|
|
3241
3397
|
return _evaluateCartValidationByItemRule.apply(this, arguments);
|
|
@@ -3245,20 +3401,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3245
3401
|
}, {
|
|
3246
3402
|
key: "validateBeforeSubmitByItemRule",
|
|
3247
3403
|
value: function () {
|
|
3248
|
-
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3404
|
+
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
|
|
3249
3405
|
var validationResult, firstFailure, errorMessage, error;
|
|
3250
|
-
return _regeneratorRuntime().wrap(function
|
|
3251
|
-
while (1) switch (
|
|
3406
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
3407
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
3252
3408
|
case 0:
|
|
3253
|
-
|
|
3409
|
+
_context41.next = 2;
|
|
3254
3410
|
return this.evaluateCartValidationByItemRule();
|
|
3255
3411
|
case 2:
|
|
3256
|
-
validationResult =
|
|
3412
|
+
validationResult = _context41.sent;
|
|
3257
3413
|
if (!validationResult.passed) {
|
|
3258
|
-
|
|
3414
|
+
_context41.next = 5;
|
|
3259
3415
|
break;
|
|
3260
3416
|
}
|
|
3261
|
-
return
|
|
3417
|
+
return _context41.abrupt("return");
|
|
3262
3418
|
case 5:
|
|
3263
3419
|
firstFailure = validationResult.failures[0];
|
|
3264
3420
|
errorMessage = (firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '当前购物车未满足商品规则,请调整后再提交';
|
|
@@ -3267,9 +3423,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3267
3423
|
throw error;
|
|
3268
3424
|
case 10:
|
|
3269
3425
|
case "end":
|
|
3270
|
-
return
|
|
3426
|
+
return _context41.stop();
|
|
3271
3427
|
}
|
|
3272
|
-
},
|
|
3428
|
+
}, _callee41, this);
|
|
3273
3429
|
}));
|
|
3274
3430
|
function validateBeforeSubmitByItemRule() {
|
|
3275
3431
|
return _validateBeforeSubmitByItemRule.apply(this, arguments);
|
|
@@ -3279,10 +3435,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3279
3435
|
}, {
|
|
3280
3436
|
key: "refreshCartValidationPassed",
|
|
3281
3437
|
value: function () {
|
|
3282
|
-
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3438
|
+
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
|
|
3283
3439
|
var previous, nextState, validationResult, changed;
|
|
3284
|
-
return _regeneratorRuntime().wrap(function
|
|
3285
|
-
while (1) switch (
|
|
3440
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
3441
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
3286
3442
|
case 0:
|
|
3287
3443
|
previous = this.store.cartValidation || {
|
|
3288
3444
|
passed: null,
|
|
@@ -3292,20 +3448,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3292
3448
|
passed: null,
|
|
3293
3449
|
failures: []
|
|
3294
3450
|
};
|
|
3295
|
-
|
|
3296
|
-
|
|
3451
|
+
_context42.prev = 2;
|
|
3452
|
+
_context42.next = 5;
|
|
3297
3453
|
return this.evaluateCartValidationByItemRule();
|
|
3298
3454
|
case 5:
|
|
3299
|
-
validationResult =
|
|
3455
|
+
validationResult = _context42.sent;
|
|
3300
3456
|
nextState = {
|
|
3301
3457
|
passed: validationResult.passed,
|
|
3302
3458
|
failures: validationResult.failures || []
|
|
3303
3459
|
};
|
|
3304
|
-
|
|
3460
|
+
_context42.next = 12;
|
|
3305
3461
|
break;
|
|
3306
3462
|
case 9:
|
|
3307
|
-
|
|
3308
|
-
|
|
3463
|
+
_context42.prev = 9;
|
|
3464
|
+
_context42.t0 = _context42["catch"](2);
|
|
3309
3465
|
nextState = {
|
|
3310
3466
|
passed: false,
|
|
3311
3467
|
failures: []
|
|
@@ -3314,21 +3470,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3314
3470
|
this.store.cartValidation = nextState;
|
|
3315
3471
|
changed = previous.passed !== nextState.passed || previous.failures !== nextState.failures;
|
|
3316
3472
|
if (!changed) {
|
|
3317
|
-
|
|
3473
|
+
_context42.next = 17;
|
|
3318
3474
|
break;
|
|
3319
3475
|
}
|
|
3320
|
-
|
|
3476
|
+
_context42.next = 17;
|
|
3321
3477
|
return this.core.effects.emit(VenueBookingHooks.onCartValidationChanged, {
|
|
3322
3478
|
cartValidation: nextState,
|
|
3323
3479
|
cartValidationPassed: nextState.passed
|
|
3324
3480
|
});
|
|
3325
3481
|
case 17:
|
|
3326
|
-
return
|
|
3482
|
+
return _context42.abrupt("return", nextState.passed);
|
|
3327
3483
|
case 18:
|
|
3328
3484
|
case "end":
|
|
3329
|
-
return
|
|
3485
|
+
return _context42.stop();
|
|
3330
3486
|
}
|
|
3331
|
-
},
|
|
3487
|
+
}, _callee42, this, [[2, 9]]);
|
|
3332
3488
|
}));
|
|
3333
3489
|
function refreshCartValidationPassed() {
|
|
3334
3490
|
return _refreshCartValidationPassed.apply(this, arguments);
|
|
@@ -3338,14 +3494,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3338
3494
|
}, {
|
|
3339
3495
|
key: "setItemRuleRuntimeConfig",
|
|
3340
3496
|
value: function () {
|
|
3341
|
-
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3497
|
+
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43() {
|
|
3342
3498
|
var _this$itemRuleRuntime, _this$itemRuleRuntime2;
|
|
3343
3499
|
var config,
|
|
3344
|
-
|
|
3345
|
-
return _regeneratorRuntime().wrap(function
|
|
3346
|
-
while (1) switch (
|
|
3500
|
+
_args43 = arguments;
|
|
3501
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3502
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
3347
3503
|
case 0:
|
|
3348
|
-
config =
|
|
3504
|
+
config = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
|
|
3349
3505
|
this.logMethodStart('setItemRuleRuntimeConfig');
|
|
3350
3506
|
this.itemRuleRuntimeConfig = _objectSpread(_objectSpread(_objectSpread({}, this.itemRuleRuntimeConfig), config), {}, {
|
|
3351
3507
|
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) || {}),
|
|
@@ -3357,10 +3513,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3357
3513
|
this.itemRuleEvaluator.setStrategyConfigs([]);
|
|
3358
3514
|
}
|
|
3359
3515
|
this.itemRulePrefillApplied = false;
|
|
3360
|
-
|
|
3516
|
+
_context43.next = 7;
|
|
3361
3517
|
return this.refreshItemRuleQuantityLimits();
|
|
3362
3518
|
case 7:
|
|
3363
|
-
|
|
3519
|
+
_context43.next = 9;
|
|
3364
3520
|
return this.refreshCartValidationPassed();
|
|
3365
3521
|
case 9:
|
|
3366
3522
|
this.logMethodSuccess('setItemRuleRuntimeConfig', {
|
|
@@ -3368,9 +3524,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3368
3524
|
});
|
|
3369
3525
|
case 10:
|
|
3370
3526
|
case "end":
|
|
3371
|
-
return
|
|
3527
|
+
return _context43.stop();
|
|
3372
3528
|
}
|
|
3373
|
-
},
|
|
3529
|
+
}, _callee43, this);
|
|
3374
3530
|
}));
|
|
3375
3531
|
function setItemRuleRuntimeConfig() {
|
|
3376
3532
|
return _setItemRuleRuntimeConfig.apply(this, arguments);
|
|
@@ -3397,23 +3553,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3397
3553
|
}, {
|
|
3398
3554
|
key: "readUIStateBucket",
|
|
3399
3555
|
value: function readUIStateBucket() {
|
|
3400
|
-
var _this$
|
|
3556
|
+
var _this$window2;
|
|
3401
3557
|
var key = this.getUIStateBucketKey();
|
|
3402
|
-
if (!key || !((_this$
|
|
3558
|
+
if (!key || !((_this$window2 = this.window) !== null && _this$window2 !== void 0 && _this$window2.sessionStorage)) return {};
|
|
3403
3559
|
try {
|
|
3404
3560
|
var raw = this.window.sessionStorage.getItem(key) || '{}';
|
|
3405
3561
|
var parsed = JSON.parse(raw);
|
|
3406
3562
|
return parsed && _typeof(parsed) === 'object' ? parsed : {};
|
|
3407
|
-
} catch (
|
|
3563
|
+
} catch (_unused4) {
|
|
3408
3564
|
return {};
|
|
3409
3565
|
}
|
|
3410
3566
|
}
|
|
3411
3567
|
}, {
|
|
3412
3568
|
key: "writeUIStateBucket",
|
|
3413
3569
|
value: function writeUIStateBucket(bucket) {
|
|
3414
|
-
var _this$
|
|
3570
|
+
var _this$window3;
|
|
3415
3571
|
var key = this.getUIStateBucketKey();
|
|
3416
|
-
if (!key || !((_this$
|
|
3572
|
+
if (!key || !((_this$window3 = this.window) !== null && _this$window3 !== void 0 && _this$window3.sessionStorage)) return;
|
|
3417
3573
|
this.window.sessionStorage.setItem(key, JSON.stringify(bucket));
|
|
3418
3574
|
}
|
|
3419
3575
|
}, {
|
|
@@ -3444,40 +3600,114 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3444
3600
|
}, {
|
|
3445
3601
|
key: "setBookingHolder",
|
|
3446
3602
|
value: function setBookingHolder(bookingUid, holder) {
|
|
3447
|
-
var
|
|
3448
|
-
|
|
3449
|
-
var
|
|
3603
|
+
var _tempOrder$bookings4;
|
|
3604
|
+
if (!this.store.order) return;
|
|
3605
|
+
var tempOrder = this.store.order.ensureTempOrder();
|
|
3606
|
+
var booking = (_tempOrder$bookings4 = tempOrder.bookings) === null || _tempOrder$bookings4 === void 0 ? void 0 : _tempOrder$bookings4.find(function (b) {
|
|
3450
3607
|
var _b$metadata4;
|
|
3451
3608
|
return ((_b$metadata4 = b.metadata) === null || _b$metadata4 === void 0 ? void 0 : _b$metadata4.unique_identification_number) === bookingUid;
|
|
3452
3609
|
});
|
|
3453
3610
|
if (booking) {
|
|
3454
3611
|
booking.holder = holder;
|
|
3455
3612
|
}
|
|
3613
|
+
var _iterator19 = _createForOfIteratorHelper(tempOrder.products),
|
|
3614
|
+
_step19;
|
|
3615
|
+
try {
|
|
3616
|
+
for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
|
|
3617
|
+
var _product$metadata$boo, _product$metadata8, _product$_origin2;
|
|
3618
|
+
var product = _step19.value;
|
|
3619
|
+
var productBookingUid = (_product$metadata$boo = (_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.booking_uid) !== null && _product$metadata$boo !== void 0 ? _product$metadata$boo : (_product$_origin2 = product._origin) === null || _product$_origin2 === void 0 || (_product$_origin2 = _product$_origin2.product) === null || _product$_origin2 === void 0 ? void 0 : _product$_origin2.bookingUuid;
|
|
3620
|
+
if (String(productBookingUid) !== String(bookingUid)) continue;
|
|
3621
|
+
var origin = product._origin && _typeof(product._origin) === 'object' ? product._origin : {};
|
|
3622
|
+
origin.holder = holder;
|
|
3623
|
+
product._origin = origin;
|
|
3624
|
+
}
|
|
3625
|
+
} catch (err) {
|
|
3626
|
+
_iterator19.e(err);
|
|
3627
|
+
} finally {
|
|
3628
|
+
_iterator19.f();
|
|
3629
|
+
}
|
|
3630
|
+
this.store.order.notifyTempOrderChanged();
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
/**
|
|
3634
|
+
* 获取 holder 表单 map
|
|
3635
|
+
*/
|
|
3636
|
+
}, {
|
|
3637
|
+
key: "getHolderFormMap",
|
|
3638
|
+
value: function getHolderFormMap() {
|
|
3639
|
+
if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
|
|
3640
|
+
return this.store.holder.getHolderFormMap();
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
/**
|
|
3644
|
+
* UI 层触发:按当前 holderMap 批量刷新所有表单的 records
|
|
3645
|
+
*/
|
|
3646
|
+
}, {
|
|
3647
|
+
key: "refreshAllHolderFormRecords",
|
|
3648
|
+
value: (function () {
|
|
3649
|
+
var _refreshAllHolderFormRecords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
|
|
3650
|
+
var _params$customer_id, _params$useCache;
|
|
3651
|
+
var customer_id;
|
|
3652
|
+
return _regeneratorRuntime().wrap(function _callee44$(_context44) {
|
|
3653
|
+
while (1) switch (_context44.prev = _context44.next) {
|
|
3654
|
+
case 0:
|
|
3655
|
+
if (this.store.holder) {
|
|
3656
|
+
_context44.next = 2;
|
|
3657
|
+
break;
|
|
3658
|
+
}
|
|
3659
|
+
throw new Error('[VenueBooking] holder 模块未初始化');
|
|
3660
|
+
case 2:
|
|
3661
|
+
customer_id = (_params$customer_id = params === null || params === void 0 ? void 0 : params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.resolveHolderCustomerId();
|
|
3662
|
+
return _context44.abrupt("return", this.store.holder.refreshAllFormRecords(_objectSpread(_objectSpread({}, params), {}, {
|
|
3663
|
+
customer_id: customer_id,
|
|
3664
|
+
useCache: (_params$useCache = params === null || params === void 0 ? void 0 : params.useCache) !== null && _params$useCache !== void 0 ? _params$useCache : false
|
|
3665
|
+
})));
|
|
3666
|
+
case 4:
|
|
3667
|
+
case "end":
|
|
3668
|
+
return _context44.stop();
|
|
3669
|
+
}
|
|
3670
|
+
}, _callee44, this);
|
|
3671
|
+
}));
|
|
3672
|
+
function refreshAllHolderFormRecords(_x22) {
|
|
3673
|
+
return _refreshAllHolderFormRecords.apply(this, arguments);
|
|
3674
|
+
}
|
|
3675
|
+
return refreshAllHolderFormRecords;
|
|
3676
|
+
}()
|
|
3677
|
+
/**
|
|
3678
|
+
* 添加表单记录
|
|
3679
|
+
*/
|
|
3680
|
+
)
|
|
3681
|
+
}, {
|
|
3682
|
+
key: "appendFormRecord",
|
|
3683
|
+
value: function appendFormRecord(params) {
|
|
3684
|
+
if (!this.store.holder) throw new Error('[VenueBooking] holder 模块未初始化');
|
|
3685
|
+
return this.store.holder.appendFormRecord(params);
|
|
3456
3686
|
}
|
|
3457
3687
|
|
|
3458
3688
|
// ─── OpenData 可用性 ───
|
|
3459
3689
|
}, {
|
|
3460
3690
|
key: "checkOpenDataAvailability",
|
|
3461
3691
|
value: function () {
|
|
3462
|
-
var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3463
|
-
return _regeneratorRuntime().wrap(function
|
|
3464
|
-
while (1) switch (
|
|
3692
|
+
var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
|
|
3693
|
+
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
3694
|
+
while (1) switch (_context45.prev = _context45.next) {
|
|
3465
3695
|
case 0:
|
|
3466
3696
|
if (this.store.openData) {
|
|
3467
|
-
|
|
3697
|
+
_context45.next = 2;
|
|
3468
3698
|
break;
|
|
3469
3699
|
}
|
|
3470
3700
|
throw new Error('openData 模块未初始化');
|
|
3471
3701
|
case 2:
|
|
3472
|
-
|
|
3702
|
+
_context45.next = 4;
|
|
3473
3703
|
return this.loadOpenDataConfig();
|
|
3474
3704
|
case 4:
|
|
3475
|
-
return
|
|
3705
|
+
return _context45.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
|
|
3476
3706
|
case 5:
|
|
3477
3707
|
case "end":
|
|
3478
|
-
return
|
|
3708
|
+
return _context45.stop();
|
|
3479
3709
|
}
|
|
3480
|
-
},
|
|
3710
|
+
}, _callee45, this);
|
|
3481
3711
|
}));
|
|
3482
3712
|
function checkOpenDataAvailability() {
|
|
3483
3713
|
return _checkOpenDataAvailability.apply(this, arguments);
|
|
@@ -3487,15 +3717,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3487
3717
|
}, {
|
|
3488
3718
|
key: "setOtherParams",
|
|
3489
3719
|
value: function () {
|
|
3490
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3720
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(params) {
|
|
3491
3721
|
var _ref5,
|
|
3492
3722
|
_ref5$cover,
|
|
3493
3723
|
cover,
|
|
3494
|
-
|
|
3495
|
-
return _regeneratorRuntime().wrap(function
|
|
3496
|
-
while (1) switch (
|
|
3724
|
+
_args46 = arguments;
|
|
3725
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context46) {
|
|
3726
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
3497
3727
|
case 0:
|
|
3498
|
-
_ref5 =
|
|
3728
|
+
_ref5 = _args46.length > 1 && _args46[1] !== undefined ? _args46[1] : {}, _ref5$cover = _ref5.cover, cover = _ref5$cover === void 0 ? false : _ref5$cover;
|
|
3499
3729
|
if (cover) {
|
|
3500
3730
|
this.otherParams = params;
|
|
3501
3731
|
} else {
|
|
@@ -3503,11 +3733,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3503
3733
|
}
|
|
3504
3734
|
case 2:
|
|
3505
3735
|
case "end":
|
|
3506
|
-
return
|
|
3736
|
+
return _context46.stop();
|
|
3507
3737
|
}
|
|
3508
|
-
},
|
|
3738
|
+
}, _callee46, this);
|
|
3509
3739
|
}));
|
|
3510
|
-
function setOtherParams(
|
|
3740
|
+
function setOtherParams(_x23) {
|
|
3511
3741
|
return _setOtherParams.apply(this, arguments);
|
|
3512
3742
|
}
|
|
3513
3743
|
return setOtherParams;
|