component-sanzhizhou 1.0.7 → 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 -28
- package/dist/pay/recharge.js +4 -1
- 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,30 +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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
+
};
|
|
52
68
|
var getPaymentQr = function getPaymentQr() {
|
|
53
|
-
setQrStatus('loading');
|
|
54
|
-
run();
|
|
69
|
+
// setQrStatus('loading');
|
|
70
|
+
// run();
|
|
55
71
|
};
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
onInit();
|
|
74
|
+
}, []);
|
|
56
75
|
return /*#__PURE__*/_jsxs("div", {
|
|
57
76
|
className: "ssz-payQr",
|
|
58
77
|
children: [/*#__PURE__*/_jsxs(Divider, {
|
package/dist/pay/recharge.js
CHANGED
|
@@ -173,11 +173,14 @@ var PayRecharge = function PayRecharge(_ref) {
|
|
|
173
173
|
}), step === 'qr-show' && /*#__PURE__*/_jsx(_Fragment, {
|
|
174
174
|
children: formData.payChannel === 'wepay' && /*#__PURE__*/_jsx(PayQr, {
|
|
175
175
|
moneyAmount: formData.moneyAmount,
|
|
176
|
+
productCount: formData.moneyAmount,
|
|
177
|
+
productName: "\u5145\u503C",
|
|
176
178
|
vipId: 0,
|
|
177
179
|
payChannel: formData.payChannel,
|
|
178
180
|
selectPayChannel: selectPayChannel,
|
|
179
181
|
size: 260,
|
|
180
|
-
env: env
|
|
182
|
+
env: env,
|
|
183
|
+
productKind: "recharge"
|
|
181
184
|
})
|
|
182
185
|
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsxs("div", {
|
|
183
186
|
className: "ssz-submits",
|
package/dist/types/Pay.d.ts
CHANGED