component-shipinlv 2.3.0 → 2.3.2
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/ActiveAccountMode/index.d.ts +1 -0
- package/dist/ActiveAccountMode/index.js +4 -2
- package/dist/ActiveAccountMode/setting.d.ts +1 -0
- package/dist/ActiveAccountMode/setting.js +11 -4
- package/dist/ActiveAccountMode/task/index.d.ts +2 -1
- package/dist/ActiveAccountMode/task/index.js +61 -51
- package/dist/VideoPublish/account-manage/home.d.ts +1 -0
- package/dist/VideoPublish/account-manage/home.js +2 -0
- package/dist/VideoPublish/account-manage/list.d.ts +1 -0
- package/dist/VideoPublish/account-manage/list.js +22 -9
- package/dist/VideoPublish/create-task/index.d.ts +1 -0
- package/dist/VideoPublish/create-task/index.js +4 -3
- package/dist/VideoPublish/index.d.ts +1 -0
- package/dist/VideoPublish/index.js +6 -2
- package/dist/VideoPublish/index.less +3 -0
- package/dist/active-code/index.js +6 -4
- package/dist/active-code/user-vip.d.ts +3 -0
- package/dist/active-code/user-vip.js +84 -0
- package/dist/active-code/user-vip.less +3 -0
- package/dist/component/product-type.d.ts +1 -0
- package/dist/component/product-type.js +4 -3
- package/dist/lib/Tool.d.ts +1 -1
- package/dist/types/User.d.ts +1 -0
- package/package.json +1 -1
@@ -3,12 +3,14 @@ import ActiveAccountModeSetting from "./setting";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
4
|
var ActiveAccountMode = function ActiveAccountMode(_ref) {
|
5
5
|
var disabled = _ref.disabled,
|
6
|
-
env = _ref.env
|
6
|
+
env = _ref.env,
|
7
|
+
notVip = _ref.notVip;
|
7
8
|
return /*#__PURE__*/_jsx(ActiveAccountModeSetting, {
|
8
9
|
env: env
|
9
10
|
// env="prod"
|
10
11
|
,
|
11
|
-
disabled: disabled
|
12
|
+
disabled: disabled,
|
13
|
+
notVip: notVip
|
12
14
|
});
|
13
15
|
};
|
14
16
|
export default ActiveAccountMode;
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
5
|
import React, { useEffect, useState } from 'react';
|
6
|
-
import { Button, ConfigProvider, Divider, Form, InputNumber, Radio, Switch } from 'antd';
|
6
|
+
import { Alert, Button, ConfigProvider, Divider, Form, InputNumber, Radio, Switch } from 'antd';
|
7
7
|
import "./setting.less";
|
8
8
|
import LayoutContent from "../UI/LayoutContent";
|
9
9
|
import { useRequest } from "@umijs/hooks";
|
@@ -28,7 +28,8 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
29
29
|
var ActiveAccountModeSetting = function ActiveAccountModeSetting(_ref) {
|
30
30
|
var disabled = _ref.disabled,
|
31
|
-
env = _ref.env
|
31
|
+
env = _ref.env,
|
32
|
+
notVip = _ref.notVip;
|
32
33
|
var _Form$useForm = Form.useForm(),
|
33
34
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
34
35
|
form = _Form$useForm2[0];
|
@@ -107,7 +108,7 @@ var ActiveAccountModeSetting = function ActiveAccountModeSetting(_ref) {
|
|
107
108
|
};
|
108
109
|
}();
|
109
110
|
useEffect(function () {
|
110
|
-
var task = new ActiveAccountModeTask(env);
|
111
|
+
var task = new ActiveAccountModeTask(env, notVip);
|
111
112
|
return function () {
|
112
113
|
task.destroy();
|
113
114
|
};
|
@@ -131,7 +132,13 @@ var ActiveAccountModeSetting = function ActiveAccountModeSetting(_ref) {
|
|
131
132
|
autoComplete: "off",
|
132
133
|
initialValues: _objectSpread({}, formData),
|
133
134
|
onFinish: onFinish,
|
134
|
-
children: [/*#__PURE__*/_jsx(Form.Item, {
|
135
|
+
children: [notVip ? /*#__PURE__*/_jsx(Form.Item, {
|
136
|
+
label: "\u542F\u7528",
|
137
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
138
|
+
type: "error",
|
139
|
+
message: "\u4E0D\u662F\u4F1A\u5458\uFF0C\u6B64\u529F\u80FD\u7981\u7528"
|
140
|
+
})
|
141
|
+
}) : /*#__PURE__*/_jsx(Form.Item, {
|
135
142
|
label: "\u542F\u7528",
|
136
143
|
name: "enabled",
|
137
144
|
children: /*#__PURE__*/_jsx(Switch, {
|
@@ -1,12 +1,13 @@
|
|
1
1
|
declare class ActiveAccountModeTask {
|
2
2
|
loopSecond: number;
|
3
|
+
notVip: boolean;
|
3
4
|
modeSetting: ActiveAccountModeSetting.Detail;
|
4
5
|
env: Global.Env | undefined;
|
5
6
|
accountList: VideoPublishVideoAccount.List[];
|
6
7
|
planDict: {
|
7
8
|
[id: number]: PublishTaskPlanStatistic.List[];
|
8
9
|
};
|
9
|
-
constructor(env?: Global.Env);
|
10
|
+
constructor(env?: Global.Env, notVip?: boolean);
|
10
11
|
destroy(): void;
|
11
12
|
onLoop(): Promise<void>;
|
12
13
|
loop(): Promise<void>;
|
@@ -15,10 +15,11 @@ import sleep from "../../lib/sleep";
|
|
15
15
|
import { delFile, fsDirVideoList } from "../../lib/fs";
|
16
16
|
import Tool from "../../lib/Tool";
|
17
17
|
var ActiveAccountModeTask = /*#__PURE__*/function () {
|
18
|
-
function ActiveAccountModeTask(env) {
|
18
|
+
function ActiveAccountModeTask(env, notVip) {
|
19
19
|
var _this = this;
|
20
20
|
_classCallCheck(this, ActiveAccountModeTask);
|
21
21
|
_defineProperty(this, "loopSecond", 1 * 60);
|
22
|
+
_defineProperty(this, "notVip", false);
|
22
23
|
_defineProperty(this, "modeSetting", {
|
23
24
|
dayTimeHourList: [],
|
24
25
|
dayPublishMaxAmount: 6,
|
@@ -37,6 +38,8 @@ var ActiveAccountModeTask = /*#__PURE__*/function () {
|
|
37
38
|
if (env && env !== 'prod') {
|
38
39
|
this.loopSecond = 50;
|
39
40
|
}
|
41
|
+
this.notVip = !!notVip;
|
42
|
+
|
40
43
|
// this.timer = setInterval(() => {
|
41
44
|
// this.loop();
|
42
45
|
// }, this.loopSecond * 1e3 )
|
@@ -100,31 +103,38 @@ var ActiveAccountModeTask = /*#__PURE__*/function () {
|
|
100
103
|
this.onLoop();
|
101
104
|
return _context2.abrupt("return");
|
102
105
|
case 11:
|
103
|
-
|
106
|
+
if (!this.notVip) {
|
107
|
+
_context2.next = 14;
|
108
|
+
break;
|
109
|
+
}
|
110
|
+
console.log('不是会员,禁用养号模式');
|
111
|
+
return _context2.abrupt("return");
|
112
|
+
case 14:
|
113
|
+
_context2.next = 16;
|
104
114
|
return this.getAccountList().catch(function (err) {
|
105
115
|
toastError('获取视频账户错误:' + (err === null || err === void 0 ? void 0 : err.message));
|
106
116
|
});
|
107
|
-
case
|
117
|
+
case 16:
|
108
118
|
accountList = _context2.sent;
|
109
119
|
if (accountList) {
|
110
|
-
_context2.next =
|
120
|
+
_context2.next = 20;
|
111
121
|
break;
|
112
122
|
}
|
113
123
|
this.onLoop();
|
114
124
|
return _context2.abrupt("return");
|
115
|
-
case
|
125
|
+
case 20:
|
116
126
|
this.accountList = accountList.list;
|
117
127
|
if (!(this.accountList.length === 0)) {
|
118
|
-
_context2.next =
|
128
|
+
_context2.next = 24;
|
119
129
|
break;
|
120
130
|
}
|
121
131
|
this.onLoop();
|
122
132
|
return _context2.abrupt("return");
|
123
|
-
case
|
133
|
+
case 24:
|
124
134
|
dayIndex = 0;
|
125
|
-
case
|
135
|
+
case 25:
|
126
136
|
if (!(dayIndex < setting.publishMaxDay)) {
|
127
|
-
_context2.next =
|
137
|
+
_context2.next = 81;
|
128
138
|
break;
|
129
139
|
}
|
130
140
|
console.log('publishMaxDay:', dayIndex);
|
@@ -134,21 +144,21 @@ var ActiveAccountModeTask = /*#__PURE__*/function () {
|
|
134
144
|
console.log("startTime:", dayIndex, new Date(startTime * 1000), new Date(endTime * 1000));
|
135
145
|
|
136
146
|
// 获取用户列表;
|
137
|
-
_context2.next =
|
147
|
+
_context2.next = 33;
|
138
148
|
return this.getTaskPlanStatisticList(startTime, endTime).catch(function (err) {
|
139
149
|
toastError('获取账户列表失败:' + (err === null || err === void 0 ? void 0 : err.message));
|
140
150
|
});
|
141
|
-
case
|
151
|
+
case 33:
|
142
152
|
list = _context2.sent;
|
143
153
|
if (list) {
|
144
|
-
_context2.next =
|
154
|
+
_context2.next = 38;
|
145
155
|
break;
|
146
156
|
}
|
147
|
-
_context2.next =
|
157
|
+
_context2.next = 37;
|
148
158
|
return sleep(20e3);
|
149
|
-
case
|
150
|
-
return _context2.abrupt("continue",
|
151
|
-
case
|
159
|
+
case 37:
|
160
|
+
return _context2.abrupt("continue", 78);
|
161
|
+
case 38:
|
152
162
|
// 把发布过的,做一个字段
|
153
163
|
this.planDict = {};
|
154
164
|
_iterator = _createForOfIteratorHelper(list);
|
@@ -168,87 +178,87 @@ var ActiveAccountModeTask = /*#__PURE__*/function () {
|
|
168
178
|
_iterator.f();
|
169
179
|
}
|
170
180
|
_iterator2 = _createForOfIteratorHelper(this.accountList);
|
171
|
-
_context2.prev =
|
181
|
+
_context2.prev = 42;
|
172
182
|
_iterator2.s();
|
173
|
-
case
|
183
|
+
case 44:
|
174
184
|
if ((_step2 = _iterator2.n()).done) {
|
175
|
-
_context2.next =
|
185
|
+
_context2.next = 70;
|
176
186
|
break;
|
177
187
|
}
|
178
188
|
accountItem = _step2.value;
|
179
189
|
if (accountItem.isLoginValid) {
|
180
|
-
_context2.next =
|
190
|
+
_context2.next = 49;
|
181
191
|
break;
|
182
192
|
}
|
183
193
|
console.log('账号已掉线:', accountItem);
|
184
|
-
return _context2.abrupt("continue",
|
185
|
-
case
|
194
|
+
return _context2.abrupt("continue", 68);
|
195
|
+
case 49:
|
186
196
|
if (!accountItem.isBan) {
|
187
|
-
_context2.next =
|
197
|
+
_context2.next = 52;
|
188
198
|
break;
|
189
199
|
}
|
190
200
|
console.log('账号已封:', accountItem);
|
191
|
-
return _context2.abrupt("continue",
|
192
|
-
case
|
201
|
+
return _context2.abrupt("continue", 68);
|
202
|
+
case 52:
|
193
203
|
if (accountItem.enabledActiveAccountMode) {
|
194
|
-
_context2.next =
|
204
|
+
_context2.next = 55;
|
195
205
|
break;
|
196
206
|
}
|
197
207
|
console.log('账号禁止养号模式:', accountItem);
|
198
|
-
return _context2.abrupt("continue",
|
199
|
-
case
|
208
|
+
return _context2.abrupt("continue", 68);
|
209
|
+
case 55:
|
200
210
|
count = ((_this$planDict$accoun = this.planDict[accountItem.id]) === null || _this$planDict$accoun === void 0 ? void 0 : _this$planDict$accoun.length) || 0; // 需要指定路径
|
201
211
|
if (accountItem.videoFromFolder) {
|
202
|
-
_context2.next =
|
212
|
+
_context2.next = 59;
|
203
213
|
break;
|
204
214
|
}
|
205
215
|
console.log('no videoFromFolder :', accountItem.id, accountItem.nickname);
|
206
|
-
return _context2.abrupt("continue",
|
207
|
-
case
|
216
|
+
return _context2.abrupt("continue", 68);
|
217
|
+
case 59:
|
208
218
|
// 删除 此账户下面,所有已经发布的视频
|
209
219
|
this.checkDelFile(accountItem.id, accountItem.videoFromFolder);
|
210
220
|
if (!(count >= setting.dayPublishMaxAmount)) {
|
211
|
-
_context2.next =
|
221
|
+
_context2.next = 63;
|
212
222
|
break;
|
213
223
|
}
|
214
224
|
console.log('count 2:', count, setting.dayPublishMaxAmount);
|
215
|
-
return _context2.abrupt("continue",
|
216
|
-
case
|
225
|
+
return _context2.abrupt("continue", 68);
|
226
|
+
case 63:
|
217
227
|
console.log('makePublishTask in:', accountItem.id, setting.dayPublishMaxAmount - count, dayIndex);
|
218
228
|
|
219
229
|
// 生成任务
|
220
|
-
_context2.next =
|
230
|
+
_context2.next = 66;
|
221
231
|
return this.makePublishTask(accountItem.id, setting.dayPublishMaxAmount - count, dayIndex).catch(function (err) {
|
222
232
|
console.log('makePublishTask err:', err);
|
223
233
|
});
|
224
|
-
case
|
225
|
-
_context2.next =
|
234
|
+
case 66:
|
235
|
+
_context2.next = 68;
|
226
236
|
return sleep(3e3);
|
227
|
-
case
|
228
|
-
_context2.next =
|
237
|
+
case 68:
|
238
|
+
_context2.next = 44;
|
229
239
|
break;
|
230
|
-
case
|
231
|
-
_context2.next =
|
240
|
+
case 70:
|
241
|
+
_context2.next = 75;
|
232
242
|
break;
|
233
|
-
case 69:
|
234
|
-
_context2.prev = 69;
|
235
|
-
_context2.t0 = _context2["catch"](39);
|
236
|
-
_iterator2.e(_context2.t0);
|
237
243
|
case 72:
|
238
244
|
_context2.prev = 72;
|
239
|
-
|
240
|
-
|
245
|
+
_context2.t0 = _context2["catch"](42);
|
246
|
+
_iterator2.e(_context2.t0);
|
241
247
|
case 75:
|
248
|
+
_context2.prev = 75;
|
249
|
+
_iterator2.f();
|
250
|
+
return _context2.finish(75);
|
251
|
+
case 78:
|
242
252
|
dayIndex++;
|
243
|
-
_context2.next =
|
253
|
+
_context2.next = 25;
|
244
254
|
break;
|
245
|
-
case
|
255
|
+
case 81:
|
246
256
|
this.onLoop();
|
247
|
-
case
|
257
|
+
case 82:
|
248
258
|
case "end":
|
249
259
|
return _context2.stop();
|
250
260
|
}
|
251
|
-
}, _callee2, this, [[
|
261
|
+
}, _callee2, this, [[42, 72, 75, 78]]);
|
252
262
|
}));
|
253
263
|
function loop() {
|
254
264
|
return _loop.apply(this, arguments);
|
@@ -15,6 +15,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePage(_ref) {
|
16
16
|
var apiUrl = _ref.apiUrl,
|
17
17
|
env = _ref.env,
|
18
|
+
notVip = _ref.notVip,
|
18
19
|
onMenu = _ref.onMenu,
|
19
20
|
canPublish = _ref.canPublish;
|
20
21
|
var _useState = useState({
|
@@ -152,6 +153,7 @@ var VideoPublishAccountManageHomePage = function VideoPublishAccountManageHomePa
|
|
152
153
|
children: [/*#__PURE__*/_jsx(HomePageAccountList, {
|
153
154
|
apiUrl: apiUrl,
|
154
155
|
env: env,
|
156
|
+
notVip: notVip,
|
155
157
|
currentAccountDetail: accountDetail,
|
156
158
|
onListData: function onListData(list) {
|
157
159
|
// accountListDataRef.current = list;
|
@@ -27,9 +27,11 @@ import openChrome from "../../lib/openChrome";
|
|
27
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
28
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
29
29
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
30
|
+
var NotVipCanAddAccountCount = 10;
|
30
31
|
var HomePageAccountList = function HomePageAccountList(_ref) {
|
31
32
|
var apiUrl = _ref.apiUrl,
|
32
33
|
env = _ref.env,
|
34
|
+
notVip = _ref.notVip,
|
33
35
|
_ref$onMenu = _ref.onMenu,
|
34
36
|
onMenu = _ref$onMenu === void 0 ? function () {} : _ref$onMenu,
|
35
37
|
_ref$onListData = _ref.onListData,
|
@@ -182,31 +184,42 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
182
184
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
183
185
|
while (1) switch (_context.prev = _context.next) {
|
184
186
|
case 0:
|
185
|
-
if (
|
187
|
+
if (!notVip) {
|
186
188
|
_context.next = 4;
|
187
189
|
break;
|
188
190
|
}
|
191
|
+
if (!(listData.length >= NotVipCanAddAccountCount)) {
|
192
|
+
_context.next = 4;
|
193
|
+
break;
|
194
|
+
}
|
195
|
+
Tool.toast("\u4E0D\u662F\u4F1A\u5458\uFF0C\u53EA\u80FD\u6DFB\u52A0 ".concat(NotVipCanAddAccountCount, "\u4E2A\u8D26\u6237"));
|
196
|
+
return _context.abrupt("return");
|
197
|
+
case 4:
|
198
|
+
if (isInstalledChrome()) {
|
199
|
+
_context.next = 8;
|
200
|
+
break;
|
201
|
+
}
|
189
202
|
Tool.toast('没有安装谷歌浏览器(Chrome),请安装');
|
190
203
|
onMenu('setting');
|
191
204
|
return _context.abrupt("return");
|
192
|
-
case
|
205
|
+
case 8:
|
193
206
|
console.log('onAdd:', platform);
|
194
207
|
settingConfig = AccountManageSettingConfig();
|
195
208
|
if (settingConfig.chromeUserDataDir) {
|
196
|
-
_context.next =
|
209
|
+
_context.next = 14;
|
197
210
|
break;
|
198
211
|
}
|
199
212
|
notification.notificationError('请先设置:“谷歌浏览器 - 多开位置”', '选个稍微大点的盘存储,每个用户会有几百M的数据');
|
200
213
|
onMenu('setting');
|
201
214
|
return _context.abrupt("return");
|
202
|
-
case
|
215
|
+
case 14:
|
203
216
|
if (!(listData.length >= 200)) {
|
204
|
-
_context.next =
|
217
|
+
_context.next = 17;
|
205
218
|
break;
|
206
219
|
}
|
207
220
|
notification.notificationError('这电脑绑定到上限了', '每台电脑最多绑定 200 个账号');
|
208
221
|
return _context.abrupt("return");
|
209
|
-
case
|
222
|
+
case 17:
|
210
223
|
toast('正在启动浏览器,请扫码登录', 12);
|
211
224
|
|
212
225
|
// const platformName = platform ; // == 'kuaishou' ? 'kwai' : '';
|
@@ -218,12 +231,12 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
218
231
|
chromeProfileName = Date.now() + '-' + Tool.math.randWord(16);
|
219
232
|
videoPlatformInfo = VideoPlatformDict[platform];
|
220
233
|
if (videoPlatformInfo) {
|
221
|
-
_context.next =
|
234
|
+
_context.next = 23;
|
222
235
|
break;
|
223
236
|
}
|
224
237
|
toast('请配置信息:' + platform);
|
225
238
|
return _context.abrupt("return");
|
226
|
-
case
|
239
|
+
case 23:
|
227
240
|
openChrome({
|
228
241
|
action: 'add-account',
|
229
242
|
platform: platform,
|
@@ -237,7 +250,7 @@ var HomePageAccountList = function HomePageAccountList(_ref) {
|
|
237
250
|
proxyInfo: proxyInfo,
|
238
251
|
isOpen: true // settingConfig.isChromeOpen,
|
239
252
|
}, true, env);
|
240
|
-
case
|
253
|
+
case 24:
|
241
254
|
case "end":
|
242
255
|
return _context.stop();
|
243
256
|
}
|
@@ -26,7 +26,8 @@ var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
|
|
26
26
|
var disabled = _ref.disabled,
|
27
27
|
productType = _ref.productType,
|
28
28
|
apiUrl = _ref.apiUrl,
|
29
|
-
env = _ref.env
|
29
|
+
env = _ref.env,
|
30
|
+
notVip = _ref.notVip;
|
30
31
|
var _Form$useForm = Form.useForm(),
|
31
32
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
32
33
|
form = _Form$useForm2[0];
|
@@ -252,8 +253,8 @@ var VideoPublishCreateTask = function VideoPublishCreateTask(_ref) {
|
|
252
253
|
// error={errorAccountList}
|
253
254
|
// onReload={runAccountList}
|
254
255
|
, {
|
255
|
-
children: [
|
256
|
-
message: "\
|
256
|
+
children: [notVip && /*#__PURE__*/_jsx(Alert, {
|
257
|
+
message: "\u4E0D\u662F\u4F1A\u5458\uFF0C\u6682\u4E0D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",
|
257
258
|
type: "warning",
|
258
259
|
showIcon: true,
|
259
260
|
style: {
|
@@ -24,6 +24,7 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
24
24
|
var disabled = _ref.disabled,
|
25
25
|
_ref$canPublish = _ref.canPublish,
|
26
26
|
canPublish = _ref$canPublish === void 0 ? false : _ref$canPublish,
|
27
|
+
notVip = _ref.notVip,
|
27
28
|
contentHeight = _ref.contentHeight,
|
28
29
|
productType = _ref.productType,
|
29
30
|
apiUrl = _ref.apiUrl,
|
@@ -49,6 +50,7 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
49
50
|
children: /*#__PURE__*/_jsx(VideoPublishAccountManageHomePage, {
|
50
51
|
apiUrl: apiUrl,
|
51
52
|
env: env,
|
53
|
+
notVip: notVip,
|
52
54
|
canPublish: canPublish,
|
53
55
|
onMenu: function onMenu(key) {
|
54
56
|
return _onMenu(key);
|
@@ -69,7 +71,8 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
69
71
|
forceRender: true,
|
70
72
|
children: /*#__PURE__*/_jsx(ActiveAccountMode, {
|
71
73
|
disabled: disabled,
|
72
|
-
env: env
|
74
|
+
env: env,
|
75
|
+
notVip: notVip
|
73
76
|
})
|
74
77
|
}, {
|
75
78
|
key: 'topic',
|
@@ -99,7 +102,8 @@ var VideoPublish = function VideoPublish(_ref) {
|
|
99
102
|
disabled: disabled,
|
100
103
|
productType: productType,
|
101
104
|
apiUrl: apiUrl,
|
102
|
-
env: env
|
105
|
+
env: env,
|
106
|
+
notVip: notVip
|
103
107
|
})
|
104
108
|
}, {
|
105
109
|
key: 'task-list',
|
@@ -11,12 +11,15 @@
|
|
11
11
|
//margin: 0 12px 0 0;
|
12
12
|
padding: 0 10px 0 0;
|
13
13
|
min-height: 100%;
|
14
|
+
height: 100%;
|
15
|
+
|
14
16
|
border-right: 1px solid #E8E8E8;
|
15
17
|
|
16
18
|
.menuWarp{
|
17
19
|
position: fixed;
|
18
20
|
width: 170px;
|
19
21
|
margin: 0 12px 0 0;
|
22
|
+
overflow-y: auto;
|
20
23
|
}
|
21
24
|
.menu{
|
22
25
|
}
|
@@ -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(
|
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__*/
|
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,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;
|
@@ -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:
|
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;
|
package/dist/lib/Tool.d.ts
CHANGED
@@ -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: "
|
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;
|
package/dist/types/User.d.ts
CHANGED