diff --git a/public/react/src/App.js b/public/react/src/App.js index b2ec1a3a3..7046c5849 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -259,6 +259,12 @@ const ProjectPackages=Loadable({ loading: Loading, }) +//竞赛 +const NewCompetitions=Loadable({ + loader: () => import('./modules/competitions/Competitions'), + loading: Loading, +}) + const Messagerouting= Loadable({ loader: () => import('./modules/message/js/Messagerouting'), loading: Loading, @@ -473,6 +479,8 @@ class App extends Component { }> {/*众包创新*/} + {/*竞赛*/} + {/*认证*/} diff --git a/public/react/src/modules/competitions/Competitions.js b/public/react/src/modules/competitions/Competitions.js new file mode 100644 index 000000000..cc52f610f --- /dev/null +++ b/public/react/src/modules/competitions/Competitions.js @@ -0,0 +1,49 @@ +import React, { Component } from 'react'; + +import { Redirect } from 'react-router'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import Loading from '../../Loading' + +import Loadable from 'react-loadable'; +import { TPMIndexHOC } from '../tpm/TPMIndexHOC' +import { SnackbarHOC } from 'educoder' + +//新版竞赛首页 +const CompetitionsIndex = Loadable({ + loader: () => import('./competitimain/CompetitionsIndex'), + loading: Loading, +}) + +class Competitions extends Component { + constructor(props) { + super(props) + } + + componentDidMount(){ + window.document.title = '竞赛' + } + + render() { + + return ( +
+ + + {/*新版竞赛首页*/} + + + () + } + > + + +
+ ); + } +} + +export default SnackbarHOC() (TPMIndexHOC (Competitions)) ; \ No newline at end of file diff --git a/public/react/src/modules/competitions/competitimain/CompetitionsIndex.js b/public/react/src/modules/competitions/competitimain/CompetitionsIndex.js new file mode 100644 index 000000000..3e0715736 --- /dev/null +++ b/public/react/src/modules/competitions/competitimain/CompetitionsIndex.js @@ -0,0 +1,191 @@ +import React, { Component } from 'react'; +import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; +import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination} from 'antd'; +import axios from 'axios'; +import './Competitionsindex.css'; +import NoneData from "../../courses/shixunHomework/shixunHomework"; + +const { SubMenu } = Menu; + +const IconText = ({ type, text }) => ( + + + {text} + +); + +class CompetitionsIndex extends Component{ + constructor(props) { + super(props) + this.state={ + current: 'all', + datas:undefined, + page:1 + + } + } + + componentDidMount(){ + window.document.title = '竞赛'; + + let{page}=this.state; + const Url =`/competitions.json`; + axios.get(Url,{params:{ + page:page + } + }).then((response) => { + if(response.status===200){ + this.setState({ + datas:response.data.competitions, + count:response.data.count, + }) + } + }) + .catch(function (error) { + console.log(error); + }); + } + + handleClick = e => { + console.log('click ', e); + this.setState({ + current: e.key, + }); + }; + + render() { + let {datas,page,count}=this.state; + + + // bonus: 0 + // current_stage: {name: "正赛 第一阶段", start_time: "2019-10-11 00:00:00", end_time: "2019-11-01 00:00:00"} + // description: null + // end_time: "2019-11-01 00:00:00" + // enroll_end_time: "2019-10-31 00:00:00" + // id: 7 + // identifier: "gcc-annotation-2019" + // image: null + // member_count: 540 + // name: "第二届全国绿色计算系列大赛" + // nearly_published: false + // published: true + // single_stage: false + // start_time: "2019-07-01 00:00:00" + // sub_title: "代码标注组" + // visits_count: 10181 + + return ( +
+
+
+
+
+
+
+
+
+ +
+
+ + + 全部 + + + 即将发布 + + + 进行中 + + + 往期比赛 + + +
+
+ +
+ ( + 竞赛时间: 2019-08-07 24: 00~2019-09-10 24: 00, + 报名截止时间:2019-08-07 08:10, + ]} + extra={ +
+ + +
奖金
+ + +
浏览数
+ + +
报名数
+ +
+ + + +
¥4500
+ + +
351
+ + +
351
+ +
+ +
+ } + > + {item.name}{item.sub_title===null?"":{ + item.sub_title + }} + } + /> + {item.description} +
+ )} + /> + +
15 ? 'block':'none' + // // } + // } + > + + + +
+ + { + datas===undefined?"":datas && datas.length===0? :"" + } +
+ +
+ +
+
+
+ ) + } +} +export default CompetitionsIndex; \ No newline at end of file diff --git a/public/react/src/modules/competitions/competitimain/Competitionsindex.css b/public/react/src/modules/competitions/competitimain/Competitionsindex.css new file mode 100644 index 000000000..608bc05fd --- /dev/null +++ b/public/react/src/modules/competitions/competitimain/Competitionsindex.css @@ -0,0 +1,109 @@ +.courses-head{ + width: 100%; + height: 300px; + background-image: url(./courses.jpg); + background-color: #081C4B; + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} + +.competitionstitle{ + height:50px !important; + border-radius: 6px; + background: #fff; + display: flex; + justify-content: center; +} + +.competitionstitle2{ + height:50px !important; + margin-left: 30px !important; + background: #fff; + width: 1200px; +} + + +.ant-menu-horizontal { + border-bottom:none !important; +} + + +.competitionsvalue{ + font-size: 16px; + font-family: PingFangSC-Medium,PingFangSC; + font-weight: 500; +} + +.competitionmr50 { + margin-right: 50px !important; +} + +.CompetitionsIndex .ant-list-item{ + background: #fff !important; + margin-top: 20px; + border: none !important; +} + +.CompetitionsIndex .ant-list-item{ + padding:25px; +} + +.CompetitionsIndex .ant-list-item-meta-title{ + height:28px; + font-size:28px; + font-family:PingFangSC-Regular,PingFangSC; + font-weight:400; + color:rgba(5,16,26,1); + line-height:28px; +} + +.CompetitionsIndex .ant-list-vertical .ant-list-item-meta{ + margin-bottom: 20px !important; +} + +.CompetitionsIndex .ant-list-vertical .ant-list-item-action { + margin-top: 20px; + margin-left: auto; +} + +.CompetitionsIndex .ant-list-item-action-split{ + display: none !important; +} + +.CompetitionsIndexdadels{ + font-family: PingFangSC-Regular,PingFangSC; + font-weight: 400; + color: #777777; + margin-bottom: 14px; + margin-right: 20px; +} + +.CompetitionsIndexbottomvalue{ + font-size: 24px; + font-family: ArialMT; + color: rgba(5,16,26,1); +} + +.CompetitionsIndex .gutter-row{ + margin-right:20px; +} + +.pt50{ + padding-top: 50px; +} + +.competitionstitles{ + max-width: 789px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; + margin-right: 15px; +} + +.competitionsrelative{ + position: absolute; + /*top: 28px;*/ +} + diff --git a/public/react/src/modules/competitions/competitimain/courses.jpg b/public/react/src/modules/competitions/competitimain/courses.jpg new file mode 100644 index 000000000..9447b74be Binary files /dev/null and b/public/react/src/modules/competitions/competitimain/courses.jpg differ diff --git a/public/react/src/modules/projectPackages/ProjectPackageIndex.js b/public/react/src/modules/projectPackages/ProjectPackageIndex.js index 29d4efa17..097e012e0 100644 --- a/public/react/src/modules/projectPackages/ProjectPackageIndex.js +++ b/public/react/src/modules/projectPackages/ProjectPackageIndex.js @@ -36,8 +36,7 @@ class ProjectPackageIndex extends Component { } render() { -console.log(this.props) - console.log(this.state) + return (