统筹管理员能看到不?
", //详情 + createdAt: "2021-11-10 17:42:38", //创建时间 + publishedAt: "2021-11-10 17:43:41", //发布时间 + collectingDays: 30, //成果提交天数 + }, + { + id: 448, + name: "研发配置要求验证与多样化目标识别仿真验证模块的1套软件和1份测试报告。", + taskModeId: 2, //悬赏模式 + bounty: 100.0, //赏金 + description: "统筹管理员能看到不?
", //详情 + createdAt: "2021-11-10 17:42:38", + publishedAt: "2021-11-11 17:43:41", + collectingDays: 30, + }, + { + id: 449, + name: "研发配置要求为包含网络", + taskModeId: 3, //悬赏模式 + bounty: 10000.0, //赏金 + description: "统筹管理员能看到不?
", //详情 + createdAt: "2021-11-10 17:42:38", + publishedAt: "2021-11-12 17:43:41", + collectingDays: 30, + } +] + +function getSomeDayAfter(initailDate, nDay) { + return moment(new Date(initailDate).setDate(new Date(initailDate).getDate() + nDay)).format('YYYY-MM-DD'); +} + +function FifthSection({ fifth, history }) { + + const [taskCategoryArr, setTaskCategoryArr] = useState([]); + const [taskArr, serTaskArr] = useState(taskArrMock); + + useEffect(() => { + const params = { + curPage: 1, + pageSize: 3, + orderBy: 'visitsDesc', + isDelete: '0', + recommend: '1', + }; + getTaskList(params).then(data => { + if (data) { + serTaskArr(data.rows); + } + }) + }, []); + + + // 获取分类数据 + useEffect(() => { + getTaskCategory().then(data => { + if (data) { + for (const item of data) { + switch (item.name) { + case "军事理论": + item.icon = "junshililun1"; + break; + case "政策法规": + item.icon = "zhengcefagui1"; + break; + case "医学": + item.icon = "yixue1"; + break; + case "电子": + item.icon = "dianzi1"; + break; + case "通信": + item.icon = "tongxin1"; + break; + case "计算机科学": + item.icon = "jisuanji1"; + item.name = "计算机"; + break; + case "软件工程": + item.icon = "ruanjiangongcheng1"; + break; + case "人工智能": + item.icon = "rengongzhineng"; + break; + case "知识图谱": + item.icon = "zhishitupu"; + break; + case "大数据": + item.icon = "dashuju"; + break; + default: + item.icon = "dianzi1"; + } + } + setTaskCategoryArr(data.slice(0, 10)); + } + }); + }, []); + + function goTask(item) { + history.push(`/task?type=${item.id}`) + // console.log(item); + } + + + return ( ++ + {taskModeNameArr[item.taskModeId]} + ¥ {item.bounty} +
+ ++ + 发布时间 + {moment(item.publishedAt || item.createdAt).format('YYYY-MM-DD')} +
+ ++ + 截止时间 + {getSomeDayAfter(item.publishedAt || item.createdAt, item.collectingDays)} + +
++ +86-010-66357650 + 北京市海淀区西三环北路72号 + osredm@163.com +
+ +
+ 版权所有:红山开源社区
+
+ 京公网安备 11010802034576 号
+ 京ICP备2021005060
+
+ 1 + + ~/ + c + d + + /opt + /Us + ers + /de + mo + /app + /sta + tic + + ++
{k + 2}{i.str}
免费提供海量代码仓储
+记录和维护软件演化全过程
+轻量级修改和提交
+代码安全和质量管控
++ + + +
+ ) +}) + diff --git a/src/home/Line/index.scss b/src/home/Line/index.scss new file mode 100644 index 00000000..10a70068 --- /dev/null +++ b/src/home/Line/index.scss @@ -0,0 +1,20 @@ +.home-line { + text-align: center; + line-height: 0; + .yellow-line { + display: inline-block; + width: 23px; + height: 4px; + background: #ff8520; + border-radius: 3px; + } + .brown-line { + display: inline-block; + width: 38px; + height: 4px; + margin:0 5px; + background: #e67a21; + border-radius: 3px; + + } +} diff --git a/src/home/SecondSection/index.jsx b/src/home/SecondSection/index.jsx new file mode 100644 index 00000000..01576084 --- /dev/null +++ b/src/home/SecondSection/index.jsx @@ -0,0 +1,124 @@ +import React, { memo, useEffect, useState } from 'react'; +import { Button } from 'antd'; +import axios from 'axios'; +import Slider from 'react-slick'; +import "slick-carousel/slick/slick.css"; +import "slick-carousel/slick/slick-theme.css"; +import Line from '../Line'; + +import './index.scss'; + + +let setting = { + infinite: true, + speed: 750, + slidesToShow: 3, + slidesToScroll: 1, + pauseOnDotsHover: true, + autoplaySpeed: 4000, + centerMode: true, + centerPadding: "10px", + // pauseOnFocus: true, + autoplay: true, + arrows: false, + vertical: true, +} + + +function SecondSection({ second ,main_web_site_url}) { + + const [leftItem, setLeftItem] = useState({}); + const [list, setList] = useState([]); + + useEffect(() => { + const url = `/home/platform_communicates.json`; + axios.get(url, { + params: { + limit: 10, + page: 1 + } + }).then(result => { + if (result && result.data) { + let communicates = result.data.communicates; + if (communicates.length) { + setLeftItem(communicates[0]); + setList(communicates.slice(1, 5)); + } + } + }).catch(error => { }); + }, []) + + + function goDetail(id) { + window.open(`${main_web_site_url}/forums/${id}/detail`); + } + + return ( +{item.content}
+ {item.created_time && item.created_time.split(' ')[0]} +{item.content}
+ {item.created_time && item.created_time.split(' ')[0]} +竞赛时间:{item.start_time && item.start_time.split(' ')[0]}-{item.end_time && item.end_time.split(' ')[0]}
+赛事简介: {item.content||'暂无简介'}
+
+ {editable ? (
+ |
+ );
+ }
+}
+
+class EditableTable extends React.Component {
+ constructor(props) {
+ super(props);
+ this.columns = [
+ {
+ title: '姓名',
+ dataIndex: 'real_name',
+ editable: true,
+ width: "40%"
+ },
+ {
+ title: '单位',
+ dataIndex: 'org_name',
+ editable: true,
+ width: '50%',
+ },
+ {
+ title: '操作',
+ dataIndex: 'operation',
+ width: '10%',
+ render: (text, record) =>
+ this.state.dataSource.length >= 1 ? (
+