component-sanzhizhou 1.0.13 → 1.0.14
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 +9 -0
- package/dist/Buy/qr.js +5 -4
- package/dist/UI/LoadError.js +2 -1
- package/dist/UI/Money/index.css.d.ts +1 -1
- package/dist/UI/Money/index.css.js +2 -2
- package/dist/UI/Money/index.d.ts +1 -0
- package/dist/UI/Money/index.js +2 -0
- package/dist/lib/formatMessage.js +3 -0
- package/dist/locales/ar-EG.json +20 -1
- package/dist/locales/de-DE.json +20 -1
- package/dist/locales/en-US.json +20 -1
- package/dist/locales/es-ES.json +20 -1
- package/dist/locales/fr-FR.json +20 -1
- package/dist/locales/it-IT.json +20 -1
- package/dist/locales/ja-JP.json +20 -1
- package/dist/locales/ko-KR.json +20 -1
- package/dist/locales/pt-PT.json +20 -1
- package/dist/locales/ru-RU.json +20 -1
- package/dist/locales/th-TH.json +20 -1
- package/dist/locales/vi-VN.json +20 -1
- package/dist/locales/zh-CN.json +20 -1
- package/dist/locales/zh-HK.json +20 -1
- package/dist/locales/zh-TW.json +20 -1
- package/dist/pay/qr-wechat.js +3 -2
- package/dist/pay/qr.js +38 -29
- package/dist/pay/recharge-moneyAmount-alt.d.ts +8 -0
- package/dist/pay/recharge-moneyAmount-alt.js +56 -0
- package/dist/pay/recharge-moneyAmount-alt.less +27 -0
- package/dist/pay/recharge-rule.d.ts +10 -0
- package/dist/pay/recharge-rule.js +87 -0
- package/dist/pay/recharge-rule.less +59 -0
- package/dist/pay/recharge.css.js +1 -1
- package/dist/pay/recharge.d.ts +1 -0
- package/dist/pay/recharge.js +54 -29
- package/dist/service/api/RechargeRuleController.d.ts +3 -0
- package/dist/service/api/RechargeRuleController.js +27 -0
- package/dist/service/api/WechatMinAppController.d.ts +5 -0
- package/dist/service/api/WechatMinAppController.js +27 -0
- package/dist/types/Pay.d.ts +1 -1
- package/dist/types/RechargeRule.d.ts +9 -0
- package/dist/types/RechargeRule.js +0 -0
- package/dist/types/WechatMinApp.d.ts +5 -0
- package/dist/types/WechatMinApp.js +0 -0
- package/package.json +1 -1
package/dist/pay/qr.js
CHANGED
|
@@ -2,9 +2,13 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { Button, Divider, QRCode, Spin } from 'antd';
|
|
4
4
|
import "./qr.less";
|
|
5
|
+
import { useRequest } from "@umijs/hooks";
|
|
5
6
|
import { CheckCircleOutlined, ReloadOutlined } from "@ant-design/icons";
|
|
6
7
|
import Tool from "../lib/Tool";
|
|
7
8
|
import CallMiniUrl from "../lib/call-mini-url";
|
|
9
|
+
import formatMessage from "../lib/formatMessage";
|
|
10
|
+
import * as WechatMinAppController from "../service/api/WechatMinAppController";
|
|
11
|
+
import { getApiEnv } from "../lib/getApiUrl";
|
|
8
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
14
|
// type QrDict = Record<Global.Env, string>;
|
|
@@ -51,24 +55,26 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
51
55
|
setQrUrl(qrUrl);
|
|
52
56
|
setQrStatus('active');
|
|
53
57
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
var _useRequest = useRequest(function () {
|
|
59
|
+
return WechatMinAppController.getUrlLink({
|
|
60
|
+
pagePath: 'pages/recharge/index',
|
|
61
|
+
pathQuery: "moneyAmount=".concat(moneyAmount),
|
|
62
|
+
envVersion: getApiEnv() === 'local' ? "develop" : 'release'
|
|
63
|
+
}, {
|
|
64
|
+
env: env
|
|
65
|
+
});
|
|
66
|
+
}, {
|
|
67
|
+
manual: true,
|
|
68
|
+
onSuccess: function onSuccess(result) {
|
|
69
|
+
setQrUrl(result.url);
|
|
70
|
+
setQrStatus('active');
|
|
71
|
+
},
|
|
72
|
+
onError: function onError(e) {
|
|
73
|
+
setQrStatus('expired');
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
runWechatMinApp = _useRequest.run,
|
|
77
|
+
loadingWechatMinApp = _useRequest.loading;
|
|
72
78
|
var onInit = function onInit() {
|
|
73
79
|
// const qrUrlBase = QrDict[ getEnv() ] || QrDict.prod;
|
|
74
80
|
// const data = JSON.stringify({
|
|
@@ -84,11 +90,14 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
84
90
|
// console.log('recharge qr:', qrUrl );
|
|
85
91
|
// setQrUrl( qrUrl );
|
|
86
92
|
// setQrStatus('active');
|
|
87
|
-
|
|
93
|
+
if (selectPayChannel.name === 'wepay') {
|
|
94
|
+
runWechatMinApp();
|
|
95
|
+
} else if (selectPayChannel.name === 'alipay') {
|
|
96
|
+
makeQrUrl();
|
|
97
|
+
}
|
|
88
98
|
};
|
|
89
99
|
var getPaymentQr = function getPaymentQr() {
|
|
90
|
-
|
|
91
|
-
// run();
|
|
100
|
+
runWechatMinApp();
|
|
92
101
|
};
|
|
93
102
|
useEffect(function () {
|
|
94
103
|
onInit();
|
|
@@ -98,7 +107,7 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
98
107
|
children: [/*#__PURE__*/_jsxs(Divider, {
|
|
99
108
|
orientation: "center",
|
|
100
109
|
className: "ssz-altBox",
|
|
101
|
-
children: [
|
|
110
|
+
children: [formatMessage('扫码支付'), /*#__PURE__*/_jsxs("span", {
|
|
102
111
|
className: "ssz-qr-moneyAmountBox",
|
|
103
112
|
children: [/*#__PURE__*/_jsx("small", {
|
|
104
113
|
children: "\xA5"
|
|
@@ -106,7 +115,7 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
106
115
|
className: "ssz-qr-moneyAmount",
|
|
107
116
|
children: moneyAmount
|
|
108
117
|
}), /*#__PURE__*/_jsx("small", {
|
|
109
|
-
children:
|
|
118
|
+
children: formatMessage('元')
|
|
110
119
|
})]
|
|
111
120
|
})]
|
|
112
121
|
}), /*#__PURE__*/_jsxs("div", {
|
|
@@ -119,7 +128,7 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
119
128
|
style: {
|
|
120
129
|
color: selectPayChannel.color
|
|
121
130
|
},
|
|
122
|
-
children: [selectPayChannel.icon, " ", selectPayChannel.label]
|
|
131
|
+
children: [selectPayChannel.icon, " ", formatMessage(selectPayChannel.label)]
|
|
123
132
|
}), /*#__PURE__*/_jsx("div", {
|
|
124
133
|
className: "ssz-qrImageWarp",
|
|
125
134
|
children: /*#__PURE__*/_jsx(QRCode, {
|
|
@@ -127,7 +136,7 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
127
136
|
color: selectPayChannel.color,
|
|
128
137
|
bgColor: "#FFF",
|
|
129
138
|
size: size,
|
|
130
|
-
value: qrUrl || '内容为空',
|
|
139
|
+
value: qrUrl || formatMessage('内容为空'),
|
|
131
140
|
status: qrStatus,
|
|
132
141
|
errorLevel: "L",
|
|
133
142
|
statusRender: function statusRender(info) {
|
|
@@ -138,12 +147,12 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
138
147
|
}
|
|
139
148
|
if (info.status === 'scanned') {
|
|
140
149
|
return /*#__PURE__*/_jsxs("div", {
|
|
141
|
-
children: [/*#__PURE__*/_jsx(CheckCircleOutlined, {}), "
|
|
150
|
+
children: [/*#__PURE__*/_jsx(CheckCircleOutlined, {}), " ", formatMessage('已扫码')]
|
|
142
151
|
});
|
|
143
152
|
}
|
|
144
153
|
if (info.status === 'expired') {
|
|
145
154
|
return /*#__PURE__*/_jsxs("div", {
|
|
146
|
-
children: [
|
|
155
|
+
children: [formatMessage('已经过期'), /*#__PURE__*/_jsx("div", {
|
|
147
156
|
style: {
|
|
148
157
|
paddingTop: 18
|
|
149
158
|
},
|
|
@@ -151,7 +160,7 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
151
160
|
type: "link",
|
|
152
161
|
icon: /*#__PURE__*/_jsx(ReloadOutlined, {}),
|
|
153
162
|
onClick: getPaymentQr,
|
|
154
|
-
children:
|
|
163
|
+
children: formatMessage('刷新')
|
|
155
164
|
})
|
|
156
165
|
})]
|
|
157
166
|
});
|
|
@@ -161,7 +170,7 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
161
170
|
})
|
|
162
171
|
}), /*#__PURE__*/_jsx("div", {
|
|
163
172
|
className: "ssz-alt",
|
|
164
|
-
children:
|
|
173
|
+
children: formatMessage('扫码支付')
|
|
165
174
|
})]
|
|
166
175
|
})]
|
|
167
176
|
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import "./recharge-moneyAmount-alt.less";
|
|
4
|
+
import formatMessage from "../lib/formatMessage";
|
|
5
|
+
import Money from "../UI/Money";
|
|
6
|
+
import { PlusOutlined } from "@ant-design/icons";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
var PayRechargeMoneyAmountAlt = function PayRechargeMoneyAmountAlt(_ref) {
|
|
10
|
+
var moneyAmount = _ref.moneyAmount,
|
|
11
|
+
_ref$rechargeRuleList = _ref.rechargeRuleList,
|
|
12
|
+
rechargeRuleList = _ref$rechargeRuleList === void 0 ? [] : _ref$rechargeRuleList;
|
|
13
|
+
var _useState = useState(0),
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
giveMoney = _useState2[0],
|
|
16
|
+
setGiveMoney = _useState2[1];
|
|
17
|
+
var onInputChange = function onInputChange(moneyAmount, rechargeRuleList) {
|
|
18
|
+
if (moneyAmount <= 0 || !rechargeRuleList || rechargeRuleList.length <= 0) {
|
|
19
|
+
return setGiveMoney(0);
|
|
20
|
+
}
|
|
21
|
+
var matchIndex = -1;
|
|
22
|
+
rechargeRuleList.forEach(function (item, i) {
|
|
23
|
+
if (moneyAmount >= item.rechargeMoney) {
|
|
24
|
+
matchIndex = i;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
if (matchIndex < 0) {
|
|
28
|
+
return setGiveMoney(-1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 计算比例: 3 * 充 / ( 充 + 送 );
|
|
32
|
+
var itemData = rechargeRuleList[matchIndex];
|
|
33
|
+
var ratio = itemData.giveMoney / itemData.rechargeMoney;
|
|
34
|
+
var giveMoney = Math.ceil(moneyAmount * ratio);
|
|
35
|
+
console.log('ratio:', ratio, giveMoney);
|
|
36
|
+
setGiveMoney(giveMoney);
|
|
37
|
+
};
|
|
38
|
+
useEffect(function () {
|
|
39
|
+
onInputChange(moneyAmount, rechargeRuleList);
|
|
40
|
+
}, [moneyAmount, rechargeRuleList]);
|
|
41
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
42
|
+
className: "ssz-recharge-form-moneyAmount-input",
|
|
43
|
+
children: [formatMessage('元'), giveMoney > 0 && /*#__PURE__*/_jsxs("div", {
|
|
44
|
+
className: "ssz-recharge-form-moneyAmount-input-bonus",
|
|
45
|
+
children: [/*#__PURE__*/_jsxs("span", {
|
|
46
|
+
className: "ssz-recharge-form-moneyAmount-input-bonus-payRechargeRule",
|
|
47
|
+
children: [/*#__PURE__*/_jsx(PlusOutlined, {}), " ", formatMessage('送')]
|
|
48
|
+
}), /*#__PURE__*/_jsx(Money, {
|
|
49
|
+
value: giveMoney,
|
|
50
|
+
className: "ssz-recharge-form-moneyAmount-input-money",
|
|
51
|
+
end: formatMessage('元')
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
export default PayRechargeMoneyAmountAlt;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.ssz-recharge-form-moneyAmount-input{
|
|
2
|
+
position: relative;
|
|
3
|
+
.ssz-recharge-form-moneyAmount-input-bonus{
|
|
4
|
+
position: absolute;
|
|
5
|
+
top: -5px;
|
|
6
|
+
left: 70px;
|
|
7
|
+
}
|
|
8
|
+
.ssz-recharge-form-moneyAmount-input-bonus-payRechargeRule{
|
|
9
|
+
display: inline-block;
|
|
10
|
+
color: #FFF;
|
|
11
|
+
padding: 0 8px;
|
|
12
|
+
margin: 0 10px 0 0;
|
|
13
|
+
line-height: 24px;
|
|
14
|
+
text-align: center;
|
|
15
|
+
background-color: #F60;
|
|
16
|
+
border-radius: 100px;
|
|
17
|
+
vertical-align: middle;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
}
|
|
20
|
+
.ssz-recharge-form-moneyAmount-input-money{
|
|
21
|
+
font-size: 16px;
|
|
22
|
+
vertical-align: middle;
|
|
23
|
+
.value{
|
|
24
|
+
color: #F60;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './recharge-rule.less';
|
|
3
|
+
interface Props {
|
|
4
|
+
formItemSpan?: number;
|
|
5
|
+
env?: Global.Env;
|
|
6
|
+
money: number;
|
|
7
|
+
onList: (list: RechargeRule.List[]) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const RechargeRule: React.FC<Props>;
|
|
10
|
+
export default RechargeRule;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import "./recharge-rule.less";
|
|
5
|
+
import PageContentWarp from "../UI/PageContentWarp";
|
|
6
|
+
import { useRequest } from "@umijs/hooks";
|
|
7
|
+
import * as RechargeRuleController from "../service/api/RechargeRuleController";
|
|
8
|
+
import { Card, Form } from "antd";
|
|
9
|
+
import Money from "../UI/Money";
|
|
10
|
+
import formatMessage from "../lib/formatMessage";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
var RechargeRule = function RechargeRule(_ref) {
|
|
15
|
+
var formItemSpan = _ref.formItemSpan,
|
|
16
|
+
env = _ref.env,
|
|
17
|
+
money = _ref.money,
|
|
18
|
+
onList = _ref.onList;
|
|
19
|
+
var _useState = useState([]),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
listData = _useState2[0],
|
|
22
|
+
setListData = _useState2[1];
|
|
23
|
+
var _useRequest = useRequest(function () {
|
|
24
|
+
return RechargeRuleController.list({}, {
|
|
25
|
+
env: env
|
|
26
|
+
});
|
|
27
|
+
}, {
|
|
28
|
+
onSuccess: function onSuccess(result) {
|
|
29
|
+
result.sort(function (a, b) {
|
|
30
|
+
return a.rechargeMoney - b.rechargeMoney;
|
|
31
|
+
});
|
|
32
|
+
setListData(_toConsumableArray(result));
|
|
33
|
+
onList(_toConsumableArray(result));
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
loading = _useRequest.loading,
|
|
37
|
+
run = _useRequest.run,
|
|
38
|
+
error = _useRequest.error;
|
|
39
|
+
return /*#__PURE__*/_jsx(PageContentWarp, {
|
|
40
|
+
loading: loading,
|
|
41
|
+
error: error,
|
|
42
|
+
onReload: run,
|
|
43
|
+
className: "ssz-payRechargeRule",
|
|
44
|
+
children: listData.length > 0 && /*#__PURE__*/_jsx(_Fragment, {
|
|
45
|
+
children: /*#__PURE__*/_jsx(Form.Item, {
|
|
46
|
+
label: formatMessage('充值就送'),
|
|
47
|
+
labelCol: {
|
|
48
|
+
span: formItemSpan
|
|
49
|
+
},
|
|
50
|
+
children: /*#__PURE__*/_jsx(Card, {
|
|
51
|
+
size: "small",
|
|
52
|
+
className: "ssz-payRechargeRule-card",
|
|
53
|
+
children: listData.map(function (item) {
|
|
54
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
55
|
+
className: "ssz-payRechargeRule-items",
|
|
56
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
57
|
+
className: "ssz-payRechargeRule-items-rechargeMoney",
|
|
58
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
59
|
+
className: "ssz-payRechargeRule-items-label",
|
|
60
|
+
children: formatMessage('充值')
|
|
61
|
+
}), /*#__PURE__*/_jsx(Money, {
|
|
62
|
+
value: item.rechargeMoney,
|
|
63
|
+
className: "ssz-payRechargeRule-items-money",
|
|
64
|
+
end: formatMessage('元')
|
|
65
|
+
})]
|
|
66
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
67
|
+
className: "ssz-payRechargeRule-items-point-warp",
|
|
68
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
69
|
+
className: "ssz-payRechargeRule-items-point",
|
|
70
|
+
children: formatMessage('送')
|
|
71
|
+
})
|
|
72
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
73
|
+
className: "ssz-payRechargeRule-items-giveMoney",
|
|
74
|
+
children: /*#__PURE__*/_jsx(Money, {
|
|
75
|
+
value: item.giveMoney,
|
|
76
|
+
className: "ssz-payRechargeRule-items-money",
|
|
77
|
+
end: formatMessage('元')
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
80
|
+
}, item.id);
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
export default RechargeRule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.ssz-payRechargeRule{
|
|
2
|
+
padding: 0 0 18px 0;
|
|
3
|
+
.ssz-payRechargeRule-card{
|
|
4
|
+
max-width: 400px;
|
|
5
|
+
|
|
6
|
+
}
|
|
7
|
+
.ssz-payRechargeRule-items{
|
|
8
|
+
display: flex;
|
|
9
|
+
padding: 0 0 6px 0;
|
|
10
|
+
margin: 0 0 8px 0;
|
|
11
|
+
border-bottom: 1px solid #E8E8E8;
|
|
12
|
+
&:last-child{
|
|
13
|
+
border-bottom: none;
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
}
|
|
17
|
+
.ssz-payRechargeRule-items-rechargeMoney{
|
|
18
|
+
vertical-align: middle;
|
|
19
|
+
}
|
|
20
|
+
.ssz-payRechargeRule-items-label{
|
|
21
|
+
margin: 0 8px 0 0;
|
|
22
|
+
}
|
|
23
|
+
.ssz-payRechargeRule-items-giveMoney{
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
.value{
|
|
26
|
+
color: green;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.ssz-payRechargeRule-items-point-warp{
|
|
32
|
+
margin: 0 0 0 12px;
|
|
33
|
+
.ssz-payRechargeRule-items-point{
|
|
34
|
+
display: inline-block;
|
|
35
|
+
color: #FFF;
|
|
36
|
+
margin: 2px 8px 0;
|
|
37
|
+
padding: 0 5px;
|
|
38
|
+
line-height: 24px;
|
|
39
|
+
text-align: center;
|
|
40
|
+
background-color: green;
|
|
41
|
+
border-radius: 100px;
|
|
42
|
+
vertical-align: middle;
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.ssz-payRechargeRule-items-money{
|
|
47
|
+
font-size: 18px;
|
|
48
|
+
//min-width: 100px;
|
|
49
|
+
vertical-align: middle;
|
|
50
|
+
}
|
|
51
|
+
.ssz-payRechargeRule-select{
|
|
52
|
+
flex: 2;
|
|
53
|
+
text-align: right;
|
|
54
|
+
vertical-align: middle;
|
|
55
|
+
color: green;
|
|
56
|
+
font-size: 22px;
|
|
57
|
+
line-height: 1em;
|
|
58
|
+
}
|
|
59
|
+
}
|
package/dist/pay/recharge.css.js
CHANGED
|
@@ -3,5 +3,5 @@ export default {
|
|
|
3
3
|
PayRecharge: styled.div.withConfig({
|
|
4
4
|
displayName: "PayRecharge",
|
|
5
5
|
componentId: "component-sanzhizhou__sc-1np6liz-0"
|
|
6
|
-
})([".ssz-groupItems{padding:0 0
|
|
6
|
+
})([".ssz-recharge-form-moneyAmount-input{input{width:120px;}}.ssz-groupItems{padding:0 0 12px 0;}.ssz-submits{display:flex;flex-direction:row;justify-content:space-between;padding:0 12px 18px;}.ssz-groupTitle{font-size:14px;color:#777;font-weight:300;padding:0 0 3px 0;}.ant-radio-wrapper-disabled{.ssz-color-tag{opacity:0.4;-webkit-filter:grayscale(100%);filter:grayscale(100%);}}"])
|
|
7
7
|
};
|
package/dist/pay/recharge.d.ts
CHANGED
package/dist/pay/recharge.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
@@ -9,23 +10,26 @@ import { WechatOutlined, AlipayCircleOutlined, CaretLeftOutlined, CaretRightOutl
|
|
|
9
10
|
import PayQr from "./qr";
|
|
10
11
|
import notification from "../lib/notification";
|
|
11
12
|
import sleep from "../lib/sleep";
|
|
13
|
+
import formatMessage from "../lib/formatMessage";
|
|
14
|
+
import RechargeRule from "./recharge-rule";
|
|
15
|
+
import PayRechargeMoneyAmountAlt from "./recharge-moneyAmount-alt";
|
|
12
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
19
|
var PayChannelList = [{
|
|
16
20
|
groupTitle: '',
|
|
17
21
|
childrenList: [{
|
|
18
|
-
name: 'alipay',
|
|
19
|
-
label: '支付宝',
|
|
20
|
-
icon: /*#__PURE__*/_jsx(AlipayCircleOutlined, {}),
|
|
21
|
-
color: '#1c6cf4',
|
|
22
|
-
disabled: false
|
|
23
|
-
}, {
|
|
24
22
|
name: 'wepay',
|
|
25
23
|
label: '微信支付',
|
|
26
24
|
icon: /*#__PURE__*/_jsx(WechatOutlined, {}),
|
|
27
25
|
color: '#2bae68',
|
|
28
26
|
disabled: false
|
|
27
|
+
}, {
|
|
28
|
+
name: 'alipay',
|
|
29
|
+
label: '支付宝',
|
|
30
|
+
icon: /*#__PURE__*/_jsx(AlipayCircleOutlined, {}),
|
|
31
|
+
color: '#1c6cf4',
|
|
32
|
+
disabled: false
|
|
29
33
|
}]
|
|
30
34
|
}, {
|
|
31
35
|
groupTitle: '国际支付',
|
|
@@ -54,9 +58,11 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
54
58
|
_ref$productKind = _ref.productKind,
|
|
55
59
|
productKind = _ref$productKind === void 0 ? 'recharge' : _ref$productKind,
|
|
56
60
|
_ref$defaultPayChanne = _ref.defaultPayChannel,
|
|
57
|
-
defaultPayChannel = _ref$defaultPayChanne === void 0 ? '
|
|
61
|
+
defaultPayChannel = _ref$defaultPayChanne === void 0 ? 'wepay' : _ref$defaultPayChanne,
|
|
58
62
|
_ref$size = _ref.size,
|
|
59
|
-
size = _ref$size === void 0 ?
|
|
63
|
+
size = _ref$size === void 0 ? 280 : _ref$size,
|
|
64
|
+
_ref$defaultPrice = _ref.defaultPrice,
|
|
65
|
+
defaultPrice = _ref$defaultPrice === void 0 ? 100 : _ref$defaultPrice,
|
|
60
66
|
_ref$maxPrice = _ref.maxPrice,
|
|
61
67
|
maxPrice = _ref$maxPrice === void 0 ? 5000 : _ref$maxPrice,
|
|
62
68
|
onHandSuccess = _ref.onHandSuccess,
|
|
@@ -70,7 +76,7 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
70
76
|
selectPayChannel = _useState2[0],
|
|
71
77
|
setSelectPayChannel = _useState2[1];
|
|
72
78
|
var _useState3 = useState({
|
|
73
|
-
moneyAmount:
|
|
79
|
+
moneyAmount: defaultPrice,
|
|
74
80
|
payChannel: defaultPayChannel
|
|
75
81
|
}),
|
|
76
82
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -83,6 +89,10 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
83
89
|
var _Form$useForm = Form.useForm(),
|
|
84
90
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
85
91
|
form = _Form$useForm2[0];
|
|
92
|
+
var _useState7 = useState([]),
|
|
93
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
94
|
+
rechargeRuleList = _useState8[0],
|
|
95
|
+
setRechargeRuleList = _useState8[1];
|
|
86
96
|
var onChoosePayChannel = function onChoosePayChannel() {
|
|
87
97
|
setStep('pay-channel');
|
|
88
98
|
};
|
|
@@ -129,45 +139,53 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
129
139
|
},
|
|
130
140
|
initialValues: _objectSpread({}, formData),
|
|
131
141
|
onFinish: onMakeQr,
|
|
132
|
-
children: [
|
|
142
|
+
children: [step === 'pay-channel' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
133
143
|
children: [/*#__PURE__*/_jsx(Form.Item, {
|
|
134
|
-
label:
|
|
144
|
+
label: formatMessage('账号'),
|
|
135
145
|
children: /*#__PURE__*/_jsx("strong", {
|
|
136
146
|
children: nickName
|
|
137
147
|
})
|
|
138
148
|
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
139
|
-
label:
|
|
149
|
+
label: formatMessage('金额'),
|
|
140
150
|
name: "moneyAmount",
|
|
141
151
|
rules: [{
|
|
142
152
|
required: true,
|
|
143
|
-
message: '
|
|
153
|
+
message: formatMessage('请输入')
|
|
144
154
|
}],
|
|
145
155
|
extra: /*#__PURE__*/_jsxs("div", {
|
|
146
|
-
children: ["\
|
|
147
|
-
children: "
|
|
148
|
-
}), /*#__PURE__*/
|
|
149
|
-
children: "
|
|
150
|
-
}), "\uFF0C
|
|
151
|
-
children: "
|
|
152
|
-
}), /*#__PURE__*/
|
|
153
|
-
children: "
|
|
156
|
+
children: [formatMessage('充值'), "\uFF1A", formatMessage('最低'), " ", /*#__PURE__*/_jsxs("strong", {
|
|
157
|
+
children: [" ", minPrice]
|
|
158
|
+
}), /*#__PURE__*/_jsxs("small", {
|
|
159
|
+
children: [" ", formatMessage('元')]
|
|
160
|
+
}), "\uFF0C", formatMessage('最大'), " ", /*#__PURE__*/_jsxs("strong", {
|
|
161
|
+
children: [" ", maxPrice]
|
|
162
|
+
}), /*#__PURE__*/_jsxs("small", {
|
|
163
|
+
children: [" ", formatMessage('元')]
|
|
154
164
|
})]
|
|
155
165
|
}),
|
|
156
166
|
children: /*#__PURE__*/_jsx(InputNumber, {
|
|
157
167
|
addonBefore: /*#__PURE__*/_jsx(_Fragment, {
|
|
158
168
|
children: "\xA5"
|
|
159
169
|
}),
|
|
160
|
-
addonAfter:
|
|
170
|
+
addonAfter: /*#__PURE__*/_jsx(PayRechargeMoneyAmountAlt, {
|
|
171
|
+
moneyAmount: formData.moneyAmount,
|
|
172
|
+
rechargeRuleList: rechargeRuleList
|
|
173
|
+
}),
|
|
174
|
+
className: "ssz-recharge-form-moneyAmount-input",
|
|
161
175
|
precision: 0,
|
|
162
176
|
min: minPrice,
|
|
163
177
|
max: maxPrice,
|
|
164
|
-
placeholder:
|
|
178
|
+
placeholder: formatMessage('请输入'),
|
|
165
179
|
autoFocus: true,
|
|
166
|
-
controls: false
|
|
180
|
+
controls: false,
|
|
181
|
+
onChange: function onChange(moneyAmount) {
|
|
182
|
+
formData.moneyAmount = moneyAmount || 0;
|
|
183
|
+
setFormData(_objectSpread({}, formData));
|
|
184
|
+
}
|
|
167
185
|
})
|
|
168
186
|
}), /*#__PURE__*/_jsx(Form.Item, {
|
|
169
187
|
name: "payChannel",
|
|
170
|
-
label:
|
|
188
|
+
label: formatMessage('支付渠道'),
|
|
171
189
|
children: /*#__PURE__*/_jsx(Radio.Group, {
|
|
172
190
|
onChange: function onChange(e) {
|
|
173
191
|
var _e$target$id;
|
|
@@ -190,13 +208,20 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
190
208
|
children: /*#__PURE__*/_jsxs(Tag, {
|
|
191
209
|
color: item.color,
|
|
192
210
|
className: "ssz-color-tag",
|
|
193
|
-
children: [item.icon, " ", item.label]
|
|
211
|
+
children: [item.icon, " ", formatMessage(item.label)]
|
|
194
212
|
})
|
|
195
213
|
}, "".concat(i, "-").concat(item.name));
|
|
196
214
|
})]
|
|
197
215
|
}, "".concat(index, "-").concat(items.groupTitle));
|
|
198
216
|
})
|
|
199
217
|
})
|
|
218
|
+
}), /*#__PURE__*/_jsx(RechargeRule, {
|
|
219
|
+
formItemSpan: FormItemSpan,
|
|
220
|
+
env: env,
|
|
221
|
+
money: formData.moneyAmount,
|
|
222
|
+
onList: function onList(list) {
|
|
223
|
+
return setRechargeRuleList(_toConsumableArray(list));
|
|
224
|
+
}
|
|
200
225
|
})]
|
|
201
226
|
}), step === 'qr-show' && /*#__PURE__*/_jsx(_Fragment, {
|
|
202
227
|
children: /*#__PURE__*/_jsx(PayQr, {
|
|
@@ -222,20 +247,20 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
222
247
|
onClick: function onClick() {
|
|
223
248
|
return onChoosePayChannel();
|
|
224
249
|
},
|
|
225
|
-
children:
|
|
250
|
+
children: formatMessage('上一步')
|
|
226
251
|
})
|
|
227
252
|
}), /*#__PURE__*/_jsxs("div", {
|
|
228
253
|
children: [['pay-channel'].includes(step) && /*#__PURE__*/_jsxs(Button, {
|
|
229
254
|
type: "primary",
|
|
230
255
|
htmlType: "submit",
|
|
231
|
-
children: ["
|
|
256
|
+
children: [formatMessage('下一步'), " ", /*#__PURE__*/_jsx(CaretRightOutlined, {})]
|
|
232
257
|
}), ['qr-show'].includes(step) && /*#__PURE__*/_jsx(Button, {
|
|
233
258
|
type: "primary",
|
|
234
259
|
ghost: true,
|
|
235
260
|
onClick: function onClick() {
|
|
236
261
|
return onIPayed();
|
|
237
262
|
},
|
|
238
|
-
children:
|
|
263
|
+
children: formatMessage('已支付')
|
|
239
264
|
})]
|
|
240
265
|
})]
|
|
241
266
|
})]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import request from "../../lib/request";
|
|
5
|
+
export function list(_x, _x2) {
|
|
6
|
+
return _list.apply(this, arguments);
|
|
7
|
+
}
|
|
8
|
+
function _list() {
|
|
9
|
+
_list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
|
|
10
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
|
12
|
+
case 0:
|
|
13
|
+
return _context.abrupt("return", request("user/rechargeRule/list", _objectSpread({
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
'Content-Type': 'application/json'
|
|
17
|
+
},
|
|
18
|
+
data: _objectSpread({}, body)
|
|
19
|
+
}, options || {})));
|
|
20
|
+
case 1:
|
|
21
|
+
case "end":
|
|
22
|
+
return _context.stop();
|
|
23
|
+
}
|
|
24
|
+
}, _callee);
|
|
25
|
+
}));
|
|
26
|
+
return _list.apply(this, arguments);
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import request from "../../lib/request";
|
|
5
|
+
export function getUrlLink(_x, _x2) {
|
|
6
|
+
return _getUrlLink.apply(this, arguments);
|
|
7
|
+
}
|
|
8
|
+
function _getUrlLink() {
|
|
9
|
+
_getUrlLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
|
|
10
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
|
12
|
+
case 0:
|
|
13
|
+
return _context.abrupt("return", request("wechatMinApp/getUrlLink", _objectSpread({
|
|
14
|
+
method: 'POST',
|
|
15
|
+
headers: {
|
|
16
|
+
'Content-Type': 'application/json'
|
|
17
|
+
},
|
|
18
|
+
data: body
|
|
19
|
+
}, options || {})));
|
|
20
|
+
case 1:
|
|
21
|
+
case "end":
|
|
22
|
+
return _context.stop();
|
|
23
|
+
}
|
|
24
|
+
}, _callee);
|
|
25
|
+
}));
|
|
26
|
+
return _getUrlLink.apply(this, arguments);
|
|
27
|
+
}
|