@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
|
@@ -112,12 +112,18 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
112
112
|
const [balanceDueAmount, setBalanceDueAmount] = (0, import_react.useState)("");
|
|
113
113
|
const [balanceDueTotalAmount, setBalanceDueTotalAmount] = (0, import_react.useState)("");
|
|
114
114
|
const [recommendAmounts, setRecommendAmounts] = (0, import_react.useState)([]);
|
|
115
|
+
const [showSplitPaymentKeyboard, setShowSplitPaymentKeyboard] = (0, import_react.useState)(false);
|
|
115
116
|
const paymentMethodsRef = (0, import_react.useRef)(null);
|
|
116
117
|
const [paymentMethods, setPaymentMethods] = (0, import_react.useState)([]);
|
|
117
118
|
const [showCashPayment, setShowCashPayment] = (0, import_react.useState)(false);
|
|
118
119
|
const [paymentOptionsTitle, setPaymentOptionsTitle] = (0, import_react.useState)(
|
|
119
120
|
import_utils.locales.getText("cards.and.digitals") || "Cards & Digitals"
|
|
120
121
|
);
|
|
122
|
+
const paymentOptionList = (0, import_react.useMemo)(() => {
|
|
123
|
+
return paymentMethods.filter(
|
|
124
|
+
(item) => !(item.type === "app" && item.code === "EFTPOS_LINKLY") && (["custom"].includes(item.type) || import_PaymentOptionsModule.SHOW_METHODS_CODE.includes(item.code))
|
|
125
|
+
);
|
|
126
|
+
}, [paymentMethods]);
|
|
121
127
|
const clientChangedRef = (0, import_react.useRef)(false);
|
|
122
128
|
const walletPassRef = (0, import_react.useRef)(null);
|
|
123
129
|
const [paymentItems, setPaymentItems] = (0, import_react.useState)([]);
|
|
@@ -446,7 +452,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
446
452
|
const orderPaymentAddedUnsubscribe = core.effects.on(
|
|
447
453
|
CheckoutHooks.OnOrderPaymentAdded,
|
|
448
454
|
executeIfActive(async (data) => {
|
|
449
|
-
var _a2, _b2;
|
|
455
|
+
var _a2, _b2, _c2, _d, _e;
|
|
450
456
|
console.log("orderPaymentAddedUnsubscribe>>>>", data);
|
|
451
457
|
const orderInfo2 = checkoutModule.getCurrentOrderInfo();
|
|
452
458
|
updateOrderInfo == null ? void 0 : updateOrderInfo(orderInfo2);
|
|
@@ -471,6 +477,12 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
471
477
|
totalAmount2 = totalAmount2.add(serviceChargeTotal);
|
|
472
478
|
}
|
|
473
479
|
console.log(totalAmount2, paymentItems2);
|
|
480
|
+
const isToastMode = ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.payment_setting) == null ? void 0 : _c2.payment_result_display_mode) !== "modal";
|
|
481
|
+
if (!isToastMode) {
|
|
482
|
+
autoCloseConfig.autoClose = false;
|
|
483
|
+
autoCloseConfig.autoCloseDelay = 0;
|
|
484
|
+
autoCloseConfig.maskClosable = false;
|
|
485
|
+
}
|
|
474
486
|
await (0, import_PaymentResultToastUtils.displayPaymentResultToast)(
|
|
475
487
|
{
|
|
476
488
|
paymentStatus: "partially_paid",
|
|
@@ -499,7 +511,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
499
511
|
title: "open_till",
|
|
500
512
|
metadata: {}
|
|
501
513
|
});
|
|
502
|
-
(
|
|
514
|
+
(_e = (_d = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _d.postMessageToApp) == null ? void 0 : _e.call(_d, {
|
|
503
515
|
module: "till",
|
|
504
516
|
key: "open_till",
|
|
505
517
|
data: {
|
|
@@ -742,6 +754,9 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
742
754
|
case "send-link":
|
|
743
755
|
setPaymentLinkModalOpen(true);
|
|
744
756
|
break;
|
|
757
|
+
case "split-payment":
|
|
758
|
+
setShowSplitPaymentKeyboard(true);
|
|
759
|
+
break;
|
|
745
760
|
case "print-receipt":
|
|
746
761
|
let data;
|
|
747
762
|
const isSynced = await checkoutModule.isCurrentOrderSynced();
|
|
@@ -856,7 +871,11 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
856
871
|
return res;
|
|
857
872
|
};
|
|
858
873
|
const handleModalClick = (0, import_react.useCallback)((event) => {
|
|
859
|
-
|
|
874
|
+
var _a2, _b2, _c2;
|
|
875
|
+
const isToastMode = ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.payment_setting) == null ? void 0 : _c2.payment_result_display_mode) !== "modal";
|
|
876
|
+
if (isToastMode) {
|
|
877
|
+
(0, import_PaymentResultToast.closeAllPaymentResultToasts)();
|
|
878
|
+
}
|
|
860
879
|
}, []);
|
|
861
880
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
862
881
|
"div",
|
|
@@ -928,7 +947,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
928
947
|
{
|
|
929
948
|
style: showCashPayment ? {
|
|
930
949
|
gridColumn: "1",
|
|
931
|
-
gridRow: "1"
|
|
950
|
+
gridRow: (paymentOptionList == null ? void 0 : paymentOptionList.length) === 1 ? "span 2" : "1"
|
|
932
951
|
} : {}
|
|
933
952
|
},
|
|
934
953
|
/* @__PURE__ */ import_react.default.createElement(
|
|
@@ -944,17 +963,18 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
944
963
|
customAmount,
|
|
945
964
|
roundingFunction,
|
|
946
965
|
balanceDueAmount,
|
|
947
|
-
balanceDueTotalAmount
|
|
966
|
+
balanceDueTotalAmount,
|
|
967
|
+
shortcutsSize: (paymentOptionList == null ? void 0 : paymentOptionList.length) === 3 || (paymentOptionList == null ? void 0 : paymentOptionList.length) === 1 ? "large" : "default"
|
|
948
968
|
}
|
|
949
969
|
)
|
|
950
970
|
),
|
|
951
|
-
moduleConfig.showPaymentOptions && /* @__PURE__ */ import_react.default.createElement(
|
|
971
|
+
moduleConfig.showPaymentOptions && (paymentOptionList == null ? void 0 : paymentOptionList.length) > 0 && /* @__PURE__ */ import_react.default.createElement(
|
|
952
972
|
"div",
|
|
953
973
|
{
|
|
954
974
|
className: showCashPayment ? "" : "payment-options-module-container",
|
|
955
975
|
style: showCashPayment ? {
|
|
956
976
|
gridColumn: "2",
|
|
957
|
-
gridRow: "1 / 3"
|
|
977
|
+
gridRow: (paymentOptionList == null ? void 0 : paymentOptionList.length) > 3 ? "1 / 3" : "1"
|
|
958
978
|
} : {}
|
|
959
979
|
},
|
|
960
980
|
/* @__PURE__ */ import_react.default.createElement(
|
|
@@ -976,8 +996,8 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
976
996
|
{
|
|
977
997
|
className: showCashPayment ? "" : "additional-module-container",
|
|
978
998
|
style: showCashPayment ? {
|
|
979
|
-
gridColumn: "1",
|
|
980
|
-
gridRow: "2"
|
|
999
|
+
gridColumn: (paymentOptionList == null ? void 0 : paymentOptionList.length) > 3 ? "1" : (paymentOptionList == null ? void 0 : paymentOptionList.length) <= 1 ? "2" : "span 2",
|
|
1000
|
+
gridRow: (paymentOptionList == null ? void 0 : paymentOptionList.length) === 0 ? "1" : "2"
|
|
981
1001
|
} : {}
|
|
982
1002
|
},
|
|
983
1003
|
/* @__PURE__ */ import_react.default.createElement(
|
|
@@ -988,7 +1008,9 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
988
1008
|
handleButtonClick,
|
|
989
1009
|
hasOrderNote: !!orderNote && orderNote.trim().length > 0,
|
|
990
1010
|
disabled: isOrderFree,
|
|
991
|
-
showCashPayment
|
|
1011
|
+
showCashPayment,
|
|
1012
|
+
isFullWidth: !((paymentOptionList == null ? void 0 : paymentOptionList.length) > 3 || (paymentOptionList == null ? void 0 : paymentOptionList.length) <= 1),
|
|
1013
|
+
showMore: !(showCashPayment && (paymentOptionList == null ? void 0 : paymentOptionList.length) === 0)
|
|
992
1014
|
}
|
|
993
1015
|
)
|
|
994
1016
|
)
|
|
@@ -1020,6 +1042,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
1020
1042
|
open: showPriceAdjustModal,
|
|
1021
1043
|
onCancel: () => setShowPriceAdjustModal(false)
|
|
1022
1044
|
},
|
|
1045
|
+
tips: import_utils.locales.getText("pisell2.checkout.modal.price-adjustment-tips") || "Changing amount will update order total",
|
|
1023
1046
|
selectType: "dark",
|
|
1024
1047
|
originalValue: currentTotalPrice,
|
|
1025
1048
|
defaultValue: currentTotalPriceAfterDiscount,
|
|
@@ -1037,6 +1060,39 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
|
1037
1060
|
walletPassData,
|
|
1038
1061
|
onSavePayLater: handleSavePayLater
|
|
1039
1062
|
}
|
|
1063
|
+
),
|
|
1064
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
1065
|
+
import_priceKeyboard.PaymentKeyboard,
|
|
1066
|
+
{
|
|
1067
|
+
containerProps: {
|
|
1068
|
+
renderType: "modal",
|
|
1069
|
+
open: showSplitPaymentKeyboard,
|
|
1070
|
+
onCancel: () => setShowSplitPaymentKeyboard(false)
|
|
1071
|
+
},
|
|
1072
|
+
paymentOriginalValue: balanceDueAmount,
|
|
1073
|
+
paymentDefaultValue: String(customAmount || 0),
|
|
1074
|
+
enableExceedMaxAmount: false,
|
|
1075
|
+
payment: {
|
|
1076
|
+
enable: true
|
|
1077
|
+
},
|
|
1078
|
+
surcharge: {
|
|
1079
|
+
enable: false
|
|
1080
|
+
},
|
|
1081
|
+
surchargeDefaultValue: {
|
|
1082
|
+
percent: "0",
|
|
1083
|
+
fixed: "0"
|
|
1084
|
+
},
|
|
1085
|
+
selectType: "light",
|
|
1086
|
+
onChange: (value) => {
|
|
1087
|
+
console.log(value);
|
|
1088
|
+
},
|
|
1089
|
+
doneText: import_utils.locales.getText("confirm") || "确认",
|
|
1090
|
+
onPay: (args) => {
|
|
1091
|
+
console.log(args);
|
|
1092
|
+
setShowSplitPaymentKeyboard(false);
|
|
1093
|
+
handleAmountChange(String(args.amount));
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1040
1096
|
)
|
|
1041
1097
|
);
|
|
1042
1098
|
}
|
|
@@ -1469,7 +1525,7 @@ var PaymentModal = ({
|
|
|
1469
1525
|
unsubscribeRef.current = checkout.core.effects.on(
|
|
1470
1526
|
"checkout:onOrderSynced",
|
|
1471
1527
|
executeIfActive(async (data2) => {
|
|
1472
|
-
var _a3, _b3, _c3, _d3, _e2;
|
|
1528
|
+
var _a3, _b3, _c3, _d3, _e2, _f2, _g2, _h2;
|
|
1473
1529
|
const currentOrderId = checkout.getCurrentOrderId();
|
|
1474
1530
|
setCurrentEditOrderId(currentOrderId);
|
|
1475
1531
|
const responseData = (_a3 = data2.response) == null ? void 0 : _a3.data;
|
|
@@ -1547,6 +1603,12 @@ var PaymentModal = ({
|
|
|
1547
1603
|
}));
|
|
1548
1604
|
}
|
|
1549
1605
|
const orderInfo3 = checkout.getCurrentOrderInfo();
|
|
1606
|
+
const isToastMode = ((_h2 = (_g2 = (_f2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _f2.config) == null ? void 0 : _g2.payment_setting) == null ? void 0 : _h2.payment_result_display_mode) !== "modal";
|
|
1607
|
+
if (!isToastMode) {
|
|
1608
|
+
autoCloseConfig.autoClose = false;
|
|
1609
|
+
autoCloseConfig.autoCloseDelay = 0;
|
|
1610
|
+
autoCloseConfig.maskClosable = false;
|
|
1611
|
+
}
|
|
1550
1612
|
await (0, import_PaymentResultToastUtils.displayPaymentResultToast)(
|
|
1551
1613
|
{
|
|
1552
1614
|
paymentStatus,
|
|
@@ -8,6 +8,8 @@ interface AdditionalModuleProps {
|
|
|
8
8
|
hasOrderNote?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
showCashPayment?: boolean;
|
|
11
|
+
isFullWidth?: boolean;
|
|
12
|
+
showMore?: boolean;
|
|
11
13
|
}
|
|
12
|
-
declare function AdditionalModule({ orderInfo, customAmount, handleButtonClick, hasOrderNote, disabled, showCashPayment, }: AdditionalModuleProps): JSX.Element;
|
|
14
|
+
declare function AdditionalModule({ orderInfo, customAmount, handleButtonClick, hasOrderNote, disabled, showCashPayment, isFullWidth, showMore }: AdditionalModuleProps): JSX.Element;
|
|
13
15
|
export default AdditionalModule;
|
|
@@ -47,7 +47,9 @@ function AdditionalModule({
|
|
|
47
47
|
handleButtonClick,
|
|
48
48
|
hasOrderNote = false,
|
|
49
49
|
disabled = false,
|
|
50
|
-
showCashPayment = false
|
|
50
|
+
showCashPayment = false,
|
|
51
|
+
isFullWidth = false,
|
|
52
|
+
showMore = true
|
|
51
53
|
}) {
|
|
52
54
|
import_utils.locales.init(import_locales2.default, (0, import_locales.getLocale)());
|
|
53
55
|
const moreMenuItems = [
|
|
@@ -55,11 +57,16 @@ function AdditionalModule({
|
|
|
55
57
|
key: "send-link",
|
|
56
58
|
label: import_utils.locales.getText("pisell2.text.send-link"),
|
|
57
59
|
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.LinkOutlined, null)
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: "print-receipt",
|
|
63
|
+
label: import_utils.locales.getText("pisell2.text.print-receipt"),
|
|
64
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-printer" })
|
|
58
65
|
}
|
|
59
66
|
];
|
|
60
67
|
const Toast = (0, import_useToast.default)();
|
|
61
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module" }, showCashPayment && /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-title" }, import_utils.locales.getText("pisell2.text.others")), /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-buttons-container" }, showCashPayment ? (
|
|
62
|
-
// Grid
|
|
68
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module" }, showCashPayment && /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-title" }, import_utils.locales.getText("pisell2.text.others")), /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-buttons-container" }, showCashPayment && !isFullWidth ? (
|
|
69
|
+
// Grid布局模式:两行布局(显示现金支付模块且非全宽时)
|
|
63
70
|
/* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-button-row" }, /* @__PURE__ */ import_react.default.createElement(
|
|
64
71
|
import_antd.Button,
|
|
65
72
|
{
|
|
@@ -83,18 +90,18 @@ function AdditionalModule({
|
|
|
83
90
|
{
|
|
84
91
|
className: "additional-module-button-base purple-theme",
|
|
85
92
|
onClick: () => {
|
|
86
|
-
handleButtonClick("
|
|
93
|
+
handleButtonClick("split-payment");
|
|
87
94
|
},
|
|
88
95
|
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
89
96
|
import_materials.Icon,
|
|
90
97
|
{
|
|
91
|
-
type: "pisell2-
|
|
98
|
+
type: "pisell2-coins-01",
|
|
92
99
|
className: "additional-module-button-icon"
|
|
93
100
|
}
|
|
94
101
|
),
|
|
95
102
|
size: "large"
|
|
96
103
|
},
|
|
97
|
-
import_utils.locales.getText("
|
|
104
|
+
import_utils.locales.getText("split.payment")
|
|
98
105
|
)), /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-button-row" }, /* @__PURE__ */ import_react.default.createElement(
|
|
99
106
|
import_antd.Button,
|
|
100
107
|
{
|
|
@@ -126,7 +133,7 @@ function AdditionalModule({
|
|
|
126
133
|
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.ClockCircleOutlined, { className: "additional-module-button-icon" })
|
|
127
134
|
},
|
|
128
135
|
import_utils.locales.getText("pisell2.text.save-pay-later")
|
|
129
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
136
|
+
), showMore && /* @__PURE__ */ import_react.default.createElement(
|
|
130
137
|
import_antd.Dropdown,
|
|
131
138
|
{
|
|
132
139
|
menu: {
|
|
@@ -143,6 +150,8 @@ function AdditionalModule({
|
|
|
143
150
|
)
|
|
144
151
|
);
|
|
145
152
|
}
|
|
153
|
+
} else if (key === "split-payment") {
|
|
154
|
+
handleButtonClick("split-payment");
|
|
146
155
|
}
|
|
147
156
|
}
|
|
148
157
|
},
|
|
@@ -163,9 +172,33 @@ function AdditionalModule({
|
|
|
163
172
|
icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-dots-vertical", size: 20 })
|
|
164
173
|
}
|
|
165
174
|
)
|
|
175
|
+
)), !showMore && /* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-button-row" }, /* @__PURE__ */ import_react.default.createElement(
|
|
176
|
+
import_antd.Button,
|
|
177
|
+
{
|
|
178
|
+
className: "additional-module-button-base purple-theme",
|
|
179
|
+
onClick: () => {
|
|
180
|
+
handleButtonClick("send-link");
|
|
181
|
+
},
|
|
182
|
+
disabled,
|
|
183
|
+
size: "large",
|
|
184
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.LinkOutlined, null)
|
|
185
|
+
},
|
|
186
|
+
import_utils.locales.getText("pisell2.text.send-link")
|
|
187
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
188
|
+
import_antd.Button,
|
|
189
|
+
{
|
|
190
|
+
className: "additional-module-button-base purple-theme",
|
|
191
|
+
onClick: () => {
|
|
192
|
+
handleButtonClick("print-receipt");
|
|
193
|
+
},
|
|
194
|
+
disabled,
|
|
195
|
+
size: "large",
|
|
196
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Icon, { type: "pisell2-printer" })
|
|
197
|
+
},
|
|
198
|
+
import_utils.locales.getText("pisell2.text.print-receipt")
|
|
166
199
|
)))
|
|
167
200
|
) : (
|
|
168
|
-
// Flex
|
|
201
|
+
// Flex布局模式:一行布局(不显示现金支付模块或强制全宽时)
|
|
169
202
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "additional-module-button-row" }, /* @__PURE__ */ import_react.default.createElement(
|
|
170
203
|
import_antd.Button,
|
|
171
204
|
{
|
|
@@ -189,18 +222,18 @@ function AdditionalModule({
|
|
|
189
222
|
{
|
|
190
223
|
className: "additional-module-button-base purple-theme",
|
|
191
224
|
onClick: () => {
|
|
192
|
-
handleButtonClick("
|
|
225
|
+
handleButtonClick("split-payment");
|
|
193
226
|
},
|
|
194
227
|
size: "large",
|
|
195
228
|
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
196
229
|
import_materials.Icon,
|
|
197
230
|
{
|
|
198
|
-
type: "pisell2-
|
|
231
|
+
type: "pisell2-coins-01",
|
|
199
232
|
className: "additional-module-button-icon"
|
|
200
233
|
}
|
|
201
234
|
)
|
|
202
235
|
},
|
|
203
|
-
import_utils.locales.getText("
|
|
236
|
+
import_utils.locales.getText("split.payment")
|
|
204
237
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
205
238
|
import_antd.Button,
|
|
206
239
|
{
|
|
@@ -42,7 +42,6 @@ var import_decimal = __toESM(require("decimal.js"));
|
|
|
42
42
|
var import_locales = __toESM(require("../../locales"));
|
|
43
43
|
var import_PaymentDetailModal = __toESM(require("../PaymentDetailModal"));
|
|
44
44
|
var import_pisellSimplePriceKeyboardPopover = __toESM(require("../../../../pro/pisellSimplePriceKeyboardPopover"));
|
|
45
|
-
var import_priceKeyboard = require("../../../../pro/priceKeyboard");
|
|
46
45
|
var import_index = require("./index.less");
|
|
47
46
|
var import_classnames = __toESM(require("classnames"));
|
|
48
47
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
@@ -365,12 +364,12 @@ function AmountSummary({
|
|
|
365
364
|
let balanceAmountValue = parseFormattedAmount(getBalanceDueAmount());
|
|
366
365
|
let balanceDecimal = new import_decimal.default(balanceAmountValue);
|
|
367
366
|
const syncedVoucherAmount = paymentItems == null ? void 0 : paymentItems.reduce((acc, item) => {
|
|
368
|
-
if (item.isSynced && (paymentType === "regular" && item.order_payment_type !== "deposit" || paymentType === "deposit" && item.order_payment_type === "deposit")) {
|
|
367
|
+
if ((item.isSynced || item.voucher_id) && (paymentType === "regular" && item.order_payment_type !== "deposit" || paymentType === "deposit" && item.order_payment_type === "deposit")) {
|
|
369
368
|
return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
|
|
370
369
|
}
|
|
371
370
|
return acc;
|
|
372
371
|
}, new import_decimal.default(0)).toNumber();
|
|
373
|
-
balanceDecimal = balanceDecimal.minus(syncedVoucherAmount);
|
|
372
|
+
balanceDecimal = new import_decimal.default(Math.abs(balanceDecimal.minus(new import_decimal.default(syncedVoucherAmount)).toNumber()));
|
|
374
373
|
const finalBalanceAmount = (0, import_utils.formatAmountWithOptions)(
|
|
375
374
|
balanceDecimal.toNumber(),
|
|
376
375
|
amountSymbol,
|
|
@@ -467,8 +466,9 @@ function AmountSummary({
|
|
|
467
466
|
return balanceDueAmount !== customAmount && Number(balanceDueAmount) > 0 && Number(customAmount) > 0;
|
|
468
467
|
}, [customAmount, balanceDueAmount]);
|
|
469
468
|
const handleChangeDepositAmount = (value) => {
|
|
470
|
-
|
|
471
|
-
|
|
469
|
+
const valueStr = String(value);
|
|
470
|
+
console.log("handleChangeDepositAmount", valueStr);
|
|
471
|
+
checkoutModule == null ? void 0 : checkoutModule.setDepositAmountAsync(valueStr);
|
|
472
472
|
};
|
|
473
473
|
const hasDepositPayment = (0, import_react.useMemo)(() => {
|
|
474
474
|
return paymentItems == null ? void 0 : paymentItems.some((item) => item.order_payment_type === "deposit" && item.status !== "voided");
|
|
@@ -594,47 +594,6 @@ function AmountSummary({
|
|
|
594
594
|
))
|
|
595
595
|
)
|
|
596
596
|
),
|
|
597
|
-
!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(
|
|
598
|
-
import_antd.Popover,
|
|
599
|
-
{
|
|
600
|
-
content: /* @__PURE__ */ import_react2.default.createElement("div", { onClick: (e) => e.stopPropagation() }, /* @__PURE__ */ import_react2.default.createElement(
|
|
601
|
-
import_priceKeyboard.PaymentKeyboard,
|
|
602
|
-
{
|
|
603
|
-
paymentOriginalValue: balanceDueAmount,
|
|
604
|
-
paymentDefaultValue: String(customAmount || 0),
|
|
605
|
-
enableExceedMaxAmount: false,
|
|
606
|
-
payment: {
|
|
607
|
-
enable: true
|
|
608
|
-
},
|
|
609
|
-
surcharge: {
|
|
610
|
-
enable: false
|
|
611
|
-
},
|
|
612
|
-
surchargeDefaultValue: {
|
|
613
|
-
percent: "0",
|
|
614
|
-
fixed: "0"
|
|
615
|
-
},
|
|
616
|
-
selectType: "light",
|
|
617
|
-
onChange: (value) => {
|
|
618
|
-
console.log(value);
|
|
619
|
-
},
|
|
620
|
-
doneText: getText("confirm"),
|
|
621
|
-
onPay: (args) => {
|
|
622
|
-
console.log(args);
|
|
623
|
-
setIsKeyboardVisible(false);
|
|
624
|
-
handleKeyboardConfirm(args.amount);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
)),
|
|
628
|
-
trigger: "click",
|
|
629
|
-
open: isKeyboardVisible,
|
|
630
|
-
onOpenChange: setIsKeyboardVisible,
|
|
631
|
-
placement: "bottom",
|
|
632
|
-
overlayClassName: "payment-keyboard-popover",
|
|
633
|
-
arrow: true,
|
|
634
|
-
destroyTooltipOnHide: true
|
|
635
|
-
},
|
|
636
|
-
/* @__PURE__ */ import_react2.default.createElement(import_antd.Button, { className: (0, import_classnames.default)("split-payment-button") }, getText("split.payment") || "拆分支付")
|
|
637
|
-
)),
|
|
638
597
|
/* @__PURE__ */ import_react2.default.createElement(
|
|
639
598
|
import_materials.PisellModal,
|
|
640
599
|
{
|
|
@@ -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;
|
|
@@ -55,8 +55,10 @@ function CashPaymentModule({
|
|
|
55
55
|
// 当前阶段剩余支付金额(定金或普通支付)
|
|
56
56
|
balanceDueTotalAmount = "0",
|
|
57
57
|
// 完整订单剩余待付金额
|
|
58
|
-
syncingLock = false
|
|
58
|
+
syncingLock = false,
|
|
59
59
|
// 是否锁定
|
|
60
|
+
shortcutsSize = "default"
|
|
61
|
+
// 预设大小
|
|
60
62
|
}) {
|
|
61
63
|
const [amount, setAmount] = (0, import_react.useState)(customAmount || "");
|
|
62
64
|
const [roundingAmount, setRoundingAmount] = (0, import_react.useState)(0);
|
|
@@ -225,7 +227,8 @@ function CashPaymentModule({
|
|
|
225
227
|
};
|
|
226
228
|
}),
|
|
227
229
|
onReset: handleReset,
|
|
228
|
-
onEnter: syncingLock ? void 0 : handleCashPay
|
|
230
|
+
onEnter: syncingLock ? void 0 : handleCashPay,
|
|
231
|
+
shortcutsSize
|
|
229
232
|
}
|
|
230
233
|
);
|
|
231
234
|
}
|
|
@@ -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;
|
|
@@ -45,7 +45,8 @@ var PaymentMethodItem = ({
|
|
|
45
45
|
customAmount,
|
|
46
46
|
disabled = false,
|
|
47
47
|
onClick,
|
|
48
|
-
getText
|
|
48
|
+
getText,
|
|
49
|
+
size = "default"
|
|
49
50
|
}) => {
|
|
50
51
|
const [isKeyboardVisible, setIsKeyboardVisible] = (0, import_react.useState)(false);
|
|
51
52
|
const calculateSurcharge = (method2) => {
|
|
@@ -100,6 +101,9 @@ var PaymentMethodItem = ({
|
|
|
100
101
|
"payment-options-module-disabled": disabled
|
|
101
102
|
}
|
|
102
103
|
),
|
|
104
|
+
style: {
|
|
105
|
+
height: size === "large" ? "82px" : "62px"
|
|
106
|
+
},
|
|
103
107
|
onClick: showKeyboard,
|
|
104
108
|
type: "button",
|
|
105
109
|
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;
|
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/checkout/components/PaymentOptionsModule/index.tsx
|
|
30
30
|
var PaymentOptionsModule_exports = {};
|
|
31
31
|
__export(PaymentOptionsModule_exports, {
|
|
32
|
+
SHOW_METHODS_CODE: () => SHOW_METHODS_CODE,
|
|
32
33
|
default: () => PaymentOptionsModule_default
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(PaymentOptionsModule_exports);
|
|
@@ -125,6 +126,7 @@ function PaymentOptionsModule({
|
|
|
125
126
|
filteredPaymentMethods.map((method) => /* @__PURE__ */ import_react.default.createElement(
|
|
126
127
|
import_PaymentMethodItem.default,
|
|
127
128
|
{
|
|
129
|
+
size: (filteredPaymentMethods == null ? void 0 : filteredPaymentMethods.length) === 2 ? "large" : "default",
|
|
128
130
|
key: method.id,
|
|
129
131
|
method,
|
|
130
132
|
amountSymbol,
|
|
@@ -138,3 +140,7 @@ function PaymentOptionsModule({
|
|
|
138
140
|
);
|
|
139
141
|
}
|
|
140
142
|
var PaymentOptionsModule_default = PaymentOptionsModule;
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
145
|
+
SHOW_METHODS_CODE
|
|
146
|
+
});
|
package/lib/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
|
/** 显示成功弹窗 */
|
|
@@ -205,6 +205,10 @@ var GlobalToastManager = class {
|
|
|
205
205
|
instance.offsetIndex = index;
|
|
206
206
|
const bottomPosition = this.calculateBottomPosition(index, totalCount);
|
|
207
207
|
if (instance.container) {
|
|
208
|
+
const hasMask = instance.container.getAttribute("data-mask") === "true";
|
|
209
|
+
if (hasMask) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
208
212
|
instance.container.classList.add("toast-moving");
|
|
209
213
|
instance.container.style.position = "fixed";
|
|
210
214
|
instance.container.style.left = `${this.LEFT_OFFSET}px`;
|
|
@@ -240,22 +244,36 @@ var GlobalToastManager = class {
|
|
|
240
244
|
autoClose: config.autoClose,
|
|
241
245
|
autoCloseDelay: config.autoCloseDelay || 30,
|
|
242
246
|
showCountdownProgress: config.showCountdownProgress,
|
|
247
|
+
clickOutsideToClose: config.clickOutsideToClose,
|
|
243
248
|
onCountdownComplete: config.onCountdownComplete,
|
|
244
249
|
onClose: () => {
|
|
245
250
|
var _a;
|
|
246
251
|
(_a = config.onClose) == null ? void 0 : _a.call(config);
|
|
247
252
|
this.removeToast(id);
|
|
248
253
|
},
|
|
249
|
-
closable: config.closable !== void 0 ? config.closable : DEFAULT_TOAST_CONFIG.closable
|
|
254
|
+
closable: config.closable !== void 0 ? config.closable : DEFAULT_TOAST_CONFIG.closable,
|
|
255
|
+
mask: config.mask || false
|
|
250
256
|
};
|
|
251
257
|
const container = document.createElement("div");
|
|
252
258
|
container.setAttribute("data-toast-id", id);
|
|
259
|
+
if (config.mask) {
|
|
260
|
+
container.setAttribute("data-mask", "true");
|
|
261
|
+
}
|
|
253
262
|
const dynamicBottomOffset = this.calculateAndCacheBottomOffset();
|
|
254
263
|
container.style.position = "fixed";
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
264
|
+
if (config.mask) {
|
|
265
|
+
container.style.left = "50%";
|
|
266
|
+
container.style.top = "50%";
|
|
267
|
+
container.style.transform = "translate(-50%, -50%)";
|
|
268
|
+
container.style.bottom = "auto";
|
|
269
|
+
container.style.right = "auto";
|
|
270
|
+
} else {
|
|
271
|
+
container.style.left = `${this.LEFT_OFFSET}px`;
|
|
272
|
+
container.style.bottom = `${dynamicBottomOffset}px`;
|
|
273
|
+
container.style.top = "auto";
|
|
274
|
+
container.style.right = "auto";
|
|
275
|
+
container.style.transform = "none";
|
|
276
|
+
}
|
|
259
277
|
container.style.pointerEvents = "none";
|
|
260
278
|
container.style.width = "auto";
|
|
261
279
|
container.style.height = "auto";
|
|
@@ -225,8 +225,8 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
|
225
225
|
mask,
|
|
226
226
|
maskClosable,
|
|
227
227
|
closable: false,
|
|
228
|
-
className: getBaseClassName(`${className} ${statusClassName}`),
|
|
229
|
-
wrapClassName: "toast-modal-wrap"
|
|
228
|
+
className: getBaseClassName(`${className} ${statusClassName} ${mask ? "payment-result-toast-with-mask" : ""}`),
|
|
229
|
+
wrapClassName: `toast-modal-wrap ${mask ? "toast-modal-wrap-with-mask" : ""}`,
|
|
230
230
|
style: {
|
|
231
231
|
...height ? { height: `${height}px` } : {},
|
|
232
232
|
// 确保Modal不会被默认定位影响
|
|
@@ -246,8 +246,8 @@ var PaymentResultToast = (0, import_react.memo)((props) => {
|
|
|
246
246
|
focusTriggerAfterClose: false,
|
|
247
247
|
transitionName: "",
|
|
248
248
|
maskTransitionName: "",
|
|
249
|
-
centered:
|
|
250
|
-
getContainer: false
|
|
249
|
+
centered: mask,
|
|
250
|
+
getContainer: mask ? void 0 : false
|
|
251
251
|
},
|
|
252
252
|
/* @__PURE__ */ import_react.default.createElement(
|
|
253
253
|
"div",
|