@pisell/private-materials 6.4.9 → 6.4.11
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/checkout/PaymentModal.js +13 -7
- package/es/components/checkout/components/CashPaymentModule/index.js +1 -1
- package/lib/components/checkout/PaymentModal.js +12 -5
- package/lib/components/checkout/components/CashPaymentModule/index.js +1 -1
- package/package.json +1 -1
@@ -185,13 +185,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
185
185
|
// 从支付方式列表中查找现金支付方式
|
186
186
|
cashPaymentMethod = paymentMethods.find(function (method) {
|
187
187
|
var _method$name;
|
188
|
-
return method.code === '
|
188
|
+
return method.code === 'CASHMANUAL' || method.type === 'CASHMANUAL' || ((_method$name = method.name) === null || _method$name === void 0 ? void 0 : _method$name.toLowerCase().includes('cash'));
|
189
189
|
});
|
190
190
|
_context.next = 3;
|
191
191
|
return checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.addPaymentItemAsync({
|
192
192
|
amount: result.amount,
|
193
193
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
194
|
-
code:
|
194
|
+
code: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.code,
|
195
195
|
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
196
196
|
id: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.id,
|
197
197
|
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
@@ -532,12 +532,16 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
532
532
|
}
|
533
533
|
// 判断是否为现金支付
|
534
534
|
var paymentMethodName = data.paymentMethodName || data.name || '';
|
535
|
-
var isCashPayment = data.paymentMethodCode === '
|
535
|
+
var isCashPayment = data.paymentMethodCode === 'CASHMANUAL' || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
|
536
536
|
if (isCashPayment) {
|
537
|
-
var _interaction$utils, _interaction$utils$
|
537
|
+
var _interaction$utils, _interaction$utils$po;
|
538
|
+
logger === null || logger === void 0 || logger.addLog({
|
539
|
+
type: 'info',
|
540
|
+
title: 'open_till',
|
541
|
+
metadata: {}
|
542
|
+
});
|
538
543
|
// handleToastClose();
|
539
|
-
|
540
|
-
interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$as = _interaction$utils.asyncDataManager) === null || _interaction$utils$as === void 0 || _interaction$utils$as.call(_interaction$utils, {
|
544
|
+
interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 || _interaction$utils$po.call(_interaction$utils, {
|
541
545
|
module: 'till',
|
542
546
|
key: 'open_till'
|
543
547
|
});
|
@@ -1763,13 +1767,15 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1763
1767
|
if (data && open) {
|
1764
1768
|
initCheckoutData();
|
1765
1769
|
}
|
1770
|
+
}, [data, open]);
|
1771
|
+
useEffect(function () {
|
1766
1772
|
return function () {
|
1767
1773
|
if (typeof unsubscribeRef.current === 'function') {
|
1768
1774
|
var _unsubscribeRef$curre;
|
1769
1775
|
(_unsubscribeRef$curre = unsubscribeRef.current) === null || _unsubscribeRef$curre === void 0 || _unsubscribeRef$curre.call(unsubscribeRef);
|
1770
1776
|
}
|
1771
1777
|
};
|
1772
|
-
}, [
|
1778
|
+
}, []);
|
1773
1779
|
|
1774
1780
|
// 创建PaymentResultToast配置对象
|
1775
1781
|
var paymentResultToastConfig = {
|
@@ -88,7 +88,7 @@ export function CashPaymentModule(_ref) {
|
|
88
88
|
}
|
89
89
|
var finalAmount = typeof amount === 'number' ? amount : Number(amount) || 0;
|
90
90
|
onPaymentComplete({
|
91
|
-
type: '
|
91
|
+
type: 'CASHMANUAL',
|
92
92
|
amount: finalAmount,
|
93
93
|
totalAmount: Number(customAmount) || 0,
|
94
94
|
change: finalAmount - (Number(customAmount) || 0),
|
@@ -144,13 +144,13 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
144
144
|
const cashPaymentMethod = paymentMethods.find(
|
145
145
|
(method) => {
|
146
146
|
var _a2;
|
147
|
-
return method.code === "
|
147
|
+
return method.code === "CASHMANUAL" || method.type === "CASHMANUAL" || ((_a2 = method.name) == null ? void 0 : _a2.toLowerCase().includes("cash"));
|
148
148
|
}
|
149
149
|
);
|
150
150
|
await (checkoutModule == null ? void 0 : checkoutModule.addPaymentItemAsync({
|
151
151
|
amount: result.amount,
|
152
152
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
153
|
-
code:
|
153
|
+
code: cashPaymentMethod == null ? void 0 : cashPaymentMethod.code,
|
154
154
|
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
155
155
|
id: cashPaymentMethod == null ? void 0 : cashPaymentMethod.id,
|
156
156
|
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
@@ -427,9 +427,14 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
427
427
|
);
|
428
428
|
}
|
429
429
|
const paymentMethodName = data.paymentMethodName || data.name || "";
|
430
|
-
const isCashPayment = data.paymentMethodCode === "
|
430
|
+
const isCashPayment = data.paymentMethodCode === "CASHMANUAL" || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
|
431
431
|
if (isCashPayment) {
|
432
|
-
|
432
|
+
logger == null ? void 0 : logger.addLog({
|
433
|
+
type: "info",
|
434
|
+
title: "open_till",
|
435
|
+
metadata: {}
|
436
|
+
});
|
437
|
+
(_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
|
433
438
|
module: "till",
|
434
439
|
key: "open_till"
|
435
440
|
});
|
@@ -1309,13 +1314,15 @@ var PaymentModal = ({
|
|
1309
1314
|
if (data && open) {
|
1310
1315
|
initCheckoutData();
|
1311
1316
|
}
|
1317
|
+
}, [data, open]);
|
1318
|
+
(0, import_react.useEffect)(() => {
|
1312
1319
|
return () => {
|
1313
1320
|
var _a2;
|
1314
1321
|
if (typeof unsubscribeRef.current === "function") {
|
1315
1322
|
(_a2 = unsubscribeRef.current) == null ? void 0 : _a2.call(unsubscribeRef);
|
1316
1323
|
}
|
1317
1324
|
};
|
1318
|
-
}, [
|
1325
|
+
}, []);
|
1319
1326
|
const paymentResultToastConfig = {
|
1320
1327
|
context,
|
1321
1328
|
pisellos,
|
@@ -92,7 +92,7 @@ function CashPaymentModule({
|
|
92
92
|
}
|
93
93
|
const finalAmount = typeof amount === "number" ? amount : Number(amount) || 0;
|
94
94
|
onPaymentComplete({
|
95
|
-
type: "
|
95
|
+
type: "CASHMANUAL",
|
96
96
|
amount: finalAmount,
|
97
97
|
totalAmount: Number(customAmount) || 0,
|
98
98
|
change: finalAmount - (Number(customAmount) || 0),
|