@pisell/private-materials 6.4.46 → 6.4.48
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 +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +0 -1
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +22 -13
- package/es/components/booking/components/voucher/index.d.ts +1 -0
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/hooks/useQuotation.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +60 -22
- package/es/components/checkout/components/AdditionalModule/index.less +1 -1
- package/es/components/checkout/components/AmountSummary/index.js +18 -14
- package/es/components/checkout/components/AmountSummary/index.less +13 -0
- package/es/components/checkout/components/CashPaymentModule/index.js +4 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +48 -44
- package/es/components/checkout/components/PaymentOptionsModule/index.less +0 -6
- package/es/components/checkout/components/PaymentResultToast/index.js +38 -8
- package/es/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/utils.js +6 -5
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +9 -4
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +4 -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 +3 -3
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/ticketBooking/components/menuBar/index.js +3 -1
- package/es/components/ticketBooking/components/menuBar/index.less +7 -0
- 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/es/plus/saasLogin/utils.d.ts +5 -5
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +0 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +39 -15
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +55 -32
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +3 -3
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +0 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +8 -1
- package/lib/components/booking/components/voucher/index.d.ts +1 -0
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +48 -18
- package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
- package/lib/components/checkout/components/AmountSummary/index.js +7 -11
- package/lib/components/checkout/components/AmountSummary/index.less +13 -0
- package/lib/components/checkout/components/CashPaymentModule/index.js +3 -1
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +47 -56
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +0 -6
- package/lib/components/checkout/components/PaymentResultToast/index.js +26 -1
- package/lib/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/utils.js +5 -4
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +9 -6
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +4 -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 +3 -3
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/ticketBooking/components/menuBar/index.js +1 -1
- package/lib/components/ticketBooking/components/menuBar/index.less +7 -0
- 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/lib/plus/saasLogin/utils.d.ts +5 -5
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +0 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +68 -37
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +51 -32
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +3 -3
- package/package.json +12 -12
@@ -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;
|
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
165
165
|
export declare const getDuration: (duration: number | {
|
166
166
|
type: string;
|
167
167
|
value: number;
|
168
|
-
}) => number | {
|
168
|
+
}) => number | "flexible" | {
|
169
169
|
type: string;
|
170
170
|
value: number;
|
171
|
-
}
|
171
|
+
};
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
174
174
|
export {};
|
@@ -151,6 +151,19 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
151
151
|
return method.code === "CASHMANUAL" || method.type === "CASHMANUAL" || ((_a3 = method.name) == null ? void 0 : _a3.toLowerCase().includes("cash"));
|
152
152
|
}
|
153
153
|
);
|
154
|
+
logger == null ? void 0 : logger.addLog({
|
155
|
+
type: "info",
|
156
|
+
title: "open_till",
|
157
|
+
metadata: {}
|
158
|
+
});
|
159
|
+
(_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
160
|
+
module: "till",
|
161
|
+
key: "open_till",
|
162
|
+
data: {
|
163
|
+
type: "cash"
|
164
|
+
// cash 不需要验证钱箱权限
|
165
|
+
}
|
166
|
+
});
|
154
167
|
await (checkoutModule == null ? void 0 : checkoutModule.addPaymentItemAsync({
|
155
168
|
amount: result.amount,
|
156
169
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
@@ -165,23 +178,11 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
165
178
|
voucher_id: 0,
|
166
179
|
rounding_amount: result.roundingAmount
|
167
180
|
}));
|
168
|
-
logger == null ? void 0 : logger.addLog({
|
169
|
-
type: "info",
|
170
|
-
title: "open_till",
|
171
|
-
metadata: {}
|
172
|
-
});
|
173
|
-
(_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
174
|
-
module: "till",
|
175
|
-
key: "open_till",
|
176
|
-
data: {
|
177
|
-
type: "cash"
|
178
|
-
// cash 不需要验证钱箱权限
|
179
|
-
}
|
180
|
-
});
|
181
181
|
};
|
182
182
|
const processSurcharge = (surcharge) => {
|
183
183
|
if (typeof surcharge === "string") {
|
184
|
-
|
184
|
+
const match = surcharge.match(/\d+(?:\.\d+)?/);
|
185
|
+
return match ? match[0] : void 0;
|
185
186
|
}
|
186
187
|
if (typeof surcharge === "number") {
|
187
188
|
return String(surcharge);
|
@@ -672,7 +673,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
672
673
|
select.forEach((item) => {
|
673
674
|
var _a2, _b2, _c2, _d;
|
674
675
|
const mapCode = item.code ? import_constants.WALLET_PASS_CODE_MAP[item.code] : null;
|
675
|
-
if (mapCode) {
|
676
|
+
if (mapCode && walletPassDetail.map[mapCode]) {
|
676
677
|
voucherItems.push({
|
677
678
|
/** 支付金额 */
|
678
679
|
amount: item.amount,
|
@@ -1729,6 +1730,17 @@ var PaymentModal = ({
|
|
1729
1730
|
}
|
1730
1731
|
),
|
1731
1732
|
onClick: handleOrderNoteClick
|
1733
|
+
},
|
1734
|
+
enabledAutoPrint ? {
|
1735
|
+
key: "print",
|
1736
|
+
label: import_utils.locales.getText("payment.result.printReceipt"),
|
1737
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.Printer, { className: getClassName("action-icon") }),
|
1738
|
+
onClick: handlePrintReceiptClick
|
1739
|
+
} : {
|
1740
|
+
key: "details",
|
1741
|
+
label: import_utils.locales.getText("payment.result.details"),
|
1742
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.FileCheck02, { className: getClassName("action-icon") }),
|
1743
|
+
onClick: handleDetailsClick
|
1732
1744
|
}
|
1733
1745
|
],
|
1734
1746
|
buttonProps: {
|
@@ -1741,7 +1753,7 @@ var PaymentModal = ({
|
|
1741
1753
|
case "partially_paid":
|
1742
1754
|
return [
|
1743
1755
|
[
|
1744
|
-
{
|
1756
|
+
enabledAutoPrint ? {
|
1745
1757
|
id: "details",
|
1746
1758
|
buttonProps: {
|
1747
1759
|
className: getClassName("action-button"),
|
@@ -1749,6 +1761,14 @@ var PaymentModal = ({
|
|
1749
1761
|
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.FileCheck02, { className: getClassName("action-icon") }),
|
1750
1762
|
children: import_utils.locales.getText("payment.result.details")
|
1751
1763
|
}
|
1764
|
+
} : {
|
1765
|
+
id: "print",
|
1766
|
+
buttonProps: {
|
1767
|
+
className: getClassName("action-button"),
|
1768
|
+
onClick: handlePrintReceiptClick,
|
1769
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.Printer, { className: getClassName("action-icon") }),
|
1770
|
+
children: import_utils.locales.getText("payment.result.printReceipt")
|
1771
|
+
}
|
1752
1772
|
},
|
1753
1773
|
{
|
1754
1774
|
id: "more",
|
@@ -1764,6 +1784,17 @@ var PaymentModal = ({
|
|
1764
1784
|
}
|
1765
1785
|
),
|
1766
1786
|
onClick: handleOrderNoteClick
|
1787
|
+
},
|
1788
|
+
enabledAutoPrint ? {
|
1789
|
+
key: "print",
|
1790
|
+
label: import_utils.locales.getText("payment.result.printReceipt"),
|
1791
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.Printer, { className: getClassName("action-icon") }),
|
1792
|
+
onClick: handlePrintReceiptClick
|
1793
|
+
} : {
|
1794
|
+
key: "details",
|
1795
|
+
label: import_utils.locales.getText("payment.result.details"),
|
1796
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.FileCheck02, { className: getClassName("action-icon") }),
|
1797
|
+
onClick: handleDetailsClick
|
1767
1798
|
}
|
1768
1799
|
],
|
1769
1800
|
buttonProps: {
|
@@ -1971,10 +2002,9 @@ var PaymentModal = ({
|
|
1971
2002
|
open: showRetryModal,
|
1972
2003
|
title: import_utils.locales.getText("pisell2.checkout.tips"),
|
1973
2004
|
footer: null,
|
1974
|
-
closable: false,
|
1975
|
-
maskClosable: false,
|
1976
2005
|
keyboard: false,
|
1977
2006
|
onCancel: () => {
|
2007
|
+
setShowRetryModal(false);
|
1978
2008
|
}
|
1979
2009
|
// 禁用关闭
|
1980
2010
|
}
|
@@ -229,15 +229,11 @@ function AmountSummary({
|
|
229
229
|
return totalDecimal.toNumber();
|
230
230
|
};
|
231
231
|
const getKeyboardLimits = () => {
|
232
|
-
const walletTotal = getWalletTotalAmount();
|
233
|
-
const walletTotalDecimal = new import_decimal.default(walletTotal);
|
234
232
|
const orderDueDecimal = new import_decimal.default(Number(balanceDueAmount || 0));
|
235
233
|
const minDecimal = new import_decimal.default(0.01);
|
236
|
-
const diffDecimal = orderDueDecimal.minus(walletTotalDecimal);
|
237
|
-
const maxAmountDecimal = import_decimal.default.max(minDecimal, diffDecimal);
|
238
234
|
return {
|
239
235
|
min: minDecimal.toNumber(),
|
240
|
-
max:
|
236
|
+
max: orderDueDecimal.toNumber()
|
241
237
|
};
|
242
238
|
};
|
243
239
|
const _formatInputAmount = (value) => {
|
@@ -266,9 +262,6 @@ function AmountSummary({
|
|
266
262
|
);
|
267
263
|
return;
|
268
264
|
}
|
269
|
-
if (!inputStr || numericValue <= 0) {
|
270
|
-
numericValue = getOrderDueAmount();
|
271
|
-
}
|
272
265
|
const minDecimal = new import_decimal.default(limits.min);
|
273
266
|
const maxDecimal = new import_decimal.default(limits.max);
|
274
267
|
const valueDecimal = new import_decimal.default(numericValue);
|
@@ -463,6 +456,9 @@ function AmountSummary({
|
|
463
456
|
return depositPaidAmount < new import_decimal.default(totalAmount).toNumber();
|
464
457
|
}
|
465
458
|
}, [paymentItems, paymentType, totalAmount]);
|
459
|
+
const showCancelSplitPayment = (0, import_react.useMemo)(() => {
|
460
|
+
return balanceDueAmount !== customAmount;
|
461
|
+
}, [customAmount, balanceDueAmount]);
|
466
462
|
const handleChangeDepositAmount = (value) => {
|
467
463
|
console.log("handleChangeDepositAmount", value);
|
468
464
|
checkoutModule == null ? void 0 : checkoutModule.setDepositAmountAsync(value);
|
@@ -511,7 +507,7 @@ function AmountSummary({
|
|
511
507
|
shouldShowConfirmMode() ? renderConfirmMode() : /* @__PURE__ */ import_react2.default.createElement("div", { className: (0, import_classnames.default)("balance-due-info") }, paymentType === "deposit" ? /* @__PURE__ */ import_react2.default.createElement(
|
512
508
|
import_pisellSimplePriceKeyboardPopover.default,
|
513
509
|
{
|
514
|
-
value:
|
510
|
+
value: balanceDueAmount || "0",
|
515
511
|
onConfirm: handleChangeDepositAmount,
|
516
512
|
showCurrencySymbol: true,
|
517
513
|
useThousandsSeparator: true,
|
@@ -570,7 +566,7 @@ function AmountSummary({
|
|
570
566
|
))
|
571
567
|
)
|
572
568
|
),
|
573
|
-
!shouldShowConfirmMode() && /* @__PURE__ */ import_react2.default.createElement(
|
569
|
+
!shouldShowConfirmMode() && (showCancelSplitPayment ? /* @__PURE__ */ import_react2.default.createElement(import_antd.Button, { className: (0, import_classnames.default)("cancel-split-payment-button"), onClick: () => onAmountChange == null ? void 0 : onAmountChange(balanceDueAmount) }, getText("split.cancel") || "取消部\n分支付") : /* @__PURE__ */ import_react2.default.createElement(
|
574
570
|
import_antd.Popover,
|
575
571
|
{
|
576
572
|
content: /* @__PURE__ */ import_react2.default.createElement("div", { onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react2.default.createElement(
|
@@ -610,7 +606,7 @@ function AmountSummary({
|
|
610
606
|
destroyTooltipOnHide: true
|
611
607
|
},
|
612
608
|
/* @__PURE__ */ import_react2.default.createElement(import_antd.Button, { className: (0, import_classnames.default)("split-payment-button") }, getText("split.payment") || "拆分支付")
|
613
|
-
),
|
609
|
+
)),
|
614
610
|
/* @__PURE__ */ import_react2.default.createElement(
|
615
611
|
import_materials.PisellModal,
|
616
612
|
{
|
@@ -476,6 +476,7 @@
|
|
476
476
|
}
|
477
477
|
|
478
478
|
.split-payment-button {
|
479
|
+
width: 80px;
|
479
480
|
padding: 0 8px;
|
480
481
|
background: #079455;
|
481
482
|
color: white;
|
@@ -485,4 +486,16 @@
|
|
485
486
|
white-space: pre-line; // 让换行符(\n)生效
|
486
487
|
text-align: left; // 确保文本居中对齐
|
487
488
|
min-width: 68px;
|
489
|
+
}
|
490
|
+
.cancel-split-payment-button {
|
491
|
+
width: 80px;
|
492
|
+
padding: 0 8px;
|
493
|
+
background: #DF5342;
|
494
|
+
color: white;
|
495
|
+
font-size: 14px;
|
496
|
+
border: 1px solid #C3B2E7;
|
497
|
+
height: 80px;
|
498
|
+
white-space: pre-line; // 让换行符(\n)生效
|
499
|
+
text-align: left; // 确保文本居中对齐
|
500
|
+
min-width: 68px;
|
488
501
|
}
|
@@ -97,7 +97,9 @@ function CashPaymentModule({
|
|
97
97
|
}
|
98
98
|
};
|
99
99
|
const { run: handleCashPay } = (0, import_ahooks.useDebounceFn)(handleCashPayInternal, {
|
100
|
-
wait: 500
|
100
|
+
wait: 500,
|
101
|
+
leading: true,
|
102
|
+
trailing: false
|
101
103
|
});
|
102
104
|
const handleKeyboardConfirm = async (value) => {
|
103
105
|
if (isInputDisabled) {
|
@@ -62,6 +62,7 @@ var PaymentMethodItem = ({
|
|
62
62
|
return baseAmount + surcharge;
|
63
63
|
};
|
64
64
|
const handleRightButtonClick = (e) => {
|
65
|
+
if (!isEftpos) return;
|
65
66
|
e.preventDefault();
|
66
67
|
if (disabled || !onClick) {
|
67
68
|
return;
|
@@ -84,14 +85,11 @@ var PaymentMethodItem = ({
|
|
84
85
|
}
|
85
86
|
};
|
86
87
|
const isEftpos = method.code === "EFTPOS" || method.type === "eftpos";
|
87
|
-
const
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
},
|
93
|
-
/* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-edit-05", style: { fontSize: "24px", color: disabled ? "#D0D5DD" : "#7F56DA" } })
|
94
|
-
)))));
|
88
|
+
const showKeyboard = () => {
|
89
|
+
if (isEftpos) return;
|
90
|
+
setIsKeyboardVisible(true);
|
91
|
+
};
|
92
|
+
const renderLeftContent = () => /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-options-module-payment-method-left") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-options-module-icon-container") }, renderPaymentIcon(method)), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-options-module-payment-info") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-options-module-payment-info-inner") }, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-options-module-payment-name") }, method.name), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-options-module-payment-info-inner-surcharge") }, !!(method == null ? void 0 : method.is_surcharge) && calculateSurcharge(method) !== 0 && /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("payment-options-module-surcharge-text") }, (getText == null ? void 0 : getText("pisell2.payment-options.surcharge-label", "Surcharge")) || "Surcharge", ":", (0, import_utils.formatAmount)(calculateSurcharge(method), 2, amountSymbol)), false))));
|
95
93
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
96
94
|
"button",
|
97
95
|
{
|
@@ -102,57 +100,11 @@ var PaymentMethodItem = ({
|
|
102
100
|
"payment-options-module-disabled": disabled
|
103
101
|
}
|
104
102
|
),
|
103
|
+
onClick: showKeyboard,
|
105
104
|
type: "button",
|
106
105
|
disabled
|
107
106
|
},
|
108
|
-
|
109
|
-
import_antd.Popover,
|
110
|
-
{
|
111
|
-
content: /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
112
|
-
import_priceKeyboard.PaymentKeyboard,
|
113
|
-
{
|
114
|
-
paymentOriginalValue: String(customAmount || 0),
|
115
|
-
paymentDefaultValue: String(customAmount || 0),
|
116
|
-
enableExceedMaxAmount: !isEftpos,
|
117
|
-
payment: {
|
118
|
-
enable: true
|
119
|
-
},
|
120
|
-
surcharge: {
|
121
|
-
enable: !!(method == null ? void 0 : method.is_surcharge) && calculateSurcharge(method) !== 0
|
122
|
-
},
|
123
|
-
surchargeDefaultValue: {
|
124
|
-
percent: method.percentage ? String(Number(method.percentage) * 100) : "",
|
125
|
-
fixed: method.fixed ? String(method.fixed) : ""
|
126
|
-
},
|
127
|
-
selectType: "light",
|
128
|
-
onChange: (value) => {
|
129
|
-
console.log(value);
|
130
|
-
},
|
131
|
-
onPay: (args) => {
|
132
|
-
var _a, _b;
|
133
|
-
console.log(args);
|
134
|
-
setIsKeyboardVisible(false);
|
135
|
-
if (onClick) {
|
136
|
-
onClick({
|
137
|
-
...method,
|
138
|
-
fixed: Number(((_a = args.surcharge) == null ? void 0 : _a.fixed) || 0),
|
139
|
-
percentage: ((_b = args.surcharge) == null ? void 0 : _b.percent) ? Number(args.surcharge.percent) / 100 : 0,
|
140
|
-
totalAmount: String((0, import_utils.formatAmount)(args.amount, 2))
|
141
|
-
});
|
142
|
-
}
|
143
|
-
}
|
144
|
-
}
|
145
|
-
)),
|
146
|
-
trigger: "click",
|
147
|
-
open: isKeyboardVisible,
|
148
|
-
onOpenChange: setIsKeyboardVisible,
|
149
|
-
placement: "bottom",
|
150
|
-
overlayClassName: "payment-keyboard-popover",
|
151
|
-
arrow: true,
|
152
|
-
destroyTooltipOnHide: true
|
153
|
-
},
|
154
|
-
/* @__PURE__ */ import_react.default.createElement("div", null, renderLeftContent())
|
155
|
-
) : renderLeftContent(),
|
107
|
+
renderLeftContent(),
|
156
108
|
/* @__PURE__ */ import_react.default.createElement(
|
157
109
|
"div",
|
158
110
|
{ className: (0, import_classnames.default)("payment-options-module-payment-method-right"), onClick: handleRightButtonClick },
|
@@ -167,6 +119,45 @@ var PaymentMethodItem = ({
|
|
167
119
|
/* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-a-arrow-circle-right2", style: { fontSize: "30px", color: disabled ? "#D0D5DD" : "#7F56DA" } })
|
168
120
|
)
|
169
121
|
)
|
122
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
123
|
+
import_priceKeyboard.PaymentKeyboard,
|
124
|
+
{
|
125
|
+
containerProps: {
|
126
|
+
renderType: "modal",
|
127
|
+
open: isKeyboardVisible,
|
128
|
+
onCancel: () => setIsKeyboardVisible(false)
|
129
|
+
},
|
130
|
+
paymentOriginalValue: String(customAmount || 0),
|
131
|
+
paymentDefaultValue: String(customAmount || 0),
|
132
|
+
enableExceedMaxAmount: !isEftpos,
|
133
|
+
payment: {
|
134
|
+
enable: true
|
135
|
+
},
|
136
|
+
surcharge: {
|
137
|
+
enable: !!(method == null ? void 0 : method.is_surcharge) && calculateSurcharge(method) !== 0
|
138
|
+
},
|
139
|
+
surchargeDefaultValue: {
|
140
|
+
percent: method.percentage ? String(Number(method.percentage) * 100) : "",
|
141
|
+
fixed: method.fixed ? String(method.fixed) : ""
|
142
|
+
},
|
143
|
+
selectType: "dark",
|
144
|
+
onChange: (value) => {
|
145
|
+
console.log(value);
|
146
|
+
},
|
147
|
+
onPay: (args) => {
|
148
|
+
var _a, _b;
|
149
|
+
console.log(args);
|
150
|
+
setIsKeyboardVisible(false);
|
151
|
+
if (onClick) {
|
152
|
+
onClick({
|
153
|
+
...method,
|
154
|
+
fixed: Number(((_a = args.surcharge) == null ? void 0 : _a.fixed) || 0),
|
155
|
+
percentage: ((_b = args.surcharge) == null ? void 0 : _b.percent) ? Number(args.surcharge.percent) / 100 : 0,
|
156
|
+
totalAmount: String((0, import_utils.formatAmount)(args.amount, 2))
|
157
|
+
});
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
170
161
|
));
|
171
162
|
};
|
172
163
|
var PaymentMethodItem_default = PaymentMethodItem;
|
@@ -92,10 +92,13 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
92
92
|
mask = false,
|
93
93
|
maskClosable = false,
|
94
94
|
closable = true,
|
95
|
-
zIndex
|
95
|
+
zIndex,
|
96
|
+
clickOutsideToClose = true
|
96
97
|
} = props;
|
97
98
|
const [isAnimating, setIsAnimating] = (0, import_react.useState)(false);
|
98
99
|
const countdownTimeoutRef = (0, import_react.useRef)(null);
|
100
|
+
const modalContentRef = (0, import_react.useRef)(null);
|
101
|
+
const modalRef = (0, import_react.useRef)(null);
|
99
102
|
const onCloseRef = (0, import_react.useRef)(onClose);
|
100
103
|
const onCountdownCompleteRef = (0, import_react.useRef)(onCountdownComplete);
|
101
104
|
onCloseRef.current = onClose;
|
@@ -133,6 +136,27 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
133
136
|
(0, import_react.useEffect)(() => {
|
134
137
|
return clearCountdown;
|
135
138
|
}, [clearCountdown]);
|
139
|
+
(0, import_react.useEffect)(() => {
|
140
|
+
if (!clickOutsideToClose || !visible) {
|
141
|
+
return;
|
142
|
+
}
|
143
|
+
const handleClickOutside = (event) => {
|
144
|
+
var _a;
|
145
|
+
const target = event.target;
|
146
|
+
const modalContent = modalContentRef.current;
|
147
|
+
if (!modalContent) {
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
if (!modalContent.contains(target)) {
|
151
|
+
clearCountdown();
|
152
|
+
(_a = onCloseRef.current) == null ? void 0 : _a.call(onCloseRef);
|
153
|
+
}
|
154
|
+
};
|
155
|
+
document.addEventListener("mousedown", handleClickOutside);
|
156
|
+
return () => {
|
157
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
158
|
+
};
|
159
|
+
}, [clickOutsideToClose, visible, clearCountdown]);
|
136
160
|
const handleClose = (0, import_react.useCallback)(() => {
|
137
161
|
var _a;
|
138
162
|
clearCountdown();
|
@@ -228,6 +252,7 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
228
252
|
/* @__PURE__ */ import_react.default.createElement(
|
229
253
|
"div",
|
230
254
|
{
|
255
|
+
ref: modalContentRef,
|
231
256
|
className: getClassName("content", statusClassName),
|
232
257
|
style: {
|
233
258
|
position: "relative",
|
@@ -89,14 +89,14 @@ var formatDiscountWalletData = (data, selectId = []) => {
|
|
89
89
|
var _a, _b, _c;
|
90
90
|
let name = "";
|
91
91
|
let storeName = "";
|
92
|
-
if (item.tag === "product_discount_card") {
|
92
|
+
if (item.tag === "product_discount_card" || item.tag === "discount_card") {
|
93
93
|
if (((_a = item == null ? void 0 : item.metadata) == null ? void 0 : _a.discount_card_type) === "fixed_amount") {
|
94
94
|
const amountValue = (item == null ? void 0 : item.savedAmount) ? item == null ? void 0 : item.savedAmount : item.par_value;
|
95
95
|
name = /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.checkout.discount.fixed_amount"), " ", /* @__PURE__ */ import_react.default.createElement(Amount, { value: amountValue, showCurrencySymbol: true }));
|
96
96
|
} else {
|
97
|
-
name = import_utils.locales.getText("pisell2.checkout.discount.percentage.off")(item.par_value);
|
97
|
+
name = import_utils.locales.getText("pisell2.checkout.discount.percentage.off")(item.par_value || item.discount.percent);
|
98
98
|
}
|
99
|
-
storeName = item.product_name;
|
99
|
+
storeName = item.product_name || item.format_title.auto;
|
100
100
|
} else if (item.tag === "good_pass") {
|
101
101
|
name = item.product_name;
|
102
102
|
const left = Number(item.balance) || 0;
|
@@ -106,7 +106,8 @@ var formatDiscountWalletData = (data, selectId = []) => {
|
|
106
106
|
name = item.product_name;
|
107
107
|
}
|
108
108
|
if (!name && item.isEditMode) {
|
109
|
-
name = item.
|
109
|
+
name = item.amount;
|
110
|
+
storeName = item.format_title.auto;
|
110
111
|
}
|
111
112
|
return {
|
112
113
|
...item,
|
@@ -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;
|
@@ -539,14 +539,17 @@ var useWalletPass = (props) => {
|
|
539
539
|
import_utils.locales.getText("wallet-pass-module-already-best-combination")
|
540
540
|
);
|
541
541
|
} else {
|
542
|
-
|
542
|
+
const select = searchIdentificationCodeList.filter((item) => item.unified_available_status);
|
543
|
+
setWalletSelect(select);
|
543
544
|
handleFetchUserIdentificationCodes(
|
544
|
-
|
545
|
-
|
546
|
-
);
|
547
|
-
Toast == null ? void 0 : Toast.success(
|
548
|
-
import_utils.locales.getText("wallet-pass-module-best-combination-selected")
|
545
|
+
select.map((item) => item.id),
|
546
|
+
select
|
549
547
|
);
|
548
|
+
if (select.length) {
|
549
|
+
Toast == null ? void 0 : Toast.success(
|
550
|
+
import_utils.locales.getText("wallet-pass-module-best-combination-selected")
|
551
|
+
);
|
552
|
+
}
|
550
553
|
}
|
551
554
|
}
|
552
555
|
return;
|
@@ -25,6 +25,7 @@ declare const _default: {
|
|
25
25
|
'partial.paid': string;
|
26
26
|
'deposit.partial.paid': string;
|
27
27
|
'split.payment': string;
|
28
|
+
'split.cancel': string;
|
28
29
|
cash: string;
|
29
30
|
rounding: string;
|
30
31
|
'cash.payment': string;
|
@@ -191,6 +192,7 @@ declare const _default: {
|
|
191
192
|
'partial.paid': string;
|
192
193
|
'deposit.partial.paid': string;
|
193
194
|
'split.payment': string;
|
195
|
+
'split.cancel': string;
|
194
196
|
cash: string;
|
195
197
|
rounding: string;
|
196
198
|
'cash.payment': string;
|
@@ -357,6 +359,7 @@ declare const _default: {
|
|
357
359
|
'partial.paid': string;
|
358
360
|
'deposit.partial.paid': string;
|
359
361
|
'split.payment': string;
|
362
|
+
'split.cancel': string;
|
360
363
|
cash: string;
|
361
364
|
rounding: string;
|
362
365
|
'cash.payment': string;
|