@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.
- 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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +5 -5
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +6 -6
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.js +23 -7
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/es/components/booking/notes/addNote/index.d.ts +0 -1
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/checkout/PaymentModal.js +23 -33
- package/es/components/checkout/PaymentPlugin.d.ts +0 -1
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
- package/es/components/checkout/components/PaymentResultToast/index.js +1 -1
- package/es/components/checkout/components/ScrollableList/index.js +0 -1
- package/es/components/eftposPay/amount.d.ts +0 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/es/components/pay/toB/components/MX51/index.js +14 -44
- package/es/components/pay/toB/types/index.d.ts +0 -12
- package/es/components/pay/toB/types/index.js +0 -4
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.js +8 -7
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/lib/components/booking/notes/addNote/index.d.ts +0 -1
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/checkout/PaymentModal.js +7 -17
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -1
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
- package/lib/components/checkout/components/PaymentResultToast/index.js +1 -1
- package/lib/components/checkout/components/ScrollableList/index.js +0 -1
- package/lib/components/eftposPay/amount.d.ts +0 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/lib/components/pay/toB/components/MX51/index.js +12 -37
- package/lib/components/pay/toB/types/index.d.ts +0 -12
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/package.json +1 -1
- package/es/hooks/printer.d.ts +0 -4
- package/es/hooks/printer.js +0 -35
- package/lib/hooks/printer.d.ts +0 -4
- package/lib/hooks/printer.js +0 -60
@@ -1,10 +1 @@
|
|
1
|
-
|
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;
|
@@ -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
|
1664
|
-
|
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
|
-
|
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,10 +1 @@
|
|
1
|
-
|
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,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:
|
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,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:
|
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,10 +1 @@
|
|
1
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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 =
|
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
|
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
|
-
|
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 =
|
1764
|
+
_context17.next = 29;
|
1775
1765
|
break;
|
1776
|
-
case
|
1766
|
+
case 18:
|
1777
1767
|
if (!isLocalOrderCreated.current) {
|
1778
|
-
_context17.next =
|
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 =
|
1774
|
+
_context17.next = 23;
|
1785
1775
|
return checkout.cancelCurrentOrderAsync();
|
1786
|
-
case
|
1787
|
-
_context17.next =
|
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
|
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
|
1803
|
-
_context17.next =
|
1792
|
+
case 29:
|
1793
|
+
_context17.next = 35;
|
1804
1794
|
break;
|
1805
|
-
case
|
1806
|
-
_context17.prev =
|
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
|
1806
|
+
case 35:
|
1817
1807
|
case "end":
|
1818
1808
|
return _context17.stop();
|
1819
1809
|
}
|
1820
|
-
}, _callee17, null, [[0,
|
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
|
-
|
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) || '');
|
@@ -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 ?
|
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, 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,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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
73
|
-
|
74
|
-
|
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
|
-
}
|
@@ -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:
|
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 { 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:
|
73
|
-
state: FormState;
|
74
|
-
} & {
|
75
|
-
dispatch: (params: {
|
76
|
-
type: string;
|
77
|
-
payload: any;
|
78
|
-
}) => void;
|
79
|
-
}>;
|
71
|
+
export declare const Provider: any, Context: any;
|