@pisell/private-materials 6.3.175 → 6.3.177
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -1
- package/es/components/scanOrder/components/Check/index.js +187 -46
- package/es/components/scanOrder/components/Check/index.less +39 -0
- package/es/components/scanOrder/components/Content/index.js +189 -72
- package/es/components/scanOrder/components/Menu/index.js +11 -5
- package/es/components/scanOrder/hooks.js +7 -0
- package/es/components/scanOrder/locales.d.ts +75 -0
- package/es/components/scanOrder/locales.js +75 -0
- package/es/components/venueBooking/components/Voucher/index.js +6 -1
- package/es/pro/Login2.0/locales.js +1 -1
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -1
- package/lib/components/scanOrder/components/Check/index.js +116 -3
- package/lib/components/scanOrder/components/Check/index.less +39 -0
- package/lib/components/scanOrder/components/Content/index.js +106 -25
- package/lib/components/scanOrder/components/Menu/index.js +2 -0
- package/lib/components/scanOrder/hooks.js +7 -0
- package/lib/components/scanOrder/locales.d.ts +75 -0
- package/lib/components/scanOrder/locales.js +75 -0
- package/lib/components/venueBooking/components/Voucher/index.js +5 -1
- package/lib/pro/Login2.0/locales.js +1 -1
- package/package.json +1 -1
|
@@ -82,7 +82,6 @@ function ReadyState() {
|
|
|
82
82
|
resumeStep = _useScanOrderContext.resumeStep,
|
|
83
83
|
consumeResumeStep = _useScanOrderContext.consumeResumeStep;
|
|
84
84
|
var _useScanOrderLogin = useScanOrderLogin(),
|
|
85
|
-
isLogin = _useScanOrderLogin.isLogin,
|
|
86
85
|
openLoginModal = _useScanOrderLogin.openLoginModal;
|
|
87
86
|
var utils = contextUtils();
|
|
88
87
|
var _useComponents = useComponents({
|
|
@@ -215,6 +214,7 @@ function ReadyState() {
|
|
|
215
214
|
var requestPaxMinRef = useRef(1);
|
|
216
215
|
var requestPaxMaxRef = useRef(1);
|
|
217
216
|
var tableFormRecordRef = useRef(null);
|
|
217
|
+
var entryLoginPromptedRef = useRef(false);
|
|
218
218
|
/** 本次会话是否曾实际弹出过入口人数弹窗(商品页返回首页前可二次弹窗) */
|
|
219
219
|
var entryPaxModalWasPresentedRef = useRef(false);
|
|
220
220
|
|
|
@@ -258,6 +258,10 @@ function ReadyState() {
|
|
|
258
258
|
};
|
|
259
259
|
};
|
|
260
260
|
var app = utils === null || utils === void 0 || (_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.call(utils);
|
|
261
|
+
var getCurrentIsLogin = function getCurrentIsLogin() {
|
|
262
|
+
var _utils$token, _utils$token$get;
|
|
263
|
+
return Boolean(utils === null || utils === void 0 || (_utils$token = utils.token) === null || _utils$token === void 0 || (_utils$token$get = _utils$token.get) === null || _utils$token$get === void 0 ? void 0 : _utils$token$get.call(_utils$token));
|
|
264
|
+
};
|
|
261
265
|
|
|
262
266
|
/** 回站点首页(与商品步返回兜底一致) */
|
|
263
267
|
var navigateToHome = function navigateToHome() {
|
|
@@ -521,17 +525,17 @@ function ReadyState() {
|
|
|
521
525
|
return utils === null || utils === void 0 || (_utils$request = utils.request) === null || _utils$request === void 0 || (_utils$request$get = _utils$request.get) === null || _utils$request$get === void 0 ? void 0 : _utils$request$get.call(_utils$request, "/h5/shop-policy/".concat(id), {});
|
|
522
526
|
};
|
|
523
527
|
useEffect(function () {
|
|
524
|
-
var
|
|
525
|
-
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
526
|
-
var hasOrderId, _yield$runModuleActio, mode, order_id, errorTips, policy, form, partyroom_booking, requestEntryPax, requestPaxMin, requestPaxMax, table_form_record, normalizedFormPayload, isAdditionalOrder, normalizedPolicyPayload, tips,
|
|
527
|
-
return _regeneratorRuntime().wrap(function
|
|
528
|
-
while (1) switch (
|
|
528
|
+
var runResourceCheck = /*#__PURE__*/function () {
|
|
529
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
530
|
+
var hasOrderId, _yield$runModuleActio, mode, order_id, errorTips, policy, form, partyroom_booking, requestEntryPax, requestPaxMin, requestPaxMax, table_form_record, normalizedFormPayload, isAdditionalOrder, normalizedPolicyPayload, allowAddItems, openLoginForOrderDetail, tips, _openLoginForOrderDetail, content, _content;
|
|
531
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
532
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
529
533
|
case 0:
|
|
530
534
|
hasOrderId = !!(entryContext !== null && entryContext !== void 0 && entryContext.order_id);
|
|
531
|
-
|
|
535
|
+
_context7.next = 3;
|
|
532
536
|
return runModuleAction('checkResourceAvailable', entryContext === null || entryContext === void 0 ? void 0 : entryContext.resource_id, hasOrderId);
|
|
533
537
|
case 3:
|
|
534
|
-
_yield$runModuleActio =
|
|
538
|
+
_yield$runModuleActio = _context7.sent;
|
|
535
539
|
mode = _yield$runModuleActio.mode;
|
|
536
540
|
order_id = _yield$runModuleActio.order_id;
|
|
537
541
|
errorTips = _yield$runModuleActio.errorTips;
|
|
@@ -552,14 +556,14 @@ function ReadyState() {
|
|
|
552
556
|
setEntryMode(isAdditionalOrder ? 'additional_order' : 'default');
|
|
553
557
|
// 资源空闲:按需依次弹 协议 -> 表单 -> 人数,最后进入商品选择
|
|
554
558
|
if (!(mode === 'idle')) {
|
|
555
|
-
|
|
559
|
+
_context7.next = 35;
|
|
556
560
|
break;
|
|
557
561
|
}
|
|
558
562
|
normalizedPolicyPayload = _typeof(policy) === 'object' && policy !== null ? policy : {
|
|
559
563
|
id: policy
|
|
560
564
|
}; // 步骤缓存:同一 resourceId 会话内已确认过协议则跳过
|
|
561
565
|
if (!(normalizedPolicyPayload !== null && normalizedPolicyPayload !== void 0 && normalizedPolicyPayload.id && !isGatePassed('policyAccepted'))) {
|
|
562
|
-
|
|
566
|
+
_context7.next = 28;
|
|
563
567
|
break;
|
|
564
568
|
}
|
|
565
569
|
setPendingFormPayload(normalizedFormPayload);
|
|
@@ -567,76 +571,172 @@ function ReadyState() {
|
|
|
567
571
|
open: true,
|
|
568
572
|
content: normalizedPolicyPayload
|
|
569
573
|
});
|
|
570
|
-
return
|
|
574
|
+
return _context7.abrupt("return");
|
|
571
575
|
case 28:
|
|
572
576
|
if (!(normalizedFormPayload && !isGatePassed('formSubmitted'))) {
|
|
573
|
-
|
|
577
|
+
_context7.next = 31;
|
|
574
578
|
break;
|
|
575
579
|
}
|
|
576
580
|
openFormModal(normalizedFormPayload);
|
|
577
|
-
return
|
|
581
|
+
return _context7.abrupt("return");
|
|
578
582
|
case 31:
|
|
579
|
-
|
|
583
|
+
_context7.next = 33;
|
|
580
584
|
return runEntryPaxGateThenEnterProduct();
|
|
581
585
|
case 33:
|
|
582
|
-
|
|
586
|
+
_context7.next = 62;
|
|
583
587
|
break;
|
|
584
588
|
case 35:
|
|
585
589
|
if (!isAdditionalOrder) {
|
|
586
|
-
|
|
590
|
+
_context7.next = 54;
|
|
587
591
|
break;
|
|
588
592
|
}
|
|
589
|
-
|
|
590
|
-
return
|
|
593
|
+
_context7.next = 38;
|
|
594
|
+
return runModuleAction('checkAllowAddItems');
|
|
591
595
|
case 38:
|
|
592
|
-
|
|
596
|
+
allowAddItems = _context7.sent;
|
|
597
|
+
if (getCurrentIsLogin()) {
|
|
598
|
+
_context7.next = 45;
|
|
599
|
+
break;
|
|
600
|
+
}
|
|
601
|
+
openLoginForOrderDetail = function openLoginForOrderDetail() {
|
|
602
|
+
var _scanOrderModule$setU;
|
|
603
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$setU = scanOrderModule.setUIState) === null || _scanOrderModule$setU === void 0 || _scanOrderModule$setU.call(scanOrderModule, 'pendingStep', currentStep);
|
|
604
|
+
openLoginModal({
|
|
605
|
+
callback: function () {
|
|
606
|
+
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(status) {
|
|
607
|
+
var loginRequiredModal;
|
|
608
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
609
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
610
|
+
case 0:
|
|
611
|
+
if (!(status === 'success')) {
|
|
612
|
+
_context6.next = 9;
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
if (!(!(entryContext !== null && entryContext !== void 0 && entryContext.order_id) || !allowAddItems.enabled)) {
|
|
616
|
+
_context6.next = 4;
|
|
617
|
+
break;
|
|
618
|
+
}
|
|
619
|
+
handleOrderDetail(order_id);
|
|
620
|
+
return _context6.abrupt("return");
|
|
621
|
+
case 4:
|
|
622
|
+
_context6.next = 6;
|
|
623
|
+
return runModuleAction('restorePreviousOrderData');
|
|
624
|
+
case 6:
|
|
625
|
+
_context6.next = 8;
|
|
626
|
+
return enterProductStep();
|
|
627
|
+
case 8:
|
|
628
|
+
return _context6.abrupt("return");
|
|
629
|
+
case 9:
|
|
630
|
+
console.log('status>>>>>>>', status);
|
|
631
|
+
loginRequiredModal = Modal.info({
|
|
632
|
+
title: locales.getText('pisell2.scan.order.add.on.login.required.title'),
|
|
633
|
+
content: String(locales.getText('pisell2.scan.order.add.on.login.required') || '').trim(),
|
|
634
|
+
okText: String(locales.getText('pisell2.event.confirm') || 'OK'),
|
|
635
|
+
maskClosable: false,
|
|
636
|
+
onOk: function onOk() {
|
|
637
|
+
loginRequiredModal.destroy();
|
|
638
|
+
openLoginForOrderDetail();
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
case 11:
|
|
642
|
+
case "end":
|
|
643
|
+
return _context6.stop();
|
|
644
|
+
}
|
|
645
|
+
}, _callee6);
|
|
646
|
+
}));
|
|
647
|
+
function callback(_x) {
|
|
648
|
+
return _callback.apply(this, arguments);
|
|
649
|
+
}
|
|
650
|
+
return callback;
|
|
651
|
+
}()
|
|
652
|
+
});
|
|
653
|
+
};
|
|
654
|
+
openLoginForOrderDetail();
|
|
655
|
+
return _context7.abrupt("return");
|
|
656
|
+
case 45:
|
|
657
|
+
if (!(!(entryContext !== null && entryContext !== void 0 && entryContext.order_id) || !allowAddItems.enabled)) {
|
|
658
|
+
_context7.next = 48;
|
|
659
|
+
break;
|
|
660
|
+
}
|
|
661
|
+
handleOrderDetail(order_id);
|
|
662
|
+
return _context7.abrupt("return");
|
|
663
|
+
case 48:
|
|
664
|
+
_context7.next = 50;
|
|
665
|
+
return runModuleAction('restorePreviousOrderData');
|
|
666
|
+
case 50:
|
|
667
|
+
_context7.next = 52;
|
|
668
|
+
return enterProductStep();
|
|
669
|
+
case 52:
|
|
670
|
+
_context7.next = 62;
|
|
593
671
|
break;
|
|
594
|
-
case
|
|
672
|
+
case 54:
|
|
595
673
|
if (!(mode === 'submit_disabled')) {
|
|
596
|
-
|
|
674
|
+
_context7.next = 61;
|
|
597
675
|
break;
|
|
598
676
|
}
|
|
599
677
|
// 禁止下单模式:允许进入商品选择,但下一步按钮需被禁用,点击提示 errorTips
|
|
600
678
|
tips = resolveLocalizedText(errorTips) || String(locales.getText('pisell2.scan.order.submit.disabled.default') || '');
|
|
601
679
|
setSubmitDisabledTips(tips);
|
|
602
|
-
|
|
680
|
+
_context7.next = 59;
|
|
603
681
|
return enterProductStep();
|
|
604
|
-
case
|
|
605
|
-
|
|
682
|
+
case 59:
|
|
683
|
+
_context7.next = 62;
|
|
606
684
|
break;
|
|
607
|
-
case
|
|
608
|
-
if (mode === '
|
|
685
|
+
case 61:
|
|
686
|
+
if (mode === 'multiple_orders') {
|
|
687
|
+
Modal.info({
|
|
688
|
+
title: locales.getText('pisell2.scan.order.step.error'),
|
|
689
|
+
content: String(locales.getText('pisell2.scan.order.multiple.orders.tip') || '').trim(),
|
|
690
|
+
okText: String(locales.getText('pisell2.scan.order.multiple.orders.confirm') || 'I Got It'),
|
|
691
|
+
maskClosable: false,
|
|
692
|
+
onOk: function onOk() {
|
|
693
|
+
navigateToHome();
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
} else if (mode === 'resource_busy') {
|
|
609
697
|
// 如果资源是占用,则跳转到订单详情页
|
|
610
698
|
// 需要检测当前是否已经登录,如果未登录则先登录再跳转
|
|
611
|
-
//
|
|
612
|
-
// 没有合法后续状态,统一兜底回首页避免卡死。
|
|
699
|
+
// 若用户直接关闭登录弹窗(非登录成功),提示需要登录,确定后再次拉起登录弹窗。
|
|
613
700
|
if (Number(order_id) !== 0) {
|
|
614
|
-
if (!
|
|
701
|
+
if (!getCurrentIsLogin()) {
|
|
615
702
|
// 登录回流意图:登录成功后 hydrate 阶段消费 pendingStep,避免卡在 init
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
703
|
+
_openLoginForOrderDetail = function _openLoginForOrderDetail() {
|
|
704
|
+
var _scanOrderModule$setU2;
|
|
705
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$setU2 = scanOrderModule.setUIState) === null || _scanOrderModule$setU2 === void 0 || _scanOrderModule$setU2.call(scanOrderModule, 'pendingStep', currentStep);
|
|
706
|
+
openLoginModal({
|
|
707
|
+
callback: function callback(status) {
|
|
708
|
+
if (status === 'success') {
|
|
709
|
+
var _scanOrderModule$dele;
|
|
710
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$dele = scanOrderModule.deleteUIState) === null || _scanOrderModule$dele === void 0 || _scanOrderModule$dele.call(scanOrderModule, 'pendingStep');
|
|
711
|
+
handleOrderDetail(order_id);
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
Modal.info({
|
|
715
|
+
title: locales.getText('pisell2.scan.order.add.on.login.required.title'),
|
|
716
|
+
content: String(locales.getText('pisell2.scan.order.add.on.login.required') || '').trim(),
|
|
717
|
+
okText: String(locales.getText('pisell2.event.confirm') || 'OK'),
|
|
718
|
+
maskClosable: false,
|
|
719
|
+
onOk: function onOk() {
|
|
720
|
+
_openLoginForOrderDetail();
|
|
721
|
+
}
|
|
722
|
+
});
|
|
625
723
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
});
|
|
724
|
+
});
|
|
725
|
+
};
|
|
726
|
+
_openLoginForOrderDetail();
|
|
630
727
|
} else {
|
|
631
728
|
handleOrderDetail(order_id);
|
|
632
729
|
}
|
|
633
730
|
} else {
|
|
634
|
-
content =
|
|
635
|
-
content = String(locales.getText('pisell2.scan.order.resource.status.exception') || '');
|
|
731
|
+
content = String(locales.getText('pisell2.scan.order.add.on.unavailable.description') || '');
|
|
636
732
|
Modal.info({
|
|
637
|
-
title: locales.getText('pisell2.scan.order.
|
|
638
|
-
content:
|
|
639
|
-
|
|
733
|
+
title: locales.getText('pisell2.scan.order.add.on.unavailable.title'),
|
|
734
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
735
|
+
style: {
|
|
736
|
+
whiteSpace: 'pre-line'
|
|
737
|
+
}
|
|
738
|
+
}, content.trim()),
|
|
739
|
+
okText: String(locales.getText('pisell2.scan.order.add.on.unavailable.confirm') || 'Got it'),
|
|
640
740
|
maskClosable: false,
|
|
641
741
|
onOk: function onOk() {
|
|
642
742
|
location.replace('/');
|
|
@@ -663,19 +763,36 @@ function ReadyState() {
|
|
|
663
763
|
}
|
|
664
764
|
});
|
|
665
765
|
}
|
|
666
|
-
case
|
|
766
|
+
case 62:
|
|
667
767
|
case "end":
|
|
668
|
-
return
|
|
768
|
+
return _context7.stop();
|
|
669
769
|
}
|
|
670
|
-
},
|
|
770
|
+
}, _callee7);
|
|
671
771
|
}));
|
|
672
|
-
return function
|
|
772
|
+
return function runResourceCheck() {
|
|
673
773
|
return _ref8.apply(this, arguments);
|
|
674
774
|
};
|
|
675
775
|
}();
|
|
676
776
|
// 等 ScanOrderProvider 的步骤缓存 hydrate 完成再跑,确保 gate 标记已就位
|
|
677
777
|
if (!isCacheHydrated) return;
|
|
678
|
-
|
|
778
|
+
// if (!getCurrentIsLogin()) {
|
|
779
|
+
// if (entryLoginPromptedRef.current) return;
|
|
780
|
+
// entryLoginPromptedRef.current = true;
|
|
781
|
+
// scanOrderModule?.setUIState?.('pendingStep', currentStep);
|
|
782
|
+
// // openLoginModal({
|
|
783
|
+
// // callback: (status: string) => {
|
|
784
|
+
// // scanOrderModule?.deleteUIState?.('pendingStep');
|
|
785
|
+
// // // if (status === 'success') {
|
|
786
|
+
// // // void runResourceCheck();
|
|
787
|
+
// // // return;
|
|
788
|
+
// // // }
|
|
789
|
+
// // // navigateToHome();
|
|
790
|
+
// // void runResourceCheck();
|
|
791
|
+
// // },
|
|
792
|
+
// // });
|
|
793
|
+
// return;
|
|
794
|
+
// }
|
|
795
|
+
runResourceCheck();
|
|
679
796
|
}, [isCacheHydrated]);
|
|
680
797
|
useEffect(function () {
|
|
681
798
|
window.scrollTo({
|
|
@@ -772,22 +889,22 @@ function ReadyState() {
|
|
|
772
889
|
|
|
773
890
|
// 跳转到订单确认页
|
|
774
891
|
var gotoCheckOrder = /*#__PURE__*/function () {
|
|
775
|
-
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
892
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
776
893
|
var _otherParams$dineInCo;
|
|
777
|
-
var firstFailure, failedProductIds, failureTips, otherParams, dineInConfig, isPauseOrder, _dineInConfig$availab, _scanOrderModule$
|
|
778
|
-
return _regeneratorRuntime().wrap(function
|
|
779
|
-
while (1) switch (
|
|
894
|
+
var firstFailure, failedProductIds, failureTips, otherParams, dineInConfig, isPauseOrder, _dineInConfig$availab, _scanOrderModule$setU3;
|
|
895
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
896
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
780
897
|
case 0:
|
|
781
898
|
if (!submitDisabledTips) {
|
|
782
|
-
|
|
899
|
+
_context8.next = 3;
|
|
783
900
|
break;
|
|
784
901
|
}
|
|
785
902
|
message.warning(submitDisabledTips, 2);
|
|
786
|
-
return
|
|
903
|
+
return _context8.abrupt("return");
|
|
787
904
|
case 3:
|
|
788
905
|
firstFailure = Array.isArray(cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.failures) ? cartValidation.failures[0] : null;
|
|
789
906
|
if (!((cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.passed) === false)) {
|
|
790
|
-
|
|
907
|
+
_context8.next = 10;
|
|
791
908
|
break;
|
|
792
909
|
}
|
|
793
910
|
failedProductIds = getFirstFailedProductIds();
|
|
@@ -796,17 +913,17 @@ function ReadyState() {
|
|
|
796
913
|
}
|
|
797
914
|
failureTips = String((firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '').trim();
|
|
798
915
|
message.warning(failureTips, 2);
|
|
799
|
-
return
|
|
916
|
+
return _context8.abrupt("return");
|
|
800
917
|
case 10:
|
|
801
|
-
|
|
918
|
+
_context8.next = 12;
|
|
802
919
|
return runModuleAction('getOtherParams');
|
|
803
920
|
case 12:
|
|
804
|
-
otherParams =
|
|
921
|
+
otherParams = _context8.sent;
|
|
805
922
|
console.log('otherParams >>>>> ', otherParams);
|
|
806
923
|
dineInConfig = (_otherParams$dineInCo = otherParams === null || otherParams === void 0 ? void 0 : otherParams.dineInConfig) !== null && _otherParams$dineInCo !== void 0 ? _otherParams$dineInCo : {};
|
|
807
924
|
isPauseOrder = dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.paused']; // 如果暂停接单直接弹提示,点完确定回首页
|
|
808
925
|
if (!isPauseOrder) {
|
|
809
|
-
|
|
926
|
+
_context8.next = 19;
|
|
810
927
|
break;
|
|
811
928
|
}
|
|
812
929
|
Modal.info({
|
|
@@ -817,30 +934,30 @@ function ReadyState() {
|
|
|
817
934
|
location.replace('/');
|
|
818
935
|
}
|
|
819
936
|
});
|
|
820
|
-
return
|
|
937
|
+
return _context8.abrupt("return");
|
|
821
938
|
case 19:
|
|
822
|
-
if (
|
|
823
|
-
|
|
939
|
+
if (getCurrentIsLogin()) {
|
|
940
|
+
_context8.next = 23;
|
|
824
941
|
break;
|
|
825
942
|
}
|
|
826
943
|
// 登录前落盘跳转意图:弹窗 callback 能触发时由本函数消费,
|
|
827
944
|
// 整页跳转回流时由 Provider 的 hydrate 消费(参见 venueBooking 同名实现)
|
|
828
|
-
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$
|
|
945
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$setU3 = scanOrderModule.setUIState) === null || _scanOrderModule$setU3 === void 0 || _scanOrderModule$setU3.call(scanOrderModule, 'pendingStep', 'check');
|
|
829
946
|
openLoginModal({
|
|
830
947
|
callback: function callback(status) {
|
|
831
|
-
var _scanOrderModule$
|
|
832
|
-
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$
|
|
948
|
+
var _scanOrderModule$dele2;
|
|
949
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$dele2 = scanOrderModule.deleteUIState) === null || _scanOrderModule$dele2 === void 0 || _scanOrderModule$dele2.call(scanOrderModule, 'pendingStep');
|
|
833
950
|
if (status === 'success') goToStep('check');
|
|
834
951
|
}
|
|
835
952
|
});
|
|
836
|
-
return
|
|
953
|
+
return _context8.abrupt("return");
|
|
837
954
|
case 23:
|
|
838
955
|
goToStep('check');
|
|
839
956
|
case 24:
|
|
840
957
|
case "end":
|
|
841
|
-
return
|
|
958
|
+
return _context8.stop();
|
|
842
959
|
}
|
|
843
|
-
},
|
|
960
|
+
}, _callee8);
|
|
844
961
|
}));
|
|
845
962
|
return function gotoCheckOrder() {
|
|
846
963
|
return _ref9.apply(this, arguments);
|
|
@@ -293,7 +293,7 @@ export default function Menu(props) {
|
|
|
293
293
|
},
|
|
294
294
|
callback: function () {
|
|
295
295
|
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
|
|
296
|
-
var _item$product_id2;
|
|
296
|
+
var _data$origin, _data$origin2, _data$origin3, _item$product_id2;
|
|
297
297
|
var orderProduct;
|
|
298
298
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
299
299
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -304,24 +304,30 @@ export default function Menu(props) {
|
|
|
304
304
|
}
|
|
305
305
|
return _context5.abrupt("return");
|
|
306
306
|
case 2:
|
|
307
|
+
if (!(data !== null && data !== void 0 && (_data$origin = data.origin) !== null && _data$origin !== void 0 && _data$origin.is_track && !(data !== null && data !== void 0 && (_data$origin2 = data.origin) !== null && _data$origin2 !== void 0 && _data$origin2.over_sold) && (data === null || data === void 0 || (_data$origin3 = data.origin) === null || _data$origin3 === void 0 ? void 0 : _data$origin3.stock_quantity) <= 0)) {
|
|
308
|
+
_context5.next = 4;
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
return _context5.abrupt("return");
|
|
312
|
+
case 4:
|
|
307
313
|
orderProduct = transformProductDetailToOrderProduct({
|
|
308
314
|
payload: data,
|
|
309
315
|
fallbackProductId: (_item$product_id2 = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id2 !== void 0 ? _item$product_id2 : item === null || item === void 0 ? void 0 : item.id,
|
|
310
316
|
sourceItem: sourceItem
|
|
311
317
|
});
|
|
312
318
|
if (orderProduct) {
|
|
313
|
-
_context5.next =
|
|
319
|
+
_context5.next = 8;
|
|
314
320
|
break;
|
|
315
321
|
}
|
|
316
322
|
console.warn('[scanOrder] productDetail callback missing product_id', data);
|
|
317
323
|
return _context5.abrupt("return");
|
|
318
|
-
case
|
|
319
|
-
_context5.next =
|
|
324
|
+
case 8:
|
|
325
|
+
_context5.next = 10;
|
|
320
326
|
return addOrderProduct({
|
|
321
327
|
orderProduct: orderProduct,
|
|
322
328
|
sourceData: data
|
|
323
329
|
});
|
|
324
|
-
case
|
|
330
|
+
case 10:
|
|
325
331
|
case "end":
|
|
326
332
|
return _context5.stop();
|
|
327
333
|
}
|
|
@@ -99,6 +99,13 @@ export var useScanOrderLogin = function useScanOrderLogin() {
|
|
|
99
99
|
var openLoginModal = function openLoginModal(params) {
|
|
100
100
|
var _ref = params || {},
|
|
101
101
|
callback = _ref.callback;
|
|
102
|
+
var pubsub = utils.pubsub;
|
|
103
|
+
pubsub.once('pisell1.login.success', function (res) {
|
|
104
|
+
if (res === 'success') {
|
|
105
|
+
callback(res);
|
|
106
|
+
}
|
|
107
|
+
callback('close');
|
|
108
|
+
});
|
|
102
109
|
utils.action({
|
|
103
110
|
type: 'pisell1.login',
|
|
104
111
|
data: {
|
|
@@ -30,6 +30,21 @@ declare const _default: {
|
|
|
30
30
|
'pisell2.scan.order.products.empty.tip': string;
|
|
31
31
|
'pisell2.scan.order.check.cart.empty.tip': string;
|
|
32
32
|
'pisell2.scan.order.submit.disabled.default': string;
|
|
33
|
+
'pisell2.scan.order.multiple.orders.tip': string;
|
|
34
|
+
'pisell2.scan.order.multiple.orders.confirm': string;
|
|
35
|
+
'pisell2.scan.order.settled.cannot.add.tip': string;
|
|
36
|
+
'pisell2.scan.order.inventory.insufficient.title': string;
|
|
37
|
+
'pisell2.scan.order.inventory.insufficient.description': string;
|
|
38
|
+
'pisell2.scan.order.inventory.insufficient.products.label': string;
|
|
39
|
+
'pisell2.scan.order.add.on.confirm.title': string;
|
|
40
|
+
'pisell2.scan.order.add.on.confirm.description': string;
|
|
41
|
+
'pisell2.scan.order.add.on.confirm.button': string;
|
|
42
|
+
'pisell2.scan.order.add.on.return.button': string;
|
|
43
|
+
'pisell2.scan.order.add.on.unavailable.title': string;
|
|
44
|
+
'pisell2.scan.order.add.on.unavailable.description': string;
|
|
45
|
+
'pisell2.scan.order.add.on.unavailable.confirm': string;
|
|
46
|
+
'pisell2.scan.order.add.on.login.required.title': string;
|
|
47
|
+
'pisell2.scan.order.add.on.login.required': string;
|
|
33
48
|
'pisell2.text.goodpass': string;
|
|
34
49
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
35
50
|
'pisell2.text.goodpass.view-more': string;
|
|
@@ -79,6 +94,21 @@ declare const _default: {
|
|
|
79
94
|
'pisell2.scan.order.products.empty.tip': string;
|
|
80
95
|
'pisell2.scan.order.check.cart.empty.tip': string;
|
|
81
96
|
'pisell2.scan.order.submit.disabled.default': string;
|
|
97
|
+
'pisell2.scan.order.multiple.orders.tip': string;
|
|
98
|
+
'pisell2.scan.order.multiple.orders.confirm': string;
|
|
99
|
+
'pisell2.scan.order.settled.cannot.add.tip': string;
|
|
100
|
+
'pisell2.scan.order.inventory.insufficient.title': string;
|
|
101
|
+
'pisell2.scan.order.inventory.insufficient.description': string;
|
|
102
|
+
'pisell2.scan.order.inventory.insufficient.products.label': string;
|
|
103
|
+
'pisell2.scan.order.add.on.confirm.title': string;
|
|
104
|
+
'pisell2.scan.order.add.on.confirm.description': string;
|
|
105
|
+
'pisell2.scan.order.add.on.confirm.button': string;
|
|
106
|
+
'pisell2.scan.order.add.on.return.button': string;
|
|
107
|
+
'pisell2.scan.order.add.on.unavailable.title': string;
|
|
108
|
+
'pisell2.scan.order.add.on.unavailable.description': string;
|
|
109
|
+
'pisell2.scan.order.add.on.unavailable.confirm': string;
|
|
110
|
+
'pisell2.scan.order.add.on.login.required.title': string;
|
|
111
|
+
'pisell2.scan.order.add.on.login.required': string;
|
|
82
112
|
'pisell2.text.goodpass': string;
|
|
83
113
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
84
114
|
'pisell2.text.goodpass.view-more': string;
|
|
@@ -128,6 +158,21 @@ declare const _default: {
|
|
|
128
158
|
'pisell2.scan.order.products.empty.tip': string;
|
|
129
159
|
'pisell2.scan.order.check.cart.empty.tip': string;
|
|
130
160
|
'pisell2.scan.order.submit.disabled.default': string;
|
|
161
|
+
'pisell2.scan.order.multiple.orders.tip': string;
|
|
162
|
+
'pisell2.scan.order.multiple.orders.confirm': string;
|
|
163
|
+
'pisell2.scan.order.settled.cannot.add.tip': string;
|
|
164
|
+
'pisell2.scan.order.inventory.insufficient.title': string;
|
|
165
|
+
'pisell2.scan.order.inventory.insufficient.description': string;
|
|
166
|
+
'pisell2.scan.order.inventory.insufficient.products.label': string;
|
|
167
|
+
'pisell2.scan.order.add.on.confirm.title': string;
|
|
168
|
+
'pisell2.scan.order.add.on.confirm.description': string;
|
|
169
|
+
'pisell2.scan.order.add.on.confirm.button': string;
|
|
170
|
+
'pisell2.scan.order.add.on.return.button': string;
|
|
171
|
+
'pisell2.scan.order.add.on.unavailable.title': string;
|
|
172
|
+
'pisell2.scan.order.add.on.unavailable.description': string;
|
|
173
|
+
'pisell2.scan.order.add.on.unavailable.confirm': string;
|
|
174
|
+
'pisell2.scan.order.add.on.login.required.title': string;
|
|
175
|
+
'pisell2.scan.order.add.on.login.required': string;
|
|
131
176
|
'pisell2.text.goodpass': string;
|
|
132
177
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
133
178
|
'pisell2.text.goodpass.view-more': string;
|
|
@@ -177,6 +222,21 @@ declare const _default: {
|
|
|
177
222
|
'pisell2.scan.order.products.empty.tip': string;
|
|
178
223
|
'pisell2.scan.order.check.cart.empty.tip': string;
|
|
179
224
|
'pisell2.scan.order.submit.disabled.default': string;
|
|
225
|
+
'pisell2.scan.order.multiple.orders.tip': string;
|
|
226
|
+
'pisell2.scan.order.multiple.orders.confirm': string;
|
|
227
|
+
'pisell2.scan.order.settled.cannot.add.tip': string;
|
|
228
|
+
'pisell2.scan.order.inventory.insufficient.title': string;
|
|
229
|
+
'pisell2.scan.order.inventory.insufficient.description': string;
|
|
230
|
+
'pisell2.scan.order.inventory.insufficient.products.label': string;
|
|
231
|
+
'pisell2.scan.order.add.on.confirm.title': string;
|
|
232
|
+
'pisell2.scan.order.add.on.confirm.description': string;
|
|
233
|
+
'pisell2.scan.order.add.on.confirm.button': string;
|
|
234
|
+
'pisell2.scan.order.add.on.return.button': string;
|
|
235
|
+
'pisell2.scan.order.add.on.unavailable.title': string;
|
|
236
|
+
'pisell2.scan.order.add.on.unavailable.description': string;
|
|
237
|
+
'pisell2.scan.order.add.on.unavailable.confirm': string;
|
|
238
|
+
'pisell2.scan.order.add.on.login.required.title': string;
|
|
239
|
+
'pisell2.scan.order.add.on.login.required': string;
|
|
180
240
|
'pisell2.text.goodpass': string;
|
|
181
241
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
182
242
|
'pisell2.text.goodpass.view-more': string;
|
|
@@ -226,6 +286,21 @@ declare const _default: {
|
|
|
226
286
|
'pisell2.scan.order.products.empty.tip': string;
|
|
227
287
|
'pisell2.scan.order.check.cart.empty.tip': string;
|
|
228
288
|
'pisell2.scan.order.submit.disabled.default': string;
|
|
289
|
+
'pisell2.scan.order.multiple.orders.tip': string;
|
|
290
|
+
'pisell2.scan.order.multiple.orders.confirm': string;
|
|
291
|
+
'pisell2.scan.order.settled.cannot.add.tip': string;
|
|
292
|
+
'pisell2.scan.order.inventory.insufficient.title': string;
|
|
293
|
+
'pisell2.scan.order.inventory.insufficient.description': string;
|
|
294
|
+
'pisell2.scan.order.inventory.insufficient.products.label': string;
|
|
295
|
+
'pisell2.scan.order.add.on.confirm.title': string;
|
|
296
|
+
'pisell2.scan.order.add.on.confirm.description': string;
|
|
297
|
+
'pisell2.scan.order.add.on.confirm.button': string;
|
|
298
|
+
'pisell2.scan.order.add.on.return.button': string;
|
|
299
|
+
'pisell2.scan.order.add.on.unavailable.title': string;
|
|
300
|
+
'pisell2.scan.order.add.on.unavailable.description': string;
|
|
301
|
+
'pisell2.scan.order.add.on.unavailable.confirm': string;
|
|
302
|
+
'pisell2.scan.order.add.on.login.required.title': string;
|
|
303
|
+
'pisell2.scan.order.add.on.login.required': string;
|
|
229
304
|
'pisell2.text.goodpass': string;
|
|
230
305
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
231
306
|
'pisell2.text.goodpass.view-more': string;
|