@pisell/private-materials 6.8.20 → 6.8.22

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.
@@ -699,10 +699,12 @@ var Footer = function Footer(props) {
699
699
  setPaymentModalData(null);
700
700
  setPaymentCallback(null);
701
701
  } else {
702
+ var _window7;
702
703
  console.log('Payment status:', paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status);
703
704
  // 其他状态也关闭弹窗
704
705
  setPaymentModalData(null);
705
706
  setPaymentCallback(null);
707
+ (_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.shopApi) === null || _window7 === void 0 || (_window7 = _window7.bookingTicket) === null || _window7 === void 0 || _window7.clearAllCart();
706
708
  }
707
709
  };
708
710
  });
@@ -855,7 +857,7 @@ var Footer = function Footer(props) {
855
857
  var handleSave = /*#__PURE__*/function () {
856
858
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref6) {
857
859
  var _state$bookingConfig6, _state$service$value2, _state$client3;
858
- var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isToastMode, isHasDayProducts, hasUnspecifiedHolderProduct, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window7, callbackData, values, checkout, subtotal_info, res, isNeedDeposit, api;
860
+ var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isToastMode, isHasDayProducts, hasUnspecifiedHolderProduct, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window8, callbackData, values, checkout, subtotal_info, res, isNeedDeposit, api;
859
861
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
860
862
  while (1) switch (_context6.prev = _context6.next) {
861
863
  case 0:
@@ -984,7 +986,7 @@ var Footer = function Footer(props) {
984
986
  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
985
987
  }, {
986
988
  key: 'shopApi',
987
- value: JSON.stringify((_window7 = window) === null || _window7 === void 0 ? void 0 : _window7.shopApi, function (key, value) {
989
+ value: JSON.stringify((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.shopApi, function (key, value) {
988
990
  if (typeof value === 'function') {
989
991
  return 'function';
990
992
  }
@@ -1783,16 +1785,8 @@ var Footer = function Footer(props) {
1783
1785
  clearAllScanListenersTaskQueue = _useScanManager2.clearAllScanListenersTaskQueue;
1784
1786
  // 清空所有内容并重置购物车
1785
1787
  var handleClearAllAndReset = function handleClearAllAndReset() {
1786
- var _window8, _shopDiscount$clear;
1787
- (_window8 = window) === null || _window8 === void 0 || (_window8 = _window8.shopApi) === null || _window8 === void 0 || (_window8 = _window8.bookingTicket) === null || _window8 === void 0 || _window8.clearAllCart();
1788
+ var _shopDiscount$clear;
1788
1789
  clearAllScanListenersTaskQueue();
1789
- // 清空服务项目
1790
- dispatch({
1791
- type: 'setService',
1792
- payload: {
1793
- value: []
1794
- }
1795
- });
1796
1790
 
1797
1791
  // 清空附加服务
1798
1792
  dispatch({
@@ -1843,6 +1837,17 @@ var Footer = function Footer(props) {
1843
1837
  // 清空商品券
1844
1838
  shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$clear = shopDiscount.clear) === null || _shopDiscount$clear === void 0 || _shopDiscount$clear.call(shopDiscount);
1845
1839
  setEditOrderId(0);
1840
+ setTimeout(function () {
1841
+ var _window9;
1842
+ (_window9 = window) === null || _window9 === void 0 || (_window9 = _window9.shopApi) === null || _window9 === void 0 || (_window9 = _window9.bookingTicket) === null || _window9 === void 0 || _window9.clearAllCart();
1843
+ // 清空服务项目
1844
+ dispatch({
1845
+ type: 'setService',
1846
+ payload: {
1847
+ value: []
1848
+ }
1849
+ });
1850
+ }, 0);
1846
1851
  };
1847
1852
 
1848
1853
  // 购物车进入编辑状态
@@ -1986,7 +1991,7 @@ var Footer = function Footer(props) {
1986
1991
  onChangeOrderNote: handleNoteConfirm,
1987
1992
  onDeleteOrderNote: handleNoteDelete,
1988
1993
  onClose: function onClose(reset) {
1989
- // console.log('🔄 Footer: Closing PaymentModal');
1994
+ console.log('🔄 Footer: Closing PaymentModal', reset);
1990
1995
  setIsPaymentModalOpen(false);
1991
1996
  setPaymentModalData(null);
1992
1997
  setPaymentCallback(null);
@@ -500,7 +500,7 @@ var Footer = (props) => {
500
500
  setIsPaymentModalOpen(true);
501
501
  setCheckoutLoading(false);
502
502
  setPaymentCallback(() => (paymentResult) => {
503
- var _a3, _b3, _c3, _d2;
503
+ var _a3, _b3, _c3, _d2, _e2, _f2;
504
504
  console.log("Payment result:", paymentResult);
505
505
  setIsPaymentModalOpen(false);
506
506
  if ((paymentResult == null ? void 0 : paymentResult.status) === "success") {
@@ -519,6 +519,7 @@ var Footer = (props) => {
519
519
  console.log("Payment status:", paymentResult == null ? void 0 : paymentResult.status);
520
520
  setPaymentModalData(null);
521
521
  setPaymentCallback(null);
522
+ (_f2 = (_e2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _e2.bookingTicket) == null ? void 0 : _f2.clearAllCart();
522
523
  }
523
524
  });
524
525
  } else {
@@ -1286,15 +1287,8 @@ var Footer = (props) => {
1286
1287
  const shopDiscount = (0, import_useShopDiscountModule.useShopDiscountModule)();
1287
1288
  const { clearAllScanListenersTaskQueue } = (0, import_useScanManager.default)();
1288
1289
  const handleClearAllAndReset = () => {
1289
- var _a2, _b2, _c2;
1290
- (_b2 = (_a2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a2.bookingTicket) == null ? void 0 : _b2.clearAllCart();
1290
+ var _a2;
1291
1291
  clearAllScanListenersTaskQueue();
1292
- dispatch({
1293
- type: "setService",
1294
- payload: {
1295
- value: []
1296
- }
1297
- });
1298
1292
  dispatch({
1299
1293
  type: "setAddons",
1300
1294
  payload: {
@@ -1325,8 +1319,18 @@ var Footer = (props) => {
1325
1319
  orderNote: ""
1326
1320
  }
1327
1321
  });
1328
- (_c2 = shopDiscount == null ? void 0 : shopDiscount.clear) == null ? void 0 : _c2.call(shopDiscount);
1322
+ (_a2 = shopDiscount == null ? void 0 : shopDiscount.clear) == null ? void 0 : _a2.call(shopDiscount);
1329
1323
  setEditOrderId(0);
1324
+ setTimeout(() => {
1325
+ var _a3, _b2;
1326
+ (_b2 = (_a3 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a3.bookingTicket) == null ? void 0 : _b2.clearAllCart();
1327
+ dispatch({
1328
+ type: "setService",
1329
+ payload: {
1330
+ value: []
1331
+ }
1332
+ });
1333
+ }, 0);
1330
1334
  };
1331
1335
  const setEditCartMode = (order_id2, payData, closeModal = false) => {
1332
1336
  setEditOrderId(order_id2);
@@ -1457,6 +1461,7 @@ var Footer = (props) => {
1457
1461
  onChangeOrderNote: handleNoteConfirm,
1458
1462
  onDeleteOrderNote: handleNoteDelete,
1459
1463
  onClose: (reset) => {
1464
+ console.log("🔄 Footer: Closing PaymentModal", reset);
1460
1465
  setIsPaymentModalOpen(false);
1461
1466
  setPaymentModalData(null);
1462
1467
  setPaymentCallback(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.8.20",
3
+ "version": "6.8.22",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -76,10 +76,10 @@
76
76
  "react-infinite-scroll-component": "^6.1.0",
77
77
  "react-resizable": "^3.0.5",
78
78
  "styled-components": "^6.0.0-rc.3",
79
- "@pisell/materials": "6.8.6",
80
- "@pisell/icon": "0.0.11",
79
+ "@pisell/date-picker": "3.0.7",
81
80
  "@pisell/utils": "3.0.2",
82
- "@pisell/date-picker": "3.0.7"
81
+ "@pisell/icon": "0.0.11",
82
+ "@pisell/materials": "6.8.6"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "react": "^18.0.0",