@pisell/pisellos 0.10.65 → 0.10.66
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/OpenData/contactInfo.d.ts +20 -0
- package/dist/modules/OpenData/contactInfo.js +70 -0
- package/dist/modules/OpenData/index.d.ts +1 -0
- package/dist/modules/OpenData/index.js +1 -0
- package/dist/modules/OpenData/types.d.ts +9 -0
- package/dist/solution/BaseSales/index.d.ts +7 -0
- package/dist/solution/BaseSales/index.js +966 -844
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +5 -14
- package/dist/solution/BookingTicket/index.js +460 -433
- package/lib/modules/OpenData/contactInfo.d.ts +20 -0
- package/lib/modules/OpenData/contactInfo.js +56 -0
- package/lib/modules/OpenData/index.d.ts +1 -0
- package/lib/modules/OpenData/index.js +12 -0
- package/lib/modules/OpenData/types.d.ts +9 -0
- package/lib/solution/BaseSales/index.d.ts +7 -0
- package/lib/solution/BaseSales/index.js +31 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +5 -14
- package/lib/solution/BookingTicket/index.js +13 -2
- package/package.json +1 -1
|
@@ -51,6 +51,8 @@ import { buildProductOptionStringFromOrderLine } from "../../modules/BookingCont
|
|
|
51
51
|
import { applyBookingsStatus, applyChildBookingStatus, resolveScheduleId, resolveStatusAfterTransition, restoreBookingsStatus, restoreChildBookingStatus } from "./utils/bookingStatus";
|
|
52
52
|
import { resolveBestAddTimePlan as _resolveBestAddTimePlan } from "./utils/resolveBestAddTimePlan";
|
|
53
53
|
import { createUuidV4 } from "../../modules/Order/utils";
|
|
54
|
+
import { extractCustomerContactInfo } from "../../modules/OpenData/contactInfo";
|
|
55
|
+
import { cloneDeep } from 'lodash-es';
|
|
54
56
|
var OPEN_DATA_SECTION_CODES = ['sale', 'reservation', 'fulfillment', 'menu', 'workflow', 'documents'];
|
|
55
57
|
var OPEN_DATA_CACHE_TTL = 5 * 60 * 1000;
|
|
56
58
|
var USER_PLATFORM = ['pc', 'h5'];
|
|
@@ -452,29 +454,48 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
452
454
|
return getOpenData;
|
|
453
455
|
}()
|
|
454
456
|
}, {
|
|
455
|
-
key: "
|
|
457
|
+
key: "loadContactInfoOpenData",
|
|
456
458
|
value: function () {
|
|
457
|
-
var
|
|
458
|
-
var openData;
|
|
459
|
+
var _loadContactInfoOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
459
460
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
460
461
|
while (1) switch (_context5.prev = _context5.next) {
|
|
461
462
|
case 0:
|
|
462
|
-
_context5.
|
|
463
|
+
return _context5.abrupt("return", this.store.openData ? this.getOpenData() : _get(_getPrototypeOf(BookingTicketImpl.prototype), "loadContactInfoOpenData", this).call(this));
|
|
464
|
+
case 1:
|
|
465
|
+
case "end":
|
|
466
|
+
return _context5.stop();
|
|
467
|
+
}
|
|
468
|
+
}, _callee5, this);
|
|
469
|
+
}));
|
|
470
|
+
function loadContactInfoOpenData() {
|
|
471
|
+
return _loadContactInfoOpenData.apply(this, arguments);
|
|
472
|
+
}
|
|
473
|
+
return loadContactInfoOpenData;
|
|
474
|
+
}()
|
|
475
|
+
}, {
|
|
476
|
+
key: "getInvoiceLayoutConfig",
|
|
477
|
+
value: function () {
|
|
478
|
+
var _getInvoiceLayoutConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
479
|
+
var openData;
|
|
480
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
481
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
482
|
+
case 0:
|
|
483
|
+
_context6.next = 2;
|
|
463
484
|
return this.loadOpenDataConfig();
|
|
464
485
|
case 2:
|
|
465
|
-
openData =
|
|
486
|
+
openData = _context6.sent;
|
|
466
487
|
if (openData) {
|
|
467
|
-
|
|
488
|
+
_context6.next = 5;
|
|
468
489
|
break;
|
|
469
490
|
}
|
|
470
|
-
return
|
|
491
|
+
return _context6.abrupt("return", getDefaultInvoiceLayoutConfig());
|
|
471
492
|
case 5:
|
|
472
|
-
return
|
|
493
|
+
return _context6.abrupt("return", this.store.openData.getInvoiceLayoutConfig());
|
|
473
494
|
case 6:
|
|
474
495
|
case "end":
|
|
475
|
-
return
|
|
496
|
+
return _context6.stop();
|
|
476
497
|
}
|
|
477
|
-
},
|
|
498
|
+
}, _callee6, this);
|
|
478
499
|
}));
|
|
479
500
|
function getInvoiceLayoutConfig() {
|
|
480
501
|
return _getInvoiceLayoutConfig.apply(this, arguments);
|
|
@@ -484,27 +505,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
484
505
|
}, {
|
|
485
506
|
key: "getInvoiceTemplateSettings",
|
|
486
507
|
value: function () {
|
|
487
|
-
var _getInvoiceTemplateSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
508
|
+
var _getInvoiceTemplateSettings = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
488
509
|
var openData;
|
|
489
|
-
return _regeneratorRuntime().wrap(function
|
|
490
|
-
while (1) switch (
|
|
510
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
511
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
491
512
|
case 0:
|
|
492
|
-
|
|
513
|
+
_context7.next = 2;
|
|
493
514
|
return this.loadOpenDataConfig();
|
|
494
515
|
case 2:
|
|
495
|
-
openData =
|
|
516
|
+
openData = _context7.sent;
|
|
496
517
|
if (openData) {
|
|
497
|
-
|
|
518
|
+
_context7.next = 5;
|
|
498
519
|
break;
|
|
499
520
|
}
|
|
500
|
-
return
|
|
521
|
+
return _context7.abrupt("return", getDefaultInvoiceTemplateSettings());
|
|
501
522
|
case 5:
|
|
502
|
-
return
|
|
523
|
+
return _context7.abrupt("return", this.store.openData.getInvoiceTemplateSettings());
|
|
503
524
|
case 6:
|
|
504
525
|
case "end":
|
|
505
|
-
return
|
|
526
|
+
return _context7.stop();
|
|
506
527
|
}
|
|
507
|
-
},
|
|
528
|
+
}, _callee7, this);
|
|
508
529
|
}));
|
|
509
530
|
function getInvoiceTemplateSettings() {
|
|
510
531
|
return _getInvoiceTemplateSettings.apply(this, arguments);
|
|
@@ -534,32 +555,32 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
534
555
|
}, {
|
|
535
556
|
key: "getShortNumberOrDeviceId",
|
|
536
557
|
value: function () {
|
|
537
|
-
var _getShortNumberOrDeviceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
558
|
+
var _getShortNumberOrDeviceId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
538
559
|
var getAsyncIotDeviceInfo, res;
|
|
539
|
-
return _regeneratorRuntime().wrap(function
|
|
540
|
-
while (1) switch (
|
|
560
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
561
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
541
562
|
case 0:
|
|
542
563
|
getAsyncIotDeviceInfo = this.getAppData('async_iot_device_info');
|
|
543
564
|
if (!getAsyncIotDeviceInfo) {
|
|
544
|
-
|
|
565
|
+
_context8.next = 7;
|
|
545
566
|
break;
|
|
546
567
|
}
|
|
547
|
-
|
|
568
|
+
_context8.next = 4;
|
|
548
569
|
return getAsyncIotDeviceInfo === null || getAsyncIotDeviceInfo === void 0 ? void 0 : getAsyncIotDeviceInfo();
|
|
549
570
|
case 4:
|
|
550
|
-
res =
|
|
571
|
+
res = _context8.sent;
|
|
551
572
|
if (!(res !== null && res !== void 0 && res.short_number)) {
|
|
552
|
-
|
|
573
|
+
_context8.next = 7;
|
|
553
574
|
break;
|
|
554
575
|
}
|
|
555
|
-
return
|
|
576
|
+
return _context8.abrupt("return", res === null || res === void 0 ? void 0 : res.short_number);
|
|
556
577
|
case 7:
|
|
557
|
-
return
|
|
578
|
+
return _context8.abrupt("return", String(this.getAppData('device_id') || 0).slice(-2));
|
|
558
579
|
case 8:
|
|
559
580
|
case "end":
|
|
560
|
-
return
|
|
581
|
+
return _context8.stop();
|
|
561
582
|
}
|
|
562
|
-
},
|
|
583
|
+
}, _callee8, this);
|
|
563
584
|
}));
|
|
564
585
|
function getShortNumberOrDeviceId() {
|
|
565
586
|
return _getShortNumberOrDeviceId.apply(this, arguments);
|
|
@@ -569,35 +590,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
569
590
|
}, {
|
|
570
591
|
key: "configureIdGeneratorFromOpenData",
|
|
571
592
|
value: function () {
|
|
572
|
-
var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
593
|
+
var _configureIdGeneratorFromOpenData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
573
594
|
var _openDataConfig, _openDataConfig2, _openDataConfig3, _openDataConfig4, _openDataConfig5, _openDataConfig6;
|
|
574
595
|
var idGenerator, openDataConfig, receiptSequenceLength, receiptSequenceStart, prefix, shopOrderPrefix, resetReceiptSequenceDaily, operatingDayBoundary, deviceId, businessCode;
|
|
575
|
-
return _regeneratorRuntime().wrap(function
|
|
576
|
-
while (1) switch (
|
|
596
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
597
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
577
598
|
case 0:
|
|
578
599
|
// 业务码切换或配置失败时不能复用上一次初始化的短号。
|
|
579
600
|
this.setPaymentNumberDevicePrefix(null);
|
|
580
601
|
idGenerator = this.getIdGeneratorPlugin();
|
|
581
602
|
if (idGenerator !== null && idGenerator !== void 0 && idGenerator.configure) {
|
|
582
|
-
|
|
603
|
+
_context9.next = 5;
|
|
583
604
|
break;
|
|
584
605
|
}
|
|
585
606
|
console.warn('[BookingTicket] idGenerator 插件不可用,跳过配置');
|
|
586
|
-
return
|
|
607
|
+
return _context9.abrupt("return");
|
|
587
608
|
case 5:
|
|
588
609
|
openDataConfig = null;
|
|
589
|
-
|
|
590
|
-
|
|
610
|
+
_context9.prev = 6;
|
|
611
|
+
_context9.next = 9;
|
|
591
612
|
return this.loadOpenDataConfig();
|
|
592
613
|
case 9:
|
|
593
|
-
openDataConfig =
|
|
594
|
-
|
|
614
|
+
openDataConfig = _context9.sent;
|
|
615
|
+
_context9.next = 16;
|
|
595
616
|
break;
|
|
596
617
|
case 12:
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置',
|
|
600
|
-
return
|
|
618
|
+
_context9.prev = 12;
|
|
619
|
+
_context9.t0 = _context9["catch"](6);
|
|
620
|
+
console.warn('[BookingTicket] OpenData 配置加载失败,跳过 idGenerator 配置', _context9.t0);
|
|
621
|
+
return _context9.abrupt("return");
|
|
601
622
|
case 16:
|
|
602
623
|
// if (!openDataConfig) return;
|
|
603
624
|
receiptSequenceLength = this.normalizePositiveInteger((_openDataConfig = openDataConfig) === null || _openDataConfig === void 0 ? void 0 : _openDataConfig['sale.short_number_digits'], 5);
|
|
@@ -609,21 +630,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
609
630
|
"type": "start_time",
|
|
610
631
|
"time": "00:00"
|
|
611
632
|
};
|
|
612
|
-
|
|
633
|
+
_context9.next = 24;
|
|
613
634
|
return this.getShortNumberOrDeviceId();
|
|
614
635
|
case 24:
|
|
615
|
-
deviceId =
|
|
636
|
+
deviceId = _context9.sent;
|
|
616
637
|
this.setPaymentNumberDevicePrefix(deviceId);
|
|
617
638
|
businessCode = this.getBookingTicketBusinessCode();
|
|
618
639
|
if (businessCode) {
|
|
619
|
-
|
|
640
|
+
_context9.next = 30;
|
|
620
641
|
break;
|
|
621
642
|
}
|
|
622
643
|
console.warn('[BookingTicket] businessCode 缺失,跳过 idGenerator 配置');
|
|
623
|
-
return
|
|
644
|
+
return _context9.abrupt("return");
|
|
624
645
|
case 30:
|
|
625
|
-
|
|
626
|
-
|
|
646
|
+
_context9.prev = 30;
|
|
647
|
+
_context9.next = 33;
|
|
627
648
|
return idGenerator.configure({
|
|
628
649
|
biz: businessCode,
|
|
629
650
|
config: {
|
|
@@ -639,17 +660,17 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
639
660
|
}
|
|
640
661
|
});
|
|
641
662
|
case 33:
|
|
642
|
-
|
|
663
|
+
_context9.next = 38;
|
|
643
664
|
break;
|
|
644
665
|
case 35:
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
console.warn('[BookingTicket] idGenerator 配置失败',
|
|
666
|
+
_context9.prev = 35;
|
|
667
|
+
_context9.t1 = _context9["catch"](30);
|
|
668
|
+
console.warn('[BookingTicket] idGenerator 配置失败', _context9.t1);
|
|
648
669
|
case 38:
|
|
649
670
|
case "end":
|
|
650
|
-
return
|
|
671
|
+
return _context9.stop();
|
|
651
672
|
}
|
|
652
|
-
},
|
|
673
|
+
}, _callee9, this, [[6, 12], [30, 35]]);
|
|
653
674
|
}));
|
|
654
675
|
function configureIdGeneratorFromOpenData() {
|
|
655
676
|
return _configureIdGeneratorFromOpenData.apply(this, arguments);
|
|
@@ -681,16 +702,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
681
702
|
}, {
|
|
682
703
|
key: "loadSalesDetail",
|
|
683
704
|
value: (function () {
|
|
684
|
-
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
705
|
+
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(orderIdOrParams) {
|
|
685
706
|
var _ref3;
|
|
686
707
|
var sales, customerModule, detailCustomer, orderCustomerSnapshot, protocolCustomerId, protocolCustomer, selectedCustomer, _selectedCustomer$nam, _ref4, detailCustomerId, detailCustomerRest, rawId, customer;
|
|
687
|
-
return _regeneratorRuntime().wrap(function
|
|
688
|
-
while (1) switch (
|
|
708
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
709
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
689
710
|
case 0:
|
|
690
|
-
|
|
711
|
+
_context10.next = 2;
|
|
691
712
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "loadSalesDetail", this).call(this, orderIdOrParams);
|
|
692
713
|
case 2:
|
|
693
|
-
sales =
|
|
714
|
+
sales = _context10.sent;
|
|
694
715
|
customerModule = this.store.customer;
|
|
695
716
|
detailCustomer = sales === null || sales === void 0 ? void 0 : sales.customer;
|
|
696
717
|
orderCustomerSnapshot = this.store.order.getOrderCustomerSnapshot();
|
|
@@ -722,12 +743,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
722
743
|
});
|
|
723
744
|
// await this.store.order.saveDraft();
|
|
724
745
|
}
|
|
725
|
-
return
|
|
746
|
+
return _context10.abrupt("return", sales);
|
|
726
747
|
case 11:
|
|
727
748
|
case "end":
|
|
728
|
-
return
|
|
749
|
+
return _context10.stop();
|
|
729
750
|
}
|
|
730
|
-
},
|
|
751
|
+
}, _callee10, this);
|
|
731
752
|
}));
|
|
732
753
|
function loadSalesDetail(_x3) {
|
|
733
754
|
return _loadSalesDetail.apply(this, arguments);
|
|
@@ -737,56 +758,56 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
737
758
|
}, {
|
|
738
759
|
key: "scanPromotionCode",
|
|
739
760
|
value: function () {
|
|
740
|
-
var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
761
|
+
var _scanPromotionCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(code, customerId) {
|
|
741
762
|
var raw, scannedList, extractedCustomerId, hasOrderCustomer, isUserPlatform, tempOrder;
|
|
742
|
-
return _regeneratorRuntime().wrap(function
|
|
743
|
-
while (1) switch (
|
|
763
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
764
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
744
765
|
case 0:
|
|
745
766
|
if (this.store.order) {
|
|
746
|
-
|
|
767
|
+
_context11.next = 2;
|
|
747
768
|
break;
|
|
748
769
|
}
|
|
749
770
|
throw new Error('order 模块未初始化');
|
|
750
771
|
case 2:
|
|
751
|
-
|
|
772
|
+
_context11.next = 4;
|
|
752
773
|
return this.store.order.scanCode(code, customerId);
|
|
753
774
|
case 4:
|
|
754
|
-
raw =
|
|
775
|
+
raw = _context11.sent;
|
|
755
776
|
scannedList = raw.scannedDiscountList || [];
|
|
756
777
|
extractedCustomerId = this.getDiscountCustomerId(scannedList);
|
|
757
778
|
hasOrderCustomer = Boolean(this.store.order.getOrderCustomer());
|
|
758
779
|
isUserPlatform = USER_PLATFORM.includes(this.otherParams.platform); // 缺 Holder 等场景 isAvailable=false,但仍需把 Pass 归属客户带入订单,供 Holder 弹窗使用。
|
|
759
780
|
if (!(!hasOrderCustomer && extractedCustomerId && !isUserPlatform)) {
|
|
760
|
-
|
|
781
|
+
_context11.next = 18;
|
|
761
782
|
break;
|
|
762
783
|
}
|
|
763
|
-
|
|
764
|
-
|
|
784
|
+
_context11.prev = 10;
|
|
785
|
+
_context11.next = 13;
|
|
765
786
|
return this.hydrateOrderCustomerFromScanDiscounts(scannedList);
|
|
766
787
|
case 13:
|
|
767
|
-
|
|
788
|
+
_context11.next = 18;
|
|
768
789
|
break;
|
|
769
790
|
case 15:
|
|
770
|
-
|
|
771
|
-
|
|
791
|
+
_context11.prev = 15;
|
|
792
|
+
_context11.t0 = _context11["catch"](10);
|
|
772
793
|
// 客户映射失败不能阻断原有 Pass 的可用性、展示或优惠处理。
|
|
773
794
|
console.warn('[BookingTicket] scan discount customer resolve failed', {
|
|
774
795
|
customerId: extractedCustomerId,
|
|
775
|
-
error:
|
|
796
|
+
error: _context11.t0
|
|
776
797
|
});
|
|
777
798
|
case 18:
|
|
778
799
|
if (!raw.isAvailable) {
|
|
779
|
-
|
|
800
|
+
_context11.next = 25;
|
|
780
801
|
break;
|
|
781
802
|
}
|
|
782
|
-
|
|
803
|
+
_context11.next = 21;
|
|
783
804
|
return this.store.order.recalculateSummary({
|
|
784
805
|
createIfMissing: true
|
|
785
806
|
});
|
|
786
807
|
case 21:
|
|
787
808
|
this.store.order.persistTempOrder();
|
|
788
809
|
tempOrder = this.store.order.ensureTempOrder();
|
|
789
|
-
|
|
810
|
+
_context11.next = 25;
|
|
790
811
|
return this.effectsEmit('onDiscountApplied', {
|
|
791
812
|
productList: tempOrder.products || [],
|
|
792
813
|
discountList: this.store.order.getDiscountList(),
|
|
@@ -794,7 +815,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
794
815
|
tempOrder: tempOrder
|
|
795
816
|
});
|
|
796
817
|
case 25:
|
|
797
|
-
return
|
|
818
|
+
return _context11.abrupt("return", _objectSpread(_objectSpread({
|
|
798
819
|
isAvailable: raw.isAvailable
|
|
799
820
|
}, raw.isAccepted !== undefined ? {
|
|
800
821
|
isAccepted: raw.isAccepted
|
|
@@ -805,9 +826,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
805
826
|
}));
|
|
806
827
|
case 26:
|
|
807
828
|
case "end":
|
|
808
|
-
return
|
|
829
|
+
return _context11.stop();
|
|
809
830
|
}
|
|
810
|
-
},
|
|
831
|
+
}, _callee11, this, [[10, 15]]);
|
|
811
832
|
}));
|
|
812
833
|
function scanPromotionCode(_x4, _x5) {
|
|
813
834
|
return _scanPromotionCode.apply(this, arguments);
|
|
@@ -817,42 +838,42 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
817
838
|
}, {
|
|
818
839
|
key: "hydrateOrderCustomerFromScanDiscounts",
|
|
819
840
|
value: function () {
|
|
820
|
-
var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
841
|
+
var _hydrateOrderCustomerFromScanDiscounts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(discounts) {
|
|
821
842
|
var currentOrderCustomer, customerId, customer;
|
|
822
|
-
return _regeneratorRuntime().wrap(function
|
|
823
|
-
while (1) switch (
|
|
843
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
844
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
824
845
|
case 0:
|
|
825
846
|
currentOrderCustomer = this.store.order.getOrderCustomer();
|
|
826
847
|
if (!currentOrderCustomer) {
|
|
827
|
-
|
|
848
|
+
_context12.next = 3;
|
|
828
849
|
break;
|
|
829
850
|
}
|
|
830
|
-
return
|
|
851
|
+
return _context12.abrupt("return");
|
|
831
852
|
case 3:
|
|
832
853
|
customerId = this.getDiscountCustomerId(discounts);
|
|
833
854
|
if (customerId) {
|
|
834
|
-
|
|
855
|
+
_context12.next = 6;
|
|
835
856
|
break;
|
|
836
857
|
}
|
|
837
|
-
return
|
|
858
|
+
return _context12.abrupt("return");
|
|
838
859
|
case 6:
|
|
839
|
-
|
|
860
|
+
_context12.next = 8;
|
|
840
861
|
return this.resolveCustomerByDiscountCustomerId(customerId);
|
|
841
862
|
case 8:
|
|
842
|
-
customer =
|
|
863
|
+
customer = _context12.sent;
|
|
843
864
|
if (customer) {
|
|
844
|
-
|
|
865
|
+
_context12.next = 11;
|
|
845
866
|
break;
|
|
846
867
|
}
|
|
847
|
-
return
|
|
868
|
+
return _context12.abrupt("return");
|
|
848
869
|
case 11:
|
|
849
870
|
this.store.customer.setSelectedCustomer(customer);
|
|
850
871
|
this.setOrderCustomer(customer);
|
|
851
872
|
case 13:
|
|
852
873
|
case "end":
|
|
853
|
-
return
|
|
874
|
+
return _context12.stop();
|
|
854
875
|
}
|
|
855
|
-
},
|
|
876
|
+
}, _callee12, this);
|
|
856
877
|
}));
|
|
857
878
|
function hydrateOrderCustomerFromScanDiscounts(_x6) {
|
|
858
879
|
return _hydrateOrderCustomerFromScanDiscounts.apply(this, arguments);
|
|
@@ -888,27 +909,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
888
909
|
}, {
|
|
889
910
|
key: "resolveCustomerById",
|
|
890
911
|
value: function () {
|
|
891
|
-
var _resolveCustomerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
912
|
+
var _resolveCustomerById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(customerId) {
|
|
892
913
|
var _this2 = this;
|
|
893
914
|
var rawCustomerId, numericCustomerId, normalizedCustomerId, existingRequest, request;
|
|
894
|
-
return _regeneratorRuntime().wrap(function
|
|
895
|
-
while (1) switch (
|
|
915
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
916
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
896
917
|
case 0:
|
|
897
918
|
rawCustomerId = String(customerId !== null && customerId !== void 0 ? customerId : '').trim();
|
|
898
919
|
numericCustomerId = Number(rawCustomerId);
|
|
899
920
|
if (!(!rawCustomerId || !Number.isInteger(numericCustomerId) || numericCustomerId <= 1)) {
|
|
900
|
-
|
|
921
|
+
_context13.next = 4;
|
|
901
922
|
break;
|
|
902
923
|
}
|
|
903
|
-
return
|
|
924
|
+
return _context13.abrupt("return", null);
|
|
904
925
|
case 4:
|
|
905
926
|
normalizedCustomerId = String(numericCustomerId);
|
|
906
927
|
existingRequest = this.customerResolveRequests.get(normalizedCustomerId);
|
|
907
928
|
if (!existingRequest) {
|
|
908
|
-
|
|
929
|
+
_context13.next = 8;
|
|
909
930
|
break;
|
|
910
931
|
}
|
|
911
|
-
return
|
|
932
|
+
return _context13.abrupt("return", existingRequest);
|
|
912
933
|
case 8:
|
|
913
934
|
request = this.request.post("/customer/resolve/".concat(encodeURIComponent(normalizedCustomerId)), {
|
|
914
935
|
with_franchisor_data: 1,
|
|
@@ -928,12 +949,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
928
949
|
}
|
|
929
950
|
});
|
|
930
951
|
this.customerResolveRequests.set(normalizedCustomerId, request);
|
|
931
|
-
return
|
|
952
|
+
return _context13.abrupt("return", request);
|
|
932
953
|
case 11:
|
|
933
954
|
case "end":
|
|
934
|
-
return
|
|
955
|
+
return _context13.stop();
|
|
935
956
|
}
|
|
936
|
-
},
|
|
957
|
+
}, _callee13, this);
|
|
937
958
|
}));
|
|
938
959
|
function resolveCustomerById(_x7) {
|
|
939
960
|
return _resolveCustomerById.apply(this, arguments);
|
|
@@ -985,60 +1006,60 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
985
1006
|
}, {
|
|
986
1007
|
key: "setBookingStatus",
|
|
987
1008
|
value: (function () {
|
|
988
|
-
var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1009
|
+
var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(status) {
|
|
989
1010
|
var _this$store$order2, _this$store$order2$ge;
|
|
990
1011
|
var tempOrder, orderId, scheduleId, bookings, previous, _data, res;
|
|
991
|
-
return _regeneratorRuntime().wrap(function
|
|
992
|
-
while (1) switch (
|
|
1012
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1013
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
993
1014
|
case 0:
|
|
994
1015
|
tempOrder = (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || (_this$store$order2$ge = _this$store$order2.getTempOrder) === null || _this$store$order2$ge === void 0 ? void 0 : _this$store$order2$ge.call(_this$store$order2);
|
|
995
1016
|
if (tempOrder) {
|
|
996
|
-
|
|
1017
|
+
_context14.next = 3;
|
|
997
1018
|
break;
|
|
998
1019
|
}
|
|
999
1020
|
throw new Error('setBookingStatus: tempOrder 未加载');
|
|
1000
1021
|
case 3:
|
|
1001
1022
|
orderId = tempOrder.order_id;
|
|
1002
1023
|
if (!(orderId === undefined || orderId === null)) {
|
|
1003
|
-
|
|
1024
|
+
_context14.next = 6;
|
|
1004
1025
|
break;
|
|
1005
1026
|
}
|
|
1006
1027
|
throw new Error('setBookingStatus: tempOrder.order_id 缺失');
|
|
1007
1028
|
case 6:
|
|
1008
1029
|
scheduleId = resolveScheduleId(tempOrder);
|
|
1009
1030
|
if (!(scheduleId === null)) {
|
|
1010
|
-
|
|
1031
|
+
_context14.next = 9;
|
|
1011
1032
|
break;
|
|
1012
1033
|
}
|
|
1013
1034
|
throw new Error('setBookingStatus: 无法解析 schedule id(metadata 与 root booking 均缺失)');
|
|
1014
1035
|
case 9:
|
|
1015
1036
|
bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
|
|
1016
1037
|
previous = applyBookingsStatus(bookings, status);
|
|
1017
|
-
|
|
1018
|
-
|
|
1038
|
+
_context14.prev = 11;
|
|
1039
|
+
_context14.next = 14;
|
|
1019
1040
|
return this.request.put("/schedule/booking/appointment-status/".concat(scheduleId), {
|
|
1020
1041
|
appointment_status: status
|
|
1021
1042
|
});
|
|
1022
1043
|
case 14:
|
|
1023
|
-
res =
|
|
1024
|
-
|
|
1044
|
+
res = _context14.sent;
|
|
1045
|
+
_context14.next = 17;
|
|
1025
1046
|
return this.refreshSalesDetail();
|
|
1026
1047
|
case 17:
|
|
1027
1048
|
this.core.effects.emit("".concat(this.name, ":onBookingStatusChange"), {
|
|
1028
1049
|
orderId: orderId,
|
|
1029
1050
|
status: status
|
|
1030
1051
|
});
|
|
1031
|
-
return
|
|
1052
|
+
return _context14.abrupt("return", (_data = res === null || res === void 0 ? void 0 : res.data) !== null && _data !== void 0 ? _data : res);
|
|
1032
1053
|
case 21:
|
|
1033
|
-
|
|
1034
|
-
|
|
1054
|
+
_context14.prev = 21;
|
|
1055
|
+
_context14.t0 = _context14["catch"](11);
|
|
1035
1056
|
restoreBookingsStatus(bookings, previous);
|
|
1036
|
-
throw
|
|
1057
|
+
throw _context14.t0;
|
|
1037
1058
|
case 25:
|
|
1038
1059
|
case "end":
|
|
1039
|
-
return
|
|
1060
|
+
return _context14.stop();
|
|
1040
1061
|
}
|
|
1041
|
-
},
|
|
1062
|
+
}, _callee14, this, [[11, 21]]);
|
|
1042
1063
|
}));
|
|
1043
1064
|
function setBookingStatus(_x8) {
|
|
1044
1065
|
return _setBookingStatus.apply(this, arguments);
|
|
@@ -1069,35 +1090,35 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1069
1090
|
}, {
|
|
1070
1091
|
key: "transitionChildBooking",
|
|
1071
1092
|
value: (function () {
|
|
1072
|
-
var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1093
|
+
var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
|
|
1073
1094
|
var _this$store$order3, _this$store$order3$ge;
|
|
1074
1095
|
var schedule_event_id, action, tempOrder, orderId, bookings, targetStatus, previous, _data2, res;
|
|
1075
|
-
return _regeneratorRuntime().wrap(function
|
|
1076
|
-
while (1) switch (
|
|
1096
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1097
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1077
1098
|
case 0:
|
|
1078
1099
|
schedule_event_id = params.schedule_event_id, action = params.action;
|
|
1079
1100
|
if (!(schedule_event_id === undefined || schedule_event_id === null || schedule_event_id === '')) {
|
|
1080
|
-
|
|
1101
|
+
_context15.next = 3;
|
|
1081
1102
|
break;
|
|
1082
1103
|
}
|
|
1083
1104
|
throw new Error('transitionChildBooking: schedule_event_id 不能为空');
|
|
1084
1105
|
case 3:
|
|
1085
1106
|
if (action) {
|
|
1086
|
-
|
|
1107
|
+
_context15.next = 5;
|
|
1087
1108
|
break;
|
|
1088
1109
|
}
|
|
1089
1110
|
throw new Error('transitionChildBooking: action 不能为空');
|
|
1090
1111
|
case 5:
|
|
1091
1112
|
tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getTempOrder) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3);
|
|
1092
1113
|
if (tempOrder) {
|
|
1093
|
-
|
|
1114
|
+
_context15.next = 8;
|
|
1094
1115
|
break;
|
|
1095
1116
|
}
|
|
1096
1117
|
throw new Error('transitionChildBooking: tempOrder 未加载');
|
|
1097
1118
|
case 8:
|
|
1098
1119
|
orderId = tempOrder.order_id;
|
|
1099
1120
|
if (!(orderId === undefined || orderId === null)) {
|
|
1100
|
-
|
|
1121
|
+
_context15.next = 11;
|
|
1101
1122
|
break;
|
|
1102
1123
|
}
|
|
1103
1124
|
throw new Error('transitionChildBooking: tempOrder.order_id 缺失');
|
|
@@ -1105,14 +1126,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1105
1126
|
bookings = Array.isArray(tempOrder.bookings) ? tempOrder.bookings : [];
|
|
1106
1127
|
targetStatus = resolveStatusAfterTransition(action);
|
|
1107
1128
|
previous = targetStatus !== null ? applyChildBookingStatus(bookings, schedule_event_id, targetStatus) : undefined;
|
|
1108
|
-
|
|
1109
|
-
|
|
1129
|
+
_context15.prev = 14;
|
|
1130
|
+
_context15.next = 17;
|
|
1110
1131
|
return this.request.post("/schedule/booking-transition/".concat(schedule_event_id), {
|
|
1111
1132
|
action: action
|
|
1112
1133
|
});
|
|
1113
1134
|
case 17:
|
|
1114
|
-
res =
|
|
1115
|
-
|
|
1135
|
+
res = _context15.sent;
|
|
1136
|
+
_context15.next = 20;
|
|
1116
1137
|
return this.refreshSalesDetail();
|
|
1117
1138
|
case 20:
|
|
1118
1139
|
this.core.effects.emit("".concat(this.name, ":onChildBookingStatusChange"), {
|
|
@@ -1121,19 +1142,19 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1121
1142
|
action: action,
|
|
1122
1143
|
status: targetStatus
|
|
1123
1144
|
});
|
|
1124
|
-
return
|
|
1145
|
+
return _context15.abrupt("return", (_data2 = res === null || res === void 0 ? void 0 : res.data) !== null && _data2 !== void 0 ? _data2 : res);
|
|
1125
1146
|
case 24:
|
|
1126
|
-
|
|
1127
|
-
|
|
1147
|
+
_context15.prev = 24;
|
|
1148
|
+
_context15.t0 = _context15["catch"](14);
|
|
1128
1149
|
if (previous !== undefined) {
|
|
1129
1150
|
restoreChildBookingStatus(bookings, schedule_event_id, previous);
|
|
1130
1151
|
}
|
|
1131
|
-
throw
|
|
1152
|
+
throw _context15.t0;
|
|
1132
1153
|
case 28:
|
|
1133
1154
|
case "end":
|
|
1134
|
-
return
|
|
1155
|
+
return _context15.stop();
|
|
1135
1156
|
}
|
|
1136
|
-
},
|
|
1157
|
+
}, _callee15, this, [[14, 24]]);
|
|
1137
1158
|
}));
|
|
1138
1159
|
function transitionChildBooking(_x9) {
|
|
1139
1160
|
return _transitionChildBooking.apply(this, arguments);
|
|
@@ -1154,19 +1175,19 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1154
1175
|
}, {
|
|
1155
1176
|
key: "refreshSalesDetail",
|
|
1156
1177
|
value: (function () {
|
|
1157
|
-
var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1178
|
+
var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
1158
1179
|
var _this$store$order4, _this$store$order4$ge;
|
|
1159
1180
|
var params,
|
|
1160
1181
|
tempOrder,
|
|
1161
1182
|
orderId,
|
|
1162
|
-
|
|
1163
|
-
return _regeneratorRuntime().wrap(function
|
|
1164
|
-
while (1) switch (
|
|
1183
|
+
_args16 = arguments;
|
|
1184
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1185
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1165
1186
|
case 0:
|
|
1166
|
-
params =
|
|
1187
|
+
params = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : {};
|
|
1167
1188
|
tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 || (_this$store$order4$ge = _this$store$order4.getTempOrder) === null || _this$store$order4$ge === void 0 ? void 0 : _this$store$order4$ge.call(_this$store$order4);
|
|
1168
1189
|
if (tempOrder) {
|
|
1169
|
-
|
|
1190
|
+
_context16.next = 4;
|
|
1170
1191
|
break;
|
|
1171
1192
|
}
|
|
1172
1193
|
throw new Error('refreshSalesDetail: tempOrder 未加载');
|
|
@@ -1174,21 +1195,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1174
1195
|
debugger;
|
|
1175
1196
|
orderId = tempOrder.order_id || tempOrder.external_sale_number;
|
|
1176
1197
|
if (!(orderId === undefined || orderId === null)) {
|
|
1177
|
-
|
|
1198
|
+
_context16.next = 8;
|
|
1178
1199
|
break;
|
|
1179
1200
|
}
|
|
1180
|
-
return
|
|
1201
|
+
return _context16.abrupt("return", {});
|
|
1181
1202
|
case 8:
|
|
1182
|
-
return
|
|
1203
|
+
return _context16.abrupt("return", this.loadSalesDetail({
|
|
1183
1204
|
orderId: orderId,
|
|
1184
1205
|
// merge: true
|
|
1185
1206
|
forceRemote: params.forceRemote
|
|
1186
1207
|
}));
|
|
1187
1208
|
case 9:
|
|
1188
1209
|
case "end":
|
|
1189
|
-
return
|
|
1210
|
+
return _context16.stop();
|
|
1190
1211
|
}
|
|
1191
|
-
},
|
|
1212
|
+
}, _callee16, this);
|
|
1192
1213
|
}));
|
|
1193
1214
|
function refreshSalesDetail() {
|
|
1194
1215
|
return _refreshSalesDetail.apply(this, arguments);
|
|
@@ -1204,7 +1225,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1204
1225
|
}, {
|
|
1205
1226
|
key: "loadProducts",
|
|
1206
1227
|
value: (function () {
|
|
1207
|
-
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1228
|
+
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
1208
1229
|
var params,
|
|
1209
1230
|
options,
|
|
1210
1231
|
schedule_date,
|
|
@@ -1213,20 +1234,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1213
1234
|
schedule_datetime,
|
|
1214
1235
|
bookingDate,
|
|
1215
1236
|
_result,
|
|
1216
|
-
|
|
1217
|
-
return _regeneratorRuntime().wrap(function
|
|
1218
|
-
while (1) switch (
|
|
1237
|
+
_args17 = arguments;
|
|
1238
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1239
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1219
1240
|
case 0:
|
|
1220
|
-
params =
|
|
1221
|
-
options =
|
|
1241
|
+
params = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {};
|
|
1242
|
+
options = _args17.length > 1 ? _args17[1] : undefined;
|
|
1222
1243
|
schedule_date = params.schedule_date, customer_id = params.customer_id, menu_list_ids = params.menu_list_ids, schedule_datetime = params.schedule_datetime; // 优先写入 schedule_datetime(含时分),供加购 presetStartTime 与 TimeBar 对齐;
|
|
1223
1244
|
// requiresDetail 弹窗仍通过 formatBookingDateForUI 只取日历日 YYYY-MM-DD。
|
|
1224
1245
|
bookingDate = schedule_datetime || schedule_date || '';
|
|
1225
1246
|
if (bookingDate) {
|
|
1226
1247
|
this.setBookingDate(bookingDate);
|
|
1227
1248
|
}
|
|
1228
|
-
|
|
1229
|
-
|
|
1249
|
+
_context17.prev = 5;
|
|
1250
|
+
_context17.next = 8;
|
|
1230
1251
|
return this.store.products.loadProducts(_objectSpread(_objectSpread({
|
|
1231
1252
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
1232
1253
|
with_schedule: 1
|
|
@@ -1234,20 +1255,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1234
1255
|
cacheId: this.cacheId
|
|
1235
1256
|
}), options);
|
|
1236
1257
|
case 8:
|
|
1237
|
-
_result =
|
|
1258
|
+
_result = _context17.sent;
|
|
1238
1259
|
this.productCatalog = Array.isArray(_result) ? _toConsumableArray(_result) : [];
|
|
1239
1260
|
this.core.effects.emit("".concat(this.name, ":onProductsLoaded"), _result);
|
|
1240
|
-
return
|
|
1261
|
+
return _context17.abrupt("return", _result);
|
|
1241
1262
|
case 14:
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
console.error('Failed to load products:',
|
|
1245
|
-
throw
|
|
1263
|
+
_context17.prev = 14;
|
|
1264
|
+
_context17.t0 = _context17["catch"](5);
|
|
1265
|
+
console.error('Failed to load products:', _context17.t0);
|
|
1266
|
+
throw _context17.t0;
|
|
1246
1267
|
case 18:
|
|
1247
1268
|
case "end":
|
|
1248
|
-
return
|
|
1269
|
+
return _context17.stop();
|
|
1249
1270
|
}
|
|
1250
|
-
},
|
|
1271
|
+
}, _callee17, this, [[5, 14]]);
|
|
1251
1272
|
}));
|
|
1252
1273
|
function loadProducts() {
|
|
1253
1274
|
return _loadProducts.apply(this, arguments);
|
|
@@ -1264,27 +1285,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1264
1285
|
}, {
|
|
1265
1286
|
key: "getAddTimeProducts",
|
|
1266
1287
|
value: (function () {
|
|
1267
|
-
var _getAddTimeProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1288
|
+
var _getAddTimeProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1268
1289
|
var params,
|
|
1269
1290
|
result,
|
|
1270
|
-
|
|
1271
|
-
return _regeneratorRuntime().wrap(function
|
|
1272
|
-
while (1) switch (
|
|
1291
|
+
_args18 = arguments;
|
|
1292
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1293
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1273
1294
|
case 0:
|
|
1274
|
-
params =
|
|
1275
|
-
|
|
1295
|
+
params = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : {};
|
|
1296
|
+
_context18.next = 3;
|
|
1276
1297
|
return this.store.products.getAddTimeProducts(_objectSpread(_objectSpread({}, params), {}, {
|
|
1277
1298
|
cacheId: this.cacheId
|
|
1278
1299
|
}));
|
|
1279
1300
|
case 3:
|
|
1280
|
-
result =
|
|
1301
|
+
result = _context18.sent;
|
|
1281
1302
|
this.addTimeProductsCatalog = Array.isArray(result) ? _toConsumableArray(result) : [];
|
|
1282
|
-
return
|
|
1303
|
+
return _context18.abrupt("return", result);
|
|
1283
1304
|
case 6:
|
|
1284
1305
|
case "end":
|
|
1285
|
-
return
|
|
1306
|
+
return _context18.stop();
|
|
1286
1307
|
}
|
|
1287
|
-
},
|
|
1308
|
+
}, _callee18, this);
|
|
1288
1309
|
}));
|
|
1289
1310
|
function getAddTimeProducts() {
|
|
1290
1311
|
return _getAddTimeProducts.apply(this, arguments);
|
|
@@ -1309,14 +1330,14 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1309
1330
|
}, {
|
|
1310
1331
|
key: "queryProductDetail",
|
|
1311
1332
|
value: (function () {
|
|
1312
|
-
var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1333
|
+
var _queryProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(params, options) {
|
|
1313
1334
|
var product_id, queryParams, _result2, list;
|
|
1314
|
-
return _regeneratorRuntime().wrap(function
|
|
1315
|
-
while (1) switch (
|
|
1335
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1336
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1316
1337
|
case 0:
|
|
1317
1338
|
product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded2);
|
|
1318
|
-
|
|
1319
|
-
|
|
1339
|
+
_context19.prev = 1;
|
|
1340
|
+
_context19.next = 4;
|
|
1320
1341
|
return this.store.products.loadProducts(_objectSpread(_objectSpread({
|
|
1321
1342
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
1322
1343
|
with_schedule: 1
|
|
@@ -1325,21 +1346,21 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1325
1346
|
cacheId: this.cacheId
|
|
1326
1347
|
}), options);
|
|
1327
1348
|
case 4:
|
|
1328
|
-
_result2 =
|
|
1349
|
+
_result2 = _context19.sent;
|
|
1329
1350
|
list = Array.isArray(_result2) ? _result2 : [];
|
|
1330
|
-
return
|
|
1351
|
+
return _context19.abrupt("return", list.find(function (product) {
|
|
1331
1352
|
return Number(product.id) === Number(product_id);
|
|
1332
1353
|
}));
|
|
1333
1354
|
case 9:
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
console.error('Failed to query product detail:',
|
|
1337
|
-
throw
|
|
1355
|
+
_context19.prev = 9;
|
|
1356
|
+
_context19.t0 = _context19["catch"](1);
|
|
1357
|
+
console.error('Failed to query product detail:', _context19.t0);
|
|
1358
|
+
throw _context19.t0;
|
|
1338
1359
|
case 13:
|
|
1339
1360
|
case "end":
|
|
1340
|
-
return
|
|
1361
|
+
return _context19.stop();
|
|
1341
1362
|
}
|
|
1342
|
-
},
|
|
1363
|
+
}, _callee19, this, [[1, 9]]);
|
|
1343
1364
|
}));
|
|
1344
1365
|
function queryProductDetail(_x10, _x11) {
|
|
1345
1366
|
return _queryProductDetail.apply(this, arguments);
|
|
@@ -1354,26 +1375,26 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1354
1375
|
}, {
|
|
1355
1376
|
key: "loadProductDetail",
|
|
1356
1377
|
value: (function () {
|
|
1357
|
-
var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1378
|
+
var _loadProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params, options) {
|
|
1358
1379
|
var product_id, queryParams, products;
|
|
1359
|
-
return _regeneratorRuntime().wrap(function
|
|
1360
|
-
while (1) switch (
|
|
1380
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1381
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1361
1382
|
case 0:
|
|
1362
1383
|
product_id = params.product_id, queryParams = _objectWithoutProperties(params, _excluded3);
|
|
1363
|
-
|
|
1384
|
+
_context20.next = 3;
|
|
1364
1385
|
return this.loadProducts(_objectSpread(_objectSpread({}, queryParams), {}, {
|
|
1365
1386
|
product_ids: [product_id]
|
|
1366
1387
|
}), options);
|
|
1367
1388
|
case 3:
|
|
1368
|
-
products =
|
|
1369
|
-
return
|
|
1389
|
+
products = _context20.sent;
|
|
1390
|
+
return _context20.abrupt("return", products.find(function (product) {
|
|
1370
1391
|
return Number(product.id) === Number(product_id);
|
|
1371
1392
|
}));
|
|
1372
1393
|
case 5:
|
|
1373
1394
|
case "end":
|
|
1374
|
-
return
|
|
1395
|
+
return _context20.stop();
|
|
1375
1396
|
}
|
|
1376
|
-
},
|
|
1397
|
+
}, _callee20, this);
|
|
1377
1398
|
}));
|
|
1378
1399
|
function loadProductDetail(_x12, _x13) {
|
|
1379
1400
|
return _loadProductDetail.apply(this, arguments);
|
|
@@ -1408,16 +1429,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1408
1429
|
}, {
|
|
1409
1430
|
key: "getProducts",
|
|
1410
1431
|
value: (function () {
|
|
1411
|
-
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1412
|
-
return _regeneratorRuntime().wrap(function
|
|
1413
|
-
while (1) switch (
|
|
1432
|
+
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
1433
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1434
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1414
1435
|
case 0:
|
|
1415
|
-
return
|
|
1436
|
+
return _context21.abrupt("return", this.store.products.getProducts());
|
|
1416
1437
|
case 1:
|
|
1417
1438
|
case "end":
|
|
1418
|
-
return
|
|
1439
|
+
return _context21.stop();
|
|
1419
1440
|
}
|
|
1420
|
-
},
|
|
1441
|
+
}, _callee21, this);
|
|
1421
1442
|
}));
|
|
1422
1443
|
function getProducts() {
|
|
1423
1444
|
return _getProducts.apply(this, arguments);
|
|
@@ -1482,33 +1503,33 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1482
1503
|
}, {
|
|
1483
1504
|
key: "getProductByIds",
|
|
1484
1505
|
value: (function () {
|
|
1485
|
-
var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1506
|
+
var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(ids, options) {
|
|
1486
1507
|
var _this$getOrderCustome, _this$getOrderCustome2, _this$getOrderCustome3;
|
|
1487
1508
|
var normalizedIds, localProducts, localProductIds, missingIds, rawBookingDate, bookingDate, customerId, loadedProducts, productById;
|
|
1488
|
-
return _regeneratorRuntime().wrap(function
|
|
1489
|
-
while (1) switch (
|
|
1509
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1510
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1490
1511
|
case 0:
|
|
1491
1512
|
normalizedIds = Array.from(new Set((ids || []).map(function (id) {
|
|
1492
1513
|
return Number(id);
|
|
1493
1514
|
}).filter(function (id) {
|
|
1494
1515
|
return Number.isFinite(id);
|
|
1495
1516
|
})));
|
|
1496
|
-
|
|
1517
|
+
_context22.next = 3;
|
|
1497
1518
|
return this.store.products.getProductByIds(normalizedIds);
|
|
1498
1519
|
case 3:
|
|
1499
|
-
|
|
1500
|
-
if (
|
|
1501
|
-
|
|
1520
|
+
_context22.t0 = _context22.sent;
|
|
1521
|
+
if (_context22.t0) {
|
|
1522
|
+
_context22.next = 6;
|
|
1502
1523
|
break;
|
|
1503
1524
|
}
|
|
1504
|
-
|
|
1525
|
+
_context22.t0 = [];
|
|
1505
1526
|
case 6:
|
|
1506
|
-
localProducts =
|
|
1527
|
+
localProducts = _context22.t0;
|
|
1507
1528
|
if (options !== null && options !== void 0 && options.loadMissing) {
|
|
1508
|
-
|
|
1529
|
+
_context22.next = 9;
|
|
1509
1530
|
break;
|
|
1510
1531
|
}
|
|
1511
|
-
return
|
|
1532
|
+
return _context22.abrupt("return", localProducts);
|
|
1512
1533
|
case 9:
|
|
1513
1534
|
localProductIds = new Set(localProducts.map(function (product) {
|
|
1514
1535
|
return Number(product.id);
|
|
@@ -1517,15 +1538,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1517
1538
|
return !localProductIds.has(id);
|
|
1518
1539
|
});
|
|
1519
1540
|
if (missingIds.length) {
|
|
1520
|
-
|
|
1541
|
+
_context22.next = 13;
|
|
1521
1542
|
break;
|
|
1522
1543
|
}
|
|
1523
|
-
return
|
|
1544
|
+
return _context22.abrupt("return", localProducts);
|
|
1524
1545
|
case 13:
|
|
1525
1546
|
rawBookingDate = this.getBookingDate();
|
|
1526
1547
|
bookingDate = rawBookingDate && dayjs(rawBookingDate).isValid() ? dayjs(rawBookingDate) : null;
|
|
1527
1548
|
customerId = Number((_this$getOrderCustome = (_this$getOrderCustome2 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome2 === void 0 ? void 0 : _this$getOrderCustome2.id) !== null && _this$getOrderCustome !== void 0 ? _this$getOrderCustome : (_this$getOrderCustome3 = this.getOrderCustomer()) === null || _this$getOrderCustome3 === void 0 ? void 0 : _this$getOrderCustome3.customer_id);
|
|
1528
|
-
|
|
1549
|
+
_context22.next = 18;
|
|
1529
1550
|
return this.store.products.loadProducts(_objectSpread(_objectSpread({
|
|
1530
1551
|
product_ids: missingIds,
|
|
1531
1552
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
@@ -1538,7 +1559,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1538
1559
|
customer_id: customerId
|
|
1539
1560
|
} : {}));
|
|
1540
1561
|
case 18:
|
|
1541
|
-
loadedProducts =
|
|
1562
|
+
loadedProducts = _context22.sent;
|
|
1542
1563
|
productById = new Map();
|
|
1543
1564
|
[].concat(_toConsumableArray(localProducts), _toConsumableArray(loadedProducts || [])).forEach(function (product) {
|
|
1544
1565
|
var productId = Number(product.id);
|
|
@@ -1546,16 +1567,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1546
1567
|
productById.set(productId, product);
|
|
1547
1568
|
}
|
|
1548
1569
|
});
|
|
1549
|
-
return
|
|
1570
|
+
return _context22.abrupt("return", normalizedIds.map(function (id) {
|
|
1550
1571
|
return productById.get(id);
|
|
1551
1572
|
}).filter(function (product) {
|
|
1552
1573
|
return Boolean(product);
|
|
1553
1574
|
}));
|
|
1554
1575
|
case 22:
|
|
1555
1576
|
case "end":
|
|
1556
|
-
return
|
|
1577
|
+
return _context22.stop();
|
|
1557
1578
|
}
|
|
1558
|
-
},
|
|
1579
|
+
}, _callee22, this);
|
|
1559
1580
|
}));
|
|
1560
1581
|
function getProductByIds(_x14, _x15) {
|
|
1561
1582
|
return _getProductByIds.apply(this, arguments);
|
|
@@ -1571,25 +1592,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1571
1592
|
}, {
|
|
1572
1593
|
key: "getScheduleTimePoints",
|
|
1573
1594
|
value: (function () {
|
|
1574
|
-
var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1595
|
+
var _getScheduleTimePoints = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
|
|
1575
1596
|
var result;
|
|
1576
|
-
return _regeneratorRuntime().wrap(function
|
|
1577
|
-
while (1) switch (
|
|
1597
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1598
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1578
1599
|
case 0:
|
|
1579
|
-
|
|
1600
|
+
_context23.next = 2;
|
|
1580
1601
|
return this.request.post('/menu/schedule-time-points', {
|
|
1581
1602
|
menu_list_ids: params.menu_list_ids
|
|
1582
1603
|
}, {
|
|
1583
1604
|
osServer: true
|
|
1584
1605
|
});
|
|
1585
1606
|
case 2:
|
|
1586
|
-
result =
|
|
1587
|
-
return
|
|
1607
|
+
result = _context23.sent;
|
|
1608
|
+
return _context23.abrupt("return", result.data || []);
|
|
1588
1609
|
case 4:
|
|
1589
1610
|
case "end":
|
|
1590
|
-
return
|
|
1611
|
+
return _context23.stop();
|
|
1591
1612
|
}
|
|
1592
|
-
},
|
|
1613
|
+
}, _callee23, this);
|
|
1593
1614
|
}));
|
|
1594
1615
|
function getScheduleTimePoints(_x16) {
|
|
1595
1616
|
return _getScheduleTimePoints.apply(this, arguments);
|
|
@@ -1605,30 +1626,30 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1605
1626
|
}, {
|
|
1606
1627
|
key: "getCustomerList",
|
|
1607
1628
|
value: (function () {
|
|
1608
|
-
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1629
|
+
var _getCustomerList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
1609
1630
|
var params,
|
|
1610
1631
|
_result3,
|
|
1611
|
-
|
|
1612
|
-
return _regeneratorRuntime().wrap(function
|
|
1613
|
-
while (1) switch (
|
|
1632
|
+
_args24 = arguments;
|
|
1633
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1634
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1614
1635
|
case 0:
|
|
1615
|
-
params =
|
|
1616
|
-
|
|
1617
|
-
|
|
1636
|
+
params = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
|
|
1637
|
+
_context24.prev = 1;
|
|
1638
|
+
_context24.next = 4;
|
|
1618
1639
|
return this.store.customer.getCustomerList(params);
|
|
1619
1640
|
case 4:
|
|
1620
|
-
_result3 =
|
|
1621
|
-
return
|
|
1641
|
+
_result3 = _context24.sent;
|
|
1642
|
+
return _context24.abrupt("return", _result3);
|
|
1622
1643
|
case 8:
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
console.error('Failed to get customer list:',
|
|
1626
|
-
throw
|
|
1644
|
+
_context24.prev = 8;
|
|
1645
|
+
_context24.t0 = _context24["catch"](1);
|
|
1646
|
+
console.error('Failed to get customer list:', _context24.t0);
|
|
1647
|
+
throw _context24.t0;
|
|
1627
1648
|
case 12:
|
|
1628
1649
|
case "end":
|
|
1629
|
-
return
|
|
1650
|
+
return _context24.stop();
|
|
1630
1651
|
}
|
|
1631
|
-
},
|
|
1652
|
+
}, _callee24, this, [[1, 8]]);
|
|
1632
1653
|
}));
|
|
1633
1654
|
function getCustomerList() {
|
|
1634
1655
|
return _getCustomerList.apply(this, arguments);
|
|
@@ -1738,7 +1759,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1738
1759
|
var _this$store$order$get3,
|
|
1739
1760
|
_this3 = this;
|
|
1740
1761
|
if (!customer) {
|
|
1741
|
-
this.clearOrderCustomer(
|
|
1762
|
+
this.clearOrderCustomer({
|
|
1763
|
+
preserveContactInfo: (options === null || options === void 0 ? void 0 : options.source) === 'detailHydrate'
|
|
1764
|
+
});
|
|
1742
1765
|
return;
|
|
1743
1766
|
}
|
|
1744
1767
|
var previousCustomerId = (_this$store$order$get3 = this.store.order.getOrderCustomer()) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.customer_id;
|
|
@@ -1749,6 +1772,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1749
1772
|
this.discountConfigCacheKey = null;
|
|
1750
1773
|
this.hasManualDiscountSelection = false;
|
|
1751
1774
|
}
|
|
1775
|
+
if (!customerUnchanged && (options === null || options === void 0 ? void 0 : options.source) !== 'detailHydrate') {
|
|
1776
|
+
this.store.order.updateTempOrderContactsInfo(cloneDeep(extractCustomerContactInfo(customer)));
|
|
1777
|
+
}
|
|
1752
1778
|
this.store.order.setOrderCustomer(patch, customer);
|
|
1753
1779
|
var snapshotAfterOrderSet = this.store.order.getOrderCustomerSnapshot();
|
|
1754
1780
|
if (customerUnchanged) {
|
|
@@ -1806,10 +1832,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1806
1832
|
*/
|
|
1807
1833
|
}, {
|
|
1808
1834
|
key: "clearOrderCustomer",
|
|
1809
|
-
value: function clearOrderCustomer() {
|
|
1835
|
+
value: function clearOrderCustomer(options) {
|
|
1810
1836
|
var _discountModule$setOr,
|
|
1811
1837
|
_discountModule$setDi,
|
|
1812
1838
|
_this4 = this;
|
|
1839
|
+
if (!(options !== null && options !== void 0 && options.preserveContactInfo)) this.store.order.updateTempOrderContactsInfo(null);
|
|
1813
1840
|
this.store.order.clearOrderCustomer();
|
|
1814
1841
|
this.discountConfigCacheKey = null;
|
|
1815
1842
|
this.hasManualDiscountSelection = false;
|
|
@@ -1848,24 +1875,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1848
1875
|
}, {
|
|
1849
1876
|
key: "restoreOrder",
|
|
1850
1877
|
value: (function () {
|
|
1851
|
-
var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1878
|
+
var _restoreOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
1852
1879
|
var _this$store$customer;
|
|
1853
1880
|
var tempOrder;
|
|
1854
|
-
return _regeneratorRuntime().wrap(function
|
|
1855
|
-
while (1) switch (
|
|
1881
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1882
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1856
1883
|
case 0:
|
|
1857
|
-
|
|
1884
|
+
_context25.next = 2;
|
|
1858
1885
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "restoreOrder", this).call(this);
|
|
1859
1886
|
case 2:
|
|
1860
|
-
tempOrder =
|
|
1887
|
+
tempOrder = _context25.sent;
|
|
1861
1888
|
this.clearOrderCustomer();
|
|
1862
1889
|
(_this$store$customer = this.store.customer) === null || _this$store$customer === void 0 || _this$store$customer.setSelectedCustomer(null);
|
|
1863
|
-
return
|
|
1890
|
+
return _context25.abrupt("return", tempOrder);
|
|
1864
1891
|
case 6:
|
|
1865
1892
|
case "end":
|
|
1866
|
-
return
|
|
1893
|
+
return _context25.stop();
|
|
1867
1894
|
}
|
|
1868
|
-
},
|
|
1895
|
+
}, _callee25, this);
|
|
1869
1896
|
}));
|
|
1870
1897
|
function restoreOrder() {
|
|
1871
1898
|
return _restoreOrder.apply(this, arguments);
|
|
@@ -1900,27 +1927,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1900
1927
|
return this.orderCustomerDiscountRefreshInFlight;
|
|
1901
1928
|
}
|
|
1902
1929
|
var previousRefresh = this.orderCustomerDiscountRefreshInFlight;
|
|
1903
|
-
var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1930
|
+
var refreshTask = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
1904
1931
|
var _this5$store$order$ge, _this5$store$order, _this5$getOrderIdenti;
|
|
1905
1932
|
var currentCustomer, currentTempOrder, currentOrderIdentity, currentOrderId, currentAction, currentOrderTarget;
|
|
1906
|
-
return _regeneratorRuntime().wrap(function
|
|
1907
|
-
while (1) switch (
|
|
1933
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1934
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1908
1935
|
case 0:
|
|
1909
1936
|
if (!previousRefresh) {
|
|
1910
|
-
|
|
1937
|
+
_context26.next = 3;
|
|
1911
1938
|
break;
|
|
1912
1939
|
}
|
|
1913
|
-
|
|
1940
|
+
_context26.next = 3;
|
|
1914
1941
|
return previousRefresh.catch(function () {
|
|
1915
1942
|
return undefined;
|
|
1916
1943
|
});
|
|
1917
1944
|
case 3:
|
|
1918
1945
|
currentCustomer = _this5.store.order.getOrderCustomer();
|
|
1919
1946
|
if (!(!currentCustomer || Number(currentCustomer.customer_id) !== customerId)) {
|
|
1920
|
-
|
|
1947
|
+
_context26.next = 6;
|
|
1921
1948
|
break;
|
|
1922
1949
|
}
|
|
1923
|
-
return
|
|
1950
|
+
return _context26.abrupt("return");
|
|
1924
1951
|
case 6:
|
|
1925
1952
|
currentTempOrder = (_this5$store$order$ge = (_this5$store$order = _this5.store.order).getTempOrder) === null || _this5$store$order$ge === void 0 ? void 0 : _this5$store$order$ge.call(_this5$store$order);
|
|
1926
1953
|
currentOrderIdentity = (_this5$getOrderIdenti = _this5.getOrderIdentity) === null || _this5$getOrderIdenti === void 0 ? void 0 : _this5$getOrderIdenti.call(_this5);
|
|
@@ -1928,12 +1955,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1928
1955
|
currentAction = !currentOrderId || String(currentOrderId).startsWith('local_order') ? 'create' : 'edit';
|
|
1929
1956
|
currentOrderTarget = currentOrderId ? "order:".concat(String(currentOrderId)) : "external:".concat(String((currentTempOrder === null || currentTempOrder === void 0 ? void 0 : currentTempOrder.external_sale_number) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.externalSaleNumber) || (currentOrderIdentity === null || currentOrderIdentity === void 0 ? void 0 : currentOrderIdentity.localId) || 'new'));
|
|
1930
1957
|
if (!("".concat(customerId, ":").concat(currentAction, ":").concat(currentOrderTarget) !== refreshTarget)) {
|
|
1931
|
-
|
|
1958
|
+
_context26.next = 13;
|
|
1932
1959
|
break;
|
|
1933
1960
|
}
|
|
1934
|
-
return
|
|
1961
|
+
return _context26.abrupt("return");
|
|
1935
1962
|
case 13:
|
|
1936
|
-
|
|
1963
|
+
_context26.next = 15;
|
|
1937
1964
|
return _this5.loadDiscountConfig({
|
|
1938
1965
|
customerId: customerId,
|
|
1939
1966
|
action: action,
|
|
@@ -1941,9 +1968,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1941
1968
|
});
|
|
1942
1969
|
case 15:
|
|
1943
1970
|
case "end":
|
|
1944
|
-
return
|
|
1971
|
+
return _context26.stop();
|
|
1945
1972
|
}
|
|
1946
|
-
},
|
|
1973
|
+
}, _callee26);
|
|
1947
1974
|
}))();
|
|
1948
1975
|
this.orderCustomerDiscountRefreshInFlight = refreshTask;
|
|
1949
1976
|
this.orderCustomerDiscountRefreshCustomerId = customerId;
|
|
@@ -1966,28 +1993,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
1966
1993
|
}, {
|
|
1967
1994
|
key: "prepareProductPriceQueryContext",
|
|
1968
1995
|
value: function () {
|
|
1969
|
-
var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1996
|
+
var _prepareProductPriceQueryContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(customerId) {
|
|
1970
1997
|
var normalizedCustomerId, refreshTask, shouldWait;
|
|
1971
|
-
return _regeneratorRuntime().wrap(function
|
|
1972
|
-
while (1) switch (
|
|
1998
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
1999
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1973
2000
|
case 0:
|
|
1974
|
-
|
|
2001
|
+
_context27.next = 2;
|
|
1975
2002
|
return Promise.resolve();
|
|
1976
2003
|
case 2:
|
|
1977
2004
|
normalizedCustomerId = Number(customerId || 0);
|
|
1978
2005
|
refreshTask = this.orderCustomerDiscountRefreshInFlight;
|
|
1979
2006
|
shouldWait = normalizedCustomerId > 1 && this.orderCustomerDiscountRefreshCustomerId === normalizedCustomerId && Boolean(refreshTask);
|
|
1980
2007
|
if (!(shouldWait && refreshTask)) {
|
|
1981
|
-
|
|
2008
|
+
_context27.next = 8;
|
|
1982
2009
|
break;
|
|
1983
2010
|
}
|
|
1984
|
-
|
|
2011
|
+
_context27.next = 8;
|
|
1985
2012
|
return refreshTask;
|
|
1986
2013
|
case 8:
|
|
1987
2014
|
case "end":
|
|
1988
|
-
return
|
|
2015
|
+
return _context27.stop();
|
|
1989
2016
|
}
|
|
1990
|
-
},
|
|
2017
|
+
}, _callee27, this);
|
|
1991
2018
|
}));
|
|
1992
2019
|
function prepareProductPriceQueryContext(_x17) {
|
|
1993
2020
|
return _prepareProductPriceQueryContext.apply(this, arguments);
|
|
@@ -2042,27 +2069,27 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2042
2069
|
}, {
|
|
2043
2070
|
key: "changeCustomerPage",
|
|
2044
2071
|
value: (function () {
|
|
2045
|
-
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2072
|
+
var _changeCustomerPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(page, pageSize) {
|
|
2046
2073
|
var _result4;
|
|
2047
|
-
return _regeneratorRuntime().wrap(function
|
|
2048
|
-
while (1) switch (
|
|
2074
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2075
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2049
2076
|
case 0:
|
|
2050
|
-
|
|
2051
|
-
|
|
2077
|
+
_context28.prev = 0;
|
|
2078
|
+
_context28.next = 3;
|
|
2052
2079
|
return this.store.customer.changeCustomerPage(page, pageSize);
|
|
2053
2080
|
case 3:
|
|
2054
|
-
_result4 =
|
|
2055
|
-
return
|
|
2081
|
+
_result4 = _context28.sent;
|
|
2082
|
+
return _context28.abrupt("return", _result4);
|
|
2056
2083
|
case 7:
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
console.error('Failed to change customer page:',
|
|
2060
|
-
throw
|
|
2084
|
+
_context28.prev = 7;
|
|
2085
|
+
_context28.t0 = _context28["catch"](0);
|
|
2086
|
+
console.error('Failed to change customer page:', _context28.t0);
|
|
2087
|
+
throw _context28.t0;
|
|
2061
2088
|
case 11:
|
|
2062
2089
|
case "end":
|
|
2063
|
-
return
|
|
2090
|
+
return _context28.stop();
|
|
2064
2091
|
}
|
|
2065
|
-
},
|
|
2092
|
+
}, _callee28, this, [[0, 7]]);
|
|
2066
2093
|
}));
|
|
2067
2094
|
function changeCustomerPage(_x18, _x19) {
|
|
2068
2095
|
return _changeCustomerPage.apply(this, arguments);
|
|
@@ -2077,28 +2104,28 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2077
2104
|
}, {
|
|
2078
2105
|
key: "loadMoreCustomers",
|
|
2079
2106
|
value: (function () {
|
|
2080
|
-
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2107
|
+
var _loadMoreCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
2081
2108
|
var _result5;
|
|
2082
|
-
return _regeneratorRuntime().wrap(function
|
|
2083
|
-
while (1) switch (
|
|
2109
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2110
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2084
2111
|
case 0:
|
|
2085
|
-
|
|
2086
|
-
|
|
2112
|
+
_context29.prev = 0;
|
|
2113
|
+
_context29.next = 3;
|
|
2087
2114
|
return this.store.customer.loadMoreCustomers();
|
|
2088
2115
|
case 3:
|
|
2089
|
-
_result5 =
|
|
2116
|
+
_result5 = _context29.sent;
|
|
2090
2117
|
this.core.effects.emit("".concat(this.name, ":onCustomerListUpdate"), _result5);
|
|
2091
|
-
return
|
|
2118
|
+
return _context29.abrupt("return", _result5);
|
|
2092
2119
|
case 8:
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
console.error('Failed to load more customers:',
|
|
2096
|
-
throw
|
|
2120
|
+
_context29.prev = 8;
|
|
2121
|
+
_context29.t0 = _context29["catch"](0);
|
|
2122
|
+
console.error('Failed to load more customers:', _context29.t0);
|
|
2123
|
+
throw _context29.t0;
|
|
2097
2124
|
case 12:
|
|
2098
2125
|
case "end":
|
|
2099
|
-
return
|
|
2126
|
+
return _context29.stop();
|
|
2100
2127
|
}
|
|
2101
|
-
},
|
|
2128
|
+
}, _callee29, this, [[0, 8]]);
|
|
2102
2129
|
}));
|
|
2103
2130
|
function loadMoreCustomers() {
|
|
2104
2131
|
return _loadMoreCustomers.apply(this, arguments);
|
|
@@ -2114,31 +2141,31 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2114
2141
|
}, {
|
|
2115
2142
|
key: "resetAndLoadCustomers",
|
|
2116
2143
|
value: (function () {
|
|
2117
|
-
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2144
|
+
var _resetAndLoadCustomers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2118
2145
|
var params,
|
|
2119
2146
|
_result6,
|
|
2120
|
-
|
|
2121
|
-
return _regeneratorRuntime().wrap(function
|
|
2122
|
-
while (1) switch (
|
|
2147
|
+
_args30 = arguments;
|
|
2148
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2149
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2123
2150
|
case 0:
|
|
2124
|
-
params =
|
|
2125
|
-
|
|
2126
|
-
|
|
2151
|
+
params = _args30.length > 0 && _args30[0] !== undefined ? _args30[0] : {};
|
|
2152
|
+
_context30.prev = 1;
|
|
2153
|
+
_context30.next = 4;
|
|
2127
2154
|
return this.store.customer.resetAndLoadCustomers(params);
|
|
2128
2155
|
case 4:
|
|
2129
|
-
_result6 =
|
|
2156
|
+
_result6 = _context30.sent;
|
|
2130
2157
|
this.core.effects.emit("".concat(this.name, ":onCustomerListReset"), _result6);
|
|
2131
|
-
return
|
|
2158
|
+
return _context30.abrupt("return", _result6);
|
|
2132
2159
|
case 9:
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
console.error('Failed to reset and load customers:',
|
|
2136
|
-
throw
|
|
2160
|
+
_context30.prev = 9;
|
|
2161
|
+
_context30.t0 = _context30["catch"](1);
|
|
2162
|
+
console.error('Failed to reset and load customers:', _context30.t0);
|
|
2163
|
+
throw _context30.t0;
|
|
2137
2164
|
case 13:
|
|
2138
2165
|
case "end":
|
|
2139
|
-
return
|
|
2166
|
+
return _context30.stop();
|
|
2140
2167
|
}
|
|
2141
|
-
},
|
|
2168
|
+
}, _callee30, this, [[1, 9]]);
|
|
2142
2169
|
}));
|
|
2143
2170
|
function resetAndLoadCustomers() {
|
|
2144
2171
|
return _resetAndLoadCustomers.apply(this, arguments);
|
|
@@ -2299,16 +2326,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2299
2326
|
}, {
|
|
2300
2327
|
key: "getOtherParams",
|
|
2301
2328
|
value: (function () {
|
|
2302
|
-
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2303
|
-
return _regeneratorRuntime().wrap(function
|
|
2304
|
-
while (1) switch (
|
|
2329
|
+
var _getOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
2330
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2331
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2305
2332
|
case 0:
|
|
2306
|
-
return
|
|
2333
|
+
return _context31.abrupt("return", this.otherParams);
|
|
2307
2334
|
case 1:
|
|
2308
2335
|
case "end":
|
|
2309
|
-
return
|
|
2336
|
+
return _context31.stop();
|
|
2310
2337
|
}
|
|
2311
|
-
},
|
|
2338
|
+
}, _callee31, this);
|
|
2312
2339
|
}));
|
|
2313
2340
|
function getOtherParams() {
|
|
2314
2341
|
return _getOtherParams.apply(this, arguments);
|
|
@@ -2632,16 +2659,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2632
2659
|
}, {
|
|
2633
2660
|
key: "updateProductInOrder",
|
|
2634
2661
|
value: (function () {
|
|
2635
|
-
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2636
|
-
return _regeneratorRuntime().wrap(function
|
|
2637
|
-
while (1) switch (
|
|
2662
|
+
var _updateProductInOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
|
|
2663
|
+
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
2664
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
2638
2665
|
case 0:
|
|
2639
|
-
return
|
|
2666
|
+
return _context32.abrupt("return", this.updateOrderProduct(params));
|
|
2640
2667
|
case 1:
|
|
2641
2668
|
case "end":
|
|
2642
|
-
return
|
|
2669
|
+
return _context32.stop();
|
|
2643
2670
|
}
|
|
2644
|
-
},
|
|
2671
|
+
}, _callee32, this);
|
|
2645
2672
|
}));
|
|
2646
2673
|
function updateProductInOrder(_x20) {
|
|
2647
2674
|
return _updateProductInOrder.apply(this, arguments);
|
|
@@ -2665,24 +2692,24 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2665
2692
|
}, {
|
|
2666
2693
|
key: "handleGlobalScanCode",
|
|
2667
2694
|
value: (function () {
|
|
2668
|
-
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2695
|
+
var _handleGlobalScanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(code, bridge) {
|
|
2669
2696
|
var _this7 = this;
|
|
2670
2697
|
var trimmed, _bridge$onNotify, _bridge$refresh, beforeScanCommit, beforeScanDialog, guardCallback, guardedBridge, _promotion$isAccepted, promotion, localSearch, scanCallback, raw, formatted, _bridge$onNotify2, _result7, _bridge$onNotify3;
|
|
2671
|
-
return _regeneratorRuntime().wrap(function
|
|
2672
|
-
while (1) switch (
|
|
2698
|
+
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2699
|
+
while (1) switch (_context33.prev = _context33.next) {
|
|
2673
2700
|
case 0:
|
|
2674
2701
|
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
2675
2702
|
if (trimmed) {
|
|
2676
|
-
|
|
2703
|
+
_context33.next = 4;
|
|
2677
2704
|
break;
|
|
2678
2705
|
}
|
|
2679
2706
|
bridge === null || bridge === void 0 || (_bridge$onNotify = bridge.onNotify) === null || _bridge$onNotify === void 0 || _bridge$onNotify.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
2680
|
-
return
|
|
2707
|
+
return _context33.abrupt("return", {
|
|
2681
2708
|
status: 'failed',
|
|
2682
2709
|
reason: 'empty_code'
|
|
2683
2710
|
});
|
|
2684
2711
|
case 4:
|
|
2685
|
-
|
|
2712
|
+
_context33.prev = 4;
|
|
2686
2713
|
// Capture before lookup/UI awaits, so a result cannot land in a new cart.
|
|
2687
2714
|
// Unscoped POS Order modules return a no-op guard.
|
|
2688
2715
|
beforeScanCommit = this.store.order.createCartIntentCommitGuard('add_product');
|
|
@@ -2709,23 +2736,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2709
2736
|
} : undefined
|
|
2710
2737
|
}) : undefined;
|
|
2711
2738
|
if (!((guardedBridge === null || guardedBridge === void 0 ? void 0 : guardedBridge.scanScope) === 'product-voucher')) {
|
|
2712
|
-
|
|
2739
|
+
_context33.next = 16;
|
|
2713
2740
|
break;
|
|
2714
2741
|
}
|
|
2715
2742
|
if (guardedBridge.applyPromotionCode) {
|
|
2716
|
-
|
|
2743
|
+
_context33.next = 12;
|
|
2717
2744
|
break;
|
|
2718
2745
|
}
|
|
2719
|
-
return
|
|
2746
|
+
return _context33.abrupt("return", {
|
|
2720
2747
|
status: 'failed',
|
|
2721
2748
|
reason: 'no_bridge'
|
|
2722
2749
|
});
|
|
2723
2750
|
case 12:
|
|
2724
|
-
|
|
2751
|
+
_context33.next = 14;
|
|
2725
2752
|
return guardedBridge.applyPromotionCode(trimmed);
|
|
2726
2753
|
case 14:
|
|
2727
|
-
promotion =
|
|
2728
|
-
return
|
|
2754
|
+
promotion = _context33.sent;
|
|
2755
|
+
return _context33.abrupt("return", ((_promotion$isAccepted = promotion.isAccepted) !== null && _promotion$isAccepted !== void 0 ? _promotion$isAccepted : promotion.isAvailable) ? {
|
|
2729
2756
|
status: 'success',
|
|
2730
2757
|
kind: 'promotion'
|
|
2731
2758
|
} : {
|
|
@@ -2737,25 +2764,25 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2737
2764
|
return _this7.store.products.findProductsByCodeOrBarcode(v);
|
|
2738
2765
|
};
|
|
2739
2766
|
scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
|
|
2740
|
-
|
|
2767
|
+
_context33.next = 20;
|
|
2741
2768
|
return scanCallback({
|
|
2742
2769
|
type: 'nativeScanner',
|
|
2743
2770
|
value: trimmed
|
|
2744
2771
|
});
|
|
2745
2772
|
case 20:
|
|
2746
|
-
raw =
|
|
2773
|
+
raw = _context33.sent;
|
|
2747
2774
|
formatted = formatGlobalScanResult(raw, trimmed);
|
|
2748
2775
|
if (formatted) {
|
|
2749
|
-
|
|
2776
|
+
_context33.next = 25;
|
|
2750
2777
|
break;
|
|
2751
2778
|
}
|
|
2752
2779
|
bridge === null || bridge === void 0 || (_bridge$onNotify2 = bridge.onNotify) === null || _bridge$onNotify2 === void 0 || _bridge$onNotify2.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
2753
|
-
return
|
|
2780
|
+
return _context33.abrupt("return", {
|
|
2754
2781
|
status: 'failed',
|
|
2755
2782
|
reason: 'not_found'
|
|
2756
2783
|
});
|
|
2757
2784
|
case 25:
|
|
2758
|
-
|
|
2785
|
+
_context33.next = 27;
|
|
2759
2786
|
return applyGlobalScan({
|
|
2760
2787
|
setOrderCustomer: function setOrderCustomer(customer) {
|
|
2761
2788
|
beforeScanCommit();
|
|
@@ -2796,23 +2823,23 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2796
2823
|
}
|
|
2797
2824
|
}, formatted, guardedBridge);
|
|
2798
2825
|
case 27:
|
|
2799
|
-
_result7 =
|
|
2826
|
+
_result7 = _context33.sent;
|
|
2800
2827
|
bridge === null || bridge === void 0 || (_bridge$refresh = bridge.refresh) === null || _bridge$refresh === void 0 || _bridge$refresh.call(bridge);
|
|
2801
|
-
return
|
|
2828
|
+
return _context33.abrupt("return", _result7);
|
|
2802
2829
|
case 32:
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
console.error('[BookingTicket] handleGlobalScanCode failed',
|
|
2830
|
+
_context33.prev = 32;
|
|
2831
|
+
_context33.t0 = _context33["catch"](4);
|
|
2832
|
+
console.error('[BookingTicket] handleGlobalScanCode failed', _context33.t0);
|
|
2806
2833
|
bridge === null || bridge === void 0 || (_bridge$onNotify3 = bridge.onNotify) === null || _bridge$onNotify3 === void 0 || _bridge$onNotify3.call(bridge, 'fail', 'pisell2.text.scan-global-failed');
|
|
2807
|
-
return
|
|
2834
|
+
return _context33.abrupt("return", {
|
|
2808
2835
|
status: 'failed',
|
|
2809
2836
|
reason: 'not_found'
|
|
2810
2837
|
});
|
|
2811
2838
|
case 37:
|
|
2812
2839
|
case "end":
|
|
2813
|
-
return
|
|
2840
|
+
return _context33.stop();
|
|
2814
2841
|
}
|
|
2815
|
-
},
|
|
2842
|
+
}, _callee33, this, [[4, 32]]);
|
|
2816
2843
|
}));
|
|
2817
2844
|
function handleGlobalScanCode(_x21, _x22) {
|
|
2818
2845
|
return _handleGlobalScanCode.apply(this, arguments);
|
|
@@ -2822,37 +2849,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2822
2849
|
}, {
|
|
2823
2850
|
key: "getGlobalScanCodeType",
|
|
2824
2851
|
value: (function () {
|
|
2825
|
-
var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2852
|
+
var _getGlobalScanCodeType = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(code) {
|
|
2826
2853
|
var _this8 = this,
|
|
2827
2854
|
_formatGlobalScanResu,
|
|
2828
2855
|
_formatGlobalScanResu2;
|
|
2829
2856
|
var trimmed, scan, raw;
|
|
2830
|
-
return _regeneratorRuntime().wrap(function
|
|
2831
|
-
while (1) switch (
|
|
2857
|
+
return _regeneratorRuntime().wrap(function _callee34$(_context34) {
|
|
2858
|
+
while (1) switch (_context34.prev = _context34.next) {
|
|
2832
2859
|
case 0:
|
|
2833
2860
|
trimmed = typeof code === 'string' ? code.trim() : '';
|
|
2834
2861
|
if (trimmed) {
|
|
2835
|
-
|
|
2862
|
+
_context34.next = 3;
|
|
2836
2863
|
break;
|
|
2837
2864
|
}
|
|
2838
|
-
return
|
|
2865
|
+
return _context34.abrupt("return", null);
|
|
2839
2866
|
case 3:
|
|
2840
2867
|
scan = handleGlobalScan(this.request, function (value) {
|
|
2841
2868
|
return _this8.store.products.findProductsByCodeOrBarcode(value);
|
|
2842
2869
|
}, this.getSubmitOrderSalesChannel());
|
|
2843
|
-
|
|
2870
|
+
_context34.next = 6;
|
|
2844
2871
|
return scan({
|
|
2845
2872
|
type: 'nativeScanner',
|
|
2846
2873
|
value: trimmed
|
|
2847
2874
|
});
|
|
2848
2875
|
case 6:
|
|
2849
|
-
raw =
|
|
2850
|
-
return
|
|
2876
|
+
raw = _context34.sent;
|
|
2877
|
+
return _context34.abrupt("return", (_formatGlobalScanResu = (_formatGlobalScanResu2 = formatGlobalScanResult(raw, trimmed)) === null || _formatGlobalScanResu2 === void 0 ? void 0 : _formatGlobalScanResu2.searchType) !== null && _formatGlobalScanResu !== void 0 ? _formatGlobalScanResu : null);
|
|
2851
2878
|
case 8:
|
|
2852
2879
|
case "end":
|
|
2853
|
-
return
|
|
2880
|
+
return _context34.stop();
|
|
2854
2881
|
}
|
|
2855
|
-
},
|
|
2882
|
+
}, _callee34, this);
|
|
2856
2883
|
}));
|
|
2857
2884
|
function getGlobalScanCodeType(_x23) {
|
|
2858
2885
|
return _getGlobalScanCodeType.apply(this, arguments);
|
|
@@ -2936,11 +2963,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2936
2963
|
}, {
|
|
2937
2964
|
key: "addAddTimeProductToBooking",
|
|
2938
2965
|
value: (function () {
|
|
2939
|
-
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2940
|
-
return _regeneratorRuntime().wrap(function
|
|
2941
|
-
while (1) switch (
|
|
2966
|
+
var _addAddTimeProductToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(input) {
|
|
2967
|
+
return _regeneratorRuntime().wrap(function _callee35$(_context35) {
|
|
2968
|
+
while (1) switch (_context35.prev = _context35.next) {
|
|
2942
2969
|
case 0:
|
|
2943
|
-
return
|
|
2970
|
+
return _context35.abrupt("return", this.addAddTimeProductsToBooking({
|
|
2944
2971
|
booking: input.booking,
|
|
2945
2972
|
products: [input],
|
|
2946
2973
|
coveredMinutes: input.coveredMinutes,
|
|
@@ -2948,9 +2975,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2948
2975
|
}));
|
|
2949
2976
|
case 1:
|
|
2950
2977
|
case "end":
|
|
2951
|
-
return
|
|
2978
|
+
return _context35.stop();
|
|
2952
2979
|
}
|
|
2953
|
-
},
|
|
2980
|
+
}, _callee35, this);
|
|
2954
2981
|
}));
|
|
2955
2982
|
function addAddTimeProductToBooking(_x24) {
|
|
2956
2983
|
return _addAddTimeProductToBooking.apply(this, arguments);
|
|
@@ -2970,16 +2997,16 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2970
2997
|
}, {
|
|
2971
2998
|
key: "addAddTimeProductsToBooking",
|
|
2972
2999
|
value: (function () {
|
|
2973
|
-
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3000
|
+
var _addAddTimeProductsToBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(input) {
|
|
2974
3001
|
var _this9 = this,
|
|
2975
3002
|
_input$bookingPatch;
|
|
2976
3003
|
var bookingUid, orderLines, coveredMinutes, bookingTimePatch, result, _iterator2, _step2, line;
|
|
2977
|
-
return _regeneratorRuntime().wrap(function
|
|
2978
|
-
while (1) switch (
|
|
3004
|
+
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
3005
|
+
while (1) switch (_context36.prev = _context36.next) {
|
|
2979
3006
|
case 0:
|
|
2980
3007
|
bookingUid = resolveBookingUidForAddTime(input === null || input === void 0 ? void 0 : input.booking);
|
|
2981
3008
|
if (bookingUid) {
|
|
2982
|
-
|
|
3009
|
+
_context36.next = 3;
|
|
2983
3010
|
break;
|
|
2984
3011
|
}
|
|
2985
3012
|
throw new Error('[BookingTicket] addAddTimeProductToBooking: booking.metadata.unique_identification_number 缺失');
|
|
@@ -2990,7 +3017,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
2990
3017
|
};
|
|
2991
3018
|
});
|
|
2992
3019
|
if (this.store.order) {
|
|
2993
|
-
|
|
3020
|
+
_context36.next = 6;
|
|
2994
3021
|
break;
|
|
2995
3022
|
}
|
|
2996
3023
|
throw new Error('order 模块未初始化');
|
|
@@ -3004,53 +3031,53 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3004
3031
|
});
|
|
3005
3032
|
}
|
|
3006
3033
|
if (!(typeof this.store.order.addProductsToOrder === 'function')) {
|
|
3007
|
-
|
|
3034
|
+
_context36.next = 11;
|
|
3008
3035
|
break;
|
|
3009
3036
|
}
|
|
3010
|
-
return
|
|
3037
|
+
return _context36.abrupt("return", this.store.order.addProductsToOrder(orderLines));
|
|
3011
3038
|
case 11:
|
|
3012
3039
|
result = [];
|
|
3013
3040
|
_iterator2 = _createForOfIteratorHelper(orderLines);
|
|
3014
|
-
|
|
3041
|
+
_context36.prev = 13;
|
|
3015
3042
|
_iterator2.s();
|
|
3016
3043
|
case 15:
|
|
3017
3044
|
if ((_step2 = _iterator2.n()).done) {
|
|
3018
|
-
|
|
3045
|
+
_context36.next = 29;
|
|
3019
3046
|
break;
|
|
3020
3047
|
}
|
|
3021
3048
|
line = _step2.value;
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3049
|
+
_context36.t0 = result.splice;
|
|
3050
|
+
_context36.t1 = result;
|
|
3051
|
+
_context36.t2 = [0, result.length];
|
|
3052
|
+
_context36.t3 = _toConsumableArray;
|
|
3053
|
+
_context36.next = 23;
|
|
3027
3054
|
return this.addProductToOrder(line.product);
|
|
3028
3055
|
case 23:
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3056
|
+
_context36.t4 = _context36.sent;
|
|
3057
|
+
_context36.t5 = (0, _context36.t3)(_context36.t4);
|
|
3058
|
+
_context36.t6 = _context36.t2.concat.call(_context36.t2, _context36.t5);
|
|
3059
|
+
_context36.t0.apply.call(_context36.t0, _context36.t1, _context36.t6);
|
|
3033
3060
|
case 27:
|
|
3034
|
-
|
|
3061
|
+
_context36.next = 15;
|
|
3035
3062
|
break;
|
|
3036
3063
|
case 29:
|
|
3037
|
-
|
|
3064
|
+
_context36.next = 34;
|
|
3038
3065
|
break;
|
|
3039
3066
|
case 31:
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
_iterator2.e(
|
|
3067
|
+
_context36.prev = 31;
|
|
3068
|
+
_context36.t7 = _context36["catch"](13);
|
|
3069
|
+
_iterator2.e(_context36.t7);
|
|
3043
3070
|
case 34:
|
|
3044
|
-
|
|
3071
|
+
_context36.prev = 34;
|
|
3045
3072
|
_iterator2.f();
|
|
3046
|
-
return
|
|
3073
|
+
return _context36.finish(34);
|
|
3047
3074
|
case 37:
|
|
3048
|
-
return
|
|
3075
|
+
return _context36.abrupt("return", result);
|
|
3049
3076
|
case 38:
|
|
3050
3077
|
case "end":
|
|
3051
|
-
return
|
|
3078
|
+
return _context36.stop();
|
|
3052
3079
|
}
|
|
3053
|
-
},
|
|
3080
|
+
}, _callee36, this, [[13, 31, 34, 37]]);
|
|
3054
3081
|
}));
|
|
3055
3082
|
function addAddTimeProductsToBooking(_x25) {
|
|
3056
3083
|
return _addAddTimeProductsToBooking.apply(this, arguments);
|
|
@@ -3060,40 +3087,40 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3060
3087
|
}, {
|
|
3061
3088
|
key: "setOtherParams",
|
|
3062
3089
|
value: function () {
|
|
3063
|
-
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3090
|
+
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(params) {
|
|
3064
3091
|
var _ref19,
|
|
3065
3092
|
_ref19$cover,
|
|
3066
3093
|
cover,
|
|
3067
3094
|
invoiceContextChanged,
|
|
3068
|
-
|
|
3069
|
-
return _regeneratorRuntime().wrap(function
|
|
3070
|
-
while (1) switch (
|
|
3095
|
+
_args37 = arguments;
|
|
3096
|
+
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3097
|
+
while (1) switch (_context37.prev = _context37.next) {
|
|
3071
3098
|
case 0:
|
|
3072
|
-
_ref19 =
|
|
3073
|
-
|
|
3099
|
+
_ref19 = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : {}, _ref19$cover = _ref19.cover, cover = _ref19$cover === void 0 ? false : _ref19$cover;
|
|
3100
|
+
_context37.next = 3;
|
|
3074
3101
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "setOtherParams", this).call(this, params, {
|
|
3075
3102
|
cover: cover
|
|
3076
3103
|
});
|
|
3077
3104
|
case 3:
|
|
3078
3105
|
invoiceContextChanged = (params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined || (params === null || params === void 0 ? void 0 : params.channel) !== undefined || (params === null || params === void 0 ? void 0 : params.platform) !== undefined || Object.prototype.hasOwnProperty.call(params, 'openData');
|
|
3079
3106
|
if (!invoiceContextChanged) {
|
|
3080
|
-
|
|
3107
|
+
_context37.next = 7;
|
|
3081
3108
|
break;
|
|
3082
3109
|
}
|
|
3083
|
-
|
|
3110
|
+
_context37.next = 7;
|
|
3084
3111
|
return this.prepareInvoiceTemplateAtSolutionReady(Object.prototype.hasOwnProperty.call(params, 'openData') ? this.getInjectedOpenDataConfig() : undefined);
|
|
3085
3112
|
case 7:
|
|
3086
3113
|
if (!((params === null || params === void 0 ? void 0 : params.businessCode) !== undefined || (params === null || params === void 0 ? void 0 : params.business_code) !== undefined)) {
|
|
3087
|
-
|
|
3114
|
+
_context37.next = 10;
|
|
3088
3115
|
break;
|
|
3089
3116
|
}
|
|
3090
|
-
|
|
3117
|
+
_context37.next = 10;
|
|
3091
3118
|
return this.configureIdGeneratorFromOpenData();
|
|
3092
3119
|
case 10:
|
|
3093
3120
|
case "end":
|
|
3094
|
-
return
|
|
3121
|
+
return _context37.stop();
|
|
3095
3122
|
}
|
|
3096
|
-
},
|
|
3123
|
+
}, _callee37, this);
|
|
3097
3124
|
}));
|
|
3098
3125
|
function setOtherParams(_x26) {
|
|
3099
3126
|
return _setOtherParams.apply(this, arguments);
|
|
@@ -3112,15 +3139,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3112
3139
|
}, {
|
|
3113
3140
|
key: "handlePrintWristband",
|
|
3114
3141
|
value: function () {
|
|
3115
|
-
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3142
|
+
var _handlePrintWristband = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(params) {
|
|
3116
3143
|
var _this$getOrderIdentit2;
|
|
3117
3144
|
var deviceTask, deviceId, idempotencyKey;
|
|
3118
|
-
return _regeneratorRuntime().wrap(function
|
|
3119
|
-
while (1) switch (
|
|
3145
|
+
return _regeneratorRuntime().wrap(function _callee38$(_context38) {
|
|
3146
|
+
while (1) switch (_context38.prev = _context38.next) {
|
|
3120
3147
|
case 0:
|
|
3121
3148
|
deviceTask = this.getDeviceTaskPlugin();
|
|
3122
3149
|
if (deviceTask !== null && deviceTask !== void 0 && deviceTask.dispatch) {
|
|
3123
|
-
|
|
3150
|
+
_context38.next = 4;
|
|
3124
3151
|
break;
|
|
3125
3152
|
}
|
|
3126
3153
|
this.logger.addLog({
|
|
@@ -3130,7 +3157,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3130
3157
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3131
3158
|
}
|
|
3132
3159
|
});
|
|
3133
|
-
return
|
|
3160
|
+
return _context38.abrupt("return");
|
|
3134
3161
|
case 4:
|
|
3135
3162
|
this.logger.addLog({
|
|
3136
3163
|
type: 'info',
|
|
@@ -3139,10 +3166,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3139
3166
|
voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
|
|
3140
3167
|
}
|
|
3141
3168
|
});
|
|
3142
|
-
|
|
3169
|
+
_context38.next = 7;
|
|
3143
3170
|
return this.getShortNumberOrDeviceId();
|
|
3144
3171
|
case 7:
|
|
3145
|
-
deviceId =
|
|
3172
|
+
deviceId = _context38.sent;
|
|
3146
3173
|
idempotencyKey = createUuidV4();
|
|
3147
3174
|
deviceTask.dispatch({
|
|
3148
3175
|
action: 'print_all',
|
|
@@ -3162,9 +3189,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3162
3189
|
});
|
|
3163
3190
|
case 10:
|
|
3164
3191
|
case "end":
|
|
3165
|
-
return
|
|
3192
|
+
return _context38.stop();
|
|
3166
3193
|
}
|
|
3167
|
-
},
|
|
3194
|
+
}, _callee38, this);
|
|
3168
3195
|
}));
|
|
3169
3196
|
function handlePrintWristband(_x27) {
|
|
3170
3197
|
return _handlePrintWristband.apply(this, arguments);
|
|
@@ -3174,11 +3201,11 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3174
3201
|
}, {
|
|
3175
3202
|
key: "handleRedeem",
|
|
3176
3203
|
value: function () {
|
|
3177
|
-
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3204
|
+
var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(params) {
|
|
3178
3205
|
var _this$store$order8, _this$store$order8$ge, _this$store$order9, _ref20, _tempOrder$order_id2;
|
|
3179
3206
|
var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
|
|
3180
|
-
return _regeneratorRuntime().wrap(function
|
|
3181
|
-
while (1) switch (
|
|
3207
|
+
return _regeneratorRuntime().wrap(function _callee39$(_context39) {
|
|
3208
|
+
while (1) switch (_context39.prev = _context39.next) {
|
|
3182
3209
|
case 0:
|
|
3183
3210
|
voucherIds = Array.isArray(params.voucher_ids) ? params.voucher_ids : [];
|
|
3184
3211
|
status = params.is_checkin ? 'used' : 'unused';
|
|
@@ -3202,20 +3229,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3202
3229
|
});
|
|
3203
3230
|
});
|
|
3204
3231
|
if (!(tempOrder && hasUpdatedVoucher)) {
|
|
3205
|
-
|
|
3232
|
+
_context39.next = 11;
|
|
3206
3233
|
break;
|
|
3207
3234
|
}
|
|
3208
|
-
|
|
3235
|
+
_context39.next = 11;
|
|
3209
3236
|
return this.replaceTempOrder(_objectSpread(_objectSpread({}, tempOrder), {}, {
|
|
3210
3237
|
vouchers: nextVouchers
|
|
3211
3238
|
}));
|
|
3212
3239
|
case 11:
|
|
3213
3240
|
this.core.effects.emit("".concat(this.name, ":onVouchersChange"), {});
|
|
3214
3241
|
if (!(voucherIds.length === 0)) {
|
|
3215
|
-
|
|
3242
|
+
_context39.next = 14;
|
|
3216
3243
|
break;
|
|
3217
3244
|
}
|
|
3218
|
-
return
|
|
3245
|
+
return _context39.abrupt("return", {
|
|
3219
3246
|
code: 200,
|
|
3220
3247
|
status: true,
|
|
3221
3248
|
message: '',
|
|
@@ -3226,7 +3253,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3226
3253
|
externalSaleNumber = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.external_sale_number) || (identity === null || identity === void 0 ? void 0 : identity.externalSaleNumber) || undefined;
|
|
3227
3254
|
orderId = (_ref20 = (_tempOrder$order_id2 = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.order_id) !== null && _tempOrder$order_id2 !== void 0 ? _tempOrder$order_id2 : identity === null || identity === void 0 ? void 0 : identity.orderId) !== null && _ref20 !== void 0 ? _ref20 : undefined;
|
|
3228
3255
|
orderLookup = externalSaleNumber || orderId || (identity === null || identity === void 0 ? void 0 : identity.orderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopOrderNumber) || (identity === null || identity === void 0 ? void 0 : identity.shopFullOrderNumber) || undefined;
|
|
3229
|
-
return
|
|
3256
|
+
return _context39.abrupt("return", this.request.post('/machinecode/batch', {
|
|
3230
3257
|
ids: voucherIds,
|
|
3231
3258
|
status: status,
|
|
3232
3259
|
order_lookup: orderLookup,
|
|
@@ -3237,9 +3264,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3237
3264
|
}));
|
|
3238
3265
|
case 19:
|
|
3239
3266
|
case "end":
|
|
3240
|
-
return
|
|
3267
|
+
return _context39.stop();
|
|
3241
3268
|
}
|
|
3242
|
-
},
|
|
3269
|
+
}, _callee39, this);
|
|
3243
3270
|
}));
|
|
3244
3271
|
function handleRedeem(_x28) {
|
|
3245
3272
|
return _handleRedeem.apply(this, arguments);
|
|
@@ -3253,12 +3280,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3253
3280
|
}, {
|
|
3254
3281
|
key: "destroy",
|
|
3255
3282
|
value: (function () {
|
|
3256
|
-
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
3283
|
+
var _destroy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
|
|
3257
3284
|
var _this$scan;
|
|
3258
|
-
return _regeneratorRuntime().wrap(function
|
|
3259
|
-
while (1) switch (
|
|
3285
|
+
return _regeneratorRuntime().wrap(function _callee40$(_context40) {
|
|
3286
|
+
while (1) switch (_context40.prev = _context40.next) {
|
|
3260
3287
|
case 0:
|
|
3261
|
-
|
|
3288
|
+
_context40.next = 2;
|
|
3262
3289
|
return _get(_getPrototypeOf(BookingTicketImpl.prototype), "destroy", this).call(this);
|
|
3263
3290
|
case 2:
|
|
3264
3291
|
try {
|
|
@@ -3269,9 +3296,9 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
3269
3296
|
scanCache.clear();
|
|
3270
3297
|
case 4:
|
|
3271
3298
|
case "end":
|
|
3272
|
-
return
|
|
3299
|
+
return _context40.stop();
|
|
3273
3300
|
}
|
|
3274
|
-
},
|
|
3301
|
+
}, _callee40, this);
|
|
3275
3302
|
}));
|
|
3276
3303
|
function destroy() {
|
|
3277
3304
|
return _destroy.apply(this, arguments);
|