@pisell/private-materials 6.6.84 → 6.6.85
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.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/components/footer/index.js +14 -13
- package/lib/components/booking/components/footer/index.js +4 -3
- package/package.json +2 -2
|
@@ -653,7 +653,7 @@ var Footer = function Footer(props) {
|
|
|
653
653
|
};
|
|
654
654
|
return {
|
|
655
655
|
wait: function wait(orderId) {
|
|
656
|
-
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
656
|
+
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3000;
|
|
657
657
|
return new Promise(function (resolve) {
|
|
658
658
|
targetOrderId = String(orderId !== null && orderId !== void 0 ? orderId : '');
|
|
659
659
|
if (!targetOrderId || syncedOrderIds.has(targetOrderId)) {
|
|
@@ -686,7 +686,7 @@ var Footer = function Footer(props) {
|
|
|
686
686
|
var handleCheckoutInternal = /*#__PURE__*/function () {
|
|
687
687
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
688
688
|
var _state$bookingConfig5;
|
|
689
|
-
var isToastMode, isNewOrder, isHasDayProducts, res, modalData, orderSyncWaiter, _res;
|
|
689
|
+
var isToastMode, isNewOrder, isHasDayProducts, res, modalData, _window7, orderSyncWaiter, _res;
|
|
690
690
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
691
691
|
while (1) switch (_context4.prev = _context4.next) {
|
|
692
692
|
case 0:
|
|
@@ -697,7 +697,7 @@ var Footer = function Footer(props) {
|
|
|
697
697
|
}
|
|
698
698
|
isNewOrder = !state.bookingId; // 如果有编辑内容, 则先保存
|
|
699
699
|
if (!isEdit) {
|
|
700
|
-
_context4.next =
|
|
700
|
+
_context4.next = 34;
|
|
701
701
|
break;
|
|
702
702
|
}
|
|
703
703
|
if (!isDayBooking(state)) {
|
|
@@ -770,10 +770,10 @@ var Footer = function Footer(props) {
|
|
|
770
770
|
}
|
|
771
771
|
};
|
|
772
772
|
});
|
|
773
|
-
_context4.next =
|
|
773
|
+
_context4.next = 33;
|
|
774
774
|
break;
|
|
775
775
|
case 21:
|
|
776
|
-
orderSyncWaiter = isWebPos && isNewOrder ? createOrderSyncWaiter() : null;
|
|
776
|
+
orderSyncWaiter = (_window7 = window) !== null && _window7 !== void 0 && _window7.isWebPos && isNewOrder ? createOrderSyncWaiter() : null;
|
|
777
777
|
_context4.next = 24;
|
|
778
778
|
return handleSave({
|
|
779
779
|
type: 'checkout',
|
|
@@ -781,24 +781,25 @@ var Footer = function Footer(props) {
|
|
|
781
781
|
});
|
|
782
782
|
case 24:
|
|
783
783
|
_res = _context4.sent;
|
|
784
|
-
if (_res) {
|
|
784
|
+
if (!(!_res && orderSyncWaiter)) {
|
|
785
785
|
_context4.next = 28;
|
|
786
786
|
break;
|
|
787
787
|
}
|
|
788
788
|
orderSyncWaiter === null || orderSyncWaiter === void 0 || orderSyncWaiter.dispose();
|
|
789
789
|
return _context4.abrupt("return");
|
|
790
790
|
case 28:
|
|
791
|
-
|
|
791
|
+
console.log(orderSyncWaiter, isTerminal === null || isTerminal === void 0 ? void 0 : isTerminal(), 'orderSyncWaiter');
|
|
792
|
+
_context4.next = 31;
|
|
792
793
|
return orderSyncWaiter === null || orderSyncWaiter === void 0 ? void 0 : orderSyncWaiter.wait(_res === null || _res === void 0 ? void 0 : _res.order_id);
|
|
793
|
-
case
|
|
794
|
+
case 31:
|
|
794
795
|
// goCheckout2(res);
|
|
795
796
|
console.log(_res);
|
|
796
797
|
goCheckout((_res === null || _res === void 0 ? void 0 : _res.order_id) || state.bookingId, isNewOrder);
|
|
797
|
-
case 32:
|
|
798
|
-
return _context4.abrupt("return");
|
|
799
798
|
case 33:
|
|
800
|
-
return _context4.abrupt("return"
|
|
799
|
+
return _context4.abrupt("return");
|
|
801
800
|
case 34:
|
|
801
|
+
return _context4.abrupt("return", goCheckout(state.bookingId, isNewOrder));
|
|
802
|
+
case 35:
|
|
802
803
|
case "end":
|
|
803
804
|
return _context4.stop();
|
|
804
805
|
}
|
|
@@ -930,7 +931,7 @@ var Footer = function Footer(props) {
|
|
|
930
931
|
var handleSave = /*#__PURE__*/function () {
|
|
931
932
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref6) {
|
|
932
933
|
var _submitState, _submitState$service, _submitState$client;
|
|
933
|
-
var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, submitState, isToastMode, isHasDayProducts, hasUnspecifiedHolderProduct, shouldContinue, _setLoading, loadingTimer, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _submitState2, _submitState2$onSave, _store$getState,
|
|
934
|
+
var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, submitState, isToastMode, isHasDayProducts, hasUnspecifiedHolderProduct, shouldContinue, _setLoading, loadingTimer, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _submitState2, _submitState2$onSave, _store$getState, _window8, _submitState4, callbackData, values, checkout, subtotal_info, res, _submitState3, isNeedDeposit, api;
|
|
934
935
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
935
936
|
while (1) switch (_context6.prev = _context6.next) {
|
|
936
937
|
case 0:
|
|
@@ -1072,7 +1073,7 @@ var Footer = function Footer(props) {
|
|
|
1072
1073
|
value: store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.globalConfig) === null || _store$getState === void 0 ? void 0 : _store$getState.id
|
|
1073
1074
|
}, {
|
|
1074
1075
|
key: 'shopApi',
|
|
1075
|
-
value: JSON.stringify((
|
|
1076
|
+
value: JSON.stringify((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.shopApi, function (key, value) {
|
|
1076
1077
|
if (typeof value === 'function') {
|
|
1077
1078
|
return 'function';
|
|
1078
1079
|
}
|
|
@@ -508,7 +508,7 @@ var Footer = (props) => {
|
|
|
508
508
|
(_b3 = (_a3 = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _a3.off) == null ? void 0 : _b3.call(_a3, "order:onOrdersChanged", handleOrdersChanged);
|
|
509
509
|
};
|
|
510
510
|
return {
|
|
511
|
-
wait: (orderId, timeout =
|
|
511
|
+
wait: (orderId, timeout = 3e3) => new Promise((resolve) => {
|
|
512
512
|
targetOrderId = String(orderId ?? "");
|
|
513
513
|
if (!targetOrderId || syncedOrderIds.has(targetOrderId)) {
|
|
514
514
|
dispose();
|
|
@@ -582,15 +582,16 @@ var Footer = (props) => {
|
|
|
582
582
|
}
|
|
583
583
|
});
|
|
584
584
|
} else {
|
|
585
|
-
const orderSyncWaiter = isWebPos && isNewOrder ? createOrderSyncWaiter() : null;
|
|
585
|
+
const orderSyncWaiter = (window == null ? void 0 : window.isWebPos) && isNewOrder ? createOrderSyncWaiter() : null;
|
|
586
586
|
const res = await handleSave({
|
|
587
587
|
type: "checkout",
|
|
588
588
|
messageShow: !(isTerminal == null ? void 0 : isTerminal())
|
|
589
589
|
});
|
|
590
|
-
if (!res) {
|
|
590
|
+
if (!res && orderSyncWaiter) {
|
|
591
591
|
orderSyncWaiter == null ? void 0 : orderSyncWaiter.dispose();
|
|
592
592
|
return;
|
|
593
593
|
}
|
|
594
|
+
console.log(orderSyncWaiter, isTerminal == null ? void 0 : isTerminal(), "orderSyncWaiter");
|
|
594
595
|
await (orderSyncWaiter == null ? void 0 : orderSyncWaiter.wait(res == null ? void 0 : res.order_id));
|
|
595
596
|
console.log(res);
|
|
596
597
|
goCheckout((res == null ? void 0 : res.order_id) || state.bookingId, isNewOrder);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.85",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
"styled-components": "^6.0.0-rc.3",
|
|
64
64
|
"@react-spring/web": "^9.6.1",
|
|
65
65
|
"@use-gesture/react": "^10.3.1",
|
|
66
|
+
"@pisell/utils": "3.0.2",
|
|
66
67
|
"@pisell/materials": "6.6.20",
|
|
67
68
|
"@pisell/icon": "0.0.11",
|
|
68
|
-
"@pisell/utils": "3.0.2",
|
|
69
69
|
"@pisell/date-picker": "3.0.7"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|