@pisell/pisellos 3.0.92 → 3.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/Discount/types.d.ts +2 -0
- 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 +2 -1
- 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/types.d.ts +7 -0
- package/dist/modules/Rules/index.js +13 -0
- package/dist/modules/Summary/utils.js +42 -21
- 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 +24 -0
- package/dist/solution/VenueBooking/index.js +1010 -733
- package/dist/solution/VenueBooking/types.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/modules/Discount/types.d.ts +2 -0
- 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 +2 -1
- 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/types.d.ts +7 -0
- package/lib/modules/Rules/index.js +8 -0
- package/lib/modules/Summary/utils.js +23 -3
- 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 +24 -0
- package/lib/solution/VenueBooking/index.js +152 -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,68 +2494,115 @@ 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);
|
|
2385
2541
|
}
|
|
2386
2542
|
return submitOrder;
|
|
2387
2543
|
}()
|
|
2544
|
+
/**
|
|
2545
|
+
* 0 元订单免费领取(非定金场景)
|
|
2546
|
+
* 与 appointment getFreeProduct 同接口:POST /pay/order/free-pay/:id
|
|
2547
|
+
*/
|
|
2548
|
+
}, {
|
|
2549
|
+
key: "submitFreeOrder",
|
|
2550
|
+
value: (function () {
|
|
2551
|
+
var _submitFreeOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(id) {
|
|
2552
|
+
var res;
|
|
2553
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2554
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2555
|
+
case 0:
|
|
2556
|
+
this.logMethodStart('submitFreeOrder', {
|
|
2557
|
+
id: id
|
|
2558
|
+
});
|
|
2559
|
+
_context26.prev = 1;
|
|
2560
|
+
if (id) {
|
|
2561
|
+
_context26.next = 4;
|
|
2562
|
+
break;
|
|
2563
|
+
}
|
|
2564
|
+
throw new Error('订单 ID 不能为空');
|
|
2565
|
+
case 4:
|
|
2566
|
+
_context26.next = 6;
|
|
2567
|
+
return this.request.post("/pay/order/free-pay/".concat(id));
|
|
2568
|
+
case 6:
|
|
2569
|
+
res = _context26.sent;
|
|
2570
|
+
this.logMethodSuccess('submitFreeOrder', {
|
|
2571
|
+
id: id,
|
|
2572
|
+
status: res === null || res === void 0 ? void 0 : res.status
|
|
2573
|
+
});
|
|
2574
|
+
return _context26.abrupt("return", res);
|
|
2575
|
+
case 11:
|
|
2576
|
+
_context26.prev = 11;
|
|
2577
|
+
_context26.t0 = _context26["catch"](1);
|
|
2578
|
+
this.logMethodError('submitFreeOrder', _context26.t0);
|
|
2579
|
+
throw _context26.t0;
|
|
2580
|
+
case 15:
|
|
2581
|
+
case "end":
|
|
2582
|
+
return _context26.stop();
|
|
2583
|
+
}
|
|
2584
|
+
}, _callee26, this, [[1, 11]]);
|
|
2585
|
+
}));
|
|
2586
|
+
function submitFreeOrder(_x17) {
|
|
2587
|
+
return _submitFreeOrder.apply(this, arguments);
|
|
2588
|
+
}
|
|
2589
|
+
return submitFreeOrder;
|
|
2590
|
+
}())
|
|
2388
2591
|
}, {
|
|
2389
2592
|
key: "addProductToOrder",
|
|
2390
2593
|
value: function () {
|
|
2391
|
-
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2594
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(product) {
|
|
2392
2595
|
var _product$metadata5, _product$product_vari2, quotationPrice, products;
|
|
2393
|
-
return _regeneratorRuntime().wrap(function
|
|
2394
|
-
while (1) switch (
|
|
2596
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2597
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2395
2598
|
case 0:
|
|
2396
2599
|
this.logMethodStart('addProductToOrder', {
|
|
2397
2600
|
product_id: product.product_id,
|
|
2398
2601
|
product_variant_id: product.product_variant_id
|
|
2399
2602
|
});
|
|
2400
|
-
|
|
2603
|
+
_context27.prev = 1;
|
|
2401
2604
|
if (this.store.order) {
|
|
2402
|
-
|
|
2605
|
+
_context27.next = 4;
|
|
2403
2606
|
break;
|
|
2404
2607
|
}
|
|
2405
2608
|
throw new Error('order 模块未初始化');
|
|
@@ -2417,32 +2620,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2417
2620
|
product.original_price = product.selling_price;
|
|
2418
2621
|
}
|
|
2419
2622
|
}
|
|
2420
|
-
|
|
2623
|
+
_context27.next = 7;
|
|
2421
2624
|
return this.store.order.addProductToOrder(product);
|
|
2422
2625
|
case 7:
|
|
2423
|
-
products =
|
|
2424
|
-
|
|
2626
|
+
products = _context27.sent;
|
|
2627
|
+
_context27.next = 10;
|
|
2425
2628
|
return this.refreshItemRuleQuantityLimits();
|
|
2426
2629
|
case 10:
|
|
2427
|
-
|
|
2630
|
+
_context27.next = 12;
|
|
2428
2631
|
return this.refreshCartValidationPassed();
|
|
2429
2632
|
case 12:
|
|
2430
2633
|
this.logMethodSuccess('addProductToOrder', {
|
|
2431
2634
|
productCount: products.length
|
|
2432
2635
|
});
|
|
2433
|
-
return
|
|
2636
|
+
return _context27.abrupt("return", products);
|
|
2434
2637
|
case 16:
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
this.logMethodError('addProductToOrder',
|
|
2438
|
-
throw
|
|
2638
|
+
_context27.prev = 16;
|
|
2639
|
+
_context27.t0 = _context27["catch"](1);
|
|
2640
|
+
this.logMethodError('addProductToOrder', _context27.t0);
|
|
2641
|
+
throw _context27.t0;
|
|
2439
2642
|
case 20:
|
|
2440
2643
|
case "end":
|
|
2441
|
-
return
|
|
2644
|
+
return _context27.stop();
|
|
2442
2645
|
}
|
|
2443
|
-
},
|
|
2646
|
+
}, _callee27, this, [[1, 16]]);
|
|
2444
2647
|
}));
|
|
2445
|
-
function addProductToOrder(
|
|
2648
|
+
function addProductToOrder(_x18) {
|
|
2446
2649
|
return _addProductToOrder.apply(this, arguments);
|
|
2447
2650
|
}
|
|
2448
2651
|
return addProductToOrder;
|
|
@@ -2450,48 +2653,48 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2450
2653
|
}, {
|
|
2451
2654
|
key: "updateProductInOrder",
|
|
2452
2655
|
value: function () {
|
|
2453
|
-
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2656
|
+
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
2454
2657
|
var products;
|
|
2455
|
-
return _regeneratorRuntime().wrap(function
|
|
2456
|
-
while (1) switch (
|
|
2658
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2659
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2457
2660
|
case 0:
|
|
2458
2661
|
this.logMethodStart('updateProductInOrder', {
|
|
2459
2662
|
product_id: params.product_id,
|
|
2460
2663
|
product_variant_id: params.product_variant_id
|
|
2461
2664
|
});
|
|
2462
|
-
|
|
2665
|
+
_context28.prev = 1;
|
|
2463
2666
|
if (this.store.order) {
|
|
2464
|
-
|
|
2667
|
+
_context28.next = 4;
|
|
2465
2668
|
break;
|
|
2466
2669
|
}
|
|
2467
2670
|
throw new Error('order 模块未初始化');
|
|
2468
2671
|
case 4:
|
|
2469
|
-
|
|
2672
|
+
_context28.next = 6;
|
|
2470
2673
|
return this.store.order.updateProductInOrder(params);
|
|
2471
2674
|
case 6:
|
|
2472
|
-
products =
|
|
2473
|
-
|
|
2675
|
+
products = _context28.sent;
|
|
2676
|
+
_context28.next = 9;
|
|
2474
2677
|
return this.refreshItemRuleQuantityLimits();
|
|
2475
2678
|
case 9:
|
|
2476
|
-
|
|
2679
|
+
_context28.next = 11;
|
|
2477
2680
|
return this.refreshCartValidationPassed();
|
|
2478
2681
|
case 11:
|
|
2479
2682
|
this.logMethodSuccess('updateProductInOrder', {
|
|
2480
2683
|
productCount: products.length
|
|
2481
2684
|
});
|
|
2482
|
-
return
|
|
2685
|
+
return _context28.abrupt("return", products);
|
|
2483
2686
|
case 15:
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
this.logMethodError('updateProductInOrder',
|
|
2487
|
-
throw
|
|
2687
|
+
_context28.prev = 15;
|
|
2688
|
+
_context28.t0 = _context28["catch"](1);
|
|
2689
|
+
this.logMethodError('updateProductInOrder', _context28.t0);
|
|
2690
|
+
throw _context28.t0;
|
|
2488
2691
|
case 19:
|
|
2489
2692
|
case "end":
|
|
2490
|
-
return
|
|
2693
|
+
return _context28.stop();
|
|
2491
2694
|
}
|
|
2492
|
-
},
|
|
2695
|
+
}, _callee28, this, [[1, 15]]);
|
|
2493
2696
|
}));
|
|
2494
|
-
function updateProductInOrder(
|
|
2697
|
+
function updateProductInOrder(_x19) {
|
|
2495
2698
|
return _updateProductInOrder.apply(this, arguments);
|
|
2496
2699
|
}
|
|
2497
2700
|
return updateProductInOrder;
|
|
@@ -2499,66 +2702,66 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2499
2702
|
}, {
|
|
2500
2703
|
key: "removeProductFromOrder",
|
|
2501
2704
|
value: function () {
|
|
2502
|
-
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2503
|
-
var _this$store$order$get3, _this$store$
|
|
2504
|
-
return _regeneratorRuntime().wrap(function
|
|
2505
|
-
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) {
|
|
2506
2709
|
case 0:
|
|
2507
2710
|
this.logMethodStart('removeProductFromOrder', {
|
|
2508
2711
|
product_id: identity.product_id,
|
|
2509
2712
|
product_variant_id: identity.product_variant_id
|
|
2510
2713
|
});
|
|
2511
|
-
|
|
2714
|
+
_context29.prev = 1;
|
|
2512
2715
|
if (this.store.order) {
|
|
2513
|
-
|
|
2716
|
+
_context29.next = 4;
|
|
2514
2717
|
break;
|
|
2515
2718
|
}
|
|
2516
2719
|
throw new Error('order 模块未初始化');
|
|
2517
2720
|
case 4:
|
|
2518
|
-
tempOrder = ((_this$store$order$get3 = (_this$store$
|
|
2519
|
-
|
|
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;
|
|
2520
2723
|
return this.store.order.removeProductFromOrder(identity);
|
|
2521
2724
|
case 7:
|
|
2522
|
-
products =
|
|
2725
|
+
products = _context29.sent;
|
|
2523
2726
|
if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
|
|
2524
|
-
|
|
2727
|
+
_context29.next = 33;
|
|
2525
2728
|
break;
|
|
2526
2729
|
}
|
|
2527
2730
|
venueProductUids = new Set();
|
|
2528
2731
|
venueBookingUids = new Set();
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2732
|
+
_iterator16 = _createForOfIteratorHelper(tempOrder.products || []);
|
|
2733
|
+
_context29.prev = 12;
|
|
2734
|
+
_iterator16.s();
|
|
2532
2735
|
case 14:
|
|
2533
|
-
if ((
|
|
2534
|
-
|
|
2736
|
+
if ((_step16 = _iterator16.n()).done) {
|
|
2737
|
+
_context29.next = 22;
|
|
2535
2738
|
break;
|
|
2536
2739
|
}
|
|
2537
|
-
product =
|
|
2740
|
+
product = _step16.value;
|
|
2538
2741
|
if (product !== null && product !== void 0 && (_product$metadata6 = product.metadata) !== null && _product$metadata6 !== void 0 && _product$metadata6.venue_booking) {
|
|
2539
|
-
|
|
2742
|
+
_context29.next = 18;
|
|
2540
2743
|
break;
|
|
2541
2744
|
}
|
|
2542
|
-
return
|
|
2745
|
+
return _context29.abrupt("continue", 20);
|
|
2543
2746
|
case 18:
|
|
2544
2747
|
if (product.identity_key) venueProductUids.add(String(product.identity_key));
|
|
2545
2748
|
if ((_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.booking_uid) {
|
|
2546
2749
|
venueBookingUids.add(String(product.metadata.booking_uid));
|
|
2547
2750
|
}
|
|
2548
2751
|
case 20:
|
|
2549
|
-
|
|
2752
|
+
_context29.next = 14;
|
|
2550
2753
|
break;
|
|
2551
2754
|
case 22:
|
|
2552
|
-
|
|
2755
|
+
_context29.next = 27;
|
|
2553
2756
|
break;
|
|
2554
2757
|
case 24:
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2758
|
+
_context29.prev = 24;
|
|
2759
|
+
_context29.t0 = _context29["catch"](12);
|
|
2760
|
+
_iterator16.e(_context29.t0);
|
|
2558
2761
|
case 27:
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
return
|
|
2762
|
+
_context29.prev = 27;
|
|
2763
|
+
_iterator16.f();
|
|
2764
|
+
return _context29.finish(27);
|
|
2562
2765
|
case 30:
|
|
2563
2766
|
beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
|
|
2564
2767
|
tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
|
|
@@ -2572,31 +2775,31 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2572
2775
|
return true;
|
|
2573
2776
|
});
|
|
2574
2777
|
if ((((_tempOrder$bookings3 = tempOrder.bookings) === null || _tempOrder$bookings3 === void 0 ? void 0 : _tempOrder$bookings3.length) || 0) !== beforeBookingCount) {
|
|
2575
|
-
(_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);
|
|
2576
2779
|
}
|
|
2577
2780
|
case 33:
|
|
2578
|
-
|
|
2781
|
+
_context29.next = 35;
|
|
2579
2782
|
return this.refreshItemRuleQuantityLimits();
|
|
2580
2783
|
case 35:
|
|
2581
|
-
|
|
2784
|
+
_context29.next = 37;
|
|
2582
2785
|
return this.refreshCartValidationPassed();
|
|
2583
2786
|
case 37:
|
|
2584
2787
|
this.logMethodSuccess('removeProductFromOrder', {
|
|
2585
2788
|
productCount: products.length
|
|
2586
2789
|
});
|
|
2587
|
-
return
|
|
2790
|
+
return _context29.abrupt("return", products);
|
|
2588
2791
|
case 41:
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
this.logMethodError('removeProductFromOrder',
|
|
2592
|
-
throw
|
|
2792
|
+
_context29.prev = 41;
|
|
2793
|
+
_context29.t1 = _context29["catch"](1);
|
|
2794
|
+
this.logMethodError('removeProductFromOrder', _context29.t1);
|
|
2795
|
+
throw _context29.t1;
|
|
2593
2796
|
case 45:
|
|
2594
2797
|
case "end":
|
|
2595
|
-
return
|
|
2798
|
+
return _context29.stop();
|
|
2596
2799
|
}
|
|
2597
|
-
},
|
|
2800
|
+
}, _callee29, this, [[1, 41], [12, 24, 27, 30]]);
|
|
2598
2801
|
}));
|
|
2599
|
-
function removeProductFromOrder(
|
|
2802
|
+
function removeProductFromOrder(_x20) {
|
|
2600
2803
|
return _removeProductFromOrder.apply(this, arguments);
|
|
2601
2804
|
}
|
|
2602
2805
|
return removeProductFromOrder;
|
|
@@ -2604,27 +2807,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2604
2807
|
}, {
|
|
2605
2808
|
key: "getProductList",
|
|
2606
2809
|
value: function () {
|
|
2607
|
-
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2810
|
+
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2608
2811
|
var result;
|
|
2609
|
-
return _regeneratorRuntime().wrap(function
|
|
2610
|
-
while (1) switch (
|
|
2812
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2813
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2611
2814
|
case 0:
|
|
2612
2815
|
if (!this.productsLoaded) {
|
|
2613
|
-
|
|
2816
|
+
_context30.next = 2;
|
|
2614
2817
|
break;
|
|
2615
2818
|
}
|
|
2616
|
-
return
|
|
2819
|
+
return _context30.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
|
|
2617
2820
|
case 2:
|
|
2618
|
-
|
|
2821
|
+
_context30.next = 4;
|
|
2619
2822
|
return this.loadAllProducts();
|
|
2620
2823
|
case 4:
|
|
2621
|
-
result =
|
|
2622
|
-
return
|
|
2824
|
+
result = _context30.sent;
|
|
2825
|
+
return _context30.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
|
|
2623
2826
|
case 6:
|
|
2624
2827
|
case "end":
|
|
2625
|
-
return
|
|
2828
|
+
return _context30.stop();
|
|
2626
2829
|
}
|
|
2627
|
-
},
|
|
2830
|
+
}, _callee30, this);
|
|
2628
2831
|
}));
|
|
2629
2832
|
function getProductList() {
|
|
2630
2833
|
return _getProductList.apply(this, arguments);
|
|
@@ -2634,13 +2837,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2634
2837
|
}, {
|
|
2635
2838
|
key: "loadOpenDataConfig",
|
|
2636
2839
|
value: function () {
|
|
2637
|
-
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2840
|
+
var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
2638
2841
|
var lastFetchedAt, cachedData, openDataConfig;
|
|
2639
|
-
return _regeneratorRuntime().wrap(function
|
|
2640
|
-
while (1) switch (
|
|
2842
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2843
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2641
2844
|
case 0:
|
|
2642
2845
|
if (this.store.openData) {
|
|
2643
|
-
|
|
2846
|
+
_context31.next = 2;
|
|
2644
2847
|
break;
|
|
2645
2848
|
}
|
|
2646
2849
|
throw new Error('openData 模块未初始化');
|
|
@@ -2648,42 +2851,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2648
2851
|
lastFetchedAt = this.store.openData.getLastFetchedAt();
|
|
2649
2852
|
cachedData = this.store.openData.getOpenData();
|
|
2650
2853
|
if (!(cachedData && lastFetchedAt && Date.now() - lastFetchedAt < VenueBookingImpl.OPEN_DATA_CACHE_TTL)) {
|
|
2651
|
-
|
|
2854
|
+
_context31.next = 7;
|
|
2652
2855
|
break;
|
|
2653
2856
|
}
|
|
2654
2857
|
this.otherParams.openData = cachedData;
|
|
2655
|
-
return
|
|
2858
|
+
return _context31.abrupt("return", cachedData);
|
|
2656
2859
|
case 7:
|
|
2657
2860
|
if (!this.loadOpenDataConfigInFlight) {
|
|
2658
|
-
|
|
2861
|
+
_context31.next = 11;
|
|
2659
2862
|
break;
|
|
2660
2863
|
}
|
|
2661
|
-
|
|
2864
|
+
_context31.next = 10;
|
|
2662
2865
|
return this.loadOpenDataConfigInFlight;
|
|
2663
2866
|
case 10:
|
|
2664
|
-
return
|
|
2867
|
+
return _context31.abrupt("return", _context31.sent);
|
|
2665
2868
|
case 11:
|
|
2666
2869
|
this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
|
|
2667
2870
|
scope: 'board',
|
|
2668
2871
|
target: 'venue_booking+online_store',
|
|
2669
2872
|
section_code: [].concat(OPEN_DATA_SECTION_CODES)
|
|
2670
2873
|
});
|
|
2671
|
-
|
|
2672
|
-
|
|
2874
|
+
_context31.prev = 12;
|
|
2875
|
+
_context31.next = 15;
|
|
2673
2876
|
return this.loadOpenDataConfigInFlight;
|
|
2674
2877
|
case 15:
|
|
2675
|
-
openDataConfig =
|
|
2878
|
+
openDataConfig = _context31.sent;
|
|
2676
2879
|
this.otherParams.openData = openDataConfig;
|
|
2677
|
-
return
|
|
2880
|
+
return _context31.abrupt("return", openDataConfig);
|
|
2678
2881
|
case 18:
|
|
2679
|
-
|
|
2882
|
+
_context31.prev = 18;
|
|
2680
2883
|
this.loadOpenDataConfigInFlight = null;
|
|
2681
|
-
return
|
|
2884
|
+
return _context31.finish(18);
|
|
2682
2885
|
case 21:
|
|
2683
2886
|
case "end":
|
|
2684
|
-
return
|
|
2887
|
+
return _context31.stop();
|
|
2685
2888
|
}
|
|
2686
|
-
},
|
|
2889
|
+
}, _callee31, this, [[12,, 18, 21]]);
|
|
2687
2890
|
}));
|
|
2688
2891
|
function loadOpenDataConfig() {
|
|
2689
2892
|
return _loadOpenDataConfig.apply(this, arguments);
|
|
@@ -2693,29 +2896,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2693
2896
|
}, {
|
|
2694
2897
|
key: "loadRuntimeConfigs",
|
|
2695
2898
|
value: function () {
|
|
2696
|
-
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2899
|
+
var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
|
|
2697
2900
|
var itemRuleConfigs;
|
|
2698
|
-
return _regeneratorRuntime().wrap(function
|
|
2699
|
-
while (1) switch (
|
|
2901
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2902
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2700
2903
|
case 0:
|
|
2701
|
-
|
|
2904
|
+
_context32.next = 2;
|
|
2702
2905
|
return this.loadOpenDataConfig();
|
|
2703
2906
|
case 2:
|
|
2704
|
-
|
|
2907
|
+
_context32.next = 4;
|
|
2705
2908
|
return this.ensureItemRuleConfigsLoaded();
|
|
2706
2909
|
case 4:
|
|
2707
|
-
itemRuleConfigs =
|
|
2910
|
+
itemRuleConfigs = _context32.sent;
|
|
2708
2911
|
this.logMethodSuccess('loadRuntimeConfigs', {
|
|
2709
2912
|
itemRuleCount: itemRuleConfigs.length
|
|
2710
2913
|
});
|
|
2711
|
-
return
|
|
2914
|
+
return _context32.abrupt("return", {
|
|
2712
2915
|
itemRuleConfigs: itemRuleConfigs
|
|
2713
2916
|
});
|
|
2714
2917
|
case 7:
|
|
2715
2918
|
case "end":
|
|
2716
|
-
return
|
|
2919
|
+
return _context32.stop();
|
|
2717
2920
|
}
|
|
2718
|
-
},
|
|
2921
|
+
}, _callee32, this);
|
|
2719
2922
|
}));
|
|
2720
2923
|
function loadRuntimeConfigs() {
|
|
2721
2924
|
return _loadRuntimeConfigs.apply(this, arguments);
|
|
@@ -2725,22 +2928,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2725
2928
|
}, {
|
|
2726
2929
|
key: "fetchItemRuleConfigsByModelIds",
|
|
2727
2930
|
value: function () {
|
|
2728
|
-
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2931
|
+
var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(strategyModelIds) {
|
|
2729
2932
|
var result, configs;
|
|
2730
|
-
return _regeneratorRuntime().wrap(function
|
|
2731
|
-
while (1) switch (
|
|
2933
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2934
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2732
2935
|
case 0:
|
|
2733
2936
|
this.logMethodStart('fetchItemRuleConfigsByModelIds', {
|
|
2734
2937
|
strategyModelIds: strategyModelIds
|
|
2735
2938
|
});
|
|
2736
2939
|
if (strategyModelIds.length) {
|
|
2737
|
-
|
|
2940
|
+
_context33.next = 3;
|
|
2738
2941
|
break;
|
|
2739
2942
|
}
|
|
2740
|
-
return
|
|
2943
|
+
return _context33.abrupt("return", []);
|
|
2741
2944
|
case 3:
|
|
2742
|
-
|
|
2743
|
-
|
|
2945
|
+
_context33.prev = 3;
|
|
2946
|
+
_context33.next = 6;
|
|
2744
2947
|
return this.request.get('/promotion', {
|
|
2745
2948
|
skip: 1,
|
|
2746
2949
|
num: 99,
|
|
@@ -2748,7 +2951,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2748
2951
|
ids: strategyModelIds
|
|
2749
2952
|
});
|
|
2750
2953
|
case 6:
|
|
2751
|
-
result =
|
|
2954
|
+
result = _context33.sent;
|
|
2752
2955
|
configs = [];
|
|
2753
2956
|
if (result.code === 200) {
|
|
2754
2957
|
configs = result.data.list.map(function (item) {
|
|
@@ -2759,21 +2962,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2759
2962
|
strategyModelIds: strategyModelIds,
|
|
2760
2963
|
strategyCount: configs.length
|
|
2761
2964
|
});
|
|
2762
|
-
return
|
|
2965
|
+
return _context33.abrupt("return", configs);
|
|
2763
2966
|
case 13:
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
this.logMethodError('fetchItemRuleConfigsByModelIds',
|
|
2967
|
+
_context33.prev = 13;
|
|
2968
|
+
_context33.t0 = _context33["catch"](3);
|
|
2969
|
+
this.logMethodError('fetchItemRuleConfigsByModelIds', _context33.t0, {
|
|
2767
2970
|
strategyModelIds: strategyModelIds
|
|
2768
2971
|
});
|
|
2769
|
-
return
|
|
2972
|
+
return _context33.abrupt("return", []);
|
|
2770
2973
|
case 17:
|
|
2771
2974
|
case "end":
|
|
2772
|
-
return
|
|
2975
|
+
return _context33.stop();
|
|
2773
2976
|
}
|
|
2774
|
-
},
|
|
2977
|
+
}, _callee33, this, [[3, 13]]);
|
|
2775
2978
|
}));
|
|
2776
|
-
function fetchItemRuleConfigsByModelIds(
|
|
2979
|
+
function fetchItemRuleConfigsByModelIds(_x21) {
|
|
2777
2980
|
return _fetchItemRuleConfigsByModelIds.apply(this, arguments);
|
|
2778
2981
|
}
|
|
2779
2982
|
return fetchItemRuleConfigsByModelIds;
|
|
@@ -2781,22 +2984,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2781
2984
|
}, {
|
|
2782
2985
|
key: "buildPrefillProductSourceMap",
|
|
2783
2986
|
value: function () {
|
|
2784
|
-
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2987
|
+
var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
|
|
2785
2988
|
var sourceMap, productList, visited, collectFromValue;
|
|
2786
|
-
return _regeneratorRuntime().wrap(function
|
|
2787
|
-
while (1) switch (
|
|
2989
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2990
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2788
2991
|
case 0:
|
|
2789
2992
|
sourceMap = new Map();
|
|
2790
|
-
|
|
2791
|
-
|
|
2993
|
+
_context34.prev = 1;
|
|
2994
|
+
_context34.next = 4;
|
|
2792
2995
|
return this.getProductList();
|
|
2793
2996
|
case 4:
|
|
2794
|
-
productList =
|
|
2997
|
+
productList = _context34.sent;
|
|
2795
2998
|
if (Array.isArray(productList)) {
|
|
2796
|
-
|
|
2999
|
+
_context34.next = 7;
|
|
2797
3000
|
break;
|
|
2798
3001
|
}
|
|
2799
|
-
return
|
|
3002
|
+
return _context34.abrupt("return", sourceMap);
|
|
2800
3003
|
case 7:
|
|
2801
3004
|
visited = new Set();
|
|
2802
3005
|
collectFromValue = function collectFromValue(value) {
|
|
@@ -2805,17 +3008,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2805
3008
|
if (visited.has(value)) return;
|
|
2806
3009
|
visited.add(value);
|
|
2807
3010
|
if (Array.isArray(value)) {
|
|
2808
|
-
var
|
|
2809
|
-
|
|
3011
|
+
var _iterator17 = _createForOfIteratorHelper(value),
|
|
3012
|
+
_step17;
|
|
2810
3013
|
try {
|
|
2811
|
-
for (
|
|
2812
|
-
var item =
|
|
3014
|
+
for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {
|
|
3015
|
+
var item = _step17.value;
|
|
2813
3016
|
collectFromValue(item);
|
|
2814
3017
|
}
|
|
2815
3018
|
} catch (err) {
|
|
2816
|
-
|
|
3019
|
+
_iterator17.e(err);
|
|
2817
3020
|
} finally {
|
|
2818
|
-
|
|
3021
|
+
_iterator17.f();
|
|
2819
3022
|
}
|
|
2820
3023
|
return;
|
|
2821
3024
|
}
|
|
@@ -2835,19 +3038,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2835
3038
|
}
|
|
2836
3039
|
};
|
|
2837
3040
|
collectFromValue(productList);
|
|
2838
|
-
|
|
3041
|
+
_context34.next = 15;
|
|
2839
3042
|
break;
|
|
2840
3043
|
case 12:
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
this.logMethodError('buildPrefillProductSourceMap',
|
|
3044
|
+
_context34.prev = 12;
|
|
3045
|
+
_context34.t0 = _context34["catch"](1);
|
|
3046
|
+
this.logMethodError('buildPrefillProductSourceMap', _context34.t0);
|
|
2844
3047
|
case 15:
|
|
2845
|
-
return
|
|
3048
|
+
return _context34.abrupt("return", sourceMap);
|
|
2846
3049
|
case 16:
|
|
2847
3050
|
case "end":
|
|
2848
|
-
return
|
|
3051
|
+
return _context34.stop();
|
|
2849
3052
|
}
|
|
2850
|
-
},
|
|
3053
|
+
}, _callee34, this, [[1, 12]]);
|
|
2851
3054
|
}));
|
|
2852
3055
|
function buildPrefillProductSourceMap() {
|
|
2853
3056
|
return _buildPrefillProductSourceMap.apply(this, arguments);
|
|
@@ -2862,56 +3065,56 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2862
3065
|
}, {
|
|
2863
3066
|
key: "ensureItemRuleConfigsLoaded",
|
|
2864
3067
|
value: function () {
|
|
2865
|
-
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3068
|
+
var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
|
|
2866
3069
|
var _this11 = this;
|
|
2867
|
-
return _regeneratorRuntime().wrap(function
|
|
2868
|
-
while (1) switch (
|
|
3070
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
3071
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2869
3072
|
case 0:
|
|
2870
3073
|
if (!(this.itemRuleConfigs.length > 0)) {
|
|
2871
|
-
|
|
3074
|
+
_context36.next = 2;
|
|
2872
3075
|
break;
|
|
2873
3076
|
}
|
|
2874
|
-
return
|
|
3077
|
+
return _context36.abrupt("return", this.itemRuleConfigs);
|
|
2875
3078
|
case 2:
|
|
2876
3079
|
if (!this.itemRuleConfigsPromise) {
|
|
2877
|
-
|
|
3080
|
+
_context36.next = 4;
|
|
2878
3081
|
break;
|
|
2879
3082
|
}
|
|
2880
|
-
return
|
|
3083
|
+
return _context36.abrupt("return", this.itemRuleConfigsPromise);
|
|
2881
3084
|
case 4:
|
|
2882
|
-
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3085
|
+
this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
|
|
2883
3086
|
var runtimeConfig, staticConfigs;
|
|
2884
|
-
return _regeneratorRuntime().wrap(function
|
|
2885
|
-
while (1) switch (
|
|
3087
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
3088
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2886
3089
|
case 0:
|
|
2887
3090
|
runtimeConfig = _this11.getItemRuleRuntimeConfig();
|
|
2888
3091
|
staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
|
|
2889
3092
|
if (!(staticConfigs.length > 0)) {
|
|
2890
|
-
|
|
3093
|
+
_context35.next = 6;
|
|
2891
3094
|
break;
|
|
2892
3095
|
}
|
|
2893
3096
|
_this11.itemRuleConfigs = staticConfigs;
|
|
2894
3097
|
_this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
|
|
2895
|
-
return
|
|
3098
|
+
return _context35.abrupt("return", _this11.itemRuleConfigs);
|
|
2896
3099
|
case 6:
|
|
2897
3100
|
_this11.itemRuleConfigs = [];
|
|
2898
3101
|
_this11.itemRuleEvaluator.setStrategyConfigs([]);
|
|
2899
|
-
return
|
|
3102
|
+
return _context35.abrupt("return", _this11.itemRuleConfigs);
|
|
2900
3103
|
case 9:
|
|
2901
3104
|
case "end":
|
|
2902
|
-
return
|
|
3105
|
+
return _context35.stop();
|
|
2903
3106
|
}
|
|
2904
|
-
},
|
|
3107
|
+
}, _callee35);
|
|
2905
3108
|
}))();
|
|
2906
|
-
|
|
3109
|
+
_context36.next = 7;
|
|
2907
3110
|
return this.itemRuleConfigsPromise;
|
|
2908
3111
|
case 7:
|
|
2909
|
-
return
|
|
3112
|
+
return _context36.abrupt("return", _context36.sent);
|
|
2910
3113
|
case 8:
|
|
2911
3114
|
case "end":
|
|
2912
|
-
return
|
|
3115
|
+
return _context36.stop();
|
|
2913
3116
|
}
|
|
2914
|
-
},
|
|
3117
|
+
}, _callee36, this);
|
|
2915
3118
|
}));
|
|
2916
3119
|
function ensureItemRuleConfigsLoaded() {
|
|
2917
3120
|
return _ensureItemRuleConfigsLoaded.apply(this, arguments);
|
|
@@ -2921,22 +3124,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2921
3124
|
}, {
|
|
2922
3125
|
key: "refreshItemRuleQuantityLimits",
|
|
2923
3126
|
value: function () {
|
|
2924
|
-
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3127
|
+
var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
|
|
2925
3128
|
var strategyConfigs, businessData, limits;
|
|
2926
|
-
return _regeneratorRuntime().wrap(function
|
|
2927
|
-
while (1) switch (
|
|
3129
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3130
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
2928
3131
|
case 0:
|
|
2929
|
-
|
|
2930
|
-
|
|
3132
|
+
_context37.prev = 0;
|
|
3133
|
+
_context37.next = 3;
|
|
2931
3134
|
return this.ensureItemRuleConfigsLoaded();
|
|
2932
3135
|
case 3:
|
|
2933
|
-
strategyConfigs =
|
|
3136
|
+
strategyConfigs = _context37.sent;
|
|
2934
3137
|
if (strategyConfigs.length) {
|
|
2935
|
-
|
|
3138
|
+
_context37.next = 7;
|
|
2936
3139
|
break;
|
|
2937
3140
|
}
|
|
2938
3141
|
this.store.itemRuleQuantityLimits = [];
|
|
2939
|
-
return
|
|
3142
|
+
return _context37.abrupt("return", []);
|
|
2940
3143
|
case 7:
|
|
2941
3144
|
businessData = buildItemRuleBusinessData({
|
|
2942
3145
|
tempOrder: this.ensureTempOrder(),
|
|
@@ -2948,18 +3151,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2948
3151
|
this.logMethodSuccess('refreshItemRuleQuantityLimits', {
|
|
2949
3152
|
limitCount: limits.length
|
|
2950
3153
|
});
|
|
2951
|
-
return
|
|
3154
|
+
return _context37.abrupt("return", limits);
|
|
2952
3155
|
case 14:
|
|
2953
|
-
|
|
2954
|
-
|
|
3156
|
+
_context37.prev = 14;
|
|
3157
|
+
_context37.t0 = _context37["catch"](0);
|
|
2955
3158
|
this.store.itemRuleQuantityLimits = [];
|
|
2956
|
-
this.logMethodError('refreshItemRuleQuantityLimits',
|
|
2957
|
-
return
|
|
3159
|
+
this.logMethodError('refreshItemRuleQuantityLimits', _context37.t0);
|
|
3160
|
+
return _context37.abrupt("return", []);
|
|
2958
3161
|
case 19:
|
|
2959
3162
|
case "end":
|
|
2960
|
-
return
|
|
3163
|
+
return _context37.stop();
|
|
2961
3164
|
}
|
|
2962
|
-
},
|
|
3165
|
+
}, _callee37, this, [[0, 14]]);
|
|
2963
3166
|
}));
|
|
2964
3167
|
function refreshItemRuleQuantityLimits() {
|
|
2965
3168
|
return _refreshItemRuleQuantityLimits.apply(this, arguments);
|
|
@@ -2969,32 +3172,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2969
3172
|
}, {
|
|
2970
3173
|
key: "applyPrefillByItemRule",
|
|
2971
3174
|
value: function () {
|
|
2972
|
-
var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2973
|
-
var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges,
|
|
2974
|
-
return _regeneratorRuntime().wrap(function
|
|
2975
|
-
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) {
|
|
2976
3179
|
case 0:
|
|
2977
3180
|
if (!this.itemRulePrefillApplied) {
|
|
2978
|
-
|
|
3181
|
+
_context38.next = 2;
|
|
2979
3182
|
break;
|
|
2980
3183
|
}
|
|
2981
|
-
return
|
|
3184
|
+
return _context38.abrupt("return");
|
|
2982
3185
|
case 2:
|
|
2983
3186
|
if (this.store.order) {
|
|
2984
|
-
|
|
3187
|
+
_context38.next = 4;
|
|
2985
3188
|
break;
|
|
2986
3189
|
}
|
|
2987
|
-
return
|
|
3190
|
+
return _context38.abrupt("return");
|
|
2988
3191
|
case 4:
|
|
2989
|
-
|
|
3192
|
+
_context38.next = 6;
|
|
2990
3193
|
return this.ensureItemRuleConfigsLoaded();
|
|
2991
3194
|
case 6:
|
|
2992
|
-
strategyConfigs =
|
|
3195
|
+
strategyConfigs = _context38.sent;
|
|
2993
3196
|
if (strategyConfigs.length) {
|
|
2994
|
-
|
|
3197
|
+
_context38.next = 9;
|
|
2995
3198
|
break;
|
|
2996
3199
|
}
|
|
2997
|
-
return
|
|
3200
|
+
return _context38.abrupt("return");
|
|
2998
3201
|
case 9:
|
|
2999
3202
|
businessData = buildItemRuleBusinessData({
|
|
3000
3203
|
tempOrder: this.ensureTempOrder(),
|
|
@@ -3003,41 +3206,41 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3003
3206
|
});
|
|
3004
3207
|
prefillItems = this.itemRuleEvaluator.getPrefillItems(businessData);
|
|
3005
3208
|
if (prefillItems.length) {
|
|
3006
|
-
|
|
3209
|
+
_context38.next = 14;
|
|
3007
3210
|
break;
|
|
3008
3211
|
}
|
|
3009
3212
|
this.itemRulePrefillApplied = true;
|
|
3010
|
-
return
|
|
3213
|
+
return _context38.abrupt("return");
|
|
3011
3214
|
case 14:
|
|
3012
|
-
|
|
3215
|
+
_context38.next = 16;
|
|
3013
3216
|
return this.buildPrefillProductSourceMap();
|
|
3014
3217
|
case 16:
|
|
3015
|
-
productSourceMap =
|
|
3218
|
+
productSourceMap = _context38.sent;
|
|
3016
3219
|
tempOrder = this.ensureTempOrder();
|
|
3017
3220
|
hasChanges = false;
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3221
|
+
_iterator18 = _createForOfIteratorHelper(prefillItems);
|
|
3222
|
+
_context38.prev = 20;
|
|
3223
|
+
_iterator18.s();
|
|
3021
3224
|
case 22:
|
|
3022
|
-
if ((
|
|
3023
|
-
|
|
3225
|
+
if ((_step18 = _iterator18.n()).done) {
|
|
3226
|
+
_context38.next = 45;
|
|
3024
3227
|
break;
|
|
3025
3228
|
}
|
|
3026
|
-
prefillItem =
|
|
3229
|
+
prefillItem = _step18.value;
|
|
3027
3230
|
productId = Number(prefillItem.product_id);
|
|
3028
3231
|
productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
|
|
3029
3232
|
targetQuantity = toNonNegativeInt(prefillItem.quantity);
|
|
3030
3233
|
if (!(!Number.isFinite(productId) || targetQuantity <= 0)) {
|
|
3031
|
-
|
|
3234
|
+
_context38.next = 29;
|
|
3032
3235
|
break;
|
|
3033
3236
|
}
|
|
3034
|
-
return
|
|
3237
|
+
return _context38.abrupt("continue", 43);
|
|
3035
3238
|
case 29:
|
|
3036
3239
|
if (!Number.isNaN(productVariantId)) {
|
|
3037
|
-
|
|
3240
|
+
_context38.next = 31;
|
|
3038
3241
|
break;
|
|
3039
3242
|
}
|
|
3040
|
-
return
|
|
3243
|
+
return _context38.abrupt("continue", 43);
|
|
3041
3244
|
case 31:
|
|
3042
3245
|
sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
|
|
3043
3246
|
productIndex = getProductIdentityIndex(tempOrder.products, {
|
|
@@ -3045,7 +3248,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3045
3248
|
product_variant_id: productVariantId
|
|
3046
3249
|
});
|
|
3047
3250
|
if (!(productIndex === -1)) {
|
|
3048
|
-
|
|
3251
|
+
_context38.next = 38;
|
|
3049
3252
|
break;
|
|
3050
3253
|
}
|
|
3051
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');
|
|
@@ -3065,7 +3268,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3065
3268
|
})
|
|
3066
3269
|
}));
|
|
3067
3270
|
hasChanges = true;
|
|
3068
|
-
return
|
|
3271
|
+
return _context38.abrupt("continue", 43);
|
|
3069
3272
|
case 38:
|
|
3070
3273
|
targetProduct = tempOrder.products[productIndex];
|
|
3071
3274
|
existedQuantity = toNonNegativeInt(targetProduct.num);
|
|
@@ -3084,34 +3287,34 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3084
3287
|
hasChanges = true;
|
|
3085
3288
|
}
|
|
3086
3289
|
case 43:
|
|
3087
|
-
|
|
3290
|
+
_context38.next = 22;
|
|
3088
3291
|
break;
|
|
3089
3292
|
case 45:
|
|
3090
|
-
|
|
3293
|
+
_context38.next = 50;
|
|
3091
3294
|
break;
|
|
3092
3295
|
case 47:
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3296
|
+
_context38.prev = 47;
|
|
3297
|
+
_context38.t0 = _context38["catch"](20);
|
|
3298
|
+
_iterator18.e(_context38.t0);
|
|
3096
3299
|
case 50:
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
return
|
|
3300
|
+
_context38.prev = 50;
|
|
3301
|
+
_iterator18.f();
|
|
3302
|
+
return _context38.finish(50);
|
|
3100
3303
|
case 53:
|
|
3101
3304
|
if (!hasChanges) {
|
|
3102
|
-
|
|
3305
|
+
_context38.next = 58;
|
|
3103
3306
|
break;
|
|
3104
3307
|
}
|
|
3105
3308
|
// Prefill 属于 products CRUD 的一种形式:新增后让 Rules 重算,以支持自动应用可用优惠券。
|
|
3106
3309
|
this.store.order.applyDiscount();
|
|
3107
|
-
|
|
3310
|
+
_context38.next = 57;
|
|
3108
3311
|
return this.store.order.recalculateSummary({
|
|
3109
3312
|
createIfMissing: true
|
|
3110
3313
|
});
|
|
3111
3314
|
case 57:
|
|
3112
3315
|
this.store.order.persistTempOrder();
|
|
3113
3316
|
case 58:
|
|
3114
|
-
|
|
3317
|
+
_context38.next = 60;
|
|
3115
3318
|
return this.refreshItemRuleQuantityLimits();
|
|
3116
3319
|
case 60:
|
|
3117
3320
|
this.itemRulePrefillApplied = true;
|
|
@@ -3121,9 +3324,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3121
3324
|
});
|
|
3122
3325
|
case 62:
|
|
3123
3326
|
case "end":
|
|
3124
|
-
return
|
|
3327
|
+
return _context38.stop();
|
|
3125
3328
|
}
|
|
3126
|
-
},
|
|
3329
|
+
}, _callee38, this, [[20, 47, 50, 53]]);
|
|
3127
3330
|
}));
|
|
3128
3331
|
function applyPrefillByItemRule() {
|
|
3129
3332
|
return _applyPrefillByItemRule.apply(this, arguments);
|
|
@@ -3133,24 +3336,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3133
3336
|
}, {
|
|
3134
3337
|
key: "applyItemRulePrefill",
|
|
3135
3338
|
value: function () {
|
|
3136
|
-
var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3137
|
-
return _regeneratorRuntime().wrap(function
|
|
3138
|
-
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) {
|
|
3139
3342
|
case 0:
|
|
3140
3343
|
this.logMethodStart('applyItemRulePrefill');
|
|
3141
|
-
|
|
3344
|
+
_context39.next = 3;
|
|
3142
3345
|
return this.applyPrefillByItemRule();
|
|
3143
3346
|
case 3:
|
|
3144
|
-
|
|
3347
|
+
_context39.next = 5;
|
|
3145
3348
|
return this.refreshItemRuleQuantityLimits();
|
|
3146
3349
|
case 5:
|
|
3147
|
-
|
|
3350
|
+
_context39.next = 7;
|
|
3148
3351
|
return this.refreshCartValidationPassed();
|
|
3149
3352
|
case 7:
|
|
3150
3353
|
case "end":
|
|
3151
|
-
return
|
|
3354
|
+
return _context39.stop();
|
|
3152
3355
|
}
|
|
3153
|
-
},
|
|
3356
|
+
}, _callee39, this);
|
|
3154
3357
|
}));
|
|
3155
3358
|
function applyItemRulePrefill() {
|
|
3156
3359
|
return _applyItemRulePrefill.apply(this, arguments);
|
|
@@ -3160,20 +3363,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3160
3363
|
}, {
|
|
3161
3364
|
key: "evaluateCartValidationByItemRule",
|
|
3162
3365
|
value: function () {
|
|
3163
|
-
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3366
|
+
var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
|
|
3164
3367
|
var strategyConfigs, businessData;
|
|
3165
|
-
return _regeneratorRuntime().wrap(function
|
|
3166
|
-
while (1) switch (
|
|
3368
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3369
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
3167
3370
|
case 0:
|
|
3168
|
-
|
|
3371
|
+
_context40.next = 2;
|
|
3169
3372
|
return this.ensureItemRuleConfigsLoaded();
|
|
3170
3373
|
case 2:
|
|
3171
|
-
strategyConfigs =
|
|
3374
|
+
strategyConfigs = _context40.sent;
|
|
3172
3375
|
if (strategyConfigs.length) {
|
|
3173
|
-
|
|
3376
|
+
_context40.next = 5;
|
|
3174
3377
|
break;
|
|
3175
3378
|
}
|
|
3176
|
-
return
|
|
3379
|
+
return _context40.abrupt("return", {
|
|
3177
3380
|
passed: true,
|
|
3178
3381
|
failures: []
|
|
3179
3382
|
});
|
|
@@ -3183,12 +3386,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3183
3386
|
runtimeConfig: this.getItemRuleRuntimeConfig(),
|
|
3184
3387
|
itemRuleConfigs: this.itemRuleConfigs
|
|
3185
3388
|
});
|
|
3186
|
-
return
|
|
3389
|
+
return _context40.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
|
|
3187
3390
|
case 7:
|
|
3188
3391
|
case "end":
|
|
3189
|
-
return
|
|
3392
|
+
return _context40.stop();
|
|
3190
3393
|
}
|
|
3191
|
-
},
|
|
3394
|
+
}, _callee40, this);
|
|
3192
3395
|
}));
|
|
3193
3396
|
function evaluateCartValidationByItemRule() {
|
|
3194
3397
|
return _evaluateCartValidationByItemRule.apply(this, arguments);
|
|
@@ -3198,20 +3401,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3198
3401
|
}, {
|
|
3199
3402
|
key: "validateBeforeSubmitByItemRule",
|
|
3200
3403
|
value: function () {
|
|
3201
|
-
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3404
|
+
var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
|
|
3202
3405
|
var validationResult, firstFailure, errorMessage, error;
|
|
3203
|
-
return _regeneratorRuntime().wrap(function
|
|
3204
|
-
while (1) switch (
|
|
3406
|
+
return _regeneratorRuntime().wrap(function _callee41$(_context41) {
|
|
3407
|
+
while (1) switch (_context41.prev = _context41.next) {
|
|
3205
3408
|
case 0:
|
|
3206
|
-
|
|
3409
|
+
_context41.next = 2;
|
|
3207
3410
|
return this.evaluateCartValidationByItemRule();
|
|
3208
3411
|
case 2:
|
|
3209
|
-
validationResult =
|
|
3412
|
+
validationResult = _context41.sent;
|
|
3210
3413
|
if (!validationResult.passed) {
|
|
3211
|
-
|
|
3414
|
+
_context41.next = 5;
|
|
3212
3415
|
break;
|
|
3213
3416
|
}
|
|
3214
|
-
return
|
|
3417
|
+
return _context41.abrupt("return");
|
|
3215
3418
|
case 5:
|
|
3216
3419
|
firstFailure = validationResult.failures[0];
|
|
3217
3420
|
errorMessage = (firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '当前购物车未满足商品规则,请调整后再提交';
|
|
@@ -3220,9 +3423,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3220
3423
|
throw error;
|
|
3221
3424
|
case 10:
|
|
3222
3425
|
case "end":
|
|
3223
|
-
return
|
|
3426
|
+
return _context41.stop();
|
|
3224
3427
|
}
|
|
3225
|
-
},
|
|
3428
|
+
}, _callee41, this);
|
|
3226
3429
|
}));
|
|
3227
3430
|
function validateBeforeSubmitByItemRule() {
|
|
3228
3431
|
return _validateBeforeSubmitByItemRule.apply(this, arguments);
|
|
@@ -3232,10 +3435,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3232
3435
|
}, {
|
|
3233
3436
|
key: "refreshCartValidationPassed",
|
|
3234
3437
|
value: function () {
|
|
3235
|
-
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3438
|
+
var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
|
|
3236
3439
|
var previous, nextState, validationResult, changed;
|
|
3237
|
-
return _regeneratorRuntime().wrap(function
|
|
3238
|
-
while (1) switch (
|
|
3440
|
+
return _regeneratorRuntime().wrap(function _callee42$(_context42) {
|
|
3441
|
+
while (1) switch (_context42.prev = _context42.next) {
|
|
3239
3442
|
case 0:
|
|
3240
3443
|
previous = this.store.cartValidation || {
|
|
3241
3444
|
passed: null,
|
|
@@ -3245,20 +3448,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3245
3448
|
passed: null,
|
|
3246
3449
|
failures: []
|
|
3247
3450
|
};
|
|
3248
|
-
|
|
3249
|
-
|
|
3451
|
+
_context42.prev = 2;
|
|
3452
|
+
_context42.next = 5;
|
|
3250
3453
|
return this.evaluateCartValidationByItemRule();
|
|
3251
3454
|
case 5:
|
|
3252
|
-
validationResult =
|
|
3455
|
+
validationResult = _context42.sent;
|
|
3253
3456
|
nextState = {
|
|
3254
3457
|
passed: validationResult.passed,
|
|
3255
3458
|
failures: validationResult.failures || []
|
|
3256
3459
|
};
|
|
3257
|
-
|
|
3460
|
+
_context42.next = 12;
|
|
3258
3461
|
break;
|
|
3259
3462
|
case 9:
|
|
3260
|
-
|
|
3261
|
-
|
|
3463
|
+
_context42.prev = 9;
|
|
3464
|
+
_context42.t0 = _context42["catch"](2);
|
|
3262
3465
|
nextState = {
|
|
3263
3466
|
passed: false,
|
|
3264
3467
|
failures: []
|
|
@@ -3267,21 +3470,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3267
3470
|
this.store.cartValidation = nextState;
|
|
3268
3471
|
changed = previous.passed !== nextState.passed || previous.failures !== nextState.failures;
|
|
3269
3472
|
if (!changed) {
|
|
3270
|
-
|
|
3473
|
+
_context42.next = 17;
|
|
3271
3474
|
break;
|
|
3272
3475
|
}
|
|
3273
|
-
|
|
3476
|
+
_context42.next = 17;
|
|
3274
3477
|
return this.core.effects.emit(VenueBookingHooks.onCartValidationChanged, {
|
|
3275
3478
|
cartValidation: nextState,
|
|
3276
3479
|
cartValidationPassed: nextState.passed
|
|
3277
3480
|
});
|
|
3278
3481
|
case 17:
|
|
3279
|
-
return
|
|
3482
|
+
return _context42.abrupt("return", nextState.passed);
|
|
3280
3483
|
case 18:
|
|
3281
3484
|
case "end":
|
|
3282
|
-
return
|
|
3485
|
+
return _context42.stop();
|
|
3283
3486
|
}
|
|
3284
|
-
},
|
|
3487
|
+
}, _callee42, this, [[2, 9]]);
|
|
3285
3488
|
}));
|
|
3286
3489
|
function refreshCartValidationPassed() {
|
|
3287
3490
|
return _refreshCartValidationPassed.apply(this, arguments);
|
|
@@ -3291,14 +3494,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3291
3494
|
}, {
|
|
3292
3495
|
key: "setItemRuleRuntimeConfig",
|
|
3293
3496
|
value: function () {
|
|
3294
|
-
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3497
|
+
var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43() {
|
|
3295
3498
|
var _this$itemRuleRuntime, _this$itemRuleRuntime2;
|
|
3296
3499
|
var config,
|
|
3297
|
-
|
|
3298
|
-
return _regeneratorRuntime().wrap(function
|
|
3299
|
-
while (1) switch (
|
|
3500
|
+
_args43 = arguments;
|
|
3501
|
+
return _regeneratorRuntime().wrap(function _callee43$(_context43) {
|
|
3502
|
+
while (1) switch (_context43.prev = _context43.next) {
|
|
3300
3503
|
case 0:
|
|
3301
|
-
config =
|
|
3504
|
+
config = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
|
|
3302
3505
|
this.logMethodStart('setItemRuleRuntimeConfig');
|
|
3303
3506
|
this.itemRuleRuntimeConfig = _objectSpread(_objectSpread(_objectSpread({}, this.itemRuleRuntimeConfig), config), {}, {
|
|
3304
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) || {}),
|
|
@@ -3310,10 +3513,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3310
3513
|
this.itemRuleEvaluator.setStrategyConfigs([]);
|
|
3311
3514
|
}
|
|
3312
3515
|
this.itemRulePrefillApplied = false;
|
|
3313
|
-
|
|
3516
|
+
_context43.next = 7;
|
|
3314
3517
|
return this.refreshItemRuleQuantityLimits();
|
|
3315
3518
|
case 7:
|
|
3316
|
-
|
|
3519
|
+
_context43.next = 9;
|
|
3317
3520
|
return this.refreshCartValidationPassed();
|
|
3318
3521
|
case 9:
|
|
3319
3522
|
this.logMethodSuccess('setItemRuleRuntimeConfig', {
|
|
@@ -3321,9 +3524,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3321
3524
|
});
|
|
3322
3525
|
case 10:
|
|
3323
3526
|
case "end":
|
|
3324
|
-
return
|
|
3527
|
+
return _context43.stop();
|
|
3325
3528
|
}
|
|
3326
|
-
},
|
|
3529
|
+
}, _callee43, this);
|
|
3327
3530
|
}));
|
|
3328
3531
|
function setItemRuleRuntimeConfig() {
|
|
3329
3532
|
return _setItemRuleRuntimeConfig.apply(this, arguments);
|
|
@@ -3350,23 +3553,23 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3350
3553
|
}, {
|
|
3351
3554
|
key: "readUIStateBucket",
|
|
3352
3555
|
value: function readUIStateBucket() {
|
|
3353
|
-
var _this$
|
|
3556
|
+
var _this$window2;
|
|
3354
3557
|
var key = this.getUIStateBucketKey();
|
|
3355
|
-
if (!key || !((_this$
|
|
3558
|
+
if (!key || !((_this$window2 = this.window) !== null && _this$window2 !== void 0 && _this$window2.sessionStorage)) return {};
|
|
3356
3559
|
try {
|
|
3357
3560
|
var raw = this.window.sessionStorage.getItem(key) || '{}';
|
|
3358
3561
|
var parsed = JSON.parse(raw);
|
|
3359
3562
|
return parsed && _typeof(parsed) === 'object' ? parsed : {};
|
|
3360
|
-
} catch (
|
|
3563
|
+
} catch (_unused4) {
|
|
3361
3564
|
return {};
|
|
3362
3565
|
}
|
|
3363
3566
|
}
|
|
3364
3567
|
}, {
|
|
3365
3568
|
key: "writeUIStateBucket",
|
|
3366
3569
|
value: function writeUIStateBucket(bucket) {
|
|
3367
|
-
var _this$
|
|
3570
|
+
var _this$window3;
|
|
3368
3571
|
var key = this.getUIStateBucketKey();
|
|
3369
|
-
if (!key || !((_this$
|
|
3572
|
+
if (!key || !((_this$window3 = this.window) !== null && _this$window3 !== void 0 && _this$window3.sessionStorage)) return;
|
|
3370
3573
|
this.window.sessionStorage.setItem(key, JSON.stringify(bucket));
|
|
3371
3574
|
}
|
|
3372
3575
|
}, {
|
|
@@ -3397,40 +3600,114 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3397
3600
|
}, {
|
|
3398
3601
|
key: "setBookingHolder",
|
|
3399
3602
|
value: function setBookingHolder(bookingUid, holder) {
|
|
3400
|
-
var
|
|
3401
|
-
|
|
3402
|
-
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) {
|
|
3403
3607
|
var _b$metadata4;
|
|
3404
3608
|
return ((_b$metadata4 = b.metadata) === null || _b$metadata4 === void 0 ? void 0 : _b$metadata4.unique_identification_number) === bookingUid;
|
|
3405
3609
|
});
|
|
3406
3610
|
if (booking) {
|
|
3407
3611
|
booking.holder = holder;
|
|
3408
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);
|
|
3409
3686
|
}
|
|
3410
3687
|
|
|
3411
3688
|
// ─── OpenData 可用性 ───
|
|
3412
3689
|
}, {
|
|
3413
3690
|
key: "checkOpenDataAvailability",
|
|
3414
3691
|
value: function () {
|
|
3415
|
-
var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3416
|
-
return _regeneratorRuntime().wrap(function
|
|
3417
|
-
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) {
|
|
3418
3695
|
case 0:
|
|
3419
3696
|
if (this.store.openData) {
|
|
3420
|
-
|
|
3697
|
+
_context45.next = 2;
|
|
3421
3698
|
break;
|
|
3422
3699
|
}
|
|
3423
3700
|
throw new Error('openData 模块未初始化');
|
|
3424
3701
|
case 2:
|
|
3425
|
-
|
|
3702
|
+
_context45.next = 4;
|
|
3426
3703
|
return this.loadOpenDataConfig();
|
|
3427
3704
|
case 4:
|
|
3428
|
-
return
|
|
3705
|
+
return _context45.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
|
|
3429
3706
|
case 5:
|
|
3430
3707
|
case "end":
|
|
3431
|
-
return
|
|
3708
|
+
return _context45.stop();
|
|
3432
3709
|
}
|
|
3433
|
-
},
|
|
3710
|
+
}, _callee45, this);
|
|
3434
3711
|
}));
|
|
3435
3712
|
function checkOpenDataAvailability() {
|
|
3436
3713
|
return _checkOpenDataAvailability.apply(this, arguments);
|
|
@@ -3440,15 +3717,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3440
3717
|
}, {
|
|
3441
3718
|
key: "setOtherParams",
|
|
3442
3719
|
value: function () {
|
|
3443
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3720
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(params) {
|
|
3444
3721
|
var _ref5,
|
|
3445
3722
|
_ref5$cover,
|
|
3446
3723
|
cover,
|
|
3447
|
-
|
|
3448
|
-
return _regeneratorRuntime().wrap(function
|
|
3449
|
-
while (1) switch (
|
|
3724
|
+
_args46 = arguments;
|
|
3725
|
+
return _regeneratorRuntime().wrap(function _callee46$(_context46) {
|
|
3726
|
+
while (1) switch (_context46.prev = _context46.next) {
|
|
3450
3727
|
case 0:
|
|
3451
|
-
_ref5 =
|
|
3728
|
+
_ref5 = _args46.length > 1 && _args46[1] !== undefined ? _args46[1] : {}, _ref5$cover = _ref5.cover, cover = _ref5$cover === void 0 ? false : _ref5$cover;
|
|
3452
3729
|
if (cover) {
|
|
3453
3730
|
this.otherParams = params;
|
|
3454
3731
|
} else {
|
|
@@ -3456,11 +3733,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3456
3733
|
}
|
|
3457
3734
|
case 2:
|
|
3458
3735
|
case "end":
|
|
3459
|
-
return
|
|
3736
|
+
return _context46.stop();
|
|
3460
3737
|
}
|
|
3461
|
-
},
|
|
3738
|
+
}, _callee46, this);
|
|
3462
3739
|
}));
|
|
3463
|
-
function setOtherParams(
|
|
3740
|
+
function setOtherParams(_x23) {
|
|
3464
3741
|
return _setOtherParams.apply(this, arguments);
|
|
3465
3742
|
}
|
|
3466
3743
|
return setOtherParams;
|