@titaui/pc 1.11.21-beta.10 → 1.11.21-beta.4
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/lib/components/dynamic/dynamic-list/index.js +11 -3
- package/lib/components/dynamic/index.js +9 -12
- package/lib/components/dynamic/request-api.js +7 -68
- package/lib/components/nav-top/index.js +6 -3
- package/lib/components/wechat-btn/index.js +27 -15
- package/package.json +2 -2
- package/lib/components/dynamic/advertise/components/next-btn/index.css +0 -27
- package/lib/components/dynamic/advertise/components/next-btn/index.js +0 -32
- package/lib/components/dynamic/advertise/components/pre-btn/index.css +0 -26
- package/lib/components/dynamic/advertise/components/pre-btn/index.js +0 -32
- package/lib/components/dynamic/advertise/index.css +0 -21
- package/lib/components/dynamic/advertise/index.js +0 -126
- package/lib/components/dynamic/advertise/interface.js +0 -5
- package/lib/components/dynamic/advertise/util.js +0 -28
- package/lib/components/dynamic/components/dynamic-search-input/index.css +0 -81
- package/lib/components/dynamic/components/dynamic-search-input/index.js +0 -203
- package/lib/components/dynamic/components/first-level-tabs/index.css +0 -101
- package/lib/components/dynamic/components/first-level-tabs/index.js +0 -131
- package/lib/components/dynamic/dynamic-like-ranking/image/like-ranking.svg +0 -23
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-1.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-2.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-3.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/image/ranking-empty.png +0 -0
- package/lib/components/dynamic/dynamic-like-ranking/index.css +0 -146
- package/lib/components/dynamic/dynamic-like-ranking/index.js +0 -180
- package/lib/components/dynamic/dynamic-like-ranking/item.js +0 -105
- package/lib/components/dynamic/dynamic-like-ranking/mock.js +0 -84
- package/lib/components/dynamic/dynamic-liking/image/like-dynamic.svg +0 -30
- package/lib/components/dynamic/dynamic-liking/index.css +0 -81
- package/lib/components/dynamic/dynamic-liking/index.js +0 -79
- package/lib/components/dynamic/dynamic-liking/item.js +0 -75
- package/lib/components/dynamic/dynamic-liking/mock.js +0 -83
- package/lib/components/dynamic/dynamic-topping/image/quotation-mark.svg +0 -16
- package/lib/components/dynamic/dynamic-topping/image/top-icon.svg +0 -30
- package/lib/components/dynamic/dynamic-topping/index.css +0 -141
- package/lib/components/dynamic/dynamic-topping/index.js +0 -82
- package/lib/components/dynamic/dynamic-topping/interface.js +0 -5
- package/lib/components/dynamic/dynamic-topping/item.js +0 -153
- package/lib/components/dynamic/dynamic-topping/request-api.js +0 -36
- package/lib/components/dynamic/dynamic.css +0 -173
- package/lib/components/dynamic/dynamic.js +0 -428
- package/lib/components/dynamic/export-module/index.js +0 -37
- package/lib/components/dynamic/img/dynamic-top.svg +0 -14
- package/lib/components/dynamic/my-team/img/add-subordinate.png +0 -0
- package/lib/components/dynamic/my-team/img/line.png +0 -0
- package/lib/components/dynamic/my-team/img/team.png +0 -0
- package/lib/components/dynamic/my-team/index.css +0 -184
- package/lib/components/dynamic/my-team/index.js +0 -263
- package/lib/components/dynamic/my-team/request-api.js +0 -52
- package/lib/components/dynamic/my-team/util.js +0 -20
- package/lib/components/dynamic/new-ui.css +0 -192
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.css +0 -58
- package/lib/components/dynamic/online-broadcast/components/broadcast-item/index.js +0 -68
- package/lib/components/dynamic/online-broadcast/data.js +0 -77
- package/lib/components/dynamic/online-broadcast/img/broadcast.svg +0 -14
- package/lib/components/dynamic/online-broadcast/img/new.png +0 -0
- package/lib/components/dynamic/online-broadcast/img/preview.png +0 -0
- package/lib/components/dynamic/online-broadcast/index.css +0 -46
- package/lib/components/dynamic/online-broadcast/index.js +0 -61
- package/lib/components/dynamic/online-broadcast/interfact.js +0 -5
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-announcement/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-okr/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-okr/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-share/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-share/index.js +0 -39
- package/lib/components/dynamic/quick-operation/components/create-task/index.css +0 -25
- package/lib/components/dynamic/quick-operation/components/create-task/index.js +0 -44
- package/lib/components/dynamic/quick-operation/img/new-announcement.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-okr.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-share.png +0 -0
- package/lib/components/dynamic/quick-operation/img/new-task.png +0 -0
- package/lib/components/dynamic/quick-operation/index.css +0 -51
- package/lib/components/dynamic/quick-operation/index.js +0 -120
|
@@ -17,6 +17,8 @@ var _conditionRender = _interopRequireDefault(require("../../condition-render"))
|
|
|
17
17
|
|
|
18
18
|
var _getLocale = require("../../../utils/getLocale");
|
|
19
19
|
|
|
20
|
+
var _context = require("../context");
|
|
21
|
+
|
|
20
22
|
require("./index.css");
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -29,7 +31,9 @@ var DynamicList = function DynamicList(_ref) {
|
|
|
29
31
|
dynamicShareIsShowToping = _ref.dynamicShareIsShowToping,
|
|
30
32
|
onDeleteFeed = _ref.onDeleteFeed,
|
|
31
33
|
_ref$height = _ref.height,
|
|
32
|
-
height = _ref$height === void 0 ? -1 : _ref$height
|
|
34
|
+
height = _ref$height === void 0 ? -1 : _ref$height,
|
|
35
|
+
_ref$searchKeyWord = _ref.searchKeyWord,
|
|
36
|
+
searchKeyWord = _ref$searchKeyWord === void 0 ? "" : _ref$searchKeyWord;
|
|
33
37
|
|
|
34
38
|
var handleDeleteFeed = function handleDeleteFeed(feedId) {
|
|
35
39
|
if (onDeleteFeed) {
|
|
@@ -37,7 +41,11 @@ var DynamicList = function DynamicList(_ref) {
|
|
|
37
41
|
}
|
|
38
42
|
};
|
|
39
43
|
|
|
40
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement(_context.SearchKeyContext.Provider, {
|
|
45
|
+
value: {
|
|
46
|
+
searchKeyWord: searchKeyWord
|
|
47
|
+
}
|
|
48
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
41
49
|
className: prefix,
|
|
42
50
|
style: {
|
|
43
51
|
minHeight: height === -1 ? "auto" : height
|
|
@@ -72,7 +80,7 @@ var DynamicList = function DynamicList(_ref) {
|
|
|
72
80
|
onDeleteFeed: handleDeleteFeed,
|
|
73
81
|
dynamicShareIsShowToping: dynamicShareIsShowToping
|
|
74
82
|
}));
|
|
75
|
-
}))));
|
|
83
|
+
})))));
|
|
76
84
|
};
|
|
77
85
|
|
|
78
86
|
var _default = DynamicList;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = void 0;
|
|
9
7
|
|
|
10
|
-
var
|
|
8
|
+
var _dynamicList = _interopRequireDefault(require("./dynamic-list"));
|
|
9
|
+
|
|
10
|
+
var _dynamicItem = _interopRequireDefault(require("./dynamic-item"));
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var _context = require("./context");
|
|
13
13
|
|
|
14
|
-
function
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_exportModule["default"].QuickOperation = _exportModule.DynamicQuickOperation;
|
|
21
|
-
_exportModule["default"].Topping = _exportModule.DynamicTopping;
|
|
22
|
-
var _default = _exportModule["default"];
|
|
16
|
+
var Dynamic = _dynamicList["default"];
|
|
17
|
+
Dynamic.Item = _dynamicItem["default"];
|
|
18
|
+
Dynamic.SearchKeyContext = _context.SearchKeyContext;
|
|
19
|
+
var _default = Dynamic;
|
|
23
20
|
exports["default"] = _default;
|
|
@@ -3,105 +3,44 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.topDynamic = exports.
|
|
6
|
+
exports.topDynamic = exports.deleteDynamic = exports.collectDynamic = exports.cancelTopDynamic = exports.cancelCollectDynamic = void 0;
|
|
7
7
|
|
|
8
8
|
var _request = require("../../utils/request");
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
|
|
16
10
|
// @ts-ignore
|
|
17
11
|
var userId = BSGlobal && BSGlobal.loginUserInfo.Id || 0;
|
|
18
12
|
|
|
19
13
|
var topDynamic = function topDynamic(_ref) {
|
|
20
14
|
var feedId = _ref.feedId;
|
|
21
|
-
return (0, _request.rget)(
|
|
15
|
+
return (0, _request.rget)('v2')("user/feednew/setTop?feedId=".concat(feedId));
|
|
22
16
|
};
|
|
23
17
|
|
|
24
18
|
exports.topDynamic = topDynamic;
|
|
25
19
|
|
|
26
20
|
var cancelTopDynamic = function cancelTopDynamic(_ref2) {
|
|
27
21
|
var feedId = _ref2.feedId;
|
|
28
|
-
return (0, _request.rget)(
|
|
22
|
+
return (0, _request.rget)('v2')("user/feednew/cancelTop?feedId=".concat(feedId));
|
|
29
23
|
};
|
|
30
24
|
|
|
31
25
|
exports.cancelTopDynamic = cancelTopDynamic;
|
|
32
26
|
|
|
33
27
|
var collectDynamic = function collectDynamic(_ref3) {
|
|
34
28
|
var feedId = _ref3.feedId;
|
|
35
|
-
return (0, _request.rput)(
|
|
29
|
+
return (0, _request.rput)('v2')("user/feed/Collect?feed_id=".concat(feedId));
|
|
36
30
|
};
|
|
37
31
|
|
|
38
32
|
exports.collectDynamic = collectDynamic;
|
|
39
33
|
|
|
40
34
|
var cancelCollectDynamic = function cancelCollectDynamic(_ref4) {
|
|
41
35
|
var feedId = _ref4.feedId;
|
|
42
|
-
return (0, _request.rdelete)(
|
|
36
|
+
return (0, _request.rdelete)('v2')("user/feed/CancelCollect?feed_id=".concat(feedId));
|
|
43
37
|
};
|
|
44
38
|
|
|
45
39
|
exports.cancelCollectDynamic = cancelCollectDynamic;
|
|
46
40
|
|
|
47
41
|
var deleteDynamic = function deleteDynamic(_ref5) {
|
|
48
42
|
var feedId = _ref5.feedId;
|
|
49
|
-
return (0, _request.rdelete)(
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
exports.deleteDynamic = deleteDynamic;
|
|
53
|
-
|
|
54
|
-
var getPraise = function getPraise(_ref6) {
|
|
55
|
-
var objId = _ref6.objId,
|
|
56
|
-
_ref6$start = _ref6.start,
|
|
57
|
-
start = _ref6$start === void 0 ? "" : _ref6$start,
|
|
58
|
-
_ref6$count = _ref6.count,
|
|
59
|
-
count = _ref6$count === void 0 ? 5 : _ref6$count,
|
|
60
|
-
_ref6$objType = _ref6.objType,
|
|
61
|
-
objType = _ref6$objType === void 0 ? 10 : _ref6$objType;
|
|
62
|
-
return (0, _request.rget)("v1")("praise/get?objId=".concat(objId, "&start=&count=").concat(count, "&objType=").concat(objType));
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
exports.getPraise = getPraise;
|
|
66
|
-
|
|
67
|
-
var getRanking = function getRanking(data) {
|
|
68
|
-
return (0, _request.rpost)("v1")("praise/getRanking", data);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
exports.getRanking = getRanking;
|
|
72
|
-
|
|
73
|
-
var getLeastPariseInfo = function getLeastPariseInfo() {
|
|
74
|
-
return (0, _request.rget)("v1")("praise/getLeastPariseInfo?count=10");
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
exports.getLeastPariseInfo = getLeastPariseInfo;
|
|
78
|
-
|
|
79
|
-
var getMenu = function getMenu() {
|
|
80
|
-
return (0, _request.rget)("v2")("feed/FeedTabMenus");
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
exports.getMenu = getMenu;
|
|
84
|
-
|
|
85
|
-
var getDynamicFeedList = function getDynamicFeedList() {
|
|
86
|
-
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
87
|
-
PageSize: 20,
|
|
88
|
-
PageNum: 1,
|
|
89
|
-
KeyWord: "",
|
|
90
|
-
ChannelIds: "",
|
|
91
|
-
Domain: "",
|
|
92
|
-
TitaHost: "",
|
|
93
|
-
RequestSource: 0,
|
|
94
|
-
CommentCount: 3
|
|
95
|
-
};
|
|
96
|
-
return (0, _request.rpost)("v2")("feed/feeds", _objectSpread(_objectSpread({}, data), {}, {
|
|
97
|
-
CommentCount: 3
|
|
98
|
-
}));
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
exports.getDynamicFeedList = getDynamicFeedList;
|
|
102
|
-
|
|
103
|
-
var getAdvertise = function getAdvertise() {
|
|
104
|
-
return (0, _request.rget)("v1")("operationAd/getByTerminalType?terminalType=1");
|
|
43
|
+
return (0, _request.rdelete)('v2')("user/feed/Delete?feed_id=".concat(feedId));
|
|
105
44
|
};
|
|
106
45
|
|
|
107
|
-
exports.
|
|
46
|
+
exports.deleteDynamic = deleteDynamic;
|
|
@@ -25,12 +25,14 @@ var _version = _interopRequireDefault(require("./components/version"));
|
|
|
25
25
|
|
|
26
26
|
var _utils = require("./utils");
|
|
27
27
|
|
|
28
|
-
require("./index.css");
|
|
29
|
-
|
|
30
28
|
var _request = require("../../utils/request");
|
|
31
29
|
|
|
32
30
|
var _toast = _interopRequireDefault(require("../toast"));
|
|
33
31
|
|
|
32
|
+
var _useGlobalValue = _interopRequireDefault(require("./useGlobalValue"));
|
|
33
|
+
|
|
34
|
+
require("./index.css");
|
|
35
|
+
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
37
|
|
|
36
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -171,4 +173,5 @@ var NavTop = function NavTop() {
|
|
|
171
173
|
};
|
|
172
174
|
|
|
173
175
|
var _default = NavTop;
|
|
174
|
-
exports["default"] = _default;
|
|
176
|
+
exports["default"] = _default;
|
|
177
|
+
NavTop.useGlobalValue = _useGlobalValue["default"];
|
|
@@ -117,9 +117,11 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
117
117
|
var isMac = navigator.userAgent.match(/Mac/);
|
|
118
118
|
/**
|
|
119
119
|
* 点击企业微信图标这块稍许复杂 注释说明一下
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
120
|
+
* 先判断有没有群 没群就新建群
|
|
121
|
+
* 有群就先调用加人的接口 人本身不在群的情况 成功加人就打开进入群聊
|
|
122
|
+
* 人在群的情况 加人接口返回报错信息updateEnterpriseChat:fail_unsupported chat 则调用打开群接口
|
|
123
|
+
* 群解散的情况 则弹窗提示 联系负责人手动加群
|
|
124
|
+
* mac 不支持加人接口
|
|
123
125
|
*/
|
|
124
126
|
|
|
125
127
|
var handleClickWechatBtn = function handleClickWechatBtn() {
|
|
@@ -129,19 +131,34 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
129
131
|
wx.invoke('openExistedChatWithMsg', {
|
|
130
132
|
chatId: chatId
|
|
131
133
|
}, function (res) {
|
|
132
|
-
console.log(res.err_msg);
|
|
133
|
-
|
|
134
134
|
if (res.err_msg === 'openExistedChatWithMsg:ok') {
|
|
135
135
|
console.log('打开群成功');
|
|
136
136
|
} else {
|
|
137
137
|
if (isMac) {
|
|
138
138
|
setMacWarnModalVisible(true);
|
|
139
139
|
} else {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
140
|
+
wx.invoke('updateEnterpriseChat', {
|
|
141
|
+
chatId: chatId,
|
|
142
|
+
userIdsToAdd: loginUserOpenId
|
|
143
|
+
}, function (res) {
|
|
144
|
+
console.log(chatId);
|
|
145
|
+
|
|
146
|
+
if (res.err_msg == 'updateEnterpriseChat:ok') {
|
|
147
|
+
wx.invoke('openExistedChatWithMsg', {
|
|
148
|
+
chatId: chatId
|
|
149
|
+
}, function (res) {
|
|
150
|
+
if (res.err_msg == 'openExistedChatWithMsg:ok') {
|
|
151
|
+
console.log('打开群成功');
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
} else {
|
|
155
|
+
if (userId === principalUser.userId) {
|
|
156
|
+
setPrincipalUserModalVisible(true);
|
|
157
|
+
} else {
|
|
158
|
+
setMemberVisible(true);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
});
|
|
145
162
|
}
|
|
146
163
|
}
|
|
147
164
|
});
|
|
@@ -258,11 +275,6 @@ var WeChatBtn = function WeChatBtn(props) {
|
|
|
258
275
|
setApply('任务');
|
|
259
276
|
}
|
|
260
277
|
}, []);
|
|
261
|
-
|
|
262
|
-
if (!isShowWeChat) {
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
278
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
267
279
|
overlay: tooltip,
|
|
268
280
|
placement: "bottom"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titaui/pc",
|
|
3
|
-
"version": "1.11.21-beta.
|
|
3
|
+
"version": "1.11.21-beta.4",
|
|
4
4
|
"nameCN": "",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"react-transition-group": "4.4.2",
|
|
145
145
|
"resize-observer-polyfill": "1.5.1",
|
|
146
146
|
"slick-carousel": "1.8.1",
|
|
147
|
-
"tita-ui": "1.2.
|
|
147
|
+
"tita-ui": "1.2.56",
|
|
148
148
|
"url-parse": "1.5.1",
|
|
149
149
|
"uuid": "3.1.0",
|
|
150
150
|
"viewerjs": "1.10.1",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
.titaui-dynamic-advertise-next-btn {
|
|
2
|
-
width: 24px;
|
|
3
|
-
height: 24px;
|
|
4
|
-
background: rgba(0, 0, 0, 0.4);
|
|
5
|
-
border-radius: 50%;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: 50%;
|
|
12
|
-
transform: translateY(-50%);
|
|
13
|
-
z-index: 1;
|
|
14
|
-
right: 16px;
|
|
15
|
-
opacity: 1;
|
|
16
|
-
transition: all 0.3s linear;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.titaui-dynamic-advertise-next-btn__icon {
|
|
20
|
-
font-size: 16px;
|
|
21
|
-
transform: rotate(180deg);
|
|
22
|
-
color: #ffffff;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.titaui-dynamic-advertise-next-btn--hidden {
|
|
26
|
-
opacity: 0;
|
|
27
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
|
-
require("./index.css");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
|
|
18
|
-
var prefix = "titaui-dynamic-advertise-next-btn";
|
|
19
|
-
|
|
20
|
-
var NextBtn = function NextBtn(_ref) {
|
|
21
|
-
var onClick = _ref.onClick,
|
|
22
|
-
isShow = _ref.isShow;
|
|
23
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
24
|
-
className: (0, _classnames["default"])(prefix, _defineProperty({}, "".concat(prefix, "--hidden"), !isShow)),
|
|
25
|
-
onClick: onClick
|
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
27
|
-
className: (0, _classnames["default"])("tu-icon-left", "".concat(prefix, "__icon"))
|
|
28
|
-
}));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var _default = NextBtn;
|
|
32
|
-
exports["default"] = _default;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.titaui-dynamic-advertise-pre-btn {
|
|
2
|
-
width: 24px;
|
|
3
|
-
height: 24px;
|
|
4
|
-
background: rgba(0, 0, 0, 0.4);
|
|
5
|
-
border-radius: 50%;
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
position: absolute;
|
|
11
|
-
top: 50%;
|
|
12
|
-
left: 16px;
|
|
13
|
-
transform: translateY(-50%);
|
|
14
|
-
z-index: 1;
|
|
15
|
-
opacity: 1;
|
|
16
|
-
transition: all 0.3s linear;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.titaui-dynamic-advertise-pre-btn__icon {
|
|
20
|
-
font-size: 16px;
|
|
21
|
-
color: #ffffff;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.titaui-dynamic-advertise-pre-btn--hidden {
|
|
25
|
-
opacity: 0;
|
|
26
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
|
-
require("./index.css");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
|
|
18
|
-
var prefix = "titaui-dynamic-advertise-pre-btn";
|
|
19
|
-
|
|
20
|
-
var PreBtn = function PreBtn(_ref) {
|
|
21
|
-
var onClick = _ref.onClick,
|
|
22
|
-
isShow = _ref.isShow;
|
|
23
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
24
|
-
className: (0, _classnames["default"])(prefix, _defineProperty({}, "".concat(prefix, "--hidden"), !isShow)),
|
|
25
|
-
onClick: onClick
|
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
27
|
-
className: (0, _classnames["default"])("tu-icon-left", "".concat(prefix, "__icon"))
|
|
28
|
-
}));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var _default = PreBtn;
|
|
32
|
-
exports["default"] = _default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
.tutaui-dynamic-advertise {
|
|
2
|
-
width: 278px;
|
|
3
|
-
border-radius: 12px;
|
|
4
|
-
position: relative;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.tutaui-dynamic-advertise--not-empty {
|
|
8
|
-
box-shadow: 0px 2px 12px 0px rgba(127, 145, 180, 0.2);
|
|
9
|
-
margin-top: 10px;
|
|
10
|
-
height: 136px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.tutaui-dynamic-advertise *:focus {
|
|
14
|
-
outline: none !important;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.tutaui-dynamic-advertise__img {
|
|
18
|
-
border-radius: 12px;
|
|
19
|
-
width: 278px;
|
|
20
|
-
height: 136px;
|
|
21
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _reactSlick = _interopRequireDefault(require("react-slick"));
|
|
13
|
-
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
|
-
var _requestApi = require("../request-api");
|
|
17
|
-
|
|
18
|
-
var _toast = _interopRequireDefault(require("../../toast"));
|
|
19
|
-
|
|
20
|
-
var _util = require("./util");
|
|
21
|
-
|
|
22
|
-
var _nextBtn = _interopRequireDefault(require("./components/next-btn"));
|
|
23
|
-
|
|
24
|
-
var _preBtn = _interopRequireDefault(require("./components/pre-btn"));
|
|
25
|
-
|
|
26
|
-
require("slick-carousel/slick/slick.css");
|
|
27
|
-
|
|
28
|
-
require("slick-carousel/slick/slick-theme.css");
|
|
29
|
-
|
|
30
|
-
require("./index.css");
|
|
31
|
-
|
|
32
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
-
|
|
34
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
|
|
38
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
39
|
-
|
|
40
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
|
-
|
|
42
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
|
-
|
|
44
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
45
|
-
|
|
46
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
47
|
-
|
|
48
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
49
|
-
|
|
50
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
51
|
-
|
|
52
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
-
|
|
54
|
-
var prefix = "tutaui-dynamic-advertise";
|
|
55
|
-
var settings = {
|
|
56
|
-
dots: false,
|
|
57
|
-
infinite: true,
|
|
58
|
-
speed: 1000,
|
|
59
|
-
slidesToShow: 1,
|
|
60
|
-
slidesToScroll: 1,
|
|
61
|
-
// arrows: false,
|
|
62
|
-
autoplay: true
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var DynamicAdvertise = function DynamicAdvertise() {
|
|
66
|
-
var _useState = (0, _react.useState)([]),
|
|
67
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
68
|
-
sliderData = _useState2[0],
|
|
69
|
-
setSliderData = _useState2[1];
|
|
70
|
-
|
|
71
|
-
var _useState3 = (0, _react.useState)(false),
|
|
72
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
73
|
-
isMouseEnter = _useState4[0],
|
|
74
|
-
setIsMouseEnter = _useState4[1];
|
|
75
|
-
|
|
76
|
-
var handleImgClick = function handleImgClick(link) {
|
|
77
|
-
window.open(link, "_blank");
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
var handleMouseEnter = function handleMouseEnter() {
|
|
81
|
-
setIsMouseEnter(true);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
var handleMouseLeave = function handleMouseLeave() {
|
|
85
|
-
setIsMouseEnter(false);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
(0, _react.useEffect)(function () {
|
|
89
|
-
(0, _requestApi.getAdvertise)().then(function (resp) {
|
|
90
|
-
if (resp.Code === 1 && resp.Data.length > 0) {
|
|
91
|
-
setSliderData((0, _util.formatResp)(resp.Data));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (resp.Code !== 1) {
|
|
95
|
-
_toast["default"].Error(resp.Message, {
|
|
96
|
-
canClose: false
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}, []);
|
|
101
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
|
-
className: (0, _classnames["default"])(prefix, _defineProperty({}, "".concat(prefix, "--not-empty"), sliderData.length > 0)),
|
|
103
|
-
onMouseEnter: handleMouseEnter,
|
|
104
|
-
onMouseLeave: handleMouseLeave
|
|
105
|
-
}, sliderData.length > 0 && /*#__PURE__*/_react["default"].createElement(_reactSlick["default"], _extends({}, settings, {
|
|
106
|
-
nextArrow: /*#__PURE__*/_react["default"].createElement(_nextBtn["default"], {
|
|
107
|
-
isShow: isMouseEnter
|
|
108
|
-
}),
|
|
109
|
-
prevArrow: /*#__PURE__*/_react["default"].createElement(_preBtn["default"], {
|
|
110
|
-
isShow: isMouseEnter
|
|
111
|
-
})
|
|
112
|
-
}), sliderData.map(function (item) {
|
|
113
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
114
|
-
onClick: function onClick() {
|
|
115
|
-
handleImgClick(item.link);
|
|
116
|
-
}
|
|
117
|
-
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
118
|
-
className: "".concat(prefix, "__img"),
|
|
119
|
-
src: item.img,
|
|
120
|
-
alt: item.name
|
|
121
|
-
}));
|
|
122
|
-
})));
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
var _default = DynamicAdvertise;
|
|
126
|
-
exports["default"] = _default;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.formatResp = void 0;
|
|
7
|
-
|
|
8
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
-
|
|
10
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
|
-
|
|
12
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
|
|
14
|
-
var formatResp = function formatResp(data) {
|
|
15
|
-
if (!data || data.length === 0) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return data.map(function (item) {
|
|
20
|
-
var content = JSON.parse(item.content);
|
|
21
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
22
|
-
img: content.picUrl,
|
|
23
|
-
link: content.link
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
exports.formatResp = formatResp;
|