@pisell/private-materials 6.12.157 → 6.12.158
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/preview.js +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +6 -6
- package/es/components/checkout/PaymentModal.js +552 -392
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +16 -8
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/SearchAndClientModule/index.js +12 -4
- package/es/components/checkout/hooks/useCheckoutPaymentScanActivity.js +80 -0
- package/es/components/checkout/hooks/useSharedWalletPass.js +54 -7
- package/es/components/checkout/hooks/useWalletPass.js +45 -7
- package/es/components/checkout/locales.js +15 -0
- package/es/components/checkout/paymentRuntime/PaymentMethodRuntime.js +35 -6
- package/es/components/pay/toB/components/EFTPOS/index.js +44 -7
- package/es/components/pay/toB/components/MX51/index.js +11 -1
- package/es/components/pay/toB/paymentMethods/index.js +31 -17
- package/es/plus/salesSdk/demo/hosts/legacyOpenProductDetail.js +1 -7
- package/lib/components/checkout/PaymentModal.js +552 -392
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +16 -8
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/lib/components/checkout/components/SearchAndClientModule/index.js +12 -4
- package/lib/components/checkout/hooks/useCheckoutPaymentScanActivity.js +81 -0
- package/lib/components/checkout/hooks/useSharedWalletPass.js +54 -7
- package/lib/components/checkout/hooks/useWalletPass.js +45 -7
- package/lib/components/checkout/locales.js +15 -0
- package/lib/components/checkout/paymentRuntime/PaymentMethodRuntime.js +35 -6
- package/lib/components/pay/toB/components/EFTPOS/index.js +44 -7
- package/lib/components/pay/toB/components/MX51/index.js +11 -1
- package/lib/components/pay/toB/paymentMethods/index.js +31 -17
- package/lib/plus/salesSdk/demo/hosts/legacyOpenProductDetail.js +1 -7
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ const MX51 = (props, ref) => {
|
|
|
13
13
|
const logger = useLogger();
|
|
14
14
|
const context = useEngineContext();
|
|
15
15
|
const action = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.action;
|
|
16
|
-
const onOpen = ({ data, payCallback }) => {
|
|
16
|
+
const onOpen = ({ data, payCallback, isActive }) => {
|
|
17
17
|
const { params, mode } = data;
|
|
18
18
|
const uniquePaymentNumber = getUuid();
|
|
19
19
|
const newData = {
|
|
@@ -31,6 +31,15 @@ const MX51 = (props, ref) => {
|
|
|
31
31
|
title: "ToB_MX51_onOpen 开始调用",
|
|
32
32
|
metadata: { params: newData }
|
|
33
33
|
});
|
|
34
|
+
if (isActive && !isActive()) return false;
|
|
35
|
+
if (typeof action !== "function") {
|
|
36
|
+
logger === null || logger === void 0 || logger.addLog({
|
|
37
|
+
type: "error",
|
|
38
|
+
title: "ToB_MX51_onOpen 支付能力不可用",
|
|
39
|
+
metadata: { params: newData }
|
|
40
|
+
});
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
34
43
|
action({
|
|
35
44
|
type: "webpos.handleMX51Pay",
|
|
36
45
|
data: newData,
|
|
@@ -64,6 +73,7 @@ const MX51 = (props, ref) => {
|
|
|
64
73
|
});
|
|
65
74
|
}
|
|
66
75
|
});
|
|
76
|
+
return true;
|
|
67
77
|
};
|
|
68
78
|
useImperativeHandle(ref, () => ({ open: onOpen }));
|
|
69
79
|
return null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
|
+
import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
2
3
|
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
|
|
3
4
|
import useLogger from "../../../../hooks/useLogger.js";
|
|
4
5
|
import EFTPOS_default from "../components/EFTPOS/index.js";
|
|
@@ -10,25 +11,38 @@ const PaymentMethods = (props, ref) => {
|
|
|
10
11
|
const eftposRef = useRef(null);
|
|
11
12
|
const mx51Ref = useRef(null);
|
|
12
13
|
const logger = useLogger();
|
|
13
|
-
const onPay = (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const onPay = function() {
|
|
15
|
+
var _ref = _asyncToGenerator(function* (type, params) {
|
|
16
|
+
const { callback } = params, otherParams = _objectWithoutProperties(params, _excluded);
|
|
17
|
+
console.log("onPay_params>>>>", type, params);
|
|
18
|
+
logger === null || logger === void 0 || logger.addLog({
|
|
19
|
+
type: "info",
|
|
20
|
+
title: "ToB_PaymentMethods_onPay 开始调用",
|
|
21
|
+
metadata: {
|
|
22
|
+
type,
|
|
23
|
+
params
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const paymentRef = type === "eftpos" ? eftposRef.current : mx51Ref.current;
|
|
27
|
+
if (!(paymentRef === null || paymentRef === void 0 ? void 0 : paymentRef.open)) return false;
|
|
28
|
+
try {
|
|
29
|
+
return (yield paymentRef.open(_objectSpread2(_objectSpread2({}, otherParams), {}, { payCallback: (res) => type === "eftpos" ? _eftpcallback(res, callback) : _mx51callback(res, callback) }))) === true;
|
|
30
|
+
} catch (error) {
|
|
31
|
+
logger === null || logger === void 0 || logger.addLog({
|
|
32
|
+
type: "error",
|
|
33
|
+
title: "ToB_PaymentMethods_onPay 启动失败",
|
|
34
|
+
metadata: {
|
|
35
|
+
type,
|
|
36
|
+
error: error instanceof Error ? error.message : String(error)
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return false;
|
|
22
40
|
}
|
|
23
41
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var _mx51Ref$current, _mx51Ref$current$open;
|
|
29
|
-
(_mx51Ref$current = mx51Ref.current) === null || _mx51Ref$current === void 0 || (_mx51Ref$current$open = _mx51Ref$current.open) === null || _mx51Ref$current$open === void 0 || _mx51Ref$current$open.call(_mx51Ref$current, _objectSpread2(_objectSpread2({}, otherParams), {}, { payCallback: (res) => _mx51callback(res, callback) }));
|
|
30
|
-
}
|
|
31
|
-
};
|
|
42
|
+
return function onPay(_x, _x2) {
|
|
43
|
+
return _ref.apply(this, arguments);
|
|
44
|
+
};
|
|
45
|
+
}();
|
|
32
46
|
const _eftpcallback = (res, callback) => {
|
|
33
47
|
const params = {
|
|
34
48
|
status: res.status,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import dayjs from "dayjs";
|
|
3
3
|
//#region src/plus/salesSdk/demo/hosts/legacyOpenProductDetail.ts
|
|
4
|
-
/** 商品详情弹窗未回调时的兜底超时(避免 addProductWithFlow 永久 pending) */
|
|
5
|
-
const OPEN_PRODUCT_DETAIL_TIMEOUT_MS = 12e4;
|
|
6
4
|
const formatBundle = (bundle) => {
|
|
7
5
|
if (!Array.isArray(bundle)) return [];
|
|
8
6
|
return bundle.map((item) => _objectSpread2(_objectSpread2({}, item), {}, { bundle_product_id: item._bundle_product_id }));
|
|
@@ -29,12 +27,8 @@ function createLegacyOpenProductDetailHost(deps) {
|
|
|
29
27
|
const settle = (fn) => {
|
|
30
28
|
if (settled) return;
|
|
31
29
|
settled = true;
|
|
32
|
-
clearTimeout(timer);
|
|
33
30
|
fn();
|
|
34
31
|
};
|
|
35
|
-
const timer = setTimeout(() => {
|
|
36
|
-
settle(() => reject(/* @__PURE__ */ new Error("[SalesSdk] openProductDetail 超时:页面未响应 pisell1.handleOpenProductModal(请确认低代码页已注册该 action,且场次弹窗能正常打开)")));
|
|
37
|
-
}, OPEN_PRODUCT_DETAIL_TIMEOUT_MS);
|
|
38
32
|
action({
|
|
39
33
|
type: "pisell1.handleOpenProductModal",
|
|
40
34
|
data: {
|
|
@@ -52,7 +46,7 @@ function createLegacyOpenProductDetailHost(deps) {
|
|
|
52
46
|
callback: (e, extension_type, detail) => {
|
|
53
47
|
console.log(e, extension_type, detail, "detail1234");
|
|
54
48
|
settle(() => resolve({
|
|
55
|
-
e: _objectSpread2(_objectSpread2({}, e), {}, { bundle: formatBundle(e.bundle) }),
|
|
49
|
+
e: _objectSpread2(_objectSpread2({}, e), {}, { bundle: formatBundle(e === null || e === void 0 ? void 0 : e.bundle) }),
|
|
56
50
|
extension_type,
|
|
57
51
|
detail
|
|
58
52
|
}));
|