@pisell/private-materials 6.8.25 → 6.8.27

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.
@@ -1787,8 +1787,7 @@ var Footer = function Footer(props) {
1787
1787
  // 清空所有内容并重置购物车
1788
1788
  var handleClearAllAndReset = function handleClearAllAndReset() {
1789
1789
  var _shopDiscount$clear, _window9;
1790
- clearAllScanListenersTaskQueue();
1791
-
1790
+ debugger;
1792
1791
  // 清空附加服务
1793
1792
  dispatch({
1794
1793
  type: 'setAddons',
@@ -1840,12 +1839,15 @@ var Footer = function Footer(props) {
1840
1839
  setEditOrderId(0);
1841
1840
  (_window9 = window) === null || _window9 === void 0 || (_window9 = _window9.shopApi) === null || _window9 === void 0 || (_window9 = _window9.bookingTicket) === null || _window9 === void 0 || _window9.clearAllCart();
1842
1841
  // 清空服务项目
1843
- dispatch({
1844
- type: 'setService',
1845
- payload: {
1846
- value: []
1847
- }
1848
- });
1842
+ setTimeout(function () {
1843
+ dispatch({
1844
+ type: 'setService',
1845
+ payload: {
1846
+ value: []
1847
+ }
1848
+ });
1849
+ }, 200);
1850
+ clearAllScanListenersTaskQueue();
1849
1851
  };
1850
1852
 
1851
1853
  // 购物车进入编辑状态
@@ -1858,6 +1860,7 @@ var Footer = function Footer(props) {
1858
1860
  }
1859
1861
  // 给当前购物车中的商品添加一个编辑标识
1860
1862
  // 标记当前商品为编辑模式
1863
+ debugger;
1861
1864
  dispatch({
1862
1865
  type: 'setService',
1863
1866
  payload: {
@@ -1993,7 +1996,12 @@ var Footer = function Footer(props) {
1993
1996
  setIsPaymentModalOpen(false);
1994
1997
  setPaymentModalData(null);
1995
1998
  setPaymentCallback(null);
1996
- // 清除编辑模式
1999
+ // if (reset) {
2000
+ // handleClearAllAndReset();
2001
+ // }
2002
+ if (reset) {
2003
+ handleClearAllAndReset();
2004
+ } // 清除编辑模式
1997
2005
  setEditOrderId(0);
1998
2006
  dispatch({
1999
2007
  type: 'setPaymentPaid',
@@ -2001,12 +2009,6 @@ var Footer = function Footer(props) {
2001
2009
  value: {}
2002
2010
  }
2003
2011
  });
2004
- // if (reset) {
2005
- // handleClearAllAndReset();
2006
- // }
2007
- if (reset) {
2008
- handleClearAllAndReset();
2009
- }
2010
2012
  // setPaymentModalData(null);
2011
2013
  // setPaymentCallback(null);
2012
2014
  // if (reset) {
@@ -0,0 +1,5 @@
1
+ export declare const walkInData: {
2
+ id: number;
3
+ nickname: string;
4
+ };
5
+ export declare const Provider: any, Context: any;
@@ -27,6 +27,7 @@ var _miniRedux = miniRedux({
27
27
  });
28
28
  },
29
29
  setService: function setService(state, payload) {
30
+ debugger;
30
31
  var obj = {};
31
32
  // 拦截, 如果服务列表里 有两个相近时间的服务, 删除最后一个
32
33
  if (payload.value) {
@@ -2219,6 +2219,17 @@ var PaymentModal = function PaymentModal(_ref18) {
2219
2219
  autoCloseConfig.maskClosable = false;
2220
2220
  }
2221
2221
 
2222
+ // 根据支付状态展示不同的 toast
2223
+ displayPaymentResultToast({
2224
+ paymentStatus: paymentStatus,
2225
+ orderTotalAmount: _orderInfo3.isDeposit ? _orderInfo3.depositAmount : orderTotalAmount,
2226
+ gapAmount: paymentStatus === 'partially_paid' ? gapAmount : currentChangeGivenAmount,
2227
+ failureReason: failureReason,
2228
+ autoCloseConfig: autoCloseConfig,
2229
+ actionButtons: generateActionButtons(paymentStatus, enabledAutoPrint)
2230
+ }, paymentResultToastConfig);
2231
+ console.log('paymentStatus>>>>', paymentStatus);
2232
+
2222
2233
  // 当支付状态为 paid 时,关闭 paymentModal
2223
2234
  if (paymentStatus === 'paid') {
2224
2235
  handleModalClose();
@@ -2234,17 +2245,6 @@ var PaymentModal = function PaymentModal(_ref18) {
2234
2245
  }
2235
2246
  });
2236
2247
  handlePaymentComplete(paymentResult);
2237
- // 根据支付状态展示不同的 toast
2238
- _context22.next = 35;
2239
- return displayPaymentResultToast({
2240
- paymentStatus: paymentStatus,
2241
- orderTotalAmount: _orderInfo3.isDeposit ? _orderInfo3.depositAmount : orderTotalAmount,
2242
- gapAmount: paymentStatus === 'partially_paid' ? gapAmount : currentChangeGivenAmount,
2243
- failureReason: failureReason,
2244
- autoCloseConfig: autoCloseConfig,
2245
- actionButtons: generateActionButtons(paymentStatus, enabledAutoPrint)
2246
- }, paymentResultToastConfig);
2247
- case 35:
2248
2248
  _context22.next = 38;
2249
2249
  break;
2250
2250
  case 37:
@@ -1288,7 +1288,7 @@ var Footer = (props) => {
1288
1288
  const { clearAllScanListenersTaskQueue } = (0, import_useScanManager.default)();
1289
1289
  const handleClearAllAndReset = () => {
1290
1290
  var _a2, _b2, _c2;
1291
- clearAllScanListenersTaskQueue();
1291
+ debugger;
1292
1292
  dispatch({
1293
1293
  type: "setAddons",
1294
1294
  payload: {
@@ -1322,18 +1322,22 @@ var Footer = (props) => {
1322
1322
  (_a2 = shopDiscount == null ? void 0 : shopDiscount.clear) == null ? void 0 : _a2.call(shopDiscount);
1323
1323
  setEditOrderId(0);
1324
1324
  (_c2 = (_b2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _b2.bookingTicket) == null ? void 0 : _c2.clearAllCart();
1325
- dispatch({
1326
- type: "setService",
1327
- payload: {
1328
- value: []
1329
- }
1330
- });
1325
+ setTimeout(() => {
1326
+ dispatch({
1327
+ type: "setService",
1328
+ payload: {
1329
+ value: []
1330
+ }
1331
+ });
1332
+ }, 200);
1333
+ clearAllScanListenersTaskQueue();
1331
1334
  };
1332
1335
  const setEditCartMode = (order_id2, payData, closeModal = false) => {
1333
1336
  setEditOrderId(order_id2);
1334
1337
  if (closeModal) {
1335
1338
  setIsPaymentModalOpen(false);
1336
1339
  }
1340
+ debugger;
1337
1341
  dispatch({
1338
1342
  type: "setService",
1339
1343
  payload: {
@@ -1462,6 +1466,9 @@ var Footer = (props) => {
1462
1466
  setIsPaymentModalOpen(false);
1463
1467
  setPaymentModalData(null);
1464
1468
  setPaymentCallback(null);
1469
+ if (reset) {
1470
+ handleClearAllAndReset();
1471
+ }
1465
1472
  setEditOrderId(0);
1466
1473
  dispatch({
1467
1474
  type: "setPaymentPaid",
@@ -1469,9 +1476,6 @@ var Footer = (props) => {
1469
1476
  value: {}
1470
1477
  }
1471
1478
  });
1472
- if (reset) {
1473
- handleClearAllAndReset();
1474
- }
1475
1479
  }
1476
1480
  }
1477
1481
  ), /* @__PURE__ */ import_react.default.createElement(import_confirmHolderModal.ConfirmHolderModal, null));
@@ -0,0 +1,5 @@
1
+ export declare const walkInData: {
2
+ id: number;
3
+ nickname: string;
4
+ };
5
+ export declare const Provider: any, Context: any;
@@ -44,6 +44,7 @@ var { Provider, Context } = (0, import_utils.miniRedux)({
44
44
  });
45
45
  },
46
46
  setService(state, payload) {
47
+ debugger;
47
48
  let obj = {};
48
49
  if (payload.value) {
49
50
  obj.value = (0, import_utils2.formatServiceListByTime)(payload.value);
@@ -1566,6 +1566,18 @@ var PaymentModal = ({
1566
1566
  autoCloseConfig.autoCloseDelay = 0;
1567
1567
  autoCloseConfig.maskClosable = false;
1568
1568
  }
1569
+ (0, import_PaymentResultToastUtils.displayPaymentResultToast)(
1570
+ {
1571
+ paymentStatus,
1572
+ orderTotalAmount: orderInfo3.isDeposit ? orderInfo3.depositAmount : orderTotalAmount,
1573
+ gapAmount: paymentStatus === "partially_paid" ? gapAmount : currentChangeGivenAmount,
1574
+ failureReason,
1575
+ autoCloseConfig,
1576
+ actionButtons: generateActionButtons(paymentStatus, enabledAutoPrint)
1577
+ },
1578
+ paymentResultToastConfig
1579
+ );
1580
+ console.log("paymentStatus>>>>", paymentStatus);
1569
1581
  if (paymentStatus === "paid") {
1570
1582
  handleModalClose();
1571
1583
  }
@@ -1579,17 +1591,6 @@ var PaymentModal = ({
1579
1591
  }
1580
1592
  };
1581
1593
  handlePaymentComplete(paymentResult);
1582
- await (0, import_PaymentResultToastUtils.displayPaymentResultToast)(
1583
- {
1584
- paymentStatus,
1585
- orderTotalAmount: orderInfo3.isDeposit ? orderInfo3.depositAmount : orderTotalAmount,
1586
- gapAmount: paymentStatus === "partially_paid" ? gapAmount : currentChangeGivenAmount,
1587
- failureReason,
1588
- autoCloseConfig,
1589
- actionButtons: generateActionButtons(paymentStatus, enabledAutoPrint)
1590
- },
1591
- paymentResultToastConfig
1592
- );
1593
1594
  } else {
1594
1595
  handlePaymentComplete(data2);
1595
1596
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.8.25",
3
+ "version": "6.8.27",
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/icon": "0.0.11",
79
+ "@pisell/materials": "6.8.6",
80
80
  "@pisell/utils": "3.0.2",
81
81
  "@pisell/date-picker": "3.0.7",
82
- "@pisell/materials": "6.8.6"
82
+ "@pisell/icon": "0.0.11"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "react": "^18.0.0",
@@ -1 +0,0 @@
1
- export declare const Provider: any, Context: any;
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface ActionButtonsProps {
4
- /** booking 状态对象,包含 service、addons 等数据 */
5
- state: {
6
- service?: {
7
- value?: any[];
8
- };
9
- addons?: {
10
- value?: any[];
11
- };
12
- disabledEdit?: boolean;
13
- channelDisabledEdit?: boolean;
14
- shop_discount?: string;
15
- bookingDetail?: {
16
- [key: string]: any;
17
- };
18
- [key: string]: any;
19
- };
20
- /** dispatch 函数,用于触发状态更新 */
21
- dispatch: (action: {
22
- type: string;
23
- payload?: any;
24
- }) => void;
25
- /** 是否禁用所有按钮 */
26
- disabled?: boolean;
27
- /** 数据源,传递给 VoucherCard */
28
- source?: any;
29
- }
30
- declare const ActionButtons: React.FC<ActionButtonsProps>;
31
- export default ActionButtons;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- declare const VoucherCard: (props: any) => JSX.Element | null;
4
- export default VoucherCard;
@@ -1 +0,0 @@
1
- export declare const Provider: any, Context: any;
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface ActionButtonsProps {
4
- /** booking 状态对象,包含 service、addons 等数据 */
5
- state: {
6
- service?: {
7
- value?: any[];
8
- };
9
- addons?: {
10
- value?: any[];
11
- };
12
- disabledEdit?: boolean;
13
- channelDisabledEdit?: boolean;
14
- shop_discount?: string;
15
- bookingDetail?: {
16
- [key: string]: any;
17
- };
18
- [key: string]: any;
19
- };
20
- /** dispatch 函数,用于触发状态更新 */
21
- dispatch: (action: {
22
- type: string;
23
- payload?: any;
24
- }) => void;
25
- /** 是否禁用所有按钮 */
26
- disabled?: boolean;
27
- /** 数据源,传递给 VoucherCard */
28
- source?: any;
29
- }
30
- declare const ActionButtons: React.FC<ActionButtonsProps>;
31
- export default ActionButtons;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- declare const VoucherCard: (props: any) => JSX.Element | null;
4
- export default VoucherCard;