component-shipinlv 2.3.1 → 2.3.3

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.
@@ -132,13 +132,13 @@ var ActiveAccountModeSetting = function ActiveAccountModeSetting(_ref) {
132
132
  autoComplete: "off",
133
133
  initialValues: _objectSpread({}, formData),
134
134
  onFinish: onFinish,
135
- children: [notVip && /*#__PURE__*/_jsx(Form.Item, {
136
- label: "\u505C\u7528",
135
+ children: [notVip ? /*#__PURE__*/_jsx(Form.Item, {
136
+ label: "\u542F\u7528",
137
137
  children: /*#__PURE__*/_jsx(Alert, {
138
138
  type: "error",
139
139
  message: "\u4E0D\u662F\u4F1A\u5458\uFF0C\u6B64\u529F\u80FD\u7981\u7528"
140
140
  })
141
- }), /*#__PURE__*/_jsx(Form.Item, {
141
+ }) : /*#__PURE__*/_jsx(Form.Item, {
142
142
  label: "\u542F\u7528",
143
143
  name: "enabled",
144
144
  children: /*#__PURE__*/_jsx(Switch, {
@@ -18,7 +18,6 @@ import toast from "../../lib/toast";
18
18
  import Money from "../../UI/Money";
19
19
  import AccountManageSettingConfig from "../../lib/accountManageSettingConfig";
20
20
  import VideoPlatform from "../../component/video-platform/logo";
21
- import isInstalledChrome from "../../component/is-installed-chrome";
22
21
  import Tool from "../../lib/Tool";
23
22
  import VideoPublishVideoAccountBaseInfo from "../video-account/base-info";
24
23
  import VideoPublishVideoAccountProxySelect from "../proxy/select";
@@ -195,31 +194,29 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
195
194
  Tool.toast("\u4E0D\u662F\u4F1A\u5458\uFF0C\u53EA\u80FD\u6DFB\u52A0 ".concat(NotVipCanAddAccountCount, "\u4E2A\u8D26\u6237"));
196
195
  return _context.abrupt("return");
197
196
  case 4:
198
- if (isInstalledChrome()) {
199
- _context.next = 8;
200
- break;
201
- }
202
- Tool.toast('没有安装谷歌浏览器(Chrome),请安装');
203
- onMenu('setting');
204
- return _context.abrupt("return");
205
- case 8:
197
+ // if( ! isInstalledChrome() ){
198
+ // Tool.toast('没有安装谷歌浏览器(Chrome),请安装');
199
+ // onMenu('setting');
200
+ // return;
201
+ // }
202
+
206
203
  console.log('onAdd:', platform);
207
204
  settingConfig = AccountManageSettingConfig();
208
205
  if (settingConfig.chromeUserDataDir) {
209
- _context.next = 14;
206
+ _context.next = 10;
210
207
  break;
211
208
  }
212
209
  notification.notificationError('请先设置:“谷歌浏览器 - 多开位置”', '选个稍微大点的盘存储,每个用户会有几百M的数据');
213
210
  onMenu('setting');
214
211
  return _context.abrupt("return");
215
- case 14:
212
+ case 10:
216
213
  if (!(listData.length >= 200)) {
217
- _context.next = 17;
214
+ _context.next = 13;
218
215
  break;
219
216
  }
220
217
  notification.notificationError('这电脑绑定到上限了', '每台电脑最多绑定 200 个账号');
221
218
  return _context.abrupt("return");
222
- case 17:
219
+ case 13:
223
220
  toast('正在启动浏览器,请扫码登录', 12);
224
221
 
225
222
  // const platformName = platform ; // == 'kuaishou' ? 'kwai' : '';
@@ -231,12 +228,12 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
231
228
  chromeProfileName = Date.now() + '-' + Tool.math.randWord(16);
232
229
  videoPlatformInfo = VideoPlatformDict[platform];
233
230
  if (videoPlatformInfo) {
234
- _context.next = 23;
231
+ _context.next = 19;
235
232
  break;
236
233
  }
237
234
  toast('请配置信息:' + platform);
238
235
  return _context.abrupt("return");
239
- case 23:
236
+ case 19:
240
237
  openChrome({
241
238
  action: 'add-account',
242
239
  platform: platform,
@@ -250,7 +247,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
250
247
  proxyInfo: proxyInfo,
251
248
  isOpen: true // settingConfig.isChromeOpen,
252
249
  }, true, env);
253
- case 24:
250
+ case 20:
254
251
  case "end":
255
252
  return _context.stop();
256
253
  }
@@ -4,11 +4,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import _objectDestructuringEmpty from "@babel/runtime/helpers/esm/objectDestructuringEmpty";
6
6
  import React, { useEffect, useState } from 'react';
7
- import { ConfigProvider, Divider, Form, InputNumber, Modal, Space, Switch, Tag, TimePicker, Tooltip } from 'antd';
7
+ import { ConfigProvider, Divider, Form, InputNumber, Modal, Space, Switch, Tag, TimePicker } from 'antd';
8
8
  import "./index.less";
9
9
  import LayoutContent from "../../../UI/LayoutContent";
10
10
  import AccountManageSettingConfig from "../../../lib/accountManageSettingConfig";
11
- import FileSelect from "../../../component/file-select";
12
11
  import Tool from "../../../lib/Tool";
13
12
  import FolderSelect from "../../../component/folder-select";
14
13
  import dayjs from "dayjs";
@@ -101,30 +100,6 @@ var AccountManageSettingPage = function AccountManageSettingPage(_ref) {
101
100
  _onFinish(formData);
102
101
  }
103
102
  })
104
- }), /*#__PURE__*/_jsx(Form.Item, {
105
- label: "\u8C37\u6B4C\u6D4F\u89C8\u5668\uFF08Chrome\uFF09\u4F4D\u7F6E"
106
- // name="disabledApplyTask"
107
- ,
108
- extra: /*#__PURE__*/_jsxs("div", {
109
- children: ["\u4E0B\u8F7D\u5730\u5740", /*#__PURE__*/_jsx(Tooltip, {
110
- title: "https://google.cn/chrome/",
111
- children: /*#__PURE__*/_jsx("a", {
112
- children: " https://google.cn/chrome/"
113
- })
114
- })]
115
- }),
116
- children: /*#__PURE__*/_jsx(FileSelect, {
117
- path: formData.chromePath,
118
- disabled: false,
119
- placeholder: "\u8BF7\u9009\u62E9 Chrome \u6D4F\u89C8\u5668\u8DEF\u5F84",
120
- allowClear: false,
121
- extName: extName,
122
- onFinish: function onFinish(chromePath) {
123
- formData.chromePath = chromePath;
124
- setFormData(_objectSpread({}, formData));
125
- _onFinish(formData);
126
- }
127
- })
128
103
  }), /*#__PURE__*/_jsx(Form.Item, {
129
104
  label: "\u8C37\u6B4C\u6D4F\u89C8\u5668 - \u591A\u5F00\u4F4D\u7F6E",
130
105
  children: /*#__PURE__*/_jsx(FolderSelect, {
@@ -6,7 +6,9 @@ import { useRequest } from '@umijs/hooks';
6
6
  import * as VipCardController from "../service/api/VipCardController";
7
7
  import updateUserInfo from "../lib/updateUserInfo";
8
8
  import Tool from "../lib/Tool";
9
+ import UserProfileUserVip from "./user-vip";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
12
  var UserProfileVipCard = function UserProfileVipCard(_ref) {
11
13
  var env = _ref.env,
12
14
  onActive = _ref.onActive;
@@ -34,7 +36,7 @@ var UserProfileVipCard = function UserProfileVipCard(_ref) {
34
36
  error = _useRequest.error;
35
37
  var onFinish = function onFinish(postData) {
36
38
  var _postData$vipCardCode;
37
- var vipCardCode = (_postData$vipCardCode = postData.vipCardCode) === null || _postData$vipCardCode === void 0 ? void 0 : _postData$vipCardCode.replace(/^\s*AI\d?-/i, '').replace(/\s+/g, '').toLocaleUpperCase();
39
+ var vipCardCode = (_postData$vipCardCode = postData.vipCardCode) === null || _postData$vipCardCode === void 0 ? void 0 : _postData$vipCardCode.replace(/^[\s0-9a-z]+-/i, '').replace(/\s+/g, '').toLocaleUpperCase();
38
40
  if (!vipCardCode) {
39
41
  return;
40
42
  }
@@ -43,8 +45,8 @@ var UserProfileVipCard = function UserProfileVipCard(_ref) {
43
45
  var onupdateUserInfo = function onupdateUserInfo() {
44
46
  updateUserInfo();
45
47
  };
46
- return /*#__PURE__*/_jsx("div", {
47
- children: /*#__PURE__*/_jsx(Form, {
48
+ return /*#__PURE__*/_jsxs("div", {
49
+ children: [/*#__PURE__*/_jsx(Form, {
48
50
  form: form,
49
51
  disabled: loading,
50
52
  onFinish: onFinish,
@@ -70,7 +72,7 @@ var UserProfileVipCard = function UserProfileVipCard(_ref) {
70
72
  placeholder: "\u7C7B\u4F3C: AI-AAAA-BBBB-CCCC"
71
73
  })
72
74
  })
73
- })
75
+ }), /*#__PURE__*/_jsx(UserProfileUserVip, {})]
74
76
  });
75
77
  };
76
78
  export default UserProfileVipCard;
@@ -0,0 +1,3 @@
1
+ import './user-vip.less';
2
+ declare const UserProfileUserVip: () => import("react/jsx-runtime").JSX.Element | null;
3
+ export default UserProfileUserVip;
@@ -0,0 +1,84 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useEffect, useState } from 'react';
3
+ import { Divider, Table } from 'antd';
4
+ import { useRequest } from '@umijs/hooks';
5
+ import "./user-vip.less";
6
+ import * as UserController from "../service/api/UserController";
7
+ import ProductType from "../component/product-type";
8
+ import Time from "../UI/Time";
9
+ import PageContentWarp from "../UI/PageContentWarp";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ var UserProfileUserVip = function UserProfileUserVip() {
13
+ var _useState = useState([]),
14
+ _useState2 = _slicedToArray(_useState, 2),
15
+ listData = _useState2[0],
16
+ setListData = _useState2[1];
17
+ var _useRequest = useRequest(function () {
18
+ return UserController.userVipInfo();
19
+ }, {
20
+ manual: true,
21
+ onSuccess: function onSuccess(result) {
22
+ setListData(result);
23
+ }
24
+ }),
25
+ run = _useRequest.run,
26
+ loading = _useRequest.loading,
27
+ error = _useRequest.error;
28
+ var columns = [{
29
+ title: '名称',
30
+ dataIndex: 'productName',
31
+ key: 'productName',
32
+ render: function render(productName, record) {
33
+ return /*#__PURE__*/_jsx(ProductType, {
34
+ productType: (record === null || record === void 0 ? void 0 : record.productType) || '',
35
+ productName: productName
36
+ });
37
+ }
38
+ }, {
39
+ title: '等级',
40
+ dataIndex: 'vipLevelName',
41
+ key: 'vipLevelName',
42
+ render: function render(vipLevelName, record) {
43
+ return /*#__PURE__*/_jsx("div", {
44
+ children: vipLevelName
45
+ });
46
+ }
47
+ }, {
48
+ title: '过期时间',
49
+ dataIndex: 'expired',
50
+ key: 'expired',
51
+ render: function render(expired, record) {
52
+ return /*#__PURE__*/_jsx(Time, {
53
+ time: expired
54
+ });
55
+ }
56
+ }];
57
+ useEffect(function () {
58
+ run();
59
+ }, []);
60
+ return listData.length > 0 ? /*#__PURE__*/_jsxs("div", {
61
+ className: "userVip",
62
+ children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(PageContentWarp
63
+ // title="我的会员等级"
64
+ , {
65
+ loading: loading,
66
+ error: error,
67
+ onReload: function onReload() {
68
+ return run();
69
+ },
70
+ children: /*#__PURE__*/_jsx(Table, {
71
+ size: "small",
72
+ bordered: true,
73
+ rowKey: function rowKey(record) {
74
+ return "".concat(record.productType);
75
+ },
76
+ loading: loading,
77
+ columns: columns,
78
+ dataSource: listData,
79
+ pagination: false
80
+ })
81
+ })]
82
+ }) : null;
83
+ };
84
+ export default UserProfileUserVip;
@@ -0,0 +1,3 @@
1
+ .userVip{
2
+
3
+ }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
3
  productType: string;
4
+ productName: string;
4
5
  }
5
6
  declare const ProductType: React.FC<Props>;
6
7
  export default ProductType;
@@ -3,17 +3,18 @@ import ProductTypeDict from "./product-dict";
3
3
  import { jsxs as _jsxs } from "react/jsx-runtime";
4
4
  var ProductType = function ProductType(_ref) {
5
5
  var _ref$productType = _ref.productType,
6
- productType = _ref$productType === void 0 ? '' : _ref$productType;
6
+ productType = _ref$productType === void 0 ? '' : _ref$productType,
7
+ productName = _ref.productName;
7
8
  var itemData = ProductTypeDict[productType] || {
8
9
  color: '',
9
10
  icon: '',
10
- title: productType
11
+ title: ''
11
12
  };
12
13
  return /*#__PURE__*/_jsxs("span", {
13
14
  style: {
14
15
  color: itemData.color
15
16
  },
16
- children: [itemData.icon, " ", itemData.title]
17
+ children: [itemData.icon, " ", itemData.title || productName || productType]
17
18
  });
18
19
  };
19
20
  export default ProductType;
@@ -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?: NotificationOptions): void;
165
+ notification(type: "error" | "success" | "info" | "warning", message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
166
166
  notificationSuccess(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
167
167
  notificationError(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
168
168
  notificationWarning(message: string, description?: import("react").ReactNode, options?: NotificationOptions): void;
@@ -75,6 +75,7 @@ declare namespace User {
75
75
  vipLevel: number; // 1,
76
76
  isVip: boolean;
77
77
  expired: number;
78
+ productType: string;
78
79
  }
79
80
 
80
81
  interface StaffUserInfo{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",