You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Activity__index.5f9ff39f...

597 lines
28 KiB

"use strict";
(self["webpackChunk"] = self["webpackChunk"] || []).push([[15371],{
/***/ 33853:
/*!******************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LeftOutlined.js + 1 modules ***!
\******************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_LeftOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(54476);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/LeftOutlined.js
// This icon file is generated automatically.
var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
/* harmony default export */ var asn_LeftOutlined = (LeftOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(7657);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/LeftOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var LeftOutlined_LeftOutlined = function LeftOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_LeftOutlined
}));
};
/**![left](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcyNCAyMTguM1YxNDFjMC02LjctNy43LTEwLjQtMTIuOS02LjNMMjYwLjMgNDg2LjhhMzEuODYgMzEuODYgMCAwMDAgNTAuM2w0NTAuOCAzNTIuMWM1LjMgNC4xIDEyLjkuNCAxMi45LTYuM3YtNzcuM2MwLTQuOS0yLjMtOS42LTYuMS0xMi42bC0zNjAtMjgxIDM2MC0yODEuMWMzLjgtMyA2LjEtNy43IDYuMS0xMi42eiIgLz48L3N2Zz4=) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(LeftOutlined_LeftOutlined);
if (false) {}
/* harmony default export */ var icons_LeftOutlined = (RefIcon);
/***/ }),
/***/ 38819:
/*!*******************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/RightOutlined.js + 1 modules ***!
\*******************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_RightOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(54476);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/RightOutlined.js
// This icon file is generated automatically.
var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
/* harmony default export */ var asn_RightOutlined = (RightOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(7657);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/RightOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var RightOutlined_RightOutlined = function RightOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_RightOutlined
}));
};
/**![right](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTc2NS43IDQ4Ni44TDMxNC45IDEzNC43QTcuOTcgNy45NyAwIDAwMzAyIDE0MXY3Ny4zYzAgNC45IDIuMyA5LjYgNi4xIDEyLjZsMzYwIDI4MS4xLTM2MCAyODEuMWMtMy45IDMtNi4xIDcuNy02LjEgMTIuNlY4ODNjMCA2LjcgNy43IDEwLjQgMTIuOSA2LjNsNDUwLjgtMzUyLjFhMzEuOTYgMzEuOTYgMCAwMDAtNTAuNHoiIC8+PC9zdmc+) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(RightOutlined_RightOutlined);
if (false) {}
/* harmony default export */ var icons_RightOutlined = (RefIcon);
/***/ }),
/***/ 47472:
/*!********************************************************************************************************!*\
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/SearchOutlined.js + 1 modules ***!
\********************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Z: function() { return /* binding */ icons_SearchOutlined; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.4@@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(54476);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/SearchOutlined.js
// This icon file is generated automatically.
var SearchOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" } }] }, "name": "search", "theme": "outlined" };
/* harmony default export */ var asn_SearchOutlined = (SearchOutlined);
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
var AntdIcon = __webpack_require__(7657);
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/SearchOutlined.js
// GENERATE BY ./scripts/generate.ts
// DON NOT EDIT IT MANUALLY
var SearchOutlined_SearchOutlined = function SearchOutlined(props, ref) {
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
ref: ref,
icon: asn_SearchOutlined
}));
};
/**![search](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTkwOS42IDg1NC41TDY0OS45IDU5NC44QzY5MC4yIDU0Mi43IDcxMiA0NzkgNzEyIDQxMmMwLTgwLjItMzEuMy0xNTUuNC04Ny45LTIxMi4xLTU2LjYtNTYuNy0xMzItODcuOS0yMTIuMS04Ny45cy0xNTUuNSAzMS4zLTIxMi4xIDg3LjlDMTQzLjIgMjU2LjUgMTEyIDMzMS44IDExMiA0MTJjMCA4MC4xIDMxLjMgMTU1LjUgODcuOSAyMTIuMUMyNTYuNSA2ODAuOCAzMzEuOCA3MTIgNDEyIDcxMmM2NyAwIDEzMC42LTIxLjggMTgyLjctNjJsMjU5LjcgMjU5LjZhOC4yIDguMiAwIDAwMTEuNiAwbDQzLjYtNDMuNWE4LjIgOC4yIDAgMDAwLTExLjZ6TTU3MC40IDU3MC40QzUyOCA2MTIuNyA0NzEuOCA2MzYgNDEyIDYzNnMtMTE2LTIzLjMtMTU4LjQtNjUuNkMyMTEuMyA1MjggMTg4IDQ3MS44IDE4OCA0MTJzMjMuMy0xMTYuMSA2NS42LTE1OC40QzI5NiAyMTEuMyAzNTIuMiAxODggNDEyIDE4OHMxMTYuMSAyMy4yIDE1OC40IDY1LjZTNjM2IDM1Mi4yIDYzNiA0MTJzLTIzLjMgMTE2LjEtNjUuNiAxNTguNHoiIC8+PC9zdmc+) */
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(SearchOutlined_SearchOutlined);
if (false) {}
/* harmony default export */ var icons_SearchOutlined = (RefIcon);
/***/ }),
/***/ 71281:
/*!**************************************************!*\
!*** ./src/pages/Activity/index.tsx + 1 modules ***!
\**************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
"default": function() { return /* binding */ Activity; }
});
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__(7557);
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/toConsumableArray.js
var toConsumableArray = __webpack_require__(37205);
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectSpread2.js
var objectSpread2 = __webpack_require__(82242);
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__(41498);
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
var slicedToArray = __webpack_require__(79800);
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
var _react_17_0_2_react = __webpack_require__(59301);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
var tooltip = __webpack_require__(6848);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
var spin = __webpack_require__(71418);
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/pagination/index.js + 10 modules
var pagination = __webpack_require__(58421);
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
var _umi_production_exports = __webpack_require__(64515);
;// CONCATENATED MODULE: ./src/pages/Activity/index.less?modules
// extracted by mini-css-extract-plugin
/* harmony default export */ var Activitymodules = ({"flex_box_center":"flex_box_center___CqxTC","flex_space_between":"flex_space_between___AieI0","flex_box_vertical_center":"flex_box_vertical_center___mTGtf","flex_box_center_end":"flex_box_center_end___BXgvx","flex_box_column":"flex_box_column___uuw6_","BannerStyle":"BannerStyle___YjziC","BannerStyleContent":"BannerStyleContent___UAqae","MenuStyle":"MenuStyle___WBULX","MenuItem":"MenuItem___jXmZZ","MenuItemActive":"MenuItemActive___MZYDm","TabsStyle":"TabsStyle___QCxPd","TabsItemStyle":"TabsItemStyle___j5FzC","TabsItemStyleActive":"TabsItemStyleActive___mTRtX","ListStyleItem":"ListStyleItem___Qei_c","ListStyleItemImg":"ListStyleItemImg___KQStl","ListStyleItemTime":"ListStyleItemTime___IRtSd","ListStyleItemTimeDay":"ListStyleItemTimeDay___fZBvm","ListStyleItemTimeMonth":"ListStyleItemTimeMonth___EIqFC","ListStyleItemTitle":"ListStyleItemTitle___xhofe","ListStyleItemDesc":"ListStyleItemDesc___T9JqO","ListStyleItemTag":"ListStyleItemTag___JGaXr","ListStyleItemSpan":"ListStyleItemSpan___MNSPZ","DivDownPlay":"DivDownPlay___WwqDm","CustomInputStyle":"CustomInputStyle___LlzjI"});
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
var env = __webpack_require__(51200);
// EXTERNAL MODULE: ./node_modules/_swiper@5.4.5@swiper/css/swiper.css
var swiper = __webpack_require__(2094);
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.18@dayjs/dayjs.min.js
var dayjs_min = __webpack_require__(56656);
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
// EXTERNAL MODULE: ./src/utils/fetch.ts
var fetch = __webpack_require__(87281);
// EXTERNAL MODULE: ./src/utils/authority.ts
var authority = __webpack_require__(40189);
// EXTERNAL MODULE: ./src/components/NoData/index.tsx
var NoData = __webpack_require__(37286);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Activity/index.tsx
// import Aamodal from '@/components/HomeModal/AAmodal'
var ListDom = function ListDom(_ref) {
var _data$content, _data$news_event_tags;
var data = _ref.data,
innerWidth = _ref.innerWidth;
var OpenDom = (0,_react_17_0_2_react.useRef)(null);
var _useState = (0,_react_17_0_2_react.useState)(false),
_useState2 = slicedToArray_default()(_useState, 2),
open = _useState2[0],
setOpen = _useState2[1];
var _useState3 = (0,_react_17_0_2_react.useState)(false),
_useState4 = slicedToArray_default()(_useState3, 2),
isShow = _useState4[0],
setIsShow = _useState4[1];
(0,_react_17_0_2_react.useEffect)(function () {
var _OpenDom$current;
OpenDom.current && setIsShow((OpenDom === null || OpenDom === void 0 || (_OpenDom$current = OpenDom.current) === null || _OpenDom$current === void 0 ? void 0 : _OpenDom$current.scrollHeight) > (innerWidth == 1920 ? 30 : Math.round(30 * innerWidth / 1920)));
}, [OpenDom, innerWidth]);
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Activitymodules.ListStyleItem,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: "flex",
gap: "44px",
position: "relative",
zIndex: 1
},
onClick: function onClick() {
_umi_production_exports.history.push("/activity/".concat(data.id, "/detail"));
},
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
position: "relative"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Activitymodules.ListStyleItemImg,
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
width: "100%",
height: "100%",
src: "".concat(env/* default */.Z.API_SERVER).concat(data === null || data === void 0 ? void 0 : data.cover)
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "c-white ".concat(Activitymodules.ListStyleItemTime),
style: {
background: '#1B8565'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: "bold ".concat(Activitymodules.ListStyleItemTimeDay),
children: dayjs_min_default()(data === null || data === void 0 ? void 0 : data.publish_time).format("DD")
}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
className: Activitymodules.ListStyleItemTimeMonth,
children: dayjs_min_default()(data === null || data === void 0 ? void 0 : data.publish_time).format("YYYY.MM")
})]
})]
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
display: "flex",
flexDirection: "column",
justifyContent: "space-between",
flex: "1",
padding: "6px 0"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
title: data === null || data === void 0 ? void 0 : data.title,
placement: "topLeft",
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "bold c-grey-333 ".concat(Activitymodules.ListStyleItemTitle),
children: data === null || data === void 0 ? void 0 : data.title
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: "c-grey-666 ".concat(Activitymodules.ListStyleItemDesc),
children: data === null || data === void 0 || (_data$content = data.content) === null || _data$content === void 0 ? void 0 : _data$content.replaceAll(/<[^>]+>/g, "")
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
ref: OpenDom,
className: "c-grey-666 ".concat(Activitymodules.ListStyleItemSpan),
style: {
height: !open ? "30px" : "auto",
overflow: "hidden",
position: "relative",
display: 'flex',
alignItems: 'center'
},
children: [(data === null || data === void 0 ? void 0 : data.publisher) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
children: ["\u6765\u6E90\uFF1A", data === null || data === void 0 ? void 0 : data.publisher]
}), data === null || data === void 0 || (_data$news_event_tags = data.news_event_tags) === null || _data$news_event_tags === void 0 ? void 0 : _data$news_event_tags.map(function (item) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Activitymodules.ListStyleItemTag,
style: {
lineHeight: "22px"
},
children: item === null || item === void 0 ? void 0 : item.name
});
}), isShow && /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
position: "absolute",
right: 0,
bottom: "6px"
},
onClick: function onClick(e) {
e.preventDefault();
e.stopPropagation();
setOpen(!open);
},
children: open ? /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-zhankai4",
style: {
fontSize: "8px",
display: "block",
transform: "rotate(180deg)"
}
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-zhankai4",
style: {
fontSize: "8px"
}
})
})]
})]
})]
})
});
};
var IndexPage = function IndexPage(_ref2) {
var _data$list, _data$list2;
var homePage = _ref2.homePage,
globalSetting = _ref2.globalSetting,
user = _ref2.user,
dispatch = _ref2.dispatch;
var _useState5 = (0,_react_17_0_2_react.useState)(),
_useState6 = slicedToArray_default()(_useState5, 2),
data = _useState6[0],
setData = _useState6[1];
var _useState7 = (0,_react_17_0_2_react.useState)([]),
_useState8 = slicedToArray_default()(_useState7, 2),
taglist = _useState8[0],
settaglist = _useState8[1];
var _useState9 = (0,_react_17_0_2_react.useState)({
name: '全部活动',
ENName: "All News"
}),
_useState10 = slicedToArray_default()(_useState9, 2),
tagItem = _useState10[0],
setTagItem = _useState10[1];
var _useState11 = (0,_react_17_0_2_react.useState)(false),
_useState12 = slicedToArray_default()(_useState11, 2),
loading = _useState12[0],
setLoading = _useState12[1];
var _useState13 = (0,_react_17_0_2_react.useState)(1920),
_useState14 = slicedToArray_default()(_useState13, 2),
innerWidth = _useState14[0],
setInnerWidth = _useState14[1];
var _useState15 = (0,_react_17_0_2_react.useState)({
status: "",
keyword: "",
page: 1,
limit: 10,
tag_name: '全部活动'
}),
_useState16 = slicedToArray_default()(_useState15, 2),
params = _useState16[0],
setparams = _useState16[1];
var tabs = [{
name: '全部',
id: ''
}, {
name: '编辑中',
id: '0'
}, {
name: '审核中',
id: '1'
}, {
name: '已公开',
id: '2'
}];
(0,_react_17_0_2_react.useEffect)(function () {
getdata();
var handleResize = function handleResize() {
return setInnerWidth(window.innerWidth < 1920 ? 1920 : window.innerWidth);
};
window.addEventListener('resize', handleResize);
return function () {
return window.removeEventListener('resize', handleResize);
};
}, []);
function getdata() {
return _getdata.apply(this, arguments);
}
function _getdata() {
_getdata = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
var res;
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
_context.next = 2;
return (0,fetch/* default */.ZP)("/api/news_events/news_event_tag_names.json", {
method: 'get',
params: {
new_type: 2
}
});
case 2:
res = _context.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
settaglist([{
name: '全部活动',
ENName: "All News"
}].concat(toConsumableArray_default()(res === null || res === void 0 ? void 0 : res.data)));
}
case 4:
case "end":
return _context.stop();
}
}, _callee);
}));
return _getdata.apply(this, arguments);
}
function getlist() {
return _getlist.apply(this, arguments);
}
function _getlist() {
_getlist = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
var res;
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
setLoading(true);
_context2.next = 3;
return (0,fetch/* default */.ZP)("/api/news_events.json", {
method: 'get',
params: objectSpread2_default()(objectSpread2_default()({}, params), {}, {
tag_name: (params === null || params === void 0 ? void 0 : params.tag_name) == "全部活动" ? "全部" : params === null || params === void 0 ? void 0 : params.tag_name,
new_type: 2
})
});
case 3:
res = _context2.sent;
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
setData(res === null || res === void 0 ? void 0 : res.data);
}
setLoading(false);
case 6:
case "end":
return _context2.stop();
}
}, _callee2);
}));
return _getlist.apply(this, arguments);
}
(0,_react_17_0_2_react.useEffect)(function () {
getlist();
}, [params]);
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
style: {
paddingBottom: "300px"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Activitymodules.BannerStyle,
style: {
backgroundImage: "url(".concat(__webpack_require__(/*! ./imgs/banner.png */ 67215), ")")
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Activitymodules.BannerStyleContent,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
margin: 'auto'
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
color: "#1B8565",
fontSize: "34px",
letterSpacing: "5px",
fontWeight: 600
},
children: "\u601D\u653F\u6D3B\u52A8"
}), (0,authority/* isSuperAdmins */.Ny)() && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: "".concat(Activitymodules.DivDownPlay),
onClick: function onClick() {
_umi_production_exports.history.push("/activity/add");
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("i", {
className: "iconfont icon-icon_xinyong_xianxing_jijin-249",
style: {
marginRight: "5px"
}
}), "\u65B0\u5EFA\u601D\u653F\u6D3B\u52A8"]
})]
})
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
spinning: loading,
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
style: {
width: "1200px",
margin: "0 auto"
},
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
className: Activitymodules.MenuStyle,
children: taglist === null || taglist === void 0 ? void 0 : taglist.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
onClick: function onClick() {
setTagItem(item);
setparams(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
page: 1,
limit: 10,
tag_name: item === null || item === void 0 ? void 0 : item.name
}));
},
className: "".concat(Activitymodules.MenuItem, " ").concat(params.tag_name === item.name ? Activitymodules.MenuItemActive : ""),
children: item === null || item === void 0 ? void 0 : item.name
}, index);
})
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
className: Activitymodules.ListStyle,
children: [!(data !== null && data !== void 0 && (_data$list = data.list) !== null && _data$list !== void 0 && _data$list.length) && /*#__PURE__*/(0,jsx_runtime.jsx)(NoData/* default */.Z, {}), data === null || data === void 0 || (_data$list2 = data.list) === null || _data$list2 === void 0 ? void 0 : _data$list2.map(function (item, index) {
return /*#__PURE__*/(0,jsx_runtime.jsx)(ListDom, {
data: item,
innerWidth: innerWidth || 1920
}, index);
})]
}), /*#__PURE__*/(0,jsx_runtime.jsx)(pagination/* default */.Z, {
className: "mb20 mt20",
total: data === null || data === void 0 ? void 0 : data.count,
hideOnSinglePage: true,
showTotal: function showTotal(total, range) {
return /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
children: ["\u5171", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
style: {
color: '#1B8565'
},
children: total
}), "\u6761\u6570\u636E"]
});
},
pageSize: params === null || params === void 0 ? void 0 : params.limit,
current: params === null || params === void 0 ? void 0 : params.page,
onChange: function onChange(page, limit) {
setparams(objectSpread2_default()(objectSpread2_default()({}, params), {}, {
page: page,
limit: limit
}));
}
})]
})
})]
});
};
/* harmony default export */ var Activity = ((0,_umi_production_exports.connect)(function (_ref3) {
var homePage = _ref3.homePage,
loading = _ref3.loading,
globalSetting = _ref3.globalSetting,
user = _ref3.user;
return {
homePage: homePage,
globalSetting: globalSetting,
loading: loading.models.homePage,
user: user
};
})(IndexPage));
/***/ }),
/***/ 2094:
/*!**********************************************************!*\
!*** ./node_modules/_swiper@5.4.5@swiper/css/swiper.css ***!
\**********************************************************/
/***/ (function() {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ 67215:
/*!********************************************!*\
!*** ./src/pages/Activity/imgs/banner.png ***!
\********************************************/
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
module.exports = __webpack_require__.p + "static/banner.6d03b2ef.png";
/***/ })
}]);