component-sanzhizhou 1.2.12 → 1.2.13

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 CHANGED
@@ -11,6 +11,7 @@ interface Props {
11
11
  moneyAmount: number;
12
12
  size?: number;
13
13
  env?: Global.Env;
14
+ balanceType?: Pay.BalanceType;
14
15
  }
15
16
  declare const UserVipOrderPayQr: React.FC<Props>;
16
17
  export default UserVipOrderPayQr;
package/dist/pay/qr.js CHANGED
@@ -30,7 +30,8 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
30
30
  _ref$size = _ref.size,
31
31
  size = _ref$size === void 0 ? 260 : _ref$size,
32
32
  productKind = _ref.productKind,
33
- env = _ref.env;
33
+ env = _ref.env,
34
+ balanceType = _ref.balanceType;
34
35
  var _useState = useState(''),
35
36
  _useState2 = _slicedToArray(_useState, 2),
36
37
  qrUrl = _useState2[0],
@@ -58,7 +59,7 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
58
59
  var _useRequest = useRequest(function () {
59
60
  var postQuery = {
60
61
  pagePath: "pages/recharge/index",
61
- pathQuery: "moneyAmount=".concat(moneyAmount, "&productCount=").concat(productCount, "&userToken=").concat(getLocalUserInfo().sid || '', "&productKind=").concat(productKind, "&productTypeId=").concat(vipId, "&payChannel=").concat(payChannel),
62
+ pathQuery: "moneyAmount=".concat(moneyAmount, "&productCount=").concat(productCount, "&userToken=").concat(getLocalUserInfo().sid || '', "&productKind=").concat(productKind, "&productTypeId=").concat(vipId, "&payChannel=").concat(payChannel).concat(balanceType ? "&balanceType=".concat(balanceType) : ''),
62
63
  couponCode: couponCode,
63
64
  envVersion: getApiEnv() === 'local' ? "develop" : 'release'
64
65
  };
@@ -91,7 +92,8 @@ var UserVipOrderPayQr = function UserVipOrderPayQr(_ref) {
91
92
  userId: 0,
92
93
  payChannel: 'alipay',
93
94
  couponCode: couponCode,
94
- userToken: getLocalUserInfo().sid || ''
95
+ userToken: getLocalUserInfo().sid || '',
96
+ balanceType: balanceType
95
97
  }, {
96
98
  apiUrl: apiUrl,
97
99
  env: env
@@ -13,6 +13,11 @@ interface Props {
13
13
  maxPrice?: number;
14
14
  onHandSuccess: () => void;
15
15
  env?: Global.Env;
16
+ balanceTypeOptions?: {
17
+ label: React.ReactNode;
18
+ value: Pay.BalanceType;
19
+ }[];
20
+ defaultBalanceType?: Pay.BalanceType;
16
21
  }
17
22
  declare const PayRecharge: React.FC<Props>;
18
23
  export default PayRecharge;
@@ -21,7 +21,7 @@ var BaseDict = {
21
21
  }
22
22
  };
23
23
  var PayRecharge = function PayRecharge(_ref) {
24
- var _PayChannelList$filte;
24
+ var _PayChannelList$filte, _balanceTypeOptions$;
25
25
  var appId = _ref.appId,
26
26
  apiUrl = _ref.apiUrl,
27
27
  nickName = _ref.nickName,
@@ -41,7 +41,9 @@ var PayRecharge = function PayRecharge(_ref) {
41
41
  _ref$maxPrice = _ref.maxPrice,
42
42
  maxPrice = _ref$maxPrice === void 0 ? 5000 : _ref$maxPrice,
43
43
  onHandSuccess = _ref.onHandSuccess,
44
- env = _ref.env;
44
+ env = _ref.env,
45
+ balanceTypeOptions = _ref.balanceTypeOptions,
46
+ defaultBalanceType = _ref.defaultBalanceType;
45
47
  var _useState = useState(((_PayChannelList$filte = PayChannelList.filter(function (items) {
46
48
  var itemList = items.childrenList.filter(function (item) {
47
49
  return item.name === defaultPayChannel;
@@ -55,7 +57,8 @@ var PayRecharge = function PayRecharge(_ref) {
55
57
  setSelectPayChannel = _useState2[1];
56
58
  var _useState3 = useState({
57
59
  moneyAmount: defaultPrice,
58
- payChannel: defaultPayChannel
60
+ payChannel: defaultPayChannel,
61
+ balanceType: defaultBalanceType || (balanceTypeOptions === null || balanceTypeOptions === void 0 || (_balanceTypeOptions$ = balanceTypeOptions[0]) === null || _balanceTypeOptions$ === void 0 ? void 0 : _balanceTypeOptions$.value)
59
62
  }),
60
63
  _useState4 = _slicedToArray(_useState3, 2),
61
64
  formData = _useState4[0],
@@ -118,7 +121,15 @@ var PayRecharge = function PayRecharge(_ref) {
118
121
  onFinish: onMakeQr
119
122
  }, step === 'pay-channel' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, {
120
123
  label: formatMessage('账号')
121
- }, /*#__PURE__*/React.createElement("strong", null, nickName)), /*#__PURE__*/React.createElement(Form.Item, {
124
+ }, /*#__PURE__*/React.createElement("strong", null, nickName)), (balanceTypeOptions || []).length > 0 && /*#__PURE__*/React.createElement(Form.Item, {
125
+ name: "balanceType",
126
+ label: formatMessage('余额类别')
127
+ }, /*#__PURE__*/React.createElement(Radio.Group, null, (balanceTypeOptions || []).map(function (item) {
128
+ return /*#__PURE__*/React.createElement(Radio, {
129
+ key: item.value,
130
+ value: item.value
131
+ }, item.label);
132
+ }))), /*#__PURE__*/React.createElement(Form.Item, {
122
133
  label: formatMessage('金额'),
123
134
  name: "moneyAmount",
124
135
  rules: [{
@@ -196,7 +207,8 @@ var PayRecharge = function PayRecharge(_ref) {
196
207
  size: size,
197
208
  env: env,
198
209
  productKind: productKind,
199
- couponCode: ""
210
+ couponCode: "",
211
+ balanceType: formData.balanceType
200
212
  })), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
201
213
  className: "ssz-submits"
202
214
  }, /*#__PURE__*/React.createElement("div", null, ['qr-show'].includes(step) && /*#__PURE__*/React.createElement(Button, {
@@ -2,6 +2,7 @@
2
2
  declare namespace Pay {
3
3
  type PayChannel = Trade.PayChannel;
4
4
  type ProductKind = 'vip' | 'vip-card' | 'recharge' | 'added-service';
5
+ type BalanceType = 'software-fee' | 'package-fee';
5
6
  interface ChannelList {
6
7
  groupTitle: string;
7
8
  disabled?: boolean;
@@ -17,6 +18,7 @@ declare namespace Pay {
17
18
  interface RechargeFormData {
18
19
  moneyAmount: number;
19
20
  payChannel: PayChannel;
21
+ balanceType?: BalanceType;
20
22
  }
21
23
  interface GetPaymentQr {
22
24
  qrUrl: string;
@@ -10,6 +10,7 @@ declare namespace Trade {
10
10
  payChannel: PayChannel;
11
11
  couponCode: string;
12
12
  userToken: string;
13
+ balanceType?: Pay.BalanceType;
13
14
  [name: string]: any;
14
15
  }
15
16
  interface PayMoneyInfo {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-sanzhizhou",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",