component-sanzhizhou 1.0.6 → 1.0.8
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/dist/pay/qr.d.ts +3 -0
- package/dist/pay/qr.js +47 -26
- package/dist/pay/recharge.d.ts +1 -0
- package/dist/pay/recharge.js +7 -2
- package/dist/types/Pay.d.ts +1 -0
- package/package.json +1 -1
package/dist/pay/qr.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './qr.less';
|
|
3
3
|
interface Props {
|
|
4
|
+
productKind: Pay.ProductKind;
|
|
4
5
|
selectPayChannel: Pay.ChannelListChildrenList;
|
|
5
6
|
vipId: number;
|
|
6
7
|
payChannel: Pay.PayChannel;
|
|
8
|
+
productCount: number;
|
|
9
|
+
productName: string;
|
|
7
10
|
moneyAmount: number;
|
|
8
11
|
size?: number;
|
|
9
12
|
env?: Global.Env;
|
package/dist/pay/qr.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useState } from 'react';
|
|
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";
|
|
6
|
-
import * as RechargeController from "../service/api/RechargeController";
|
|
7
5
|
import { CheckCircleOutlined, ReloadOutlined } from "@ant-design/icons";
|
|
8
6
|
import { getEnv } from "../lib/getApiUrl";
|
|
7
|
+
import Tool from "../lib/Tool";
|
|
9
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
10
|
var QrDict = {
|
|
12
|
-
local: 'https://pay.sanzhizhou.com/pay/
|
|
11
|
+
local: 'https://pay.sanzhizhou.com/pay/we-h5',
|
|
13
12
|
// 'http://localhost:8001/pay/wepay-qr',
|
|
14
|
-
pre: 'http://localhost:8001/pay/
|
|
15
|
-
prod: 'https://pay.sanzhizhou.com/pay/
|
|
13
|
+
pre: 'http://localhost:8001/pay/we-h5r',
|
|
14
|
+
prod: 'https://pay.sanzhizhou.com/pay/we-h5'
|
|
16
15
|
};
|
|
17
16
|
var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
18
17
|
var selectPayChannel = _ref.selectPayChannel,
|
|
19
18
|
moneyAmount = _ref.moneyAmount,
|
|
19
|
+
productCount = _ref.productCount,
|
|
20
20
|
vipId = _ref.vipId,
|
|
21
|
+
productName = _ref.productName,
|
|
21
22
|
_ref$size = _ref.size,
|
|
22
23
|
size = _ref$size === void 0 ? 260 : _ref$size,
|
|
24
|
+
productKind = _ref.productKind,
|
|
23
25
|
env = _ref.env;
|
|
24
26
|
var _useState = useState(''),
|
|
25
27
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -29,28 +31,47 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
|
|
|
29
31
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
32
|
qrStatus = _useState4[0],
|
|
31
33
|
setQrStatus = _useState4[1];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
|
|
35
|
+
// const { run, loading } = useRequest(
|
|
36
|
+
// () => RechargeController.create({
|
|
37
|
+
// payChannel: selectPayChannel.name,
|
|
38
|
+
// moneyAmount,
|
|
39
|
+
// }, {
|
|
40
|
+
// env,
|
|
41
|
+
// }),
|
|
42
|
+
// {
|
|
43
|
+
// onSuccess(result) {
|
|
44
|
+
//
|
|
45
|
+
// },
|
|
46
|
+
// onError( e ){
|
|
47
|
+
// setQrStatus('expired');
|
|
48
|
+
// }
|
|
49
|
+
// },
|
|
50
|
+
// );
|
|
51
|
+
|
|
52
|
+
var onInit = function onInit() {
|
|
53
|
+
var qrUrlBase = QrDict[getEnv()] || QrDict.prod;
|
|
54
|
+
var data = JSON.stringify({
|
|
55
|
+
productKind: productKind ? productKind : vipId == 0 ? 'recharge' : '',
|
|
56
|
+
productCount: productCount,
|
|
57
|
+
productId: vipId,
|
|
58
|
+
userToken: Tool.getLocalUserInfo().sid,
|
|
59
|
+
wechatAppId: '',
|
|
60
|
+
productName: productName,
|
|
61
|
+
payMoney: moneyAmount
|
|
62
|
+
});
|
|
63
|
+
var qrUrl = qrUrlBase + (qrUrlBase.indexOf('?') === -1 ? '?' : '&') + "data=" + encodeURIComponent(data);
|
|
64
|
+
console.log('recharge qr:', qrUrl);
|
|
65
|
+
setQrUrl(qrUrl);
|
|
66
|
+
setQrStatus('active');
|
|
67
|
+
};
|
|
50
68
|
var getPaymentQr = function getPaymentQr() {
|
|
51
|
-
setQrStatus('loading');
|
|
52
|
-
run();
|
|
69
|
+
// setQrStatus('loading');
|
|
70
|
+
// run();
|
|
53
71
|
};
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
onInit();
|
|
74
|
+
}, []);
|
|
54
75
|
return /*#__PURE__*/_jsxs("div", {
|
|
55
76
|
className: "ssz-payQr",
|
|
56
77
|
children: [/*#__PURE__*/_jsxs(Divider, {
|
package/dist/pay/recharge.d.ts
CHANGED
package/dist/pay/recharge.js
CHANGED
|
@@ -40,7 +40,8 @@ var PayChannelList = [{
|
|
|
40
40
|
}];
|
|
41
41
|
var PayRecharge = function PayRecharge(_ref) {
|
|
42
42
|
var nickName = _ref.nickName,
|
|
43
|
-
onHandSuccess = _ref.onHandSuccess
|
|
43
|
+
onHandSuccess = _ref.onHandSuccess,
|
|
44
|
+
env = _ref.env;
|
|
44
45
|
var _useState = useState(PayChannelList[0].childrenList[0]),
|
|
45
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
46
47
|
selectPayChannel = _useState2[0],
|
|
@@ -172,10 +173,14 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
172
173
|
}), step === 'qr-show' && /*#__PURE__*/_jsx(_Fragment, {
|
|
173
174
|
children: formData.payChannel === 'wepay' && /*#__PURE__*/_jsx(PayQr, {
|
|
174
175
|
moneyAmount: formData.moneyAmount,
|
|
176
|
+
productCount: formData.moneyAmount,
|
|
177
|
+
productName: "\u5145\u503C",
|
|
175
178
|
vipId: 0,
|
|
176
179
|
payChannel: formData.payChannel,
|
|
177
180
|
selectPayChannel: selectPayChannel,
|
|
178
|
-
size: 260
|
|
181
|
+
size: 260,
|
|
182
|
+
env: env,
|
|
183
|
+
productKind: "recharge"
|
|
179
184
|
})
|
|
180
185
|
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsxs("div", {
|
|
181
186
|
className: "ssz-submits",
|
package/dist/types/Pay.d.ts
CHANGED