@pisell/private-materials 6.4.31 → 6.4.33

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.
Files changed (94) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +5 -5
  7. package/build/lowcode/render/default/view.js +6 -6
  8. package/build/lowcode/view.js +6 -6
  9. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  10. package/es/components/appointmentBooking/index.d.ts +0 -1
  11. package/es/components/booking/addons/model.d.ts +1 -10
  12. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  13. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  14. package/es/components/booking/components/footer/index.js +23 -7
  15. package/es/components/booking/deposit/index.d.ts +0 -1
  16. package/es/components/booking/forms/model.d.ts +1 -10
  17. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  18. package/es/components/booking/info/model.d.ts +1 -10
  19. package/es/components/booking/info/notes/index.d.ts +0 -1
  20. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  21. package/es/components/booking/model.d.ts +1 -9
  22. package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
  23. package/es/components/booking/notes/addNote/index.d.ts +0 -1
  24. package/es/components/booking/notes/model.d.ts +1 -10
  25. package/es/components/booking/payments/model.d.ts +1 -10
  26. package/es/components/checkout/PaymentModal.js +23 -33
  27. package/es/components/checkout/PaymentPlugin.d.ts +0 -1
  28. package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
  29. package/es/components/checkout/components/PaymentResultToast/index.js +1 -1
  30. package/es/components/checkout/components/ScrollableList/index.js +0 -1
  31. package/es/components/eftposPay/amount.d.ts +0 -1
  32. package/es/components/eftposPay/app.d.ts +0 -1
  33. package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  34. package/es/components/eftposPay/component/fail/index.d.ts +0 -1
  35. package/es/components/eftposPay/index.d.ts +0 -1
  36. package/es/components/eftposPay/pay.d.ts +0 -1
  37. package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
  38. package/es/components/pay/toB/components/MX51/index.js +14 -44
  39. package/es/components/pay/toB/types/index.d.ts +0 -12
  40. package/es/components/pay/toB/types/index.js +0 -4
  41. package/es/components/pay/toC/model.d.ts +1 -9
  42. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  43. package/es/components/schedules/model.d.ts +1 -9
  44. package/es/components/wallet/Detail/model.d.ts +1 -13
  45. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  46. package/es/components/wallet/PointCard/model.d.ts +1 -13
  47. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  48. package/es/components/wallet/Voucher/model.d.ts +1 -13
  49. package/es/components/wallet/model.d.ts +1 -9
  50. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  51. package/lib/components/appointmentBooking/index.d.ts +0 -1
  52. package/lib/components/booking/addons/model.d.ts +1 -10
  53. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  54. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  55. package/lib/components/booking/components/footer/index.js +8 -7
  56. package/lib/components/booking/deposit/index.d.ts +0 -1
  57. package/lib/components/booking/forms/model.d.ts +1 -10
  58. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  59. package/lib/components/booking/info/model.d.ts +1 -10
  60. package/lib/components/booking/info/notes/index.d.ts +0 -1
  61. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  62. package/lib/components/booking/model.d.ts +1 -9
  63. package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
  64. package/lib/components/booking/notes/addNote/index.d.ts +0 -1
  65. package/lib/components/booking/notes/model.d.ts +1 -10
  66. package/lib/components/booking/payments/model.d.ts +1 -10
  67. package/lib/components/checkout/PaymentModal.js +7 -17
  68. package/lib/components/checkout/PaymentPlugin.d.ts +0 -1
  69. package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
  70. package/lib/components/checkout/components/PaymentResultToast/index.js +1 -1
  71. package/lib/components/checkout/components/ScrollableList/index.js +0 -1
  72. package/lib/components/eftposPay/amount.d.ts +0 -1
  73. package/lib/components/eftposPay/app.d.ts +0 -1
  74. package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  75. package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
  76. package/lib/components/eftposPay/index.d.ts +0 -1
  77. package/lib/components/eftposPay/pay.d.ts +0 -1
  78. package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
  79. package/lib/components/pay/toB/components/MX51/index.js +12 -37
  80. package/lib/components/pay/toB/types/index.d.ts +0 -12
  81. package/lib/components/pay/toC/model.d.ts +1 -9
  82. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
  83. package/lib/components/schedules/model.d.ts +1 -9
  84. package/lib/components/wallet/Detail/model.d.ts +1 -13
  85. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  86. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  87. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  88. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  89. package/lib/components/wallet/model.d.ts +1 -9
  90. package/package.json +1 -1
  91. package/es/hooks/printer.d.ts +0 -4
  92. package/es/hooks/printer.js +0 -35
  93. package/lib/hooks/printer.d.ts +0 -4
  94. package/lib/hooks/printer.js +0 -60
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const AppointmentBooking: () => JSX.Element;
4
3
  export default AppointmentBooking;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  interface TabProductProps {
4
3
  list: any[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => JSX.Element;
4
3
  export default ProductItem;
@@ -45,6 +45,8 @@ import { Iconfont } from '@pisell/materials';
45
45
  import { useCustomer } from "../../../ticketBooking/hooks/pisellos/useCustomer";
46
46
  import { useDebounceEffect, useMemoizedFn } from 'ahooks';
47
47
  import { cloneDeep } from 'lodash';
48
+ import { useShopDiscount } from "../../../appointmentBooking/hooks";
49
+
48
50
  /**
49
51
  * @title: 底部
50
52
  * @description:
@@ -654,12 +656,12 @@ var Footer = function Footer(props) {
654
656
  setPaymentCallback(function () {
655
657
  return function (paymentResult) {
656
658
  console.log('Payment result:', paymentResult);
659
+ setIsPaymentModalOpen(false);
657
660
  if ((paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status) === 'success') {
658
661
  var _window5;
659
662
  console.log('Payment completed successfully');
660
663
  (_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.shopApi) === null || _window5 === void 0 || (_window5 = _window5.bookingTicket) === null || _window5 === void 0 || _window5.clearAllCart();
661
664
  // 支付成功后关闭弹窗
662
- setIsPaymentModalOpen(false);
663
665
  setPaymentModalData(null);
664
666
  setPaymentCallback(null);
665
667
  } else if ((paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status) === 'cancelled') {
@@ -669,13 +671,11 @@ var Footer = function Footer(props) {
669
671
  (_window6 = window) === null || _window6 === void 0 || (_window6 = _window6.shopApi) === null || _window6 === void 0 || (_window6 = _window6.booking) === null || _window6 === void 0 || _window6.voidBooking(res.order_id);
670
672
  }
671
673
  // 支付取消后关闭弹窗
672
- setIsPaymentModalOpen(false);
673
674
  setPaymentModalData(null);
674
675
  setPaymentCallback(null);
675
676
  } else {
676
677
  console.log('Payment status:', paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status);
677
678
  // 其他状态也关闭弹窗
678
- setIsPaymentModalOpen(false);
679
679
  setPaymentModalData(null);
680
680
  setPaymentCallback(null);
681
681
  }
@@ -1656,12 +1656,15 @@ var Footer = function Footer(props) {
1656
1656
  changeCustomerToGlobalState: changeCustomerToGlobalState
1657
1657
  }),
1658
1658
  selectCustomer = _useCustomer.selectCustomer;
1659
+ var shopDiscount = useShopDiscount();
1659
1660
  var _useScanManager2 = useScanManager(),
1660
1661
  clearAllScanListenersTaskQueue = _useScanManager2.clearAllScanListenersTaskQueue;
1661
1662
  // 清空所有内容并重置购物车
1662
1663
  var handleClearAllAndReset = function handleClearAllAndReset() {
1663
- var _window7;
1664
- (_window7 = window) === null || _window7 === void 0 || (_window7 = _window7.shopApi) === null || _window7 === void 0 || (_window7 = _window7.bookingTicket) === null || _window7 === void 0 || _window7.clearAllCart();
1664
+ var _shopDiscount$clear;
1665
+ // setTimeout(() => {
1666
+ // (window as any)?.shopApi?.bookingTicket?.clearAllCart();
1667
+ // }, 0);
1665
1668
  clearAllScanListenersTaskQueue();
1666
1669
  // 清空服务项目
1667
1670
  dispatch({
@@ -1716,6 +1719,9 @@ var Footer = function Footer(props) {
1716
1719
  orderNote: ''
1717
1720
  }
1718
1721
  });
1722
+
1723
+ // 清空商品券
1724
+ shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$clear = shopDiscount.clear) === null || _shopDiscount$clear === void 0 || _shopDiscount$clear.call(shopDiscount);
1719
1725
  };
1720
1726
  return /*#__PURE__*/React.createElement(Skeleton, {
1721
1727
  title: false,
@@ -1800,13 +1806,23 @@ var Footer = function Footer(props) {
1800
1806
  state: state,
1801
1807
  dispatch: dispatch,
1802
1808
  onClose: function onClose(reset) {
1803
- console.log('🔄 Footer: Closing PaymentModal');
1809
+ // console.log('🔄 Footer: Closing PaymentModal');
1804
1810
  setIsPaymentModalOpen(false);
1805
1811
  setPaymentModalData(null);
1806
1812
  setPaymentCallback(null);
1813
+ // if (reset) {
1814
+ // handleClearAllAndReset();
1815
+ // }
1807
1816
  if (reset) {
1808
- handleClearAllAndReset();
1817
+ setTimeout(function () {
1818
+ handleClearAllAndReset();
1819
+ }, 0);
1809
1820
  }
1821
+ // setPaymentModalData(null);
1822
+ // setPaymentCallback(null);
1823
+ // if (reset) {
1824
+ // handleClearAllAndReset();
1825
+ // }
1810
1826
  }
1811
1827
  }));
1812
1828
  };
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Deposit: (props: any) => JSX.Element;
3
2
  export default Deposit;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface AddServiceVariantProps {
3
2
  globalState: any;
4
3
  setGlobalState: any;
@@ -1,14 +1,5 @@
1
- /// <reference types="react" />
2
- import { FormState } from '../model';
3
1
  export declare const walkInData: {
4
2
  id: number;
5
3
  nickname: string;
6
4
  };
7
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
- state: FormState;
9
- } & {
10
- dispatch: (params: {
11
- type: string;
12
- payload: any;
13
- }) => void;
14
- }>;
5
+ export declare const Provider: any, Context: any;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Notes: () => JSX.Element | null;
3
2
  export default Notes;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PisellDrawerProps } from '../../../components/drawer';
3
2
  import '../../../info/service/addService/index.less';
4
3
  interface AddServiceProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -106,11 +105,4 @@ export declare const walkInData: {
106
105
  id: number;
107
106
  nickname: string;
108
107
  };
109
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
110
- state: FormState;
111
- } & {
112
- dispatch: (params: {
113
- type: string;
114
- payload: any;
115
- }) => void;
116
- }>;
108
+ export declare const Provider: any, Context: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  export interface InfoProps {
4
3
  title?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const AddNote: ({ value, onChange, title, placeholder }: any) => JSX.Element;
4
3
  export default AddNote;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -16,7 +16,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
16
16
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
17
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
18
  import React, { useRef, useState, useEffect, useCallback, useMemo, useImperativeHandle, forwardRef } from 'react';
19
- import { locales } from '@pisell/utils';
19
+ import { locales, webPrint } from '@pisell/utils';
20
20
  import { getLocale } from "../../utils/locales";
21
21
  import { useMemoizedFn } from 'ahooks';
22
22
  import { createPortal } from 'react-dom';
@@ -47,7 +47,6 @@ import { cloneDeep } from 'lodash';
47
47
  import { getShopWalletPassId, reorderPaymentMethodList } from "./utils";
48
48
  import usePaymentLogger from "./hooks/usePaymentLogger";
49
49
  import { Button } from 'antd';
50
- import usePrinter from "../../hooks/printer";
51
50
 
52
51
  // Checkout 模块的事件常量
53
52
  var CheckoutHooks = {
@@ -140,8 +139,6 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
140
139
  _useState16 = _slicedToArray(_useState15, 2),
141
140
  walletPassData = _useState16[0],
142
141
  setWalletPassData = _useState16[1];
143
- var _usePrinter = usePrinter(),
144
- nativePrint = _usePrinter.nativePrint;
145
142
  var isOrderFree = useMemo(function () {
146
143
  if (!customAmount) return false;
147
144
  var amount = parseFloat(customAmount);
@@ -678,12 +675,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
678
675
  data: {
679
676
  order_id: responseData.order_id,
680
677
  machine_code_print_info: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info,
681
- small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment = responseData.payment_info) === null || _responseData$payment === void 0 ? void 0 : _responseData$payment.small_ticket_data,
682
- machine_code_print_info_v2: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info_v2
678
+ small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment = responseData.payment_info) === null || _responseData$payment === void 0 ? void 0 : _responseData$payment.small_ticket_data
683
679
  }
684
680
  };
685
681
  console.log('print_order_onOrderSynced_params>>>>', params);
686
- nativePrint(params, function (res) {
682
+ webPrint(params, function (res) {
687
683
  console.log('print_order_onOrderSynced_res>>>>', res);
688
684
  });
689
685
  } catch (error) {
@@ -973,7 +969,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
973
969
  }
974
970
  };
975
971
  try {
976
- nativePrint(params, function (res) {
972
+ webPrint(params, function (res) {
977
973
  console.log('handleButtonClick_print-receipt_res>>>>', res);
978
974
  if (!(res !== null && res !== void 0 && res.result)) {
979
975
  Toast === null || Toast === void 0 || Toast.error((res === null || res === void 0 ? void 0 : res.msg) || '');
@@ -1288,8 +1284,6 @@ var PaymentModal = function PaymentModal(_ref17) {
1288
1284
  showRetryModal = _useState30[0],
1289
1285
  setShowRetryModal = _useState30[1];
1290
1286
  var Toast = useToast();
1291
- var _usePrinter2 = usePrinter(),
1292
- nativePrint = _usePrinter2.nativePrint;
1293
1287
 
1294
1288
  // 重试处理函数(逻辑由用户自己实现)
1295
1289
  var handleRetry = /*#__PURE__*/function () {
@@ -1619,7 +1613,7 @@ var PaymentModal = function PaymentModal(_ref17) {
1619
1613
  // 获取 checkout 模块并处理订单数据
1620
1614
  checkout = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
1621
1615
  if (!(checkout && data && !isLocalOrderCreated.current)) {
1622
- _context17.next = 20;
1616
+ _context17.next = 18;
1623
1617
  break;
1624
1618
  }
1625
1619
  isLocalOrderCreated.current = true;
@@ -1639,19 +1633,16 @@ var PaymentModal = function PaymentModal(_ref17) {
1639
1633
  order_rounding_setting: getData('order_rounding_setting'),
1640
1634
  shop_wallet_pass_id: shop_wallet_pass_id
1641
1635
  });
1642
- console.time('initCheckoutData');
1643
1636
  newData = cloneDeep(data); // setTotalAmount(newData.total.expectAmount);
1644
1637
  // 先往 checkout 解决方案推送一条 local 数据
1645
- _context17.next = 12;
1638
+ _context17.next = 11;
1646
1639
  return checkout.createLocalOrderAsync({
1647
1640
  orderData: newData.order_info,
1648
1641
  cartSummary: (_newData$subtotal_inf = newData.subtotal_info) === null || _newData$subtotal_inf === void 0 ? void 0 : _newData$subtotal_inf.subTotalList,
1649
1642
  autoPayment: true,
1650
1643
  totalInfo: newData.subtotal_info
1651
1644
  });
1652
- case 12:
1653
- console.timeEnd('initCheckoutData');
1654
-
1645
+ case 11:
1655
1646
  // 获取订单总金额
1656
1647
  _orderInfo2 = checkout.getCurrentOrderInfo();
1657
1648
  if (_orderInfo2 && _orderInfo2.totalAmount) {
@@ -1708,8 +1699,7 @@ var PaymentModal = function PaymentModal(_ref17) {
1708
1699
  data: {
1709
1700
  order_id: responseData.order_id,
1710
1701
  machine_code_print_info: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info,
1711
- small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment3 = responseData.payment_info) === null || _responseData$payment3 === void 0 ? void 0 : _responseData$payment3.small_ticket_data,
1712
- machine_code_print_info_v2: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info_v2
1702
+ small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment3 = responseData.payment_info) === null || _responseData$payment3 === void 0 ? void 0 : _responseData$payment3.small_ticket_data
1713
1703
  }
1714
1704
  };
1715
1705
  console.log('print_order_onOrderSynced_params>>>>', params);
@@ -1720,7 +1710,7 @@ var PaymentModal = function PaymentModal(_ref17) {
1720
1710
  params: params
1721
1711
  }
1722
1712
  });
1723
- nativePrint(params, function (res) {
1713
+ webPrint(params, function (res) {
1724
1714
  console.log('print_order_onOrderSynced_res>>>>', res);
1725
1715
  logger === null || logger === void 0 || logger.addLog({
1726
1716
  type: 'info',
@@ -1771,27 +1761,27 @@ var PaymentModal = function PaymentModal(_ref17) {
1771
1761
  // 可以在这里执行同步完成后的业务逻辑
1772
1762
  // 比如:通知其他系统、更新UI状态等
1773
1763
  });
1774
- _context17.next = 31;
1764
+ _context17.next = 29;
1775
1765
  break;
1776
- case 20:
1766
+ case 18:
1777
1767
  if (!isLocalOrderCreated.current) {
1778
- _context17.next = 31;
1768
+ _context17.next = 29;
1779
1769
  break;
1780
1770
  }
1781
1771
  // // 如果本地订单已创建,这时候还更新了 data,则需要销毁当前的订单数据,然后更新新的订单数据了
1782
1772
  console.log('🔄 PaymentModal: data changed, updating checkout data...');
1783
1773
  isLocalOrderCreated.current = false;
1784
- _context17.next = 25;
1774
+ _context17.next = 23;
1785
1775
  return checkout.cancelCurrentOrderAsync();
1786
- case 25:
1787
- _context17.next = 27;
1776
+ case 23:
1777
+ _context17.next = 25;
1788
1778
  return checkout.createLocalOrderAsync({
1789
1779
  orderData: data === null || data === void 0 ? void 0 : data.order_info,
1790
1780
  cartSummary: data === null || data === void 0 || (_data$subtotal_info = data.subtotal_info) === null || _data$subtotal_info === void 0 ? void 0 : _data$subtotal_info.subTotalList,
1791
1781
  autoPayment: true,
1792
1782
  totalInfo: data === null || data === void 0 ? void 0 : data.subtotal_info
1793
1783
  });
1794
- case 27:
1784
+ case 25:
1795
1785
  // 获取订单总金额
1796
1786
  _orderInfo3 = checkout.getCurrentOrderInfo();
1797
1787
  if (_orderInfo3 && _orderInfo3.totalAmount) {
@@ -1799,11 +1789,11 @@ var PaymentModal = function PaymentModal(_ref17) {
1799
1789
  }
1800
1790
  setOrderInfo(_orderInfo3);
1801
1791
  isLocalOrderCreated.current = true;
1802
- case 31:
1803
- _context17.next = 37;
1792
+ case 29:
1793
+ _context17.next = 35;
1804
1794
  break;
1805
- case 33:
1806
- _context17.prev = 33;
1795
+ case 31:
1796
+ _context17.prev = 31;
1807
1797
  _context17.t0 = _context17["catch"](0);
1808
1798
  console.error('Failed to initialize checkout data:', _context17.t0);
1809
1799
  logger === null || logger === void 0 || logger.addLog({
@@ -1813,11 +1803,11 @@ var PaymentModal = function PaymentModal(_ref17) {
1813
1803
  error: _context17.t0
1814
1804
  }
1815
1805
  });
1816
- case 37:
1806
+ case 35:
1817
1807
  case "end":
1818
1808
  return _context17.stop();
1819
1809
  }
1820
- }, _callee17, null, [[0, 33]]);
1810
+ }, _callee17, null, [[0, 31]]);
1821
1811
  }));
1822
1812
  return function initCheckoutData() {
1823
1813
  return _ref22.apply(this, arguments);
@@ -1941,7 +1931,7 @@ var PaymentModal = function PaymentModal(_ref17) {
1941
1931
  }
1942
1932
  };
1943
1933
  try {
1944
- nativePrint(params, function (res) {
1934
+ webPrint(params, function (res) {
1945
1935
  console.log('handleButtonClick_print-receipt_res>>>>', res);
1946
1936
  if (!(res !== null && res !== void 0 && res.result)) {
1947
1937
  Toast === null || Toast === void 0 || Toast.error((res === null || res === void 0 ? void 0 : res.msg) || '');
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const PaymentPlugin: () => JSX.Element;
3
2
  export default PaymentPlugin;
@@ -27,7 +27,7 @@ var globalPaymentResultToastContext = null;
27
27
  var DEFAULT_TOAST_CONFIG = {
28
28
  width: 680,
29
29
  mask: true,
30
- maskClosable: false,
30
+ maskClosable: true,
31
31
  closable: true,
32
32
  zIndex: 2000
33
33
  };
@@ -51,7 +51,7 @@ var PaymentResultToast = /*#__PURE__*/memo(function (props) {
51
51
  _props$mask = props.mask,
52
52
  mask = _props$mask === void 0 ? true : _props$mask,
53
53
  _props$maskClosable = props.maskClosable,
54
- maskClosable = _props$maskClosable === void 0 ? false : _props$maskClosable,
54
+ maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
55
55
  _props$closable = props.closable,
56
56
  closable = _props$closable === void 0 ? true : _props$closable,
57
57
  zIndex = props.zIndex;
@@ -241,7 +241,6 @@ var ScrollableList = function ScrollableList(_ref) {
241
241
  style: getGridStyle()
242
242
  }, children)), isScrollable && /*#__PURE__*/React.createElement("button", {
243
243
  style: _objectSpread(_objectSpread({}, bottomGradientStyle), {}, {
244
- width: '100%',
245
244
  border: 'none',
246
245
  background: 'linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #A78BE1 100%)'
247
246
  }, gradientStyle),
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PosProps } from './const';
3
2
  /**
4
3
  * @title: 支付金额信息配置页
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PosProps, RouteType } from './const';
3
2
  declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
4
3
  action: RouteType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ActionProps } from '../../const';
3
2
  declare const _default: ({ className, isMobile, onChange }: ActionProps) => JSX.Element;
4
3
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ActionProps } from '../../const';
3
2
  declare const _default: ({ onChange, className, isMobile }: ActionProps) => JSX.Element;
4
3
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PosProps } from './const';
3
2
  import './index.less';
4
3
  declare const _default: (props: PosProps) => JSX.Element | null;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PayProps } from './const';
3
2
  import './index.less';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PayMethod, PayMethodGroup } from '../../types';
3
2
  import './index.less';
4
3
  declare const ToBPayCardGroup: (props: {
@@ -1,6 +1,6 @@
1
1
  import { forwardRef, useImperativeHandle } from 'react';
2
+ import { webPayment } from '@pisell/utils';
2
3
  import useLogger from "../../../../../hooks/useLogger";
3
- import useEngineContext from "../../../../../hooks/useEngineContext";
4
4
  var getUuid = function getUuid() {
5
5
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxx'.replace(/[xy]/g, function (c) {
6
6
  var r = Math.random() * 16 | 0;
@@ -9,10 +9,7 @@ var getUuid = function getUuid() {
9
9
  });
10
10
  };
11
11
  var MX51 = function MX51(props, ref) {
12
- var _context$appHelper;
13
12
  var logger = useLogger();
14
- var context = useEngineContext();
15
- var action = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.action;
16
13
  var onOpen = function onOpen(_ref) {
17
14
  var data = _ref.data,
18
15
  payCallback = _ref.payCallback;
@@ -36,47 +33,20 @@ var MX51 = function MX51(props, ref) {
36
33
  params: newData
37
34
  }
38
35
  });
39
-
40
- // 通过action调用mx51支付
41
- action({
42
- type: 'webpos.handleMX51Pay',
43
- data: newData,
44
- callback: function callback(res) {
45
- var isSame = false;
46
- if (res !== null && res !== void 0 && res.uniquePaymentNumber) {
47
- // jsbridge调用场景结果
48
- var _res = res;
49
- // 判断是否是同一个支付
50
- isSame = (_res === null || _res === void 0 ? void 0 : _res.uniquePaymentNumber) === uniquePaymentNumber;
51
- if (isSame) {
52
- payCallback === null || payCallback === void 0 || payCallback(_res);
53
- }
54
- } else {
55
- var _res2$data, _res2$data2;
56
- // 原生调用场景结果
57
- var _res2 = res;
58
- // 转换为MX51PayResult类型,上层调用需要
59
- var newRes = {
60
- result: (_res2 === null || _res2 === void 0 ? void 0 : _res2.code) == '200' ? true : false,
61
- msg: _res2 === null || _res2 === void 0 ? void 0 : _res2.msg,
62
- amount: _res2 === null || _res2 === void 0 || (_res2$data = _res2.data) === null || _res2$data === void 0 ? void 0 : _res2$data.amount,
63
- surcharge: _res2 === null || _res2 === void 0 || (_res2$data2 = _res2.data) === null || _res2$data2 === void 0 ? void 0 : _res2$data2.surcharge,
64
- uniquePaymentNumber: _res2 === null || _res2 === void 0 ? void 0 : _res2.uuid
65
- };
66
- // 判断是否是同一个支付
67
- isSame = (_res2 === null || _res2 === void 0 ? void 0 : _res2.uuid) === uniquePaymentNumber;
68
- if (isSame) {
69
- payCallback === null || payCallback === void 0 || payCallback(newRes);
70
- }
36
+ // 通过jsbridge调用mx51支付
37
+ webPayment(newData, function (res) {
38
+ // 判断是否是同一个支付
39
+ var isSame = (res === null || res === void 0 ? void 0 : res.uniquePaymentNumber) === uniquePaymentNumber;
40
+ logger === null || logger === void 0 || logger.addLog({
41
+ type: 'info',
42
+ title: 'ToB_MX51_onOpen_callback',
43
+ metadata: {
44
+ msg: isSame ? 'uniquePaymentNumber一致' : 'uniquePaymentNumber不一致',
45
+ res: res
71
46
  }
72
- logger === null || logger === void 0 || logger.addLog({
73
- type: 'info',
74
- title: 'ToB_MX51_onOpen_callback',
75
- metadata: {
76
- msg: isSame ? '交易流水号一致' : '交易流水号不一致',
77
- res: res
78
- }
79
- });
47
+ });
48
+ if (isSame) {
49
+ payCallback === null || payCallback === void 0 || payCallback(res);
80
50
  }
81
51
  });
82
52
  };
@@ -58,15 +58,3 @@ export interface MX51PayResult {
58
58
  surcharge: number;
59
59
  uniquePaymentNumber: string;
60
60
  }
61
- /**
62
- * @title 原生MX51支付结果
63
- */
64
- export interface NativeMX51PayResult {
65
- code: string;
66
- msg?: string;
67
- data: {
68
- amount: number;
69
- surcharge: number;
70
- };
71
- uuid: string;
72
- }
@@ -11,8 +11,4 @@ export * from "./storeTypes";
11
11
  /**
12
12
  * @title: MX51支付结果
13
13
  */
14
-
15
- /**
16
- * @title 原生MX51支付结果
17
- */
18
14
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  platform: 'pc' | 'h5' | '' | undefined;
4
3
  order: any;
@@ -29,11 +28,4 @@ export interface PayGroup {
29
28
  pay_number?: string;
30
29
  _order: any;
31
30
  }
32
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
33
- state: FormState;
34
- } & {
35
- dispatch: (params: {
36
- type: string;
37
- payload: any;
38
- }) => void;
39
- }>;
31
+ export declare const Provider: any, Context: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => JSX.Element;
4
3
  export default ProductItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,11 +68,4 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
73
- state: FormState;
74
- } & {
75
- dispatch: (params: {
76
- type: string;
77
- payload: any;
78
- }) => void;
79
- }>;
71
+ export declare const Provider: any, Context: any;