竞赛调整

dev_sync_trustie
杨树明 5 years ago
parent 00e70575cc
commit e8344c6674

@ -285,16 +285,12 @@ const Ecs = Loadable({
loading: Loading,
})
//团队竞赛报名
const Registration = Loadable({
loader: () => import('./modules/competition/Registration'),
loading: Loading,
});
//个人竞赛报名
const PersonalCompetit = Loadable({
loader: () => import('./modules/competition/personal/PersonalCompetit.js'),
loading: Loading,
});
// //个人竞赛报名
// const PersonalCompetit = Loadable({
// loader: () => import('./modules/competition/personal/PersonalCompetit.js'),
// loading: Loading,
// });
class App extends Component {
constructor(props) {
super(props)
@ -541,12 +537,12 @@ class App extends Component {
return (<BanksIndex {...this.props} {...props} {...this.state} />)
}
}></Route>
<Route
path="/personalcompetit"
render={
(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>)
}
/>
{/*<Route*/}
{/*path="/personalcompetit"*/}
{/*render={*/}
{/*(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>)*/}
{/*}*/}
{/*/>*/}
<Route
path="/changepassword"
render={
@ -603,12 +599,12 @@ class App extends Component {
{/*<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>*/}
{/*<Route path="/testRCComponent" component={TestComponent}/>*/}
{/*<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>*/}
<Route
path="/registration"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>)
}
/>
{/*<Route*/}
{/*path="/registration"*/}
{/*render={*/}
{/*(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>)*/}
{/*}*/}
{/*/>*/}
<Route path="/messages"
render={

@ -401,4 +401,4 @@ class Registration extends React.Component {
}
export default SnackbarHOC()(TPMIndexHOC(Registration));
export default Registration;

@ -8,7 +8,6 @@
background-position: center;
background-repeat: no-repeat;
}
.competitionstitle{
height:50px !important;
border-radius: 6px;

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon} from 'antd';
import axios from 'axios';
import {markdownToHTML} from 'educoder';
import {markdownToHTML,getImageUrl} from 'educoder';
import NoneData from "../../courses/shixunHomework/shixunHomework";
import './CompetitionCommon.css';
@ -12,13 +12,24 @@ class CompetitionCommon extends Component{
constructor(props) {
super(props)
this.state={
data:undefined
data:undefined,
bannerdata:undefined
}
}
componentDidMount(){
window.document.title = '竞赛';
this.getbannerdata()
this.getbannerdata();
let url=`/competitions/${this.props.match.params.identifier}.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
bannerdata:response.data
})
}
}).catch((error) => {
console.log(error)
})
}
getbannerdata=()=>{
@ -28,6 +39,8 @@ class CompetitionCommon extends Component{
this.setState({
data:response.data
})
let datalist=response.data.competition_modules
}
}).catch((error) => {
console.log(error)
@ -36,8 +49,8 @@ class CompetitionCommon extends Component{
}
render() {
let {data}=this.state;
console.log(data)
let {data,bannerdata}=this.state;
// console.log(bannerdata)
return (
data===undefined?"":<div className={"educontent clearfix mt20 "}>
@ -48,8 +61,10 @@ class CompetitionCommon extends Component{
<div className={"mt10"}>
<Row className={"CompetitionCommonbanner"}>
<Col span={15}>banner</Col>
<Col className={"CompetitionCommonbannerfont"} span={9}>
<Col span={15}>
<img src={getImageUrl(bannerdata&&bannerdata.image_url)}/>
</Col>
<Col className={"CompetitionCommonbannerfont mt50"} span={9}>
<Col className={"competitionbannerdiv"}>{data&&data.name}</Col>
@ -86,7 +101,7 @@ class CompetitionCommon extends Component{
<Col className={"competitionbannerdiv mt20"}>
<Button type="primary" block className={"Competitionfontsize22"}>
立即报名
<a href={`/newcompetitions/${this.props.match.params.identifier}/enroll`}>立即报名</a>
</Button>
</Col>
<Col className={"mt10 Competitionfontsize16"}>{data&&data.enroll_end_time===null?"":"报名截止时间:"+data&&data.enroll_end_time}</Col>

@ -29,6 +29,11 @@ const CompetitionTeams = Loadable({
loading: Loading,
})
//团队竞赛报名
const Registration = Loadable({
loader: () => import('../competition/Registration'),
loading: Loading,
});
class Competitions extends Component {
constructor(props) {
@ -53,6 +58,12 @@ class Competitions extends Component {
}
></Route>
<Route
path="/newcompetitions/:identifier/enroll"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>)
}
/>
{/*新版竞赛详情页面*/}
<Route path="/newcompetitions/:identifier/common_header"
render={

Loading…
Cancel
Save