@pisell/private-materials 6.6.66 → 6.6.68
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/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/mx51/Action.d.ts +8 -1
- package/es/components/eftposPay/mx51/Action.js +4 -4
- package/es/components/eftposPay/mx51/index.js +45 -18
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/mx51/Action.d.ts +8 -1
- package/lib/components/eftposPay/mx51/Action.js +2 -2
- package/lib/components/eftposPay/mx51/index.js +36 -13
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/package.json +3 -3
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { ParsedElement } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* @title 渲染动态内容
|
|
3
4
|
* @description 用于渲染从接口解析出来的元素
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
interface ActionProps {
|
|
7
|
+
data: any;
|
|
8
|
+
cancelDisabled?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
onClick: (element: ParsedElement, extra: Record<string, any>) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Action: (props: ActionProps) => JSX.Element;
|
|
6
13
|
export default Action;
|
|
@@ -22,10 +22,10 @@ import { EButtonKeyType } from "./types";
|
|
|
22
22
|
var Action = function Action(props) {
|
|
23
23
|
var _data$layouts2, _data$layouts3;
|
|
24
24
|
var data = props.data,
|
|
25
|
-
_props$showMessage = props.showMessage,
|
|
26
|
-
showMessage = _props$showMessage === void 0 ? true : _props$showMessage,
|
|
27
25
|
_props$cancelDisabled = props.cancelDisabled,
|
|
28
|
-
cancelDisabled = _props$cancelDisabled === void 0 ? false : _props$cancelDisabled
|
|
26
|
+
cancelDisabled = _props$cancelDisabled === void 0 ? false : _props$cancelDisabled,
|
|
27
|
+
_props$isLoading = props.isLoading,
|
|
28
|
+
isLoading = _props$isLoading === void 0 ? false : _props$isLoading;
|
|
29
29
|
var _useState = useState({}),
|
|
30
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
31
31
|
inputValues = _useState2[0],
|
|
@@ -53,7 +53,7 @@ var Action = function Action(props) {
|
|
|
53
53
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, key, value));
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
56
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading && (data === null || data === void 0 ? void 0 : data.message) && /*#__PURE__*/React.createElement("div", {
|
|
57
57
|
className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip"
|
|
58
58
|
}, data === null || data === void 0 ? void 0 : data.message), (data === null || data === void 0 || (_data$layouts2 = data.layouts) === null || _data$layouts2 === void 0 ? void 0 : _data$layouts2.length) > 0 && (data === null || data === void 0 || (_data$layouts3 = data.layouts) === null || _data$layouts3 === void 0 ? void 0 : _data$layouts3.map(function (item, index) {
|
|
59
59
|
var _item$elements2;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["customAction"];
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
2
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -71,6 +74,8 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
71
74
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
72
75
|
cancelDisabled = _useState6[0],
|
|
73
76
|
setCancelDisabled = _useState6[1];
|
|
77
|
+
var clickLockedRef = useRef(false);
|
|
78
|
+
var clickUnlockTimerRef = useRef(null);
|
|
74
79
|
// 操作行为超时
|
|
75
80
|
var actionTimeoutRef = useRef(null);
|
|
76
81
|
var clearRef = useRef(null);
|
|
@@ -198,6 +203,10 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
198
203
|
clearTimeout(clearRef.current);
|
|
199
204
|
clearRef.current = null;
|
|
200
205
|
}
|
|
206
|
+
if (clickUnlockTimerRef.current) {
|
|
207
|
+
clearTimeout(clickUnlockTimerRef.current);
|
|
208
|
+
clickUnlockTimerRef.current = null;
|
|
209
|
+
}
|
|
201
210
|
};
|
|
202
211
|
}, []);
|
|
203
212
|
|
|
@@ -296,8 +305,6 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
296
305
|
|
|
297
306
|
// 拒绝签名
|
|
298
307
|
var onDecline = function onDecline(element) {
|
|
299
|
-
console.log('onDecline', element);
|
|
300
|
-
updateToLoading();
|
|
301
308
|
payment.action({
|
|
302
309
|
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
|
|
303
310
|
});
|
|
@@ -305,8 +312,6 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
305
312
|
|
|
306
313
|
// 接受签名
|
|
307
314
|
var onAccept = function onAccept(element) {
|
|
308
|
-
console.log('onAccept', element);
|
|
309
|
-
updateToLoading();
|
|
310
315
|
payment.action({
|
|
311
316
|
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
|
|
312
317
|
});
|
|
@@ -314,7 +319,6 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
314
319
|
|
|
315
320
|
// 打印商户收据
|
|
316
321
|
var onPrintMerchantReceipt = function onPrintMerchantReceipt(element) {
|
|
317
|
-
console.log('onPrintMerchantReceipt', element);
|
|
318
322
|
onChange('print', element !== null && element !== void 0 && element.receipt ? [element === null || element === void 0 ? void 0 : element.receipt] : []);
|
|
319
323
|
setReceiptModalShow(true);
|
|
320
324
|
setReceiptModalData(element === null || element === void 0 ? void 0 : element.receipt);
|
|
@@ -322,7 +326,6 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
322
326
|
|
|
323
327
|
// 打印客户收据
|
|
324
328
|
var onPrintCustomerReceipt = function onPrintCustomerReceipt(element) {
|
|
325
|
-
console.log('onPrintCustomerReceipt', element);
|
|
326
329
|
onChange('print', element !== null && element !== void 0 && element.receipt ? [element === null || element === void 0 ? void 0 : element.receipt] : []);
|
|
327
330
|
setReceiptModalShow(true);
|
|
328
331
|
setReceiptModalData(element === null || element === void 0 ? void 0 : element.receipt);
|
|
@@ -330,9 +333,11 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
330
333
|
|
|
331
334
|
// 重试交易
|
|
332
335
|
var onRetry = function onRetry(element) {
|
|
333
|
-
console.log('onRetry', element);
|
|
334
336
|
onChange('page', 'pay');
|
|
335
|
-
var
|
|
337
|
+
var _ref7 = custom || {},
|
|
338
|
+
customAction = _ref7.customAction,
|
|
339
|
+
restCustom = _objectWithoutProperties(_ref7, _excluded);
|
|
340
|
+
var _params = _objectSpread(_objectSpread({}, restCustom), {}, {
|
|
336
341
|
// 自定义参数需要重新传递
|
|
337
342
|
mode: mode,
|
|
338
343
|
name: name,
|
|
@@ -346,12 +351,11 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
346
351
|
|
|
347
352
|
// 交易完成
|
|
348
353
|
var onTransactionComplete = function onTransactionComplete(element) {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
customerReceipt = _ref7.customerReceipt;
|
|
354
|
+
var _ref8 = element._extra || {},
|
|
355
|
+
paymentStatus = _ref8.paymentStatus,
|
|
356
|
+
response = _ref8.response,
|
|
357
|
+
merchantReceipt = _ref8.merchantReceipt,
|
|
358
|
+
customerReceipt = _ref8.customerReceipt;
|
|
355
359
|
if (paymentStatus === EPaymentStatus.Success) {
|
|
356
360
|
var _response$data, _deviceRef$current2;
|
|
357
361
|
var receipt = [];
|
|
@@ -395,7 +399,6 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
395
399
|
|
|
396
400
|
// 提交到API
|
|
397
401
|
var onSubmitToAPI = function onSubmitToAPI(element, extra) {
|
|
398
|
-
updateToLoading();
|
|
399
402
|
var inputValues = (extra === null || extra === void 0 ? void 0 : extra.inputValues) || {};
|
|
400
403
|
payment.action({
|
|
401
404
|
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl,
|
|
@@ -408,7 +411,6 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
408
411
|
// 如果存在submit_url,则提交到API
|
|
409
412
|
if (element !== null && element !== void 0 && element.submitUrl) {
|
|
410
413
|
console.log('onNormalClick_submit_url', element === null || element === void 0 ? void 0 : element.submitUrl);
|
|
411
|
-
updateToLoading();
|
|
412
414
|
payment.action({
|
|
413
415
|
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
|
|
414
416
|
}, config);
|
|
@@ -416,9 +418,34 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
416
418
|
console.log('onNormalClick_no_submit_url', element);
|
|
417
419
|
}
|
|
418
420
|
};
|
|
421
|
+
var shouldLockElementClick = function shouldLockElementClick(element) {
|
|
422
|
+
var lockKeys = [EButtonKeyType.DeclineSignature, EButtonKeyType.ApproveSignature, EButtonKeyType.RetryTransaction, EButtonKeyType.SubmitToAPI, EButtonKeyType.CallTestFunction];
|
|
423
|
+
return lockKeys.includes(element.key);
|
|
424
|
+
};
|
|
425
|
+
var lockElementClick = function lockElementClick() {
|
|
426
|
+
clickLockedRef.current = true;
|
|
427
|
+
clickUnlockTimerRef.current = setTimeout(function () {
|
|
428
|
+
clickLockedRef.current = false;
|
|
429
|
+
clickUnlockTimerRef.current = null;
|
|
430
|
+
}, 1000);
|
|
431
|
+
};
|
|
419
432
|
|
|
420
433
|
// 点击元素
|
|
421
434
|
var onElementClick = function onElementClick(element, extra) {
|
|
435
|
+
if (shouldLockElementClick(element)) {
|
|
436
|
+
if (clickLockedRef.current) {
|
|
437
|
+
payLog.log("\u5FFD\u7565\u91CD\u590D\u70B9\u51FB".concat((element === null || element === void 0 ? void 0 : element.key) || '未知', "\u6309\u94AE"));
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
// 锁定点击
|
|
441
|
+
lockElementClick();
|
|
442
|
+
// 清除action data
|
|
443
|
+
dispatch(updateCustom({
|
|
444
|
+
customAction: {}
|
|
445
|
+
}));
|
|
446
|
+
// 更新为加载状态
|
|
447
|
+
updateToLoading();
|
|
448
|
+
}
|
|
422
449
|
console.log('onElementClick', element, extra);
|
|
423
450
|
payLog.log("\u70B9\u51FB".concat((element === null || element === void 0 ? void 0 : element.key) || '未知', "\u6309\u94AE"));
|
|
424
451
|
switch (element.key) {
|
|
@@ -471,9 +498,9 @@ var AggregatePayment = function AggregatePayment(_ref) {
|
|
|
471
498
|
}
|
|
472
499
|
}, title) : null, status !== StatusEnum.Success ? /*#__PURE__*/React.createElement(Action, {
|
|
473
500
|
data: custom === null || custom === void 0 ? void 0 : custom.customAction,
|
|
474
|
-
showMessage: status === StatusEnum.Loading,
|
|
475
501
|
onClick: onElementClick,
|
|
476
|
-
cancelDisabled: cancelDisabled
|
|
502
|
+
cancelDisabled: cancelDisabled,
|
|
503
|
+
isLoading: status === StatusEnum.Loading
|
|
477
504
|
}) : null), receiptModalShow ? /*#__PURE__*/React.createElement(PisellModal, {
|
|
478
505
|
open: receiptModalShow,
|
|
479
506
|
onCancel: onCloseReceiptModal,
|
|
@@ -299,8 +299,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
299
299
|
amount?: string | number | undefined;
|
|
300
300
|
mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
|
|
301
301
|
order_id?: string | number | undefined;
|
|
302
|
-
eftpos?: "stripe" | "tyro" | "
|
|
303
|
-
action?: "
|
|
302
|
+
eftpos?: "stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu" | undefined;
|
|
303
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
304
304
|
key?: number | undefined;
|
|
305
305
|
step?: number | undefined;
|
|
306
306
|
title?: string | undefined;
|
|
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
|
|
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
-
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu">;
|
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
25
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { ParsedElement } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* @title 渲染动态内容
|
|
3
4
|
* @description 用于渲染从接口解析出来的元素
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
interface ActionProps {
|
|
7
|
+
data: any;
|
|
8
|
+
cancelDisabled?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
onClick: (element: ParsedElement, extra: Record<string, any>) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const Action: (props: ActionProps) => JSX.Element;
|
|
6
13
|
export default Action;
|
|
@@ -37,7 +37,7 @@ var import_antd = require("antd");
|
|
|
37
37
|
var import_types = require("./types");
|
|
38
38
|
var Action = (props) => {
|
|
39
39
|
var _a, _b;
|
|
40
|
-
const { data,
|
|
40
|
+
const { data, cancelDisabled = false, isLoading = false } = props;
|
|
41
41
|
const [inputValues, setInputValues] = (0, import_react.useState)({});
|
|
42
42
|
const inputValuesRef = (0, import_react.useRef)(inputValues);
|
|
43
43
|
(0, import_react.useEffect)(() => {
|
|
@@ -60,7 +60,7 @@ var Action = (props) => {
|
|
|
60
60
|
const handleInputChange = (key, value) => {
|
|
61
61
|
setInputValues((prev) => ({ ...prev, [key]: value }));
|
|
62
62
|
};
|
|
63
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null,
|
|
63
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, isLoading && (data == null ? void 0 : data.message) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__eft-pay-step-item pisell-lowcode__eft-pay-step-item-tip" }, data == null ? void 0 : data.message), ((_a = data == null ? void 0 : data.layouts) == null ? void 0 : _a.length) > 0 && ((_b = data == null ? void 0 : data.layouts) == null ? void 0 : _b.map((item, index) => {
|
|
64
64
|
var _a2;
|
|
65
65
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
66
66
|
"div",
|
|
@@ -81,6 +81,8 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
81
81
|
const [receiptModalShow, setReceiptModalShow] = (0, import_react.useState)(false);
|
|
82
82
|
const [receiptModalData, setReceiptModalData] = (0, import_react.useState)(null);
|
|
83
83
|
const [cancelDisabled, setCancelDisabled] = (0, import_react.useState)(false);
|
|
84
|
+
const clickLockedRef = (0, import_react.useRef)(false);
|
|
85
|
+
const clickUnlockTimerRef = (0, import_react.useRef)(null);
|
|
84
86
|
const actionTimeoutRef = (0, import_react.useRef)(null);
|
|
85
87
|
const clearRef = (0, import_react.useRef)(null);
|
|
86
88
|
(0, import_react.useEffect)(() => {
|
|
@@ -177,6 +179,10 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
177
179
|
clearTimeout(clearRef.current);
|
|
178
180
|
clearRef.current = null;
|
|
179
181
|
}
|
|
182
|
+
if (clickUnlockTimerRef.current) {
|
|
183
|
+
clearTimeout(clickUnlockTimerRef.current);
|
|
184
|
+
clickUnlockTimerRef.current = null;
|
|
185
|
+
}
|
|
180
186
|
};
|
|
181
187
|
}, []);
|
|
182
188
|
const handleFail = (errorData) => {
|
|
@@ -248,32 +254,26 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
248
254
|
}, import_types2.CANCEL_ACTION_TIMEOUT);
|
|
249
255
|
};
|
|
250
256
|
const onDecline = (element) => {
|
|
251
|
-
console.log("onDecline", element);
|
|
252
|
-
updateToLoading();
|
|
253
257
|
payment.action({ submit_url: element == null ? void 0 : element.submitUrl });
|
|
254
258
|
};
|
|
255
259
|
const onAccept = (element) => {
|
|
256
|
-
console.log("onAccept", element);
|
|
257
|
-
updateToLoading();
|
|
258
260
|
payment.action({ submit_url: element == null ? void 0 : element.submitUrl });
|
|
259
261
|
};
|
|
260
262
|
const onPrintMerchantReceipt = (element) => {
|
|
261
|
-
console.log("onPrintMerchantReceipt", element);
|
|
262
263
|
onChange("print", (element == null ? void 0 : element.receipt) ? [element == null ? void 0 : element.receipt] : []);
|
|
263
264
|
setReceiptModalShow(true);
|
|
264
265
|
setReceiptModalData(element == null ? void 0 : element.receipt);
|
|
265
266
|
};
|
|
266
267
|
const onPrintCustomerReceipt = (element) => {
|
|
267
|
-
console.log("onPrintCustomerReceipt", element);
|
|
268
268
|
onChange("print", (element == null ? void 0 : element.receipt) ? [element == null ? void 0 : element.receipt] : []);
|
|
269
269
|
setReceiptModalShow(true);
|
|
270
270
|
setReceiptModalData(element == null ? void 0 : element.receipt);
|
|
271
271
|
};
|
|
272
272
|
const onRetry = (element) => {
|
|
273
|
-
console.log("onRetry", element);
|
|
274
273
|
onChange("page", "pay");
|
|
274
|
+
const { customAction, ...restCustom } = custom || {};
|
|
275
275
|
const _params = {
|
|
276
|
-
...
|
|
276
|
+
...restCustom,
|
|
277
277
|
// 自定义参数需要重新传递
|
|
278
278
|
mode,
|
|
279
279
|
name,
|
|
@@ -286,7 +286,6 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
286
286
|
};
|
|
287
287
|
const onTransactionComplete = (element) => {
|
|
288
288
|
var _a, _b, _c;
|
|
289
|
-
console.log("onTransactionComplete", element);
|
|
290
289
|
const { paymentStatus, response, merchantReceipt, customerReceipt } = element._extra || {};
|
|
291
290
|
if (paymentStatus === import_types.EPaymentStatus.Success) {
|
|
292
291
|
const receipt = [];
|
|
@@ -326,7 +325,6 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
326
325
|
}
|
|
327
326
|
};
|
|
328
327
|
const onSubmitToAPI = (element, extra) => {
|
|
329
|
-
updateToLoading();
|
|
330
328
|
const inputValues = (extra == null ? void 0 : extra.inputValues) || {};
|
|
331
329
|
payment.action(
|
|
332
330
|
{ submit_url: element == null ? void 0 : element.submitUrl, payload: { ...inputValues } },
|
|
@@ -336,13 +334,38 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
336
334
|
const onNormalClick = (element, config) => {
|
|
337
335
|
if (element == null ? void 0 : element.submitUrl) {
|
|
338
336
|
console.log("onNormalClick_submit_url", element == null ? void 0 : element.submitUrl);
|
|
339
|
-
updateToLoading();
|
|
340
337
|
payment.action({ submit_url: element == null ? void 0 : element.submitUrl }, config);
|
|
341
338
|
} else {
|
|
342
339
|
console.log("onNormalClick_no_submit_url", element);
|
|
343
340
|
}
|
|
344
341
|
};
|
|
342
|
+
const shouldLockElementClick = (element) => {
|
|
343
|
+
const lockKeys = [
|
|
344
|
+
import_types2.EButtonKeyType.DeclineSignature,
|
|
345
|
+
import_types2.EButtonKeyType.ApproveSignature,
|
|
346
|
+
import_types2.EButtonKeyType.RetryTransaction,
|
|
347
|
+
import_types2.EButtonKeyType.SubmitToAPI,
|
|
348
|
+
import_types2.EButtonKeyType.CallTestFunction
|
|
349
|
+
];
|
|
350
|
+
return lockKeys.includes(element.key);
|
|
351
|
+
};
|
|
352
|
+
const lockElementClick = () => {
|
|
353
|
+
clickLockedRef.current = true;
|
|
354
|
+
clickUnlockTimerRef.current = setTimeout(() => {
|
|
355
|
+
clickLockedRef.current = false;
|
|
356
|
+
clickUnlockTimerRef.current = null;
|
|
357
|
+
}, 1e3);
|
|
358
|
+
};
|
|
345
359
|
const onElementClick = (element, extra) => {
|
|
360
|
+
if (shouldLockElementClick(element)) {
|
|
361
|
+
if (clickLockedRef.current) {
|
|
362
|
+
import_payLog.default.log(`忽略重复点击${(element == null ? void 0 : element.key) || "未知"}按钮`);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
lockElementClick();
|
|
366
|
+
dispatch((0, import_store2.updateCustom)({ customAction: {} }));
|
|
367
|
+
updateToLoading();
|
|
368
|
+
}
|
|
346
369
|
console.log("onElementClick", element, extra);
|
|
347
370
|
import_payLog.default.log(`点击${(element == null ? void 0 : element.key) || "未知"}按钮`);
|
|
348
371
|
switch (element.key) {
|
|
@@ -393,9 +416,9 @@ var AggregatePayment = ({ onChange }) => {
|
|
|
393
416
|
import_Action.default,
|
|
394
417
|
{
|
|
395
418
|
data: custom == null ? void 0 : custom.customAction,
|
|
396
|
-
showMessage: status === import_const.StatusEnum.Loading,
|
|
397
419
|
onClick: onElementClick,
|
|
398
|
-
cancelDisabled
|
|
420
|
+
cancelDisabled,
|
|
421
|
+
isLoading: status === import_const.StatusEnum.Loading
|
|
399
422
|
}
|
|
400
423
|
) : null), receiptModalShow ? /* @__PURE__ */ import_react.default.createElement(
|
|
401
424
|
import_materials.PisellModal,
|
|
@@ -299,8 +299,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
299
299
|
amount?: string | number | undefined;
|
|
300
300
|
mode?: "pay" | "refund" | "fullPay" | "query" | undefined;
|
|
301
301
|
order_id?: string | number | undefined;
|
|
302
|
-
eftpos?: "stripe" | "tyro" | "
|
|
303
|
-
action?: "
|
|
302
|
+
eftpos?: "stripe" | "tyro" | "windcave" | "mx51" | "payo" | "linkly" | "huifu" | undefined;
|
|
303
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
304
304
|
key?: number | undefined;
|
|
305
305
|
step?: number | undefined;
|
|
306
306
|
title?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.68",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@react-spring/web": "^9.6.1",
|
|
63
63
|
"@use-gesture/react": "^10.3.1",
|
|
64
64
|
"@pisell/utils": "3.0.2",
|
|
65
|
-
"@pisell/
|
|
65
|
+
"@pisell/materials": "6.6.17",
|
|
66
66
|
"@pisell/icon": "0.0.11",
|
|
67
|
-
"@pisell/
|
|
67
|
+
"@pisell/date-picker": "3.0.7"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"react": "^18.0.0",
|