|
|
|
@ -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>
|
|
|
|
|