component-sanzhizhou 1.2.12 → 1.3.0

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.
@@ -162,7 +162,7 @@ declare const Tool: {
162
162
  getTitleByPath(path: string): string;
163
163
  getDirByPath(path: string): string;
164
164
  h5Pay(query: Pay.H5PayQuery): void;
165
- notification(type: "success" | "info" | "warning" | "error", message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
165
+ notification(type: "info" | "warning" | "error" | "success", message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
166
166
  notificationSuccess(message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
167
167
  notificationError(message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
168
168
  notificationWarning(message: string, description?: import("react").ReactNode, options?: import("./notification").NotificationOption): void;
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
@@ -1,5 +1,6 @@
1
1
  .ssz-recharge-form-moneyAmount-input{
2
2
  position: relative;
3
+
3
4
  .ssz-recharge-form-moneyAmount-input-bonus{
4
5
  position: absolute;
5
6
  top: -5px;
@@ -5,6 +5,7 @@ interface Props {
5
5
  env?: Global.Env;
6
6
  money: number;
7
7
  onList: (list: RechargeRule.List[]) => void;
8
+ balanceType?: Pay.BalanceType;
8
9
  }
9
10
  declare const RechargeRule: React.FC<Props>;
10
11
  export default RechargeRule;
@@ -12,16 +12,20 @@ var RechargeRule = function RechargeRule(_ref) {
12
12
  var formItemSpan = _ref.formItemSpan,
13
13
  env = _ref.env,
14
14
  money = _ref.money,
15
- onList = _ref.onList;
15
+ onList = _ref.onList,
16
+ balanceType = _ref.balanceType;
16
17
  var _useState = useState([]),
17
18
  _useState2 = _slicedToArray(_useState, 2),
18
19
  listData = _useState2[0],
19
20
  setListData = _useState2[1];
20
21
  var _useRequest = useRequest(function () {
21
- return RechargeRuleController.list({}, {
22
+ return RechargeRuleController.list({
23
+ balanceType: balanceType
24
+ }, {
22
25
  env: env
23
26
  });
24
27
  }, {
28
+ refreshDeps: [balanceType],
25
29
  onSuccess: function onSuccess(result) {
26
30
  result.sort(function (a, b) {
27
31
  return a.rechargeMoney - b.rechargeMoney;
@@ -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-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 0 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%);}}"])
6
+ })([".ssz-recharge-form-moneyAmount-input{input{}}.ssz-groupItems{padding:0 0 12px 0;}.ssz-submits{display:flex;flex-direction:row;justify-content:space-between;padding:0 0 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
  };
@@ -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;
@@ -12,7 +12,6 @@ import notification from "../lib/notification";
12
12
  import sleep from "../lib/sleep";
13
13
  import formatMessage from "../lib/formatMessage";
14
14
  import RechargeRule from "./recharge-rule";
15
- import PayRechargeMoneyAmountAlt from "./recharge-moneyAmount-alt";
16
15
  import PayChannelList from "./payChannelList";
17
16
  var BaseDict = {
18
17
  productKind: {
@@ -21,7 +20,7 @@ var BaseDict = {
21
20
  }
22
21
  };
23
22
  var PayRecharge = function PayRecharge(_ref) {
24
- var _PayChannelList$filte;
23
+ var _PayChannelList$filte, _balanceTypeOptions$;
25
24
  var appId = _ref.appId,
26
25
  apiUrl = _ref.apiUrl,
27
26
  nickName = _ref.nickName,
@@ -41,7 +40,9 @@ var PayRecharge = function PayRecharge(_ref) {
41
40
  _ref$maxPrice = _ref.maxPrice,
42
41
  maxPrice = _ref$maxPrice === void 0 ? 5000 : _ref$maxPrice,
43
42
  onHandSuccess = _ref.onHandSuccess,
44
- env = _ref.env;
43
+ env = _ref.env,
44
+ balanceTypeOptions = _ref.balanceTypeOptions,
45
+ defaultBalanceType = _ref.defaultBalanceType;
45
46
  var _useState = useState(((_PayChannelList$filte = PayChannelList.filter(function (items) {
46
47
  var itemList = items.childrenList.filter(function (item) {
47
48
  return item.name === defaultPayChannel;
@@ -55,7 +56,8 @@ var PayRecharge = function PayRecharge(_ref) {
55
56
  setSelectPayChannel = _useState2[1];
56
57
  var _useState3 = useState({
57
58
  moneyAmount: defaultPrice,
58
- payChannel: defaultPayChannel
59
+ payChannel: defaultPayChannel,
60
+ balanceType: defaultBalanceType || (balanceTypeOptions === null || balanceTypeOptions === void 0 || (_balanceTypeOptions$ = balanceTypeOptions[0]) === null || _balanceTypeOptions$ === void 0 ? void 0 : _balanceTypeOptions$.value)
59
61
  }),
60
62
  _useState4 = _slicedToArray(_useState3, 2),
61
63
  formData = _useState4[0],
@@ -118,7 +120,15 @@ var PayRecharge = function PayRecharge(_ref) {
118
120
  onFinish: onMakeQr
119
121
  }, step === 'pay-channel' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, {
120
122
  label: formatMessage('账号')
121
- }, /*#__PURE__*/React.createElement("strong", null, nickName)), /*#__PURE__*/React.createElement(Form.Item, {
123
+ }, /*#__PURE__*/React.createElement("strong", null, nickName)), (balanceTypeOptions || []).length > 0 && /*#__PURE__*/React.createElement(Form.Item, {
124
+ name: "balanceType",
125
+ label: formatMessage('余额类别')
126
+ }, /*#__PURE__*/React.createElement(Radio.Group, null, (balanceTypeOptions || []).map(function (item) {
127
+ return /*#__PURE__*/React.createElement(Radio, {
128
+ key: item.value,
129
+ value: item.value
130
+ }, item.label);
131
+ }))), /*#__PURE__*/React.createElement(Form.Item, {
122
132
  label: formatMessage('金额'),
123
133
  name: "moneyAmount",
124
134
  rules: [{
@@ -127,13 +137,16 @@ var PayRecharge = function PayRecharge(_ref) {
127
137
  }],
128
138
  extra: /*#__PURE__*/React.createElement("small", null, formatMessage('充值'), "\uFF1A", formatMessage('最低'), " ", /*#__PURE__*/React.createElement("strong", null, " ", minPrice), /*#__PURE__*/React.createElement("small", null, " ", formatMessage('元')), "\uFF0C", formatMessage('最大'), " ", /*#__PURE__*/React.createElement("strong", null, " ", maxPrice), /*#__PURE__*/React.createElement("small", null, " ", formatMessage('元')))
129
139
  }, /*#__PURE__*/React.createElement(InputNumber, {
130
- prefix: /*#__PURE__*/React.createElement(React.Fragment, null, "\xA5"),
131
- suffix: /*#__PURE__*/React.createElement(PayRechargeMoneyAmountAlt, {
132
- moneyAmount: formData.moneyAmount,
133
- rechargeRuleList: rechargeRuleList
134
- }),
140
+ prefix: /*#__PURE__*/React.createElement(React.Fragment, null, "\xA5")
141
+ // suffix={(
142
+ // <PayRechargeMoneyAmountAlt
143
+ // moneyAmount={ formData.moneyAmount }
144
+ // rechargeRuleList={ rechargeRuleList }
145
+ // />
146
+ // )}
147
+ ,
135
148
  style: {
136
- // minWidth: 300,
149
+ minWidth: 150
137
150
  },
138
151
  className: "ssz-recharge-form-moneyAmount-input",
139
152
  precision: precision,
@@ -178,6 +191,7 @@ var PayRecharge = function PayRecharge(_ref) {
178
191
  formItemSpan: FormItemSpan,
179
192
  env: env,
180
193
  money: formData.moneyAmount,
194
+ balanceType: formData.balanceType,
181
195
  onList: function onList(list) {
182
196
  return setRechargeRuleList(_toConsumableArray(list));
183
197
  }
@@ -196,7 +210,8 @@ var PayRecharge = function PayRecharge(_ref) {
196
210
  size: size,
197
211
  env: env,
198
212
  productKind: productKind,
199
- couponCode: ""
213
+ couponCode: "",
214
+ balanceType: formData.balanceType
200
215
  })), /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
201
216
  className: "ssz-submits"
202
217
  }, /*#__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;
@@ -5,5 +5,6 @@ declare namespace RechargeRule {
5
5
  "rechargeMoney": number;
6
6
  "giveMoney": number;
7
7
  "enabled": boolean;
8
+ "balanceType"?: Pay.BalanceType;
8
9
  }
9
10
  }
@@ -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.3.0",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",