pay-sdk-react 1.1.1 → 1.1.2
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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/es/Alipay/alipay-modal.js +1 -1
- package/dist/es/Alipay/interface.d.ts +7 -9
- package/dist/es/Button/interface.d.ts +4 -0
- package/dist/es/MAlipay/m-alipay-button.js +22 -11
- package/dist/es/MWeChat/m-wechat-button.js +23 -11
- package/dist/es/confirm-modal/index.d.ts +3 -3
- package/dist/es/confirm-modal/index.js +34 -15
- package/dist/es/index.d.ts +1 -1
- package/dist/es/pay-modal/interface.d.ts +8 -18
- package/dist/es/pay-modal/pay-modal.js +26 -12
- package/dist/lib/Alipay/alipay-modal.js +1 -1
- package/dist/lib/MAlipay/m-alipay-button.js +22 -11
- package/dist/lib/MWeChat/m-wechat-button.js +23 -11
- package/dist/lib/confirm-modal/index.js +30 -11
- package/dist/lib/pay-modal/pay-modal.js +26 -12
- package/dist/umd/pay-sdk-react.umd.js +45 -23
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ All components are written in TypeScript, ensuring type safety and an excellent
|
|
|
20
20
|
Supports payment buttons, modals, QR codes, forms, popups, modals, overlays, and more. Flexible combinations to suit various business scenarios.
|
|
21
21
|
|
|
22
22
|
# Install
|
|
23
|
-
|
|
23
|
+
[npm package](https://www.npmjs.com/package/pay-sdk-react)
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
# With npm
|
package/README.zh-CN.md
CHANGED
|
@@ -39,7 +39,7 @@ const AlipayModal = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
39
39
|
}
|
|
40
40
|
onClose === null || onClose === void 0 || onClose();
|
|
41
41
|
}
|
|
42
|
-
}, others),
|
|
42
|
+
}, others), _alipayProps && /*#__PURE__*/React.createElement(Alipay, _alipayProps));
|
|
43
43
|
});
|
|
44
44
|
AlipayModal.displayName = 'AlipayModal';
|
|
45
45
|
export default /*#__PURE__*/memo(AlipayModal);
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PayModalProps } from '../pay-modal';
|
|
3
3
|
import { ButtonProps, ButtonRef } from '../Button';
|
|
4
|
-
export interface AlipayProps
|
|
4
|
+
export interface AlipayProps {
|
|
5
|
+
/**
|
|
6
|
+
* @zh 支付宝支付 html 字符串,必须包含自动提交脚本
|
|
7
|
+
* @en Alipay payment html string, must contain auto submit script
|
|
8
|
+
*/
|
|
9
|
+
formHtml: string;
|
|
5
10
|
/**
|
|
6
11
|
* @zh 下方提示文字,可选,传 null/undefined/空字符串则不显示
|
|
7
12
|
* @en Below prompt text, optional, if null/undefined/empty string, it will not be displayed
|
|
@@ -48,18 +53,11 @@ export interface AlipayButtonProps extends ButtonProps {
|
|
|
48
53
|
modalProps?: Omit<AlipayModalProps, 'visible'>;
|
|
49
54
|
}
|
|
50
55
|
export type AlipayButtonRef = ButtonRef;
|
|
51
|
-
export interface AlipayFormData {
|
|
52
|
-
/**
|
|
53
|
-
* @zh 支付宝支付 html 字符串,必须包含自动提交脚本
|
|
54
|
-
* @en Alipay payment html string, must contain auto submit script
|
|
55
|
-
*/
|
|
56
|
-
formHtml: string;
|
|
57
|
-
}
|
|
58
56
|
/**
|
|
59
57
|
* @zh 创建订单函数,返回 Paypal 所需参数
|
|
60
58
|
* @en Function to create order, returns Paypal required params
|
|
61
59
|
*/
|
|
62
|
-
export type CreateOrderAlipayFn = () => Promise<
|
|
60
|
+
export type CreateOrderAlipayFn = () => Promise<AlipayProps>;
|
|
63
61
|
export interface AlipayModalRef {
|
|
64
62
|
/**
|
|
65
63
|
* @zh 打开弹窗
|
|
@@ -64,6 +64,10 @@ export type ButtonProps = {
|
|
|
64
64
|
* @default 'default'
|
|
65
65
|
*/
|
|
66
66
|
shape?: 'default' | 'rounded' | 'rectangular';
|
|
67
|
+
/**
|
|
68
|
+
* @zh 按钮内容
|
|
69
|
+
* @en Button content
|
|
70
|
+
*/
|
|
67
71
|
children?: ReactNode;
|
|
68
72
|
} & Pick<NativeButtonProps, 'onMouseDown' | 'onMouseUp' | 'onTouchStart' | 'onTouchEnd' | 'id' | 'form'> & NativeProps;
|
|
69
73
|
export type ButtonRef = {
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
const _excluded = ["className", "children", "onClick", "formHtml", "createOrder", "displayType", "modalProps", "maskProps"],
|
|
2
|
-
_excluded2 = ["
|
|
2
|
+
_excluded2 = ["retryButtonProps", "finishButtonProps", "onClose"],
|
|
3
3
|
_excluded3 = ["onClose"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
9
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
10
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
11
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -27,8 +32,8 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
27
32
|
others = _objectWithoutProperties(props, _excluded);
|
|
28
33
|
const _ref = modalProps || {},
|
|
29
34
|
{
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
retryButtonProps,
|
|
36
|
+
finishButtonProps,
|
|
32
37
|
onClose
|
|
33
38
|
} = _ref,
|
|
34
39
|
modalPropsOthers = _objectWithoutProperties(_ref, _excluded2);
|
|
@@ -44,18 +49,20 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
44
49
|
const [showMask, setShowMask] = useState(false);
|
|
45
50
|
const [showModal, setShowModal] = useState(false);
|
|
46
51
|
useImperativeHandle(ref, () => mAlipayButtonRef.current);
|
|
47
|
-
const handleRetry = useCallback(
|
|
52
|
+
const handleRetry = useCallback(event => {
|
|
48
53
|
if (displayType === 'modal') {
|
|
49
|
-
|
|
54
|
+
var _retryButtonProps$onC;
|
|
55
|
+
retryButtonProps === null || retryButtonProps === void 0 || (_retryButtonProps$onC = retryButtonProps.onClick) === null || _retryButtonProps$onC === void 0 || _retryButtonProps$onC.call(retryButtonProps, event);
|
|
50
56
|
setShowModal(false);
|
|
51
57
|
}
|
|
52
|
-
}, [
|
|
53
|
-
const handleFinish = useCallback(
|
|
58
|
+
}, [retryButtonProps, displayType]);
|
|
59
|
+
const handleFinish = useCallback(event => {
|
|
54
60
|
if (displayType === 'modal') {
|
|
55
|
-
|
|
61
|
+
var _finishButtonProps$on;
|
|
62
|
+
finishButtonProps === null || finishButtonProps === void 0 || (_finishButtonProps$on = finishButtonProps.onClick) === null || _finishButtonProps$on === void 0 || _finishButtonProps$on.call(finishButtonProps, event);
|
|
56
63
|
setShowModal(false);
|
|
57
64
|
}
|
|
58
|
-
}, [
|
|
65
|
+
}, [finishButtonProps, displayType]);
|
|
59
66
|
const handleDisplay = useCallback(() => {
|
|
60
67
|
if (displayType === 'modal') {
|
|
61
68
|
setShowModal(true);
|
|
@@ -108,8 +115,12 @@ const MAlipayButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
108
115
|
formHtml: formHtmlString
|
|
109
116
|
}), displayType === 'modal' && formHtmlString && /*#__PURE__*/React.createElement(ConfirmModal, _extends({
|
|
110
117
|
visible: showModal,
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
retryButtonProps: _objectSpread({
|
|
119
|
+
onClick: handleRetry
|
|
120
|
+
}, omit(retryButtonProps || {}, ['onClick'])),
|
|
121
|
+
finishButtonProps: _objectSpread({
|
|
122
|
+
onClick: handleFinish
|
|
123
|
+
}, omit(finishButtonProps || {}, ['onClick'])),
|
|
113
124
|
onClose: handleOnCloseModal,
|
|
114
125
|
autoOpenWindow: false
|
|
115
126
|
}, modalPropsOthers)), showMask && formHtmlString && /*#__PURE__*/React.createElement(PayMask, _extends({
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
const _excluded = ["className", "children", "onClick", "wechatUrl", "createOrder", "displayType", "modalProps", "maskProps"],
|
|
2
|
-
_excluded2 = ["
|
|
2
|
+
_excluded2 = ["retryButtonProps", "finishButtonProps", "onClose"],
|
|
3
3
|
_excluded3 = ["onClose"];
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
9
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
5
10
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
11
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -11,6 +16,7 @@ import ConfirmModal from '../confirm-modal';
|
|
|
11
16
|
import Button from '../Button';
|
|
12
17
|
import { IconWechatPay } from '../icons';
|
|
13
18
|
import { getPrefixCls } from '../utils/getPrefixCls';
|
|
19
|
+
import omit from '../utils/omit';
|
|
14
20
|
const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
15
21
|
const {
|
|
16
22
|
className,
|
|
@@ -25,8 +31,8 @@ const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25
31
|
others = _objectWithoutProperties(props, _excluded);
|
|
26
32
|
const _ref = modalProps || {},
|
|
27
33
|
{
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
retryButtonProps,
|
|
35
|
+
finishButtonProps,
|
|
30
36
|
onClose
|
|
31
37
|
} = _ref,
|
|
32
38
|
modalPropsOthers = _objectWithoutProperties(_ref, _excluded2);
|
|
@@ -42,18 +48,20 @@ const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
42
48
|
const [showModal, setShowModal] = useState(false);
|
|
43
49
|
const [wechatUrl, setWechatUrl] = useState();
|
|
44
50
|
useImperativeHandle(ref, () => mWeChatButtonRef.current);
|
|
45
|
-
const handleRetry = useCallback(
|
|
51
|
+
const handleRetry = useCallback(event => {
|
|
46
52
|
if (displayType === 'modal') {
|
|
47
|
-
|
|
53
|
+
var _retryButtonProps$onC;
|
|
54
|
+
retryButtonProps === null || retryButtonProps === void 0 || (_retryButtonProps$onC = retryButtonProps.onClick) === null || _retryButtonProps$onC === void 0 || _retryButtonProps$onC.call(retryButtonProps, event);
|
|
48
55
|
setShowModal(false);
|
|
49
56
|
}
|
|
50
|
-
}, [
|
|
51
|
-
const handleFinish = useCallback(
|
|
57
|
+
}, [retryButtonProps, displayType]);
|
|
58
|
+
const handleFinish = useCallback(event => {
|
|
52
59
|
if (displayType === 'modal') {
|
|
53
|
-
|
|
60
|
+
var _finishButtonProps$on;
|
|
61
|
+
finishButtonProps === null || finishButtonProps === void 0 || (_finishButtonProps$on = finishButtonProps.onClick) === null || _finishButtonProps$on === void 0 || _finishButtonProps$on.call(finishButtonProps, event);
|
|
54
62
|
setShowModal(false);
|
|
55
63
|
}
|
|
56
|
-
}, [
|
|
64
|
+
}, [finishButtonProps, displayType]);
|
|
57
65
|
const handleDisplay = useCallback(() => {
|
|
58
66
|
if (displayType === 'modal') {
|
|
59
67
|
setShowModal(true);
|
|
@@ -107,8 +115,12 @@ const MWechatButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
107
115
|
}, restMaskProps)), displayType === 'modal' && showModal && wechatUrl && /*#__PURE__*/React.createElement(ConfirmModal, _extends({
|
|
108
116
|
visible: showModal,
|
|
109
117
|
onClose: handleOnCloseModal,
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
retryButtonProps: _objectSpread({
|
|
119
|
+
onClick: handleRetry
|
|
120
|
+
}, omit(retryButtonProps || {}, ['onClick'])),
|
|
121
|
+
finishButtonProps: _objectSpread({
|
|
122
|
+
onClick: handleFinish
|
|
123
|
+
}, omit(finishButtonProps || {}, ['onClick'])),
|
|
112
124
|
payUrl: wechatUrl,
|
|
113
125
|
autoOpenWindow: true
|
|
114
126
|
}, modalPropsOthers)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ConfirmModalProps } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConfirmModalProps } from './interface';
|
|
3
3
|
declare const ConfirmModal: React.FC<ConfirmModalProps>;
|
|
4
|
-
export * from
|
|
4
|
+
export * from './interface';
|
|
5
5
|
export default ConfirmModal;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const _excluded = ["children"],
|
|
2
|
+
_excluded2 = ["children"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import React, { useCallback } from 'react';
|
|
11
|
+
import { usePayWindowOpen } from '../hooks/usePayWindowOpen';
|
|
12
|
+
import PayModal from '../pay-modal';
|
|
4
13
|
const ConfirmModal = props => {
|
|
5
14
|
const {
|
|
6
15
|
visible,
|
|
7
|
-
|
|
8
|
-
onFinish,
|
|
9
|
-
title = "支付确认",
|
|
16
|
+
title = '支付确认',
|
|
10
17
|
desc = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "1. \u5982\u679C\u60A8\u5DF2\u5B8C\u6210\u652F\u4ED8\uFF0C\u8BF7\u70B9\u51FB[\u652F\u4ED8\u5B8C\u6210]"), /*#__PURE__*/React.createElement("div", null, "2. \u5982\u679C\u672A\u652F\u4ED8\u6210\u529F\uFF0C\u53EF\u70B9\u51FB[\u91CD\u65B0\u652F\u4ED8]")),
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
retryButtonProps,
|
|
19
|
+
finishButtonProps,
|
|
13
20
|
icon = /*#__PURE__*/React.createElement("span", {
|
|
14
21
|
role: "img",
|
|
15
22
|
"aria-label": "success"
|
|
@@ -19,12 +26,22 @@ const ConfirmModal = props => {
|
|
|
19
26
|
onClose,
|
|
20
27
|
payUrl,
|
|
21
28
|
autoOpenWindow = false,
|
|
22
|
-
openMode =
|
|
29
|
+
openMode = 'window'
|
|
23
30
|
} = props;
|
|
31
|
+
const _ref = retryButtonProps || {},
|
|
32
|
+
{
|
|
33
|
+
children: retryButtonChildren = '重新支付'
|
|
34
|
+
} = _ref,
|
|
35
|
+
retryButtonPropsRest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
const _ref2 = finishButtonProps || {},
|
|
37
|
+
{
|
|
38
|
+
children: finishButtonChildren = '支付完成'
|
|
39
|
+
} = _ref2,
|
|
40
|
+
finishButtonPropsRest = _objectWithoutProperties(_ref2, _excluded2);
|
|
24
41
|
const {
|
|
25
42
|
closeWindow
|
|
26
43
|
} = usePayWindowOpen({
|
|
27
|
-
payUrl: payUrl ||
|
|
44
|
+
payUrl: payUrl || '',
|
|
28
45
|
onClose,
|
|
29
46
|
autoOpen: autoOpenWindow,
|
|
30
47
|
openMode: openMode
|
|
@@ -42,11 +59,13 @@ const ConfirmModal = props => {
|
|
|
42
59
|
showClose: showClose,
|
|
43
60
|
maskClosable: maskClosable,
|
|
44
61
|
onClose: handleClose,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
retryButtonProps: _objectSpread({
|
|
63
|
+
children: retryButtonChildren
|
|
64
|
+
}, retryButtonPropsRest),
|
|
65
|
+
finishButtonProps: _objectSpread({
|
|
66
|
+
children: finishButtonChildren
|
|
67
|
+
}, finishButtonPropsRest)
|
|
49
68
|
});
|
|
50
69
|
};
|
|
51
|
-
export * from
|
|
70
|
+
export * from './interface';
|
|
52
71
|
export default ConfirmModal;
|
package/dist/es/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type { MWeChatButtonProps, MWeChatButtonRef, CreateOrderMWeChatFn, MWeCha
|
|
|
10
10
|
export { MWechatButton } from './MWeChat';
|
|
11
11
|
export type { MAlipayButtonProps, MAlipayButtonRef, CreateOrderMAlipayFn, MAlipayFormData, } from './MAlipay/interface';
|
|
12
12
|
export { default as MAlipay } from './MAlipay';
|
|
13
|
-
export type { AlipayProps, AlipayModalProps, AlipayButtonProps, AlipayButtonRef,
|
|
13
|
+
export type { AlipayProps, AlipayModalProps, AlipayButtonProps, AlipayButtonRef, AlipayModalRef, } from './Alipay/interface';
|
|
14
14
|
export { default as Alipay } from './Alipay';
|
|
15
15
|
export type { WechatProps, WechatModalProps, WechatButtonProps, WechatButtonRef, WechatModalRef, } from './Wechat/interface';
|
|
16
16
|
export { default as Wechat } from './Wechat';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { ReactNode } from
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
2
3
|
export interface PayModalProps {
|
|
3
4
|
/**
|
|
4
5
|
* @zh 是否显示弹窗
|
|
@@ -26,18 +27,17 @@ export interface PayModalProps {
|
|
|
26
27
|
*/
|
|
27
28
|
children?: React.ReactNode;
|
|
28
29
|
/**
|
|
29
|
-
* @zh
|
|
30
|
-
* @en Retry button
|
|
30
|
+
* @zh 重试按钮 props
|
|
31
|
+
* @en Retry button props
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
+
retryButtonProps?: ButtonProps;
|
|
33
34
|
/**
|
|
34
|
-
* @zh
|
|
35
|
-
* @en Finish button
|
|
35
|
+
* @zh 完成按钮 props
|
|
36
|
+
* @en Finish button props
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
finishButtonProps?: ButtonProps;
|
|
38
39
|
/**
|
|
39
40
|
* @zh 是否显示右上角关闭按钮,默认 true
|
|
40
|
-
* @en Whether to show the close button in the top right corner, default is true
|
|
41
41
|
*/
|
|
42
42
|
showClose?: boolean;
|
|
43
43
|
/**
|
|
@@ -45,16 +45,6 @@ export interface PayModalProps {
|
|
|
45
45
|
* @en Whether to close the modal when clicking the mask, default is false
|
|
46
46
|
*/
|
|
47
47
|
maskClosable?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* @zh 重试按钮回调
|
|
50
|
-
* @en Retry button callback
|
|
51
|
-
*/
|
|
52
|
-
onRetry?: () => void;
|
|
53
|
-
/**
|
|
54
|
-
* @zh 完成按钮回调
|
|
55
|
-
* @en Finish button callback
|
|
56
|
-
*/
|
|
57
|
-
onFinish?: () => void;
|
|
58
48
|
/**
|
|
59
49
|
* @zh 关闭弹窗回调
|
|
60
50
|
* @en Close modal callback
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
const _excluded = ["className", "children"],
|
|
2
|
+
_excluded2 = ["className", "children"];
|
|
3
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
5
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
1
6
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
2
7
|
import ReactDOM from 'react-dom';
|
|
3
8
|
import { isFunction } from '../utils/is';
|
|
@@ -5,19 +10,18 @@ import cs from '../utils/classNames';
|
|
|
5
10
|
import { useLockScroll } from '../hooks/use-lock-scroll';
|
|
6
11
|
import { clientDocument } from '../utils/dom';
|
|
7
12
|
import { getPrefixCls } from '../utils/getPrefixCls';
|
|
13
|
+
import Button from '../Button';
|
|
8
14
|
const classPrefix = getPrefixCls('modal');
|
|
9
15
|
const PayModal = props => {
|
|
10
16
|
const {
|
|
11
17
|
visible,
|
|
12
18
|
title,
|
|
13
19
|
desc,
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
retryButtonProps,
|
|
21
|
+
finishButtonProps,
|
|
16
22
|
icon,
|
|
17
23
|
showClose = true,
|
|
18
24
|
maskClosable = false,
|
|
19
|
-
onRetry,
|
|
20
|
-
onFinish,
|
|
21
25
|
onClose,
|
|
22
26
|
children,
|
|
23
27
|
footer,
|
|
@@ -27,6 +31,18 @@ const PayModal = props => {
|
|
|
27
31
|
contentStyle,
|
|
28
32
|
container
|
|
29
33
|
} = props;
|
|
34
|
+
const _ref = retryButtonProps || {},
|
|
35
|
+
{
|
|
36
|
+
className: retryButtonClassName,
|
|
37
|
+
children: retryButtonChildren = '重新支付'
|
|
38
|
+
} = _ref,
|
|
39
|
+
retryButtonPropsRest = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
const _ref2 = finishButtonProps || {},
|
|
41
|
+
{
|
|
42
|
+
className: finishButtonClassName,
|
|
43
|
+
children: finishButtonChildren = '支付完成'
|
|
44
|
+
} = _ref2,
|
|
45
|
+
finishButtonPropsRest = _objectWithoutProperties(_ref2, _excluded2);
|
|
30
46
|
const el = useRef(clientDocument === null || clientDocument === void 0 ? void 0 : clientDocument.createElement('div'));
|
|
31
47
|
const ref = useRef(null);
|
|
32
48
|
useLockScroll(ref, !!visible);
|
|
@@ -51,14 +67,12 @@ const PayModal = props => {
|
|
|
51
67
|
}, [maskClosable, onClose]);
|
|
52
68
|
const renderFooter = () => {
|
|
53
69
|
if (footer === null) return;
|
|
54
|
-
const retryButtonNode = /*#__PURE__*/React.createElement(
|
|
55
|
-
className: "".concat(classPrefix, "__btn "
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
onClick: onFinish
|
|
61
|
-
}, finishText);
|
|
70
|
+
const retryButtonNode = /*#__PURE__*/React.createElement(Button, _extends({
|
|
71
|
+
className: cs("".concat(classPrefix, "__btn"), "".concat(classPrefix, "__btn--retry"), retryButtonClassName)
|
|
72
|
+
}, retryButtonPropsRest), retryButtonChildren);
|
|
73
|
+
const finishButtonNode = /*#__PURE__*/React.createElement(Button, _extends({
|
|
74
|
+
className: cs("".concat(classPrefix, "__btn"), "".concat(classPrefix, "__btn--finish"), finishButtonClassName)
|
|
75
|
+
}, finishButtonPropsRest), finishButtonChildren);
|
|
62
76
|
const footerContent = isFunction(footer) ? footer(retryButtonNode, finishButtonNode) : footer || /*#__PURE__*/React.createElement(React.Fragment, null, retryButtonNode, finishButtonNode);
|
|
63
77
|
return /*#__PURE__*/React.createElement("div", {
|
|
64
78
|
className: "".concat(classPrefix, "__actions")
|
|
@@ -47,7 +47,7 @@ const AlipayModal = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
47
47
|
}
|
|
48
48
|
onClose === null || onClose === void 0 || onClose();
|
|
49
49
|
}
|
|
50
|
-
}, others),
|
|
50
|
+
}, others), _alipayProps && /*#__PURE__*/_react.default.createElement(_alipay.default, _alipayProps));
|
|
51
51
|
});
|
|
52
52
|
AlipayModal.displayName = 'AlipayModal';
|
|
53
53
|
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(AlipayModal);
|
|
@@ -14,10 +14,15 @@ var _Button = _interopRequireDefault(require("../Button"));
|
|
|
14
14
|
var _icons = require("../icons");
|
|
15
15
|
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
16
16
|
const _excluded = ["className", "children", "onClick", "formHtml", "createOrder", "displayType", "modalProps", "maskProps"],
|
|
17
|
-
_excluded2 = ["
|
|
17
|
+
_excluded2 = ["retryButtonProps", "finishButtonProps", "onClose"],
|
|
18
18
|
_excluded3 = ["onClose"];
|
|
19
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
26
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
22
27
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
23
28
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -35,8 +40,8 @@ const MAlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
35
40
|
others = _objectWithoutProperties(props, _excluded);
|
|
36
41
|
const _ref = modalProps || {},
|
|
37
42
|
{
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
retryButtonProps,
|
|
44
|
+
finishButtonProps,
|
|
40
45
|
onClose
|
|
41
46
|
} = _ref,
|
|
42
47
|
modalPropsOthers = _objectWithoutProperties(_ref, _excluded2);
|
|
@@ -52,18 +57,20 @@ const MAlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
52
57
|
const [showMask, setShowMask] = (0, _react.useState)(false);
|
|
53
58
|
const [showModal, setShowModal] = (0, _react.useState)(false);
|
|
54
59
|
(0, _react.useImperativeHandle)(ref, () => mAlipayButtonRef.current);
|
|
55
|
-
const handleRetry = (0, _react.useCallback)(
|
|
60
|
+
const handleRetry = (0, _react.useCallback)(event => {
|
|
56
61
|
if (displayType === 'modal') {
|
|
57
|
-
|
|
62
|
+
var _retryButtonProps$onC;
|
|
63
|
+
retryButtonProps === null || retryButtonProps === void 0 || (_retryButtonProps$onC = retryButtonProps.onClick) === null || _retryButtonProps$onC === void 0 || _retryButtonProps$onC.call(retryButtonProps, event);
|
|
58
64
|
setShowModal(false);
|
|
59
65
|
}
|
|
60
|
-
}, [
|
|
61
|
-
const handleFinish = (0, _react.useCallback)(
|
|
66
|
+
}, [retryButtonProps, displayType]);
|
|
67
|
+
const handleFinish = (0, _react.useCallback)(event => {
|
|
62
68
|
if (displayType === 'modal') {
|
|
63
|
-
|
|
69
|
+
var _finishButtonProps$on;
|
|
70
|
+
finishButtonProps === null || finishButtonProps === void 0 || (_finishButtonProps$on = finishButtonProps.onClick) === null || _finishButtonProps$on === void 0 || _finishButtonProps$on.call(finishButtonProps, event);
|
|
64
71
|
setShowModal(false);
|
|
65
72
|
}
|
|
66
|
-
}, [
|
|
73
|
+
}, [finishButtonProps, displayType]);
|
|
67
74
|
const handleDisplay = (0, _react.useCallback)(() => {
|
|
68
75
|
if (displayType === 'modal') {
|
|
69
76
|
setShowModal(true);
|
|
@@ -116,8 +123,12 @@ const MAlipayButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
116
123
|
formHtml: formHtmlString
|
|
117
124
|
}), displayType === 'modal' && formHtmlString && /*#__PURE__*/_react.default.createElement(_confirmModal.default, _extends({
|
|
118
125
|
visible: showModal,
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
retryButtonProps: _objectSpread({
|
|
127
|
+
onClick: handleRetry
|
|
128
|
+
}, (0, _omit.default)(retryButtonProps || {}, ['onClick'])),
|
|
129
|
+
finishButtonProps: _objectSpread({
|
|
130
|
+
onClick: handleFinish
|
|
131
|
+
}, (0, _omit.default)(finishButtonProps || {}, ['onClick'])),
|
|
121
132
|
onClose: handleOnCloseModal,
|
|
122
133
|
autoOpenWindow: false
|
|
123
134
|
}, modalPropsOthers)), showMask && formHtmlString && /*#__PURE__*/_react.default.createElement(_PayMask.default, _extends({
|
|
@@ -11,11 +11,17 @@ var _confirmModal = _interopRequireDefault(require("../confirm-modal"));
|
|
|
11
11
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
12
12
|
var _icons = require("../icons");
|
|
13
13
|
var _getPrefixCls = require("../utils/getPrefixCls");
|
|
14
|
+
var _omit = _interopRequireDefault(require("../utils/omit"));
|
|
14
15
|
const _excluded = ["className", "children", "onClick", "wechatUrl", "createOrder", "displayType", "modalProps", "maskProps"],
|
|
15
|
-
_excluded2 = ["
|
|
16
|
+
_excluded2 = ["retryButtonProps", "finishButtonProps", "onClose"],
|
|
16
17
|
_excluded3 = ["onClose"];
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
25
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
26
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
21
27
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
@@ -33,8 +39,8 @@ const MWechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
33
39
|
others = _objectWithoutProperties(props, _excluded);
|
|
34
40
|
const _ref = modalProps || {},
|
|
35
41
|
{
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
retryButtonProps,
|
|
43
|
+
finishButtonProps,
|
|
38
44
|
onClose
|
|
39
45
|
} = _ref,
|
|
40
46
|
modalPropsOthers = _objectWithoutProperties(_ref, _excluded2);
|
|
@@ -50,18 +56,20 @@ const MWechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
50
56
|
const [showModal, setShowModal] = (0, _react.useState)(false);
|
|
51
57
|
const [wechatUrl, setWechatUrl] = (0, _react.useState)();
|
|
52
58
|
(0, _react.useImperativeHandle)(ref, () => mWeChatButtonRef.current);
|
|
53
|
-
const handleRetry = (0, _react.useCallback)(
|
|
59
|
+
const handleRetry = (0, _react.useCallback)(event => {
|
|
54
60
|
if (displayType === 'modal') {
|
|
55
|
-
|
|
61
|
+
var _retryButtonProps$onC;
|
|
62
|
+
retryButtonProps === null || retryButtonProps === void 0 || (_retryButtonProps$onC = retryButtonProps.onClick) === null || _retryButtonProps$onC === void 0 || _retryButtonProps$onC.call(retryButtonProps, event);
|
|
56
63
|
setShowModal(false);
|
|
57
64
|
}
|
|
58
|
-
}, [
|
|
59
|
-
const handleFinish = (0, _react.useCallback)(
|
|
65
|
+
}, [retryButtonProps, displayType]);
|
|
66
|
+
const handleFinish = (0, _react.useCallback)(event => {
|
|
60
67
|
if (displayType === 'modal') {
|
|
61
|
-
|
|
68
|
+
var _finishButtonProps$on;
|
|
69
|
+
finishButtonProps === null || finishButtonProps === void 0 || (_finishButtonProps$on = finishButtonProps.onClick) === null || _finishButtonProps$on === void 0 || _finishButtonProps$on.call(finishButtonProps, event);
|
|
62
70
|
setShowModal(false);
|
|
63
71
|
}
|
|
64
|
-
}, [
|
|
72
|
+
}, [finishButtonProps, displayType]);
|
|
65
73
|
const handleDisplay = (0, _react.useCallback)(() => {
|
|
66
74
|
if (displayType === 'modal') {
|
|
67
75
|
setShowModal(true);
|
|
@@ -115,8 +123,12 @@ const MWechatButton = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
|
115
123
|
}, restMaskProps)), displayType === 'modal' && showModal && wechatUrl && /*#__PURE__*/_react.default.createElement(_confirmModal.default, _extends({
|
|
116
124
|
visible: showModal,
|
|
117
125
|
onClose: handleOnCloseModal,
|
|
118
|
-
|
|
119
|
-
|
|
126
|
+
retryButtonProps: _objectSpread({
|
|
127
|
+
onClick: handleRetry
|
|
128
|
+
}, (0, _omit.default)(retryButtonProps || {}, ['onClick'])),
|
|
129
|
+
finishButtonProps: _objectSpread({
|
|
130
|
+
onClick: handleFinish
|
|
131
|
+
}, (0, _omit.default)(finishButtonProps || {}, ['onClick'])),
|
|
120
132
|
payUrl: wechatUrl,
|
|
121
133
|
autoOpenWindow: true
|
|
122
134
|
}, modalPropsOthers)));
|