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