@pisell/private-materials 6.4.2 → 6.4.4
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.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/checkout/PaymentModal.js +176 -94
- package/es/components/checkout/PaymentPlugin.d.ts +0 -1
- package/es/components/checkout/components/AdditionalModule/index.less +2 -0
- package/es/components/checkout/hooks/useWalletPass.js +2 -8
- package/es/components/checkout/index.less +0 -1
- package/es/components/checkout/locales.d.ts +9 -0
- package/es/components/checkout/locales.js +12 -3
- package/es/plus/productSelect/index.js +3 -5
- package/lib/components/checkout/PaymentModal.js +42 -9
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -1
- package/lib/components/checkout/components/AdditionalModule/index.less +2 -0
- package/lib/components/checkout/hooks/useWalletPass.js +2 -8
- package/lib/components/checkout/index.less +0 -1
- package/lib/components/checkout/locales.d.ts +9 -0
- package/lib/components/checkout/locales.js +12 -3
- package/lib/plus/productSelect/index.js +6 -8
- package/package.json +1 -1
@@ -63,6 +63,7 @@ var import_constants = require("./constants");
|
|
63
63
|
var import_lodash = require("lodash");
|
64
64
|
var import_utils2 = require("./utils");
|
65
65
|
var import_usePaymentLogger = __toESM(require("./hooks/usePaymentLogger"));
|
66
|
+
var import_antd = require("antd");
|
66
67
|
var CheckoutHooks = {
|
67
68
|
OnStateAmountChanged: "checkout:onStateAmountChanged",
|
68
69
|
OnBalanceDueAmountChanged: "checkout:onBalanceDueAmountChanged",
|
@@ -89,7 +90,8 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
89
90
|
moduleConfig: parentModuleConfig,
|
90
91
|
onShowCashPaymentChange,
|
91
92
|
showSuccessToast,
|
92
|
-
dynamicMaxHeight = "600px"
|
93
|
+
dynamicMaxHeight = "600px",
|
94
|
+
onOrderSyncFailed
|
93
95
|
}, ref) => {
|
94
96
|
var _a;
|
95
97
|
const context = (0, import_useEngineContext.default)();
|
@@ -366,13 +368,18 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
366
368
|
const orderSubmitEndUnsubscribe = core.effects.on(
|
367
369
|
CheckoutHooks.OnOrderSubmitEnd,
|
368
370
|
(res) => {
|
369
|
-
var _a2;
|
371
|
+
var _a2, _b;
|
370
372
|
if (res.success) {
|
371
373
|
(_a2 = Toast == null ? void 0 : Toast.hide) == null ? void 0 : _a2.call(Toast);
|
372
374
|
} else {
|
373
|
-
Toast == null ? void 0 : Toast.
|
374
|
-
|
375
|
-
|
375
|
+
(_b = Toast == null ? void 0 : Toast.hide) == null ? void 0 : _b.call(Toast);
|
376
|
+
if (onOrderSyncFailed) {
|
377
|
+
onOrderSyncFailed();
|
378
|
+
} else {
|
379
|
+
Toast == null ? void 0 : Toast.fail(
|
380
|
+
import_utils.locales.getText("pisell2.checkout.order-sync-failed") || "Order sync failed"
|
381
|
+
);
|
382
|
+
}
|
376
383
|
}
|
377
384
|
}
|
378
385
|
);
|
@@ -531,9 +538,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
531
538
|
logger == null ? void 0 : logger.addLog({
|
532
539
|
type: "info",
|
533
540
|
title: "handleSelectWalletChange checkoutModule updateVoucherPaymentItemsAsync",
|
534
|
-
metadata: {
|
535
|
-
voucherItems
|
536
|
-
}
|
541
|
+
metadata: {}
|
537
542
|
});
|
538
543
|
await checkoutModule.updateVoucherPaymentItemsAsync(voucherItems);
|
539
544
|
if (walletPassRef.current) {
|
@@ -886,7 +891,17 @@ var PaymentModal = ({
|
|
886
891
|
const [totalAmount, setTotalAmount] = (0, import_react.useState)(0);
|
887
892
|
const [actualShowCashPayment, setActualShowCashPayment] = (0, import_react.useState)(true);
|
888
893
|
const [windowHeight, setWindowHeight] = (0, import_react.useState)(0);
|
894
|
+
const [showRetryModal, setShowRetryModal] = (0, import_react.useState)(false);
|
889
895
|
const Toast = (0, import_useToast.default)();
|
896
|
+
const handleRetry = async () => {
|
897
|
+
const checkoutModule = pisellos == null ? void 0 : pisellos.getModule("checkout");
|
898
|
+
const res = await (checkoutModule == null ? void 0 : checkoutModule.manualSyncOrderAsync());
|
899
|
+
console.log(res);
|
900
|
+
if (res.success) {
|
901
|
+
setShowRetryModal(false);
|
902
|
+
showSuccessToast == null ? void 0 : showSuccessToast(res);
|
903
|
+
}
|
904
|
+
};
|
890
905
|
(0, import_react.useEffect)(() => {
|
891
906
|
const updateHeight = () => {
|
892
907
|
if (typeof window !== "undefined") {
|
@@ -1555,7 +1570,8 @@ var PaymentModal = ({
|
|
1555
1570
|
moduleConfig,
|
1556
1571
|
onShowCashPaymentChange: handleShowCashPaymentChange,
|
1557
1572
|
showSuccessToast,
|
1558
|
-
dynamicMaxHeight
|
1573
|
+
dynamicMaxHeight,
|
1574
|
+
onOrderSyncFailed: () => setShowRetryModal(true)
|
1559
1575
|
}
|
1560
1576
|
)
|
1561
1577
|
), noteModalOpen && (0, import_react_dom.createPortal)(
|
@@ -1571,6 +1587,23 @@ var PaymentModal = ({
|
|
1571
1587
|
}
|
1572
1588
|
)),
|
1573
1589
|
document.body
|
1590
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
1591
|
+
import_materials.PisellContainer,
|
1592
|
+
{
|
1593
|
+
renderType: "modal",
|
1594
|
+
props: {
|
1595
|
+
open: showRetryModal,
|
1596
|
+
title: import_utils.locales.getText("pisell2.checkout.tips"),
|
1597
|
+
footer: null,
|
1598
|
+
closable: false,
|
1599
|
+
maskClosable: false,
|
1600
|
+
keyboard: false,
|
1601
|
+
onCancel: () => {
|
1602
|
+
}
|
1603
|
+
// 禁用关闭
|
1604
|
+
}
|
1605
|
+
},
|
1606
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { textAlign: "center", padding: "20px" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: "16px", fontSize: "16px" } }, import_utils.locales.getText("pisell2.checkout.sync-retry-hint") || "请点击重试按钮重新同步订单"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "primary", size: "large", onClick: handleRetry, style: { width: "100%", marginTop: "80px" } }, import_utils.locales.getText("retry") || "重试"))
|
1574
1607
|
));
|
1575
1608
|
};
|
1576
1609
|
var PaymentModal_default = PaymentModal;
|
@@ -258,10 +258,7 @@ var useWalletPass = (props) => {
|
|
258
258
|
logger == null ? void 0 : logger.addLog({
|
259
259
|
type: "info",
|
260
260
|
title: "useWalletPass_onOrderCreated onSelectChange 开始调用",
|
261
|
-
metadata: {
|
262
|
-
recommendList,
|
263
|
-
select
|
264
|
-
}
|
261
|
+
metadata: {}
|
265
262
|
});
|
266
263
|
onSelectChange == null ? void 0 : onSelectChange(select);
|
267
264
|
} else {
|
@@ -413,10 +410,7 @@ var useWalletPass = (props) => {
|
|
413
410
|
logger == null ? void 0 : logger.addLog({
|
414
411
|
type: "info",
|
415
412
|
title: "useWalletPass_handleFetchUserIdentificationCodes onSelectChange 开始调用",
|
416
|
-
metadata: {
|
417
|
-
prepare_payments,
|
418
|
-
select
|
419
|
-
}
|
413
|
+
metadata: {}
|
420
414
|
});
|
421
415
|
onSelectChange == null ? void 0 : onSelectChange(select);
|
422
416
|
fetchUserIdentificationCodes({
|
@@ -147,6 +147,9 @@ declare const _default: {
|
|
147
147
|
'wallet-pass-module-customer-name-walk-in': string;
|
148
148
|
'pisell2.amount-summary.amount-cannot-be-zero': string;
|
149
149
|
'pisell2.checkout.order-sync-failed': string;
|
150
|
+
'pisell2.checkout.sync-retry-hint': string;
|
151
|
+
'pisell2.checkout.tips': string;
|
152
|
+
retry: string;
|
150
153
|
};
|
151
154
|
'zh-CN': {
|
152
155
|
'order.total': string;
|
@@ -296,6 +299,9 @@ declare const _default: {
|
|
296
299
|
'wallet-pass-module-customer-name-walk-in': string;
|
297
300
|
'pisell2.amount-summary.amount-cannot-be-zero': string;
|
298
301
|
'pisell2.checkout.order-sync-failed': string;
|
302
|
+
'pisell2.checkout.sync-retry-hint': string;
|
303
|
+
'pisell2.checkout.tips': string;
|
304
|
+
retry: string;
|
299
305
|
};
|
300
306
|
'zh-HK': {
|
301
307
|
'order.total': string;
|
@@ -445,6 +451,9 @@ declare const _default: {
|
|
445
451
|
'wallet-pass-module-customer-name-walk-in': string;
|
446
452
|
'pisell2.amount-summary.amount-cannot-be-zero': string;
|
447
453
|
'pisell2.checkout.order-sync-failed': string;
|
454
|
+
'pisell2.checkout.sync-retry-hint': string;
|
455
|
+
'pisell2.checkout.tips': string;
|
456
|
+
retry: string;
|
448
457
|
};
|
449
458
|
};
|
450
459
|
export default _default;
|
@@ -202,7 +202,10 @@ var locales_default = {
|
|
202
202
|
// Amount validation errors
|
203
203
|
"pisell2.amount-summary.amount-cannot-be-zero": "The amount cannot be 0",
|
204
204
|
// Order sync errors
|
205
|
-
"pisell2.checkout.order-sync-failed": "Order sync failed, please check your network"
|
205
|
+
"pisell2.checkout.order-sync-failed": "Order sync failed, please check your network",
|
206
|
+
"pisell2.checkout.sync-retry-hint": "Network error, please click the retry button to resync the order",
|
207
|
+
"pisell2.checkout.tips": "Tips",
|
208
|
+
"retry": "Retry"
|
206
209
|
},
|
207
210
|
"zh-CN": {
|
208
211
|
// Order and Payment
|
@@ -387,7 +390,10 @@ var locales_default = {
|
|
387
390
|
// Amount validation errors
|
388
391
|
"pisell2.amount-summary.amount-cannot-be-zero": "金额不能为0",
|
389
392
|
// Order sync errors
|
390
|
-
"pisell2.checkout.order-sync-failed": "订单同步失败,请检查网络"
|
393
|
+
"pisell2.checkout.order-sync-failed": "订单同步失败,请检查网络",
|
394
|
+
"pisell2.checkout.sync-retry-hint": "网络异常,请点击重试按钮重新同步订单",
|
395
|
+
"pisell2.checkout.tips": "提示",
|
396
|
+
"retry": "重试"
|
391
397
|
},
|
392
398
|
"zh-HK": {
|
393
399
|
// Order and Payment
|
@@ -572,6 +578,9 @@ var locales_default = {
|
|
572
578
|
// Amount validation errors
|
573
579
|
"pisell2.amount-summary.amount-cannot-be-zero": "金額不能為0",
|
574
580
|
// Order sync errors
|
575
|
-
"pisell2.checkout.order-sync-failed": "訂單同步失敗,請檢查網絡"
|
581
|
+
"pisell2.checkout.order-sync-failed": "訂單同步失敗,請檢查網絡",
|
582
|
+
"pisell2.checkout.sync-retry-hint": "網絡異常,請點擊重試按鈕重新同步訂單",
|
583
|
+
"pisell2.checkout.tips": "提示",
|
584
|
+
"retry": "重試"
|
576
585
|
}
|
577
586
|
};
|
@@ -81,6 +81,12 @@ var index = ({
|
|
81
81
|
layout,
|
82
82
|
...rest
|
83
83
|
}) => {
|
84
|
+
var _a, _b;
|
85
|
+
const context = (0, import_useEngineContext.default)();
|
86
|
+
import_utils.locales.init(
|
87
|
+
import_locales.default,
|
88
|
+
((_b = (_a = context.appHelper.utils) == null ? void 0 : _a.storage) == null ? void 0 : _b.get("umi_locale")) || "en"
|
89
|
+
);
|
84
90
|
const searchRef = (0, import_react.useRef)(null);
|
85
91
|
const [keyword, setKeyword] = (0, import_react.useState)("");
|
86
92
|
const [activeKey, setActiveKey] = (0, import_react.useState)("");
|
@@ -91,14 +97,6 @@ var index = ({
|
|
91
97
|
const gridComponents = (0, import_react.useMemo)(() => {
|
92
98
|
return (0, import_ProductList.createGridComponents)(layout);
|
93
99
|
}, [layout]);
|
94
|
-
const context = (0, import_useEngineContext.default)();
|
95
|
-
(0, import_react.useEffect)(() => {
|
96
|
-
var _a, _b;
|
97
|
-
import_utils.locales.init(
|
98
|
-
import_locales.default,
|
99
|
-
((_b = (_a = context.appHelper.utils) == null ? void 0 : _a.storage) == null ? void 0 : _b.get("umi_locale")) || "en"
|
100
|
-
);
|
101
|
-
}, []);
|
102
100
|
const _filteredList = (0, import_react.useMemo)(() => {
|
103
101
|
if (!keyword) return dataSource;
|
104
102
|
return dataSource.filter((product) => {
|