@pisell/private-materials 6.4.73 → 6.4.74
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 +4 -4
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/booking/components/footer/index.js +62 -53
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +178 -108
- package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/es/components/checkout/components/AdditionalModule/index.js +44 -12
- package/es/components/checkout/components/AmountSummary/index.js +9 -76
- package/es/components/checkout/components/AmountSummary/index.less +1 -1
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/ticketBooking/components/timeBar/index.js +112 -7
- package/es/components/ticketBooking/components/timeBar/index.less +59 -0
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +11 -7
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
- package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lib/components/booking/components/footer/index.js +15 -8
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +73 -11
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +44 -11
- package/lib/components/checkout/components/AmountSummary/index.js +5 -46
- package/lib/components/checkout/components/AmountSummary/index.less +1 -1
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
- package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +9 -5
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
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; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import { useState, useEffect, useMemo } from 'react';
|
|
12
|
-
import { Button, Dropdown
|
|
12
|
+
import { Button, Dropdown } from 'antd';
|
|
13
13
|
import { CheckCircleOutlined, PieChartOutlined } from '@ant-design/icons';
|
|
14
14
|
import { Edit05 } from '@pisell/icon';
|
|
15
15
|
import { PisellModal } from '@pisell/materials';
|
|
@@ -18,7 +18,8 @@ import Decimal from 'decimal.js';
|
|
|
18
18
|
import checkoutLocales from "../../locales";
|
|
19
19
|
import PaymentDetailModal from "../PaymentDetailModal";
|
|
20
20
|
import PisellPriceKeyboardPopover from "../../../../pro/pisellSimplePriceKeyboardPopover";
|
|
21
|
-
import { PaymentKeyboard } from
|
|
21
|
+
// import { PaymentKeyboard } from '../../../../pro/priceKeyboard';
|
|
22
|
+
|
|
22
23
|
import "./index.less";
|
|
23
24
|
import classNames from 'classnames';
|
|
24
25
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
@@ -503,12 +504,12 @@ function AmountSummary(_ref2) {
|
|
|
503
504
|
var syncedVoucherAmount = paymentItems === null || paymentItems === void 0 ? void 0 : paymentItems.reduce(function (acc, item) {
|
|
504
505
|
// 如果当前是普通支付,则减去order_payment_type不为 deposit的支付项
|
|
505
506
|
// 如果当前是定金支付,则减去order_payment_type为 deposit的支付项
|
|
506
|
-
if (item.isSynced && (paymentType === 'regular' && item.order_payment_type !== 'deposit' || paymentType === 'deposit' && item.order_payment_type === 'deposit')) {
|
|
507
|
+
if ((item.isSynced || item.voucher_id) && (paymentType === 'regular' && item.order_payment_type !== 'deposit' || paymentType === 'deposit' && item.order_payment_type === 'deposit')) {
|
|
507
508
|
return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
|
|
508
509
|
}
|
|
509
510
|
return acc;
|
|
510
511
|
}, new Decimal(0)).toNumber();
|
|
511
|
-
balanceDecimal = balanceDecimal.minus(syncedVoucherAmount);
|
|
512
|
+
balanceDecimal = new Decimal(Math.abs(balanceDecimal.minus(new Decimal(syncedVoucherAmount)).toNumber()));
|
|
512
513
|
// if (walletPassData?.selectedDiscountList && walletPassData.selectedDiscountList.length > 0) {
|
|
513
514
|
// walletPassData?.availableDiscountList?.forEach((discountItem: any) => {
|
|
514
515
|
// discountItem.appliedProductDetails?.forEach((productDetail: any) => {
|
|
@@ -639,8 +640,9 @@ function AmountSummary(_ref2) {
|
|
|
639
640
|
return balanceDueAmount !== customAmount && Number(balanceDueAmount) > 0 && Number(customAmount) > 0;
|
|
640
641
|
}, [customAmount, balanceDueAmount]);
|
|
641
642
|
var handleChangeDepositAmount = function handleChangeDepositAmount(value) {
|
|
642
|
-
|
|
643
|
-
|
|
643
|
+
var valueStr = String(value);
|
|
644
|
+
console.log('handleChangeDepositAmount', valueStr);
|
|
645
|
+
checkoutModule === null || checkoutModule === void 0 || checkoutModule.setDepositAmountAsync(valueStr);
|
|
644
646
|
};
|
|
645
647
|
var hasDepositPayment = useMemo(function () {
|
|
646
648
|
return paymentItems === null || paymentItems === void 0 ? void 0 : paymentItems.some(function (item) {
|
|
@@ -778,76 +780,7 @@ function AmountSummary(_ref2) {
|
|
|
778
780
|
hideDecimalForWholeNumbers: false,
|
|
779
781
|
useThousandsSeparator: true,
|
|
780
782
|
showCurrencySymbol: true
|
|
781
|
-
})))),
|
|
782
|
-
className: classNames('cancel-split-payment-button'),
|
|
783
|
-
onClick: function onClick() {
|
|
784
|
-
return onAmountChange === null || onAmountChange === void 0 ? void 0 : onAmountChange(balanceDueAmount);
|
|
785
|
-
}
|
|
786
|
-
}, getText('split.cancel') || '取消部\n分支付') : /*#__PURE__*/React.createElement(Popover, {
|
|
787
|
-
content: /*#__PURE__*/React.createElement("div", {
|
|
788
|
-
onClick: function onClick(e) {
|
|
789
|
-
return e.stopPropagation();
|
|
790
|
-
}
|
|
791
|
-
}, /*#__PURE__*/React.createElement(PaymentKeyboard
|
|
792
|
-
// 原始值:此支付阶段的待支付金额,reset时还原为此值
|
|
793
|
-
, {
|
|
794
|
-
paymentOriginalValue: balanceDueAmount,
|
|
795
|
-
paymentDefaultValue: String(customAmount || 0),
|
|
796
|
-
enableExceedMaxAmount: false,
|
|
797
|
-
payment: {
|
|
798
|
-
enable: true
|
|
799
|
-
},
|
|
800
|
-
surcharge: {
|
|
801
|
-
enable: false
|
|
802
|
-
},
|
|
803
|
-
surchargeDefaultValue: {
|
|
804
|
-
percent: '0',
|
|
805
|
-
fixed: '0'
|
|
806
|
-
},
|
|
807
|
-
selectType: "light",
|
|
808
|
-
onChange: function onChange(value) {
|
|
809
|
-
console.log(value);
|
|
810
|
-
},
|
|
811
|
-
doneText: getText('confirm'),
|
|
812
|
-
onPay: function onPay(args) {
|
|
813
|
-
console.log(args);
|
|
814
|
-
// 处理支付逻辑
|
|
815
|
-
setIsKeyboardVisible(false);
|
|
816
|
-
handleKeyboardConfirm(args.amount);
|
|
817
|
-
}
|
|
818
|
-
})),
|
|
819
|
-
trigger: "click",
|
|
820
|
-
open: isKeyboardVisible,
|
|
821
|
-
onOpenChange: setIsKeyboardVisible,
|
|
822
|
-
placement: "bottom",
|
|
823
|
-
overlayClassName: "payment-keyboard-popover",
|
|
824
|
-
arrow: true,
|
|
825
|
-
destroyTooltipOnHide: true
|
|
826
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
827
|
-
className: classNames('split-payment-button')
|
|
828
|
-
}, getText('split.payment') || '拆分支付')))
|
|
829
|
-
// <PisellPriceKeyboardPopover
|
|
830
|
-
// value={(() => {
|
|
831
|
-
// try {
|
|
832
|
-
// return new Decimal(currentAmount || '0').toNumber();
|
|
833
|
-
// } catch {
|
|
834
|
-
// return 0;
|
|
835
|
-
// }
|
|
836
|
-
// })()}
|
|
837
|
-
// // onChange={handleKeyboardConfirm}
|
|
838
|
-
// onConfirm={handleKeyboardConfirm}
|
|
839
|
-
// // onCancel={handleKeyboardCancel}
|
|
840
|
-
// showCurrencySymbol={true}
|
|
841
|
-
// useThousandsSeparator={false}
|
|
842
|
-
// selectType="dark"
|
|
843
|
-
// overlayClassName="amount-summary-keyboard-popover"
|
|
844
|
-
// >
|
|
845
|
-
// {/* 右侧: 拆分支付按钮 */}
|
|
846
|
-
// <Button className={classNames('split-payment-button')}>
|
|
847
|
-
// {getText('split.payment') || '拆分支付'}
|
|
848
|
-
// </Button>
|
|
849
|
-
// </PisellPriceKeyboardPopover>
|
|
850
|
-
, /*#__PURE__*/React.createElement(PisellModal, {
|
|
783
|
+
})))), /*#__PURE__*/React.createElement(PisellModal, {
|
|
851
784
|
open: isPaymentDetailOpen,
|
|
852
785
|
onCancel: handlePaymentDetailClose,
|
|
853
786
|
footer: null,
|
|
@@ -15,10 +15,12 @@ export interface CashPaymentModuleProps {
|
|
|
15
15
|
balanceDueAmount?: string;
|
|
16
16
|
balanceDueTotalAmount?: string;
|
|
17
17
|
syncingLock?: boolean;
|
|
18
|
+
shortcutsSize?: 'default' | 'large';
|
|
18
19
|
}
|
|
19
20
|
export declare function CashPaymentModule({ amountSymbol, orderInfo, onPaymentComplete, customAmount, amountButtons, // 按钮列表,默认5个推荐金额
|
|
20
21
|
disabled, // 禁用状态
|
|
21
22
|
roundingFunction, balanceDueAmount, // 当前阶段剩余支付金额(定金或普通支付)
|
|
22
23
|
balanceDueTotalAmount, // 完整订单剩余待付金额
|
|
23
|
-
syncingLock,
|
|
24
|
+
syncingLock, // 是否锁定
|
|
25
|
+
shortcutsSize, }: CashPaymentModuleProps): JSX.Element;
|
|
24
26
|
export default CashPaymentModule;
|
|
@@ -32,7 +32,9 @@ export function CashPaymentModule(_ref) {
|
|
|
32
32
|
_ref$balanceDueTotalA = _ref.balanceDueTotalAmount,
|
|
33
33
|
balanceDueTotalAmount = _ref$balanceDueTotalA === void 0 ? '0' : _ref$balanceDueTotalA,
|
|
34
34
|
_ref$syncingLock = _ref.syncingLock,
|
|
35
|
-
syncingLock = _ref$syncingLock === void 0 ? false : _ref$syncingLock
|
|
35
|
+
syncingLock = _ref$syncingLock === void 0 ? false : _ref$syncingLock,
|
|
36
|
+
_ref$shortcutsSize = _ref.shortcutsSize,
|
|
37
|
+
shortcutsSize = _ref$shortcutsSize === void 0 ? 'default' : _ref$shortcutsSize;
|
|
36
38
|
var _useState = useState(customAmount || ''),
|
|
37
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
38
40
|
amount = _useState2[0],
|
|
@@ -252,7 +254,8 @@ export function CashPaymentModule(_ref) {
|
|
|
252
254
|
};
|
|
253
255
|
}),
|
|
254
256
|
onReset: handleReset,
|
|
255
|
-
onEnter: syncingLock ? undefined : handleCashPay
|
|
257
|
+
onEnter: syncingLock ? undefined : handleCashPay,
|
|
258
|
+
shortcutsSize: shortcutsSize
|
|
256
259
|
});
|
|
257
260
|
}
|
|
258
261
|
export default CashPaymentModule;
|
|
@@ -24,6 +24,8 @@ export interface PaymentMethodItemProps {
|
|
|
24
24
|
onClick?: (method: ExtendedPaymentMethod) => void;
|
|
25
25
|
/** 获取文本的函数 */
|
|
26
26
|
getText?: (key: string, fallback?: string) => string;
|
|
27
|
+
/** 大小 */
|
|
28
|
+
size?: 'default' | 'large';
|
|
27
29
|
}
|
|
28
30
|
declare const PaymentMethodItem: React.FC<PaymentMethodItemProps>;
|
|
29
31
|
export default PaymentMethodItem;
|
|
@@ -27,7 +27,9 @@ var PaymentMethodItem = function PaymentMethodItem(_ref) {
|
|
|
27
27
|
_ref$disabled = _ref.disabled,
|
|
28
28
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
29
29
|
onClick = _ref.onClick,
|
|
30
|
-
getText = _ref.getText
|
|
30
|
+
getText = _ref.getText,
|
|
31
|
+
_ref$size = _ref.size,
|
|
32
|
+
size = _ref$size === void 0 ? 'default' : _ref$size;
|
|
31
33
|
// 控制键盘弹窗显示状态
|
|
32
34
|
var _useState = useState(false),
|
|
33
35
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -151,6 +153,9 @@ var PaymentMethodItem = function PaymentMethodItem(_ref) {
|
|
|
151
153
|
'payment-options-module-pointer': !disabled,
|
|
152
154
|
'payment-options-module-disabled': disabled
|
|
153
155
|
}),
|
|
156
|
+
style: {
|
|
157
|
+
height: size === 'large' ? '82px' : '62px'
|
|
158
|
+
},
|
|
154
159
|
onClick: showKeyboard,
|
|
155
160
|
type: "button",
|
|
156
161
|
disabled: disabled
|
|
@@ -11,5 +11,6 @@ interface ExtendedPaymentOptionsModuleProps extends PaymentOptionsModuleProps {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
showCashPayment?: boolean;
|
|
13
13
|
}
|
|
14
|
+
export declare const SHOW_METHODS_CODE: string[];
|
|
14
15
|
declare function PaymentOptionsModule({ amountSymbol, orderInfo, onClick, paymentMethods, customAmount, title, disabled, showCashPayment, }: ExtendedPaymentOptionsModuleProps): JSX.Element;
|
|
15
16
|
export default PaymentOptionsModule;
|
|
@@ -10,7 +10,7 @@ import checkoutLocales from "../../locales";
|
|
|
10
10
|
|
|
11
11
|
// 扩展 PaymentOptionsModule Props 接口
|
|
12
12
|
|
|
13
|
-
var SHOW_METHODS_CODE = ['EFTPOS_LINKLY', 'EFTPOS', 'EFTPOS_TYRO', 'EFTPOS_WINDCAVE', 'EFTPOS_PAYO'];
|
|
13
|
+
export var SHOW_METHODS_CODE = ['EFTPOS_LINKLY', 'EFTPOS', 'EFTPOS_TYRO', 'EFTPOS_WINDCAVE', 'EFTPOS_PAYO'];
|
|
14
14
|
function PaymentOptionsModule(_ref) {
|
|
15
15
|
var _context$appHelper, _context$appHelper$ge, _context$appHelper$ge2, _context$appHelper$ut;
|
|
16
16
|
var amountSymbol = _ref.amountSymbol,
|
|
@@ -92,6 +92,7 @@ function PaymentOptionsModule(_ref) {
|
|
|
92
92
|
}
|
|
93
93
|
}, filteredPaymentMethods.map(function (method) {
|
|
94
94
|
return /*#__PURE__*/React.createElement(PaymentMethodItem, {
|
|
95
|
+
size: (filteredPaymentMethods === null || filteredPaymentMethods === void 0 ? void 0 : filteredPaymentMethods.length) === 2 ? 'large' : 'default',
|
|
95
96
|
key: method.id,
|
|
96
97
|
method: method,
|
|
97
98
|
amountSymbol: amountSymbol,
|
package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ interface ShowPaymentResultToastConfig {
|
|
|
23
23
|
onClose?: () => void;
|
|
24
24
|
/** 是否显示右上角关闭按钮 */
|
|
25
25
|
closable?: boolean;
|
|
26
|
+
/** 是否启用点击外部区域关闭弹窗(使用纯JS实现) */
|
|
27
|
+
clickOutsideToClose?: boolean;
|
|
28
|
+
/** 是否显示遮罩 */
|
|
29
|
+
mask?: boolean;
|
|
26
30
|
}
|
|
27
31
|
interface PaymentResultToastContextType {
|
|
28
32
|
/** 显示成功弹窗 */
|
|
@@ -263,6 +263,13 @@ var GlobalToastManager = /*#__PURE__*/function () {
|
|
|
263
263
|
|
|
264
264
|
// 更新容器样式,带有平滑动画效果
|
|
265
265
|
if (instance.container) {
|
|
266
|
+
// 如果开启了遮罩,使用居中定位,不更新位置
|
|
267
|
+
var hasMask = instance.container.getAttribute('data-mask') === 'true';
|
|
268
|
+
if (hasMask) {
|
|
269
|
+
// mask 模式下保持居中,不更新位置
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
|
|
266
273
|
// 添加动画类名表示正在移动
|
|
267
274
|
instance.container.classList.add('toast-moving');
|
|
268
275
|
instance.container.style.position = 'fixed';
|
|
@@ -312,30 +319,46 @@ var GlobalToastManager = /*#__PURE__*/function () {
|
|
|
312
319
|
autoClose: config.autoClose,
|
|
313
320
|
autoCloseDelay: config.autoCloseDelay || 30,
|
|
314
321
|
showCountdownProgress: config.showCountdownProgress,
|
|
322
|
+
clickOutsideToClose: config.clickOutsideToClose,
|
|
315
323
|
onCountdownComplete: config.onCountdownComplete,
|
|
316
324
|
onClose: function onClose() {
|
|
317
325
|
var _config$onClose2;
|
|
318
326
|
(_config$onClose2 = config.onClose) === null || _config$onClose2 === void 0 || _config$onClose2.call(config);
|
|
319
327
|
_this2.removeToast(id);
|
|
320
328
|
},
|
|
321
|
-
closable: config.closable !== undefined ? config.closable : DEFAULT_TOAST_CONFIG.closable
|
|
329
|
+
closable: config.closable !== undefined ? config.closable : DEFAULT_TOAST_CONFIG.closable,
|
|
330
|
+
mask: config.mask || false
|
|
322
331
|
});
|
|
323
332
|
|
|
324
333
|
// 创建容器
|
|
325
334
|
var container = document.createElement('div');
|
|
326
335
|
container.setAttribute('data-toast-id', id);
|
|
336
|
+
// 如果开启遮罩,添加 data-mask 属性用于 CSS 样式区分
|
|
337
|
+
if (config.mask) {
|
|
338
|
+
container.setAttribute('data-mask', 'true');
|
|
339
|
+
}
|
|
327
340
|
|
|
328
341
|
// 计算动态的bottom位置
|
|
329
342
|
var dynamicBottomOffset = this.calculateAndCacheBottomOffset();
|
|
330
343
|
// const centerOffset = this.calculateAndCacheCenterOffset();
|
|
331
|
-
|
|
332
|
-
// 设置初始样式确保左下角定位
|
|
333
|
-
// 新Toast使用动态计算的位置
|
|
334
344
|
container.style.position = 'fixed';
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
345
|
+
// 如果开启遮罩,则需要居中
|
|
346
|
+
if (config.mask) {
|
|
347
|
+
container.style.left = '50%';
|
|
348
|
+
container.style.top = '50%';
|
|
349
|
+
container.style.transform = 'translate(-50%, -50%)';
|
|
350
|
+
container.style.bottom = 'auto';
|
|
351
|
+
container.style.right = 'auto';
|
|
352
|
+
} else {
|
|
353
|
+
// 设置初始样式确保左下角定位
|
|
354
|
+
// 新Toast使用动态计算的位置
|
|
355
|
+
container.style.left = "".concat(this.LEFT_OFFSET, "px");
|
|
356
|
+
container.style.bottom = "".concat(dynamicBottomOffset, "px"); // 使用动态计算的位置
|
|
357
|
+
container.style.top = 'auto';
|
|
358
|
+
container.style.right = 'auto';
|
|
359
|
+
container.style.transform = 'none';
|
|
360
|
+
}
|
|
361
|
+
|
|
339
362
|
// 移除强制的z-index设置,让Toast使用默认层级
|
|
340
363
|
// container.style.zIndex = `${(finalConfig.zIndex || 2000) + this.instances.size}`;
|
|
341
364
|
|
|
@@ -269,8 +269,8 @@ var PaymentResultToast = /*#__PURE__*/memo(function (props) {
|
|
|
269
269
|
mask: mask,
|
|
270
270
|
maskClosable: maskClosable,
|
|
271
271
|
closable: false,
|
|
272
|
-
className: getBaseClassName("".concat(className, " ").concat(statusClassName)),
|
|
273
|
-
wrapClassName: "toast-modal-wrap",
|
|
272
|
+
className: getBaseClassName("".concat(className, " ").concat(statusClassName, " ").concat(mask ? 'payment-result-toast-with-mask' : '')),
|
|
273
|
+
wrapClassName: "toast-modal-wrap ".concat(mask ? 'toast-modal-wrap-with-mask' : ''),
|
|
274
274
|
style: _objectSpread(_objectSpread({}, height ? {
|
|
275
275
|
height: "".concat(height, "px")
|
|
276
276
|
} : {}), {}, {
|
|
@@ -297,12 +297,12 @@ var PaymentResultToast = /*#__PURE__*/memo(function (props) {
|
|
|
297
297
|
,
|
|
298
298
|
transitionName: "",
|
|
299
299
|
maskTransitionName: ""
|
|
300
|
-
//
|
|
300
|
+
// mask 模式下使用居中定位,非 mask 模式下禁用居中
|
|
301
301
|
,
|
|
302
|
-
centered:
|
|
303
|
-
//
|
|
302
|
+
centered: mask
|
|
303
|
+
// mask 模式下渲染到 body,非 mask 模式下渲染到容器内
|
|
304
304
|
,
|
|
305
|
-
getContainer: false
|
|
305
|
+
getContainer: mask ? undefined : false
|
|
306
306
|
}, /*#__PURE__*/React.createElement("div", {
|
|
307
307
|
ref: modalContentRef,
|
|
308
308
|
className: getClassName('content', statusClassName),
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
margin: 0 !important;
|
|
18
18
|
pointer-events: none !important; // 让Toast Modal Wrap点击穿透
|
|
19
19
|
|
|
20
|
+
// 非 mask 模式下的样式
|
|
20
21
|
.ant-modal {
|
|
21
22
|
position: static !important;
|
|
22
23
|
top: auto !important;
|
|
@@ -32,11 +33,47 @@
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
// mask 模式下的全局样式(Modal 渲染到 body)
|
|
37
|
+
.toast-modal-wrap-with-mask {
|
|
38
|
+
position: fixed !important;
|
|
39
|
+
top: 0 !important;
|
|
40
|
+
left: 0 !important;
|
|
41
|
+
right: 0 !important;
|
|
42
|
+
bottom: 0 !important;
|
|
43
|
+
width: 100vw !important;
|
|
44
|
+
height: 100vh !important;
|
|
45
|
+
display: flex !important;
|
|
46
|
+
align-items: center !important;
|
|
47
|
+
justify-content: center !important;
|
|
48
|
+
pointer-events: auto !important; // mask 模式下需要响应点击
|
|
49
|
+
|
|
50
|
+
.ant-modal-mask {
|
|
51
|
+
position: fixed !important;
|
|
52
|
+
top: 0 !important;
|
|
53
|
+
left: 0 !important;
|
|
54
|
+
right: 0 !important;
|
|
55
|
+
bottom: 0 !important;
|
|
56
|
+
width: 100vw !important;
|
|
57
|
+
height: 100vh !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ant-modal {
|
|
61
|
+
position: relative !important;
|
|
62
|
+
top: auto !important;
|
|
63
|
+
left: auto !important;
|
|
64
|
+
transform: none !important;
|
|
65
|
+
margin: 0 !important;
|
|
66
|
+
padding: 0 !important;
|
|
67
|
+
width: auto !important;
|
|
68
|
+
max-width: none !important;
|
|
69
|
+
pointer-events: auto !important; // Modal 内容可以响应点击
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
35
73
|
// Toast容器样式 - 用于多实例定位
|
|
36
74
|
[data-toast-id] {
|
|
37
75
|
z-index: 1000;
|
|
38
76
|
position: fixed !important;
|
|
39
|
-
left: 96px !important;
|
|
40
77
|
/* 注意:不设置bottom的!important,让JavaScript可以动态更新 */
|
|
41
78
|
/* 移除强制的z-index设置,让Toast使用默认层级 */
|
|
42
79
|
pointer-events: none !important; // 让Toast容器本身点击穿透
|
|
@@ -45,6 +82,23 @@
|
|
|
45
82
|
width: auto !important;
|
|
46
83
|
height: auto !important;
|
|
47
84
|
|
|
85
|
+
// 非 mask 模式下使用左下角定位
|
|
86
|
+
&:not([data-mask="true"]) {
|
|
87
|
+
left: 96px !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// mask 模式下,Modal 会渲染到 body,容器只作为占位符
|
|
91
|
+
// 不需要设置定位,因为 Modal 已经独立渲染
|
|
92
|
+
&[data-mask="true"] {
|
|
93
|
+
// 容器在 mask 模式下不需要定位,Modal 会独立渲染到 body
|
|
94
|
+
position: static !important;
|
|
95
|
+
left: auto !important;
|
|
96
|
+
top: auto !important;
|
|
97
|
+
bottom: auto !important;
|
|
98
|
+
right: auto !important;
|
|
99
|
+
transform: none !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
48
102
|
/* 新Toast进入动画 */
|
|
49
103
|
&.toast-entering {
|
|
50
104
|
opacity: 0;
|
|
@@ -81,42 +135,49 @@
|
|
|
81
135
|
}
|
|
82
136
|
|
|
83
137
|
// 强制覆盖Ant Design Modal的默认定位
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
138
|
+
// 非 mask 模式下使用 static 定位
|
|
139
|
+
&:not([data-mask="true"]) {
|
|
140
|
+
.ant-modal-wrap {
|
|
141
|
+
position: static !important;
|
|
142
|
+
pointer-events: none !important; // 让Modal wrap点击穿透
|
|
143
|
+
}
|
|
88
144
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
145
|
+
.ant-modal {
|
|
146
|
+
position: static !important;
|
|
147
|
+
top: auto !important;
|
|
148
|
+
left: auto !important;
|
|
149
|
+
transform: none !important;
|
|
150
|
+
margin: 0 !important;
|
|
151
|
+
padding: 0 !important;
|
|
152
|
+
pointer-events: none !important; // 让Modal本身点击穿透
|
|
153
|
+
}
|
|
97
154
|
}
|
|
98
155
|
|
|
156
|
+
// mask 模式下,Modal 会渲染到 body,容器内的样式不再需要
|
|
157
|
+
// 样式已通过全局 .toast-modal-wrap-with-mask 类名设置
|
|
99
158
|
|
|
100
|
-
// 覆盖所有可能的Ant Design Modal
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
159
|
+
// 覆盖所有可能的Ant Design Modal定位(非 mask 模式)
|
|
160
|
+
&:not([data-mask="true"]) {
|
|
161
|
+
.ant-modal-wrap {
|
|
162
|
+
position: static !important;
|
|
163
|
+
display: block !important;
|
|
164
|
+
overflow: visible !important;
|
|
165
|
+
pointer-events: none !important; // 让Modal wrap点击穿透
|
|
166
|
+
}
|
|
107
167
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
168
|
+
.ant-modal {
|
|
169
|
+
position: static !important;
|
|
170
|
+
top: auto !important;
|
|
171
|
+
left: auto !important;
|
|
172
|
+
right: auto !important;
|
|
173
|
+
bottom: auto !important;
|
|
174
|
+
transform: none !important;
|
|
175
|
+
margin: 0 !important;
|
|
176
|
+
padding: 0 !important;
|
|
177
|
+
width: 100% !important;
|
|
178
|
+
max-width: none !important;
|
|
179
|
+
pointer-events: none !important; // 让Modal点击穿透
|
|
180
|
+
}
|
|
120
181
|
}
|
|
121
182
|
|
|
122
183
|
// Toast进入动画
|
|
@@ -401,7 +462,7 @@
|
|
|
401
462
|
// 副标题样式
|
|
402
463
|
&-subtitle {
|
|
403
464
|
&-text {
|
|
404
|
-
font-size:
|
|
465
|
+
font-size: 48px; // 与图片一致
|
|
405
466
|
font-weight: 600; // 与图片一致
|
|
406
467
|
text-shadow: none; // 移除阴影
|
|
407
468
|
|
|
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
|
|
|
17
17
|
cardData: any;
|
|
18
18
|
handleSelectWallet: (value: number[]) => void;
|
|
19
19
|
selectedWalletIds: any[];
|
|
20
|
-
expiredWalletIds: any;
|
|
20
|
+
expiredWalletIds: any[];
|
|
21
21
|
expiredWalletData: any;
|
|
22
22
|
disabledWalletData: any[];
|
|
23
23
|
clearAllSelectedWallet: () => void;
|
|
@@ -141,6 +141,7 @@ declare const _default: {
|
|
|
141
141
|
'pisell2.checkout.modal.close-price-adjustment': string;
|
|
142
142
|
'pisell2.checkout.modal.reset-price-adjustment': string;
|
|
143
143
|
'pisell2.checkout.modal.done-price-adjustment': string;
|
|
144
|
+
'pisell2.checkout.modal.price-adjustment-tips': string;
|
|
144
145
|
'pisell2.checkout.send-payment-link.modal-title': string;
|
|
145
146
|
'pisell2.checkout.send-payment-link.email-address': string;
|
|
146
147
|
'pisell2.checkout.send-payment-link.email-placeholder': string;
|
|
@@ -302,6 +303,7 @@ declare const _default: {
|
|
|
302
303
|
'pisell2.checkout.modal.close-price-adjustment': string;
|
|
303
304
|
'pisell2.checkout.modal.reset-price-adjustment': string;
|
|
304
305
|
'pisell2.checkout.modal.done-price-adjustment': string;
|
|
306
|
+
'pisell2.checkout.modal.price-adjustment-tips': string;
|
|
305
307
|
'pisell2.checkout.send-payment-link.modal-title': string;
|
|
306
308
|
'pisell2.checkout.send-payment-link.email-address': string;
|
|
307
309
|
'pisell2.checkout.send-payment-link.email-placeholder': string;
|
|
@@ -479,6 +481,7 @@ declare const _default: {
|
|
|
479
481
|
'pisell2.checkout.modal.close-price-adjustment': string;
|
|
480
482
|
'pisell2.checkout.modal.reset-price-adjustment': string;
|
|
481
483
|
'pisell2.checkout.modal.done-price-adjustment': string;
|
|
484
|
+
'pisell2.checkout.modal.price-adjustment-tips': string;
|
|
482
485
|
'pisell2.checkout.send-payment-link.modal-title': string;
|
|
483
486
|
'pisell2.checkout.send-payment-link.email-address': string;
|
|
484
487
|
'pisell2.checkout.send-payment-link.email-placeholder': string;
|
|
@@ -180,6 +180,7 @@ export default {
|
|
|
180
180
|
'pisell2.checkout.modal.close-price-adjustment': 'Close price adjustment modal',
|
|
181
181
|
'pisell2.checkout.modal.reset-price-adjustment': 'Reset',
|
|
182
182
|
'pisell2.checkout.modal.done-price-adjustment': 'Done',
|
|
183
|
+
'pisell2.checkout.modal.price-adjustment-tips': 'Changing amount will update order total',
|
|
183
184
|
// Send Payment Link Modal
|
|
184
185
|
'pisell2.checkout.send-payment-link.modal-title': 'Send Payment Link',
|
|
185
186
|
'pisell2.checkout.send-payment-link.email-address': 'Email Address',
|
|
@@ -380,6 +381,7 @@ export default {
|
|
|
380
381
|
'pisell2.checkout.modal.close-price-adjustment': '关闭价格调整弹窗',
|
|
381
382
|
'pisell2.checkout.modal.reset-price-adjustment': '重置',
|
|
382
383
|
'pisell2.checkout.modal.done-price-adjustment': '完成',
|
|
384
|
+
'pisell2.checkout.modal.price-adjustment-tips': '修改金额将更新订单总额',
|
|
383
385
|
// Send Payment Link Modal
|
|
384
386
|
'pisell2.checkout.send-payment-link.modal-title': '发送支付链接',
|
|
385
387
|
'pisell2.checkout.send-payment-link.email-address': '邮箱地址',
|
|
@@ -618,6 +620,7 @@ export default {
|
|
|
618
620
|
'pisell2.checkout.modal.close-price-adjustment': '關閉價格調整彈窗',
|
|
619
621
|
'pisell2.checkout.modal.reset-price-adjustment': '重置',
|
|
620
622
|
'pisell2.checkout.modal.done-price-adjustment': '完成',
|
|
623
|
+
'pisell2.checkout.modal.price-adjustment-tips': '修改金額將更新訂單總額',
|
|
621
624
|
// Send Payment Link Modal
|
|
622
625
|
'pisell2.checkout.send-payment-link.modal-title': '發送支付鏈接',
|
|
623
626
|
'pisell2.checkout.send-payment-link.email-address': '郵箱地址',
|
|
@@ -140,15 +140,17 @@ export var displayPaymentResultToast = /*#__PURE__*/function () {
|
|
|
140
140
|
}
|
|
141
141
|
_context.next = 5;
|
|
142
142
|
return showPaymentResultToastSuccess({
|
|
143
|
+
mask: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose) || false,
|
|
143
144
|
title: calculateTitle(paymentStatus),
|
|
144
145
|
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount, gapAmount, getData),
|
|
145
146
|
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
146
147
|
autoCloseDelay: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoCloseDelay) || 3000,
|
|
148
|
+
clickOutsideToClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
147
149
|
showCountdownProgress: true,
|
|
148
150
|
actionButtons: actionButtons || [],
|
|
149
151
|
onClose: onToastClose || function () {},
|
|
150
152
|
// 提供默认空函数
|
|
151
|
-
closable:
|
|
153
|
+
closable: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose) // 控制关闭按钮显示
|
|
152
154
|
});
|
|
153
155
|
case 5:
|
|
154
156
|
_context.next = 15;
|
|
@@ -160,10 +162,14 @@ export var displayPaymentResultToast = /*#__PURE__*/function () {
|
|
|
160
162
|
}
|
|
161
163
|
_context.next = 10;
|
|
162
164
|
return showPaymentResultToastSuccess({
|
|
165
|
+
mask: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose) || false,
|
|
163
166
|
title: calculateTitle(paymentStatus),
|
|
164
167
|
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount, gapAmount, getData),
|
|
165
168
|
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
166
169
|
actionButtons: actionButtons || [],
|
|
170
|
+
clickOutsideToClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
171
|
+
closable: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose),
|
|
172
|
+
// 控制关闭按钮显示
|
|
167
173
|
onClose: onToastClose || function () {} // 提供默认空函数
|
|
168
174
|
});
|
|
169
175
|
case 10:
|
|
@@ -176,10 +182,14 @@ export var displayPaymentResultToast = /*#__PURE__*/function () {
|
|
|
176
182
|
}
|
|
177
183
|
_context.next = 15;
|
|
178
184
|
return showPaymentResultToastFailed({
|
|
185
|
+
mask: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose) || false,
|
|
179
186
|
title: calculateTitle(paymentStatus, failureReason),
|
|
180
187
|
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount / 100, gapAmount, getData),
|
|
181
188
|
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
182
189
|
actionButtons: actionButtons || [],
|
|
190
|
+
clickOutsideToClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
|
191
|
+
closable: !(autoCloseConfig !== null && autoCloseConfig !== void 0 && autoCloseConfig.autoClose),
|
|
192
|
+
// 控制关闭按钮显示
|
|
183
193
|
onClose: onToastClose || function () {} // 提供默认空函数
|
|
184
194
|
});
|
|
185
195
|
case 15:
|
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
|
8
8
|
*/
|
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
|
10
10
|
className?: string | undefined;
|
|
11
|
-
onChange?: ((status: "success" | "page" | "
|
|
11
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
12
12
|
[keys: string]: unknown;
|
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
|
14
14
|
onClose: () => void;
|