竞赛调整

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

@ -285,16 +285,12 @@ const Ecs = Loadable({
loading: Loading, loading: Loading,
}) })
//团队竞赛报名
const Registration = Loadable({ // //个人竞赛报名
loader: () => import('./modules/competition/Registration'), // const PersonalCompetit = Loadable({
loading: Loading, // 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 { class App extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -541,12 +537,12 @@ class App extends Component {
return (<BanksIndex {...this.props} {...props} {...this.state} />) return (<BanksIndex {...this.props} {...props} {...this.state} />)
} }
}></Route> }></Route>
<Route {/*<Route*/}
path="/personalcompetit" {/*path="/personalcompetit"*/}
render={ {/*render={*/}
(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>) {/*(props) => (<PersonalCompetit {...this.props} {...props} {...this.state}></PersonalCompetit>)*/}
} {/*}*/}
/> {/*/>*/}
<Route <Route
path="/changepassword" path="/changepassword"
render={ render={
@ -603,12 +599,12 @@ class App extends Component {
{/*<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>*/} {/*<Route path="/testCodeMirror" component={TestCodeMirrorComponent}/>*/}
{/*<Route path="/testRCComponent" component={TestComponent}/>*/} {/*<Route path="/testRCComponent" component={TestComponent}/>*/}
{/*<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>*/} {/*<Route path="/testUrlQuery" component={TestUrlQueryComponent}/>*/}
<Route {/*<Route*/}
path="/registration" {/*path="/registration"*/}
render={ {/*render={*/}
(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>) {/*(props) => (<Registration {...this.props} {...props} {...this.state}></Registration>)*/}
} {/*}*/}
/> {/*/>*/}
<Route path="/messages" <Route path="/messages"
render={ 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-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.competitionstitle{ .competitionstitle{
height:50px !important; height:50px !important;
border-radius: 6px; border-radius: 6px;

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon} from 'antd'; import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon} from 'antd';
import axios from 'axios'; import axios from 'axios';
import {markdownToHTML} from 'educoder'; import {markdownToHTML,getImageUrl} from 'educoder';
import NoneData from "../../courses/shixunHomework/shixunHomework"; import NoneData from "../../courses/shixunHomework/shixunHomework";
import './CompetitionCommon.css'; import './CompetitionCommon.css';
@ -12,13 +12,24 @@ class CompetitionCommon extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
this.state={ this.state={
data:undefined data:undefined,
bannerdata:undefined
} }
} }
componentDidMount(){ componentDidMount(){
window.document.title = '竞赛'; 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=()=>{ getbannerdata=()=>{
@ -28,6 +39,8 @@ class CompetitionCommon extends Component{
this.setState({ this.setState({
data:response.data data:response.data
}) })
let datalist=response.data.competition_modules
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -36,8 +49,8 @@ class CompetitionCommon extends Component{
} }
render() { render() {
let {data}=this.state; let {data,bannerdata}=this.state;
console.log(data) // console.log(bannerdata)
return ( return (
data===undefined?"":<div className={"educontent clearfix mt20 "}> data===undefined?"":<div className={"educontent clearfix mt20 "}>
@ -48,8 +61,10 @@ class CompetitionCommon extends Component{
<div className={"mt10"}> <div className={"mt10"}>
<Row className={"CompetitionCommonbanner"}> <Row className={"CompetitionCommonbanner"}>
<Col span={15}>banner</Col> <Col span={15}>
<Col className={"CompetitionCommonbannerfont"} span={9}> <img src={getImageUrl(bannerdata&&bannerdata.image_url)}/>
</Col>
<Col className={"CompetitionCommonbannerfont mt50"} span={9}>
<Col className={"competitionbannerdiv"}>{data&&data.name}</Col> <Col className={"competitionbannerdiv"}>{data&&data.name}</Col>
@ -86,7 +101,7 @@ class CompetitionCommon extends Component{
<Col className={"competitionbannerdiv mt20"}> <Col className={"competitionbannerdiv mt20"}>
<Button type="primary" block className={"Competitionfontsize22"}> <Button type="primary" block className={"Competitionfontsize22"}>
立即报名 <a href={`/newcompetitions/${this.props.match.params.identifier}/enroll`}>立即报名</a>
</Button> </Button>
</Col> </Col>
<Col className={"mt10 Competitionfontsize16"}>{data&&data.enroll_end_time===null?"":"报名截止时间:"+data&&data.enroll_end_time}</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, loading: Loading,
}) })
//团队竞赛报名
const Registration = Loadable({
loader: () => import('../competition/Registration'),
loading: Loading,
});
class Competitions extends Component { class Competitions extends Component {
constructor(props) { constructor(props) {
@ -53,6 +58,12 @@ class Competitions extends Component {
} }
></Route> ></Route>
<Route
path="/newcompetitions/:identifier/enroll"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>)
}
/>
{/*新版竞赛详情页面*/} {/*新版竞赛详情页面*/}
<Route path="/newcompetitions/:identifier/common_header" <Route path="/newcompetitions/:identifier/common_header"
render={ render={

Loading…
Cancel
Save