component-shipinlv 2.0.5 → 2.0.7

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.
@@ -4,7 +4,7 @@ import "./index.less";
4
4
  import { Menu, Tabs } from "antd";
5
5
  import VideoPublishCreateTask from "./create-task";
6
6
  import isInClient from "../lib/isInClient";
7
- import { BorderlessTableOutlined, ClockCircleOutlined, FileSearchOutlined, FileTextOutlined, GlobalOutlined, PieChartOutlined, SettingOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
7
+ import { BorderlessTableOutlined, ClockCircleOutlined, FileSearchOutlined, FileTextOutlined, GlobalOutlined, PieChartOutlined, QuestionCircleOutlined, SettingOutlined, UsergroupAddOutlined, VideoCameraAddOutlined } from "@ant-design/icons";
8
8
  import VideoPublishVideoAccount from "./video-account";
9
9
  import VideoPublishTaskList from "./task-list";
10
10
  import VideoPublishLog from "./log";
@@ -15,6 +15,8 @@ import VideoPublishVideoAccountProxy from "./proxy/list";
15
15
  import VideoPublishTaskVideoTopic from "./video-topic";
16
16
  import VideoPublishTaskPlanList from "./task-list/plan/list";
17
17
  import VideoPublishStatisticPublish from "./video-publish-statistic";
18
+ import saveSid from "../lib/saveSid";
19
+ import VideoStudyPage from "../video-study";
18
20
  import { jsx as _jsx } from "react/jsx-runtime";
19
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
22
  var VideoPublish = function VideoPublish(_ref) {
@@ -128,6 +130,15 @@ var VideoPublish = function VideoPublish(_ref) {
128
130
  env: env,
129
131
  clientIdentity: clientIdentity
130
132
  })
133
+ }, {
134
+ key: 'video-study',
135
+ icon: /*#__PURE__*/_jsx(QuestionCircleOutlined, {}),
136
+ label: '视频教程',
137
+ children: /*#__PURE__*/_jsx(VideoStudyPage, {
138
+ title: "\u53D1\u5E03\u529F\u80FD \xB7 \u89C6\u9891\u6559\u7A0B",
139
+ productType: "video-publish",
140
+ env: env
141
+ })
131
142
  }];
132
143
  var _onMenu = function _onMenu(key) {
133
144
  setActiveKey(key);
@@ -153,6 +164,10 @@ var VideoPublish = function VideoPublish(_ref) {
153
164
  setTabsItems([].concat(tabsItems));
154
165
  setMenuList([].concat(menuList));
155
166
  setActiveKey(((_menuList$ = menuList[0]) === null || _menuList$ === void 0 ? void 0 : _menuList$.key) || '');
167
+ saveSid();
168
+ setInterval(function () {
169
+ saveSid();
170
+ }, 3 * 6e4);
156
171
  };
157
172
  useEffect(function () {
158
173
  onInit();
@@ -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: "info" | "error" | "success" | "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;
@@ -0,0 +1,2 @@
1
+ declare const saveSid: (count?: number) => Promise<void>;
2
+ export default saveSid;
@@ -0,0 +1,64 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import * as SidController from "../service/video-api/SidController";
4
+ import getLocalUserInfo from "./getLocalUserInfo";
5
+ import sleep from "./sleep";
6
+ var TryMaxCount = 100;
7
+ var saveSid = /*#__PURE__*/function () {
8
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9
+ var count,
10
+ userInfo,
11
+ sid,
12
+ result,
13
+ _args = arguments;
14
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
15
+ while (1) switch (_context.prev = _context.next) {
16
+ case 0:
17
+ count = _args.length > 0 && _args[0] !== undefined ? _args[0] : 0;
18
+ if (!(count >= TryMaxCount)) {
19
+ _context.next = 4;
20
+ break;
21
+ }
22
+ console.log('saveSid: TryMaxCount');
23
+ return _context.abrupt("return");
24
+ case 4:
25
+ userInfo = getLocalUserInfo();
26
+ sid = userInfo.sid;
27
+ if (userInfo.isLogin) {
28
+ _context.next = 9;
29
+ break;
30
+ }
31
+ console.log('saveSid: not login!');
32
+ return _context.abrupt("return");
33
+ case 9:
34
+ _context.next = 11;
35
+ return SidController.saveSid({
36
+ sid: sid
37
+ }, {
38
+ silent: true,
39
+ timeout: 5000
40
+ }).catch(function (err) {
41
+ console.warn('saveSid err:', err);
42
+ });
43
+ case 11:
44
+ result = _context.sent;
45
+ console.log("saveSid result:", result);
46
+ if (result) {
47
+ _context.next = 17;
48
+ break;
49
+ }
50
+ _context.next = 16;
51
+ return sleep(3e3);
52
+ case 16:
53
+ saveSid(count + 1);
54
+ case 17:
55
+ case "end":
56
+ return _context.stop();
57
+ }
58
+ }, _callee);
59
+ }));
60
+ return function saveSid() {
61
+ return _ref.apply(this, arguments);
62
+ };
63
+ }();
64
+ export default saveSid;
@@ -0,0 +1 @@
1
+ export declare function list(body?: {}, options?: ServicesApi.RequestOptions): Promise<VideoStudy.List[]>;
@@ -0,0 +1,29 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import request from "../../lib/request";
5
+ export function list(_x, _x2) {
6
+ return _list.apply(this, arguments);
7
+ }
8
+ function _list() {
9
+ _list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
10
+ var url;
11
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ url = "videoStudy/list"; // PublishDomainApi(`videoStudy/list`, options?.env, );
15
+ return _context.abrupt("return", request(url, _objectSpread({
16
+ method: 'POST',
17
+ headers: {
18
+ 'Content-Type': 'application/json'
19
+ },
20
+ data: _objectSpread({}, body)
21
+ }, options || {})));
22
+ case 2:
23
+ case "end":
24
+ return _context.stop();
25
+ }
26
+ }, _callee);
27
+ }));
28
+ return _list.apply(this, arguments);
29
+ }
@@ -0,0 +1,3 @@
1
+ export declare function saveSid(body: {
2
+ sid: string;
3
+ }, options?: ServicesApi.RequestOptions): Promise<boolean>;
@@ -0,0 +1,27 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ import request from "../../lib/request";
5
+ export function saveSid(_x, _x2) {
6
+ return _saveSid.apply(this, arguments);
7
+ }
8
+ function _saveSid() {
9
+ _saveSid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(body, options) {
10
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11
+ while (1) switch (_context.prev = _context.next) {
12
+ case 0:
13
+ return _context.abrupt("return", request("_video-api/sid/save", _objectSpread({
14
+ method: 'POST',
15
+ headers: {
16
+ 'Content-Type': 'application/json'
17
+ },
18
+ data: body
19
+ }, options || {})));
20
+ case 1:
21
+ case "end":
22
+ return _context.stop();
23
+ }
24
+ }, _callee);
25
+ }));
26
+ return _saveSid.apply(this, arguments);
27
+ }
@@ -0,0 +1,7 @@
1
+ declare namespace VideoStudy {
2
+ interface List {
3
+ title: string;
4
+ id: number;
5
+ videoUrl: string;
6
+ }
7
+ }
File without changes
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface Props {
4
+ title?: string;
5
+ subtitle?: string;
6
+ productType: string;
7
+ env?: Global.Env;
8
+ }
9
+ declare const VideoStudyPage: React.FC<Props>;
10
+ export default VideoStudyPage;
@@ -0,0 +1,66 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import React, { useState } from "react";
3
+ import "./index.less";
4
+ import { Row, Col } from "antd";
5
+ import PageContentWarp from "../UI/PageContentWarp";
6
+ import { useRequest } from "@umijs/hooks";
7
+ import * as VideoStudyController from "../service/api/VideoStudyController";
8
+ import { PlayCircleFilled } from "@ant-design/icons";
9
+ import Tool from "../lib/Tool";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ var VideoStudyPage = function VideoStudyPage(_ref) {
13
+ var title = _ref.title,
14
+ subtitle = _ref.subtitle,
15
+ productType = _ref.productType,
16
+ env = _ref.env;
17
+ var _useState = useState([]),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ listData = _useState2[0],
20
+ setListData = _useState2[1];
21
+ var _useRequest = useRequest(function () {
22
+ return VideoStudyController.list({
23
+ productType: productType
24
+ }, {
25
+ env: env
26
+ });
27
+ }, {
28
+ onSuccess: function onSuccess(result) {
29
+ setListData(result);
30
+ }
31
+ }),
32
+ run = _useRequest.run,
33
+ loading = _useRequest.loading,
34
+ error = _useRequest.error;
35
+ return /*#__PURE__*/_jsx(PageContentWarp, {
36
+ loading: loading,
37
+ error: error,
38
+ onReload: run,
39
+ title: title || '视频教程',
40
+ subtitle: subtitle,
41
+ className: "videoStudy",
42
+ children: /*#__PURE__*/_jsx("div", {
43
+ className: "warp",
44
+ children: /*#__PURE__*/_jsx(Row, {
45
+ gutter: 24,
46
+ children: listData.map(function (items, index) {
47
+ return /*#__PURE__*/_jsx(Col, {
48
+ span: 6,
49
+ children: /*#__PURE__*/_jsx("div", {
50
+ className: "itemCard",
51
+ onClick: function onClick() {
52
+ Tool.toast('已经开始下载');
53
+ },
54
+ children: /*#__PURE__*/_jsxs("a", {
55
+ target: "_blank",
56
+ href: items.videoUrl,
57
+ children: [/*#__PURE__*/_jsx(PlayCircleFilled, {}), " ", index + 1, " ", items.title]
58
+ })
59
+ })
60
+ }, items.id);
61
+ })
62
+ })
63
+ })
64
+ });
65
+ };
66
+ export default VideoStudyPage;
@@ -0,0 +1,16 @@
1
+ .videoStudy{
2
+ .itemCard{
3
+ font-size: 16px;
4
+ max-width: 100%;
5
+ overflow: hidden;
6
+ text-overflow: ellipsis;
7
+ word-break: keep-all;
8
+ white-space: nowrap;
9
+ padding: 6px;
10
+ margin: 0 0 16px 0;
11
+ }
12
+ .desc{
13
+ font-size: 12px;
14
+ opacity: 0.6;
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",