调整竞赛详情页

dev_sync_trustie
杨树明 5 years ago
parent 857c6bf587
commit 54ac91e349

@ -79,7 +79,7 @@ class CompetitionsIndex extends Component{
render() { render() {
let {datas,page,count}=this.state; let {datas,page,count}=this.state;
console.log(this.props.current_user&&this.props.current_user.business)
return ( return (
<div> <div>
<div className="clearfix"> <div className="clearfix">

@ -1,4 +1,5 @@
.teamsLayout{background: transparent !important;} .teamsLayout{background: transparent !important;}
.teamsLayout .ant-layout-sider{ .teamsLayout .ant-layout-sider{
background: transparent !important; background: transparent !important;
flex: 0 0 180px !important; flex: 0 0 180px !important;
@ -213,4 +214,126 @@
right: -5px; right: -5px;
width:93px; width:93px;
top: 20px; top: 20px;
} }
.Competitionthirdbox{
width:234px;
height:163px;
background:rgba(223,223,225,1);
}
.Competitionthirdbox{
width:234px;
height:163px;
background:rgba(223,223,225,1);
}
.Competitionthirdbox{
width:234px;
height:163px;
background:rgba(223,223,225,1);
position: relative;
}
.Competitionfirstbox{
width:233px;
height:167px;
background:rgba(255,231,160,1);
position: relative;
}
.Competitionsecondarybox{
width:234px;
height:155px;
background:rgba(253,230,217,1);
position: relative;
}
.rankingimg{
width: 60px;
height: 60px;
border-radius: 50% !important;
box-shadow: 0px 0px 12px rgba(0,0,0,0.2);
}
.Competitioncenter{
text-align: center;
padding-top: 20px;
}
.jinshaifont{
font-size: 16px;
color: rgba(5,16,26,1);
margin-top: 13px !important;
}
.Competitionthird .ant-card-body {
padding: 12px;
zoom: 1;
}
.Competitionthird .ant-card-meta-title{
margin-bottom: 0px !important;
}
.Competitionfirst .ant-card-body {
padding: 12px;
zoom: 1;
}
.Competitionsecondary .ant-card-body {
padding: 12px;
zoom: 1;
}
.center{
text-align: center;
}
.rankfonttop{
font-size:14px;
color:rgba(102,102,102,1);
}
.rankfontmid{
font-size:18px;
color:rgba(102,102,102,1);
}
.rankfontbottom{
font-size:26px;
color:rgba(165,91,41,1);
text-align: center;
}
.rankfontbottoms{
font-size:28px;
color:rgba(165,91,41,1);
text-align: center;
}
.Competitionuserimg{
width: 64px;
height: 63px;
border-radius: 50%;
}
.CompetitionsListzhezhao{
position: absolute;
top: 0px;
left: 0px;
width: 1206px;
height: 100%;
z-index: 10000;
display: none;
background: rgba(51, 51, 51,0.7);
text-align: center;
line-height: 416px;
color: #fff;
font-size: 50px;
}
.relative{position: relative;}
.relative:hover .CompetitionsListzhezhao{ display: block;}

@ -64,16 +64,19 @@ class CompetitionCommon extends Component{
module_id:id, module_id:id,
module_type:typeid module_type:typeid
}) })
let url=`${module_url}.json`; if(has_url===false){
axios.get(url).then((response) => { let url=`${module_url}`;
if(response.status===200){ axios.get(url).then((response) => {
this.setState({ if(response.status===200){
mdContent:response.data this.setState({
mdContent:response.data
})
}
}).catch((error) => {
console.log(error)
}) })
} }
}).catch((error) => {
console.log(error)
})
} }
render() { render() {
@ -87,8 +90,11 @@ class CompetitionCommon extends Component{
<Breadcrumb.Item href="">{data&&data.name}</Breadcrumb.Item> <Breadcrumb.Item href="">{data&&data.name}</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
<div className={"mt10"}> <div className={"mt10 relative"}>
<Row className={"CompetitionCommonbanner"}> <Row className={"CompetitionCommonbanner"}>
{data.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?"":this.props.current_user&&this.props.current_user.business===true?"":<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>:""}
<img className={"Commonimg"} <img className={"Commonimg"}
src={data.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):data.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):data.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} /> src={data.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):data.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):data.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} />
<Col span={15}> <Col span={15}>
@ -155,7 +161,8 @@ class CompetitionCommon extends Component{
已结束 已结束
</Button>: </Button>:
<Button type="primary" block className={"Competitionfontsize22"}> <Button type="primary" block className={"Competitionfontsize22"}>
<Link to={`/newcompetitions/${this.props.match.params.identifier}/enroll`}>立即报名</Link> {data.competition_status==="nearly_published"?
this.props.current_user&&this.props.current_user.admin===true?<Link to={`/newcompetitions/${this.props.match.params.identifier}/enroll`}>立即报名</Link>:this.props.current_user&&this.props.current_user.business===true?<Link to={`/newcompetitions/${this.props.match.params.identifier}/enroll`}></Link>:<a></a>:<Link to={`/newcompetitions/${this.props.match.params.identifier}/enroll`}></Link>}
</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>
@ -190,6 +197,10 @@ class CompetitionCommon extends Component{
{...this.props} {...this.props}
{...this.state} {...this.state}
/>} />}
{/*<CompetitionContentsChart*/}
{/*{...this.props}*/}
{/*{...this.state}*/}
{/*/>*/}
</Layout> </Layout>
</Layout> </Layout>

@ -18,87 +18,69 @@ class CompetitionContents extends Component{
componentDidMount(){ componentDidMount(){
window.document.title = '竞赛'; window.document.title = '竞赛';
this.gettitledata()
}
gettitledata=()=>{
let url=`/competitions/${this.props.match.params.identifier}/chart_rules.json`;
axios.get(url)
.then((response) => {
console.log(response)
}).catch((error) => {
console.log(error)
})
} }
render() { render() {
const operations = <Icon type="form" />; const operations = <Button className={"fr"} type="primary" ghost>编辑</Button>;
const columns = [ const columns = [
{ {
title: 'Name', title: 'usersum',
dataIndex: 'name', dataIndex: 'usersum',
key: 'name', key: 'name',
render: text => <a>{text}</a>, render: text => <a className={"color-blue"}>{text}</a>,
}, },
{ {
title: 'Age', title: 'userimg',
dataIndex: 'age', dataIndex: 'userimg',
key: 'age', key: 'userimg',
render: text => <img className={"Competitionuserimg"} src={getImageUrl("images/avatars/User/60969?t=1569488691")}/>,
}, },
{ {
title: 'Address', title: 'username',
dataIndex: 'address', dataIndex: 'username',
key: 'address', key: 'username',
render: text => <a>{text}</a>,
}, },
{ {
title: 'Tags', title: 'school',
key: 'tags', dataIndex: 'school',
dataIndex: 'tags', key: 'school',
render: tags => ( render: text => <a>{text}</a>,
<span>
123123
</span>
),
}, },
{ {
title: 'Action', title: 'spendtime',
key: 'action', dataIndex: 'spendtime',
render: (text, record) => ( key: 'spendtime',
<span> render: text => <a>{text}</a>,
<a>Invite {record.name}</a>
<a>Delete</a>
</span>
),
}, },
{ {
title: 'Values', title: 'score',
key: 'values', dataIndex: 'score',
dataIndex: 'values', key: 'score',
render: tags => ( render: text => <a className={"color-blue"}>{text}</a>,
<span>
123123
</span>
),
}, },
]; ];
const data = [ const data = [
{ {
key: '1', usersum: '1',
name: 'John Brown', userimg: 'John Brown',
age: 32, username: "小头鹰",
address: 'New York No. 1 Lake Park', school: '吉首大学',
tags: ['nice', 'developer'], spendtime: '150000',
values:123 score:123123
}, }
{
key: '2',
name: 'Jim Green',
age: 42,
address: 'London No. 1 Lake Park',
tags: ['loser'],
values:123
},
{
key: '3',
name: 'Joe Black',
age: 32,
address: 'Sidney No. 1 Lake Park',
tags: ['cool', 'teacher'],
values:123
},
]; ];
@ -129,15 +111,27 @@ class CompetitionContents extends Component{
<Card <Card
className={"Competitionthird"} className={"Competitionthird"}
cover={ cover={
<img <div className={"Competitionthirdbox center"}>
alt="example" <li className="pr Competitioncenter">
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png" <img src={getImageUrl("/images/educoder/huangguan-two.png")}/>
/> <div className={"mt10"}>
<a href="/users/p45296381" className="color-dark">
<img className={"rankingimg"} src={getImageUrl("/images/avatars/User/45459?t=1566570434")} />
<p className="task-hide rankName mt5 jinshaifont">蒙睿</p>
</a>
</div>
</li>
</div>
} }
> >
<Meta <Meta
title="Card title" title={<div className={"center"}>
description="This is the description" <div className={"rankfonttop"}>吉首大学</div>
<div className={"rankfontmid"}>78:01:02</div>
</div>}
description={
<div className={"rankfontbottom"}>3423.45</div>
}
/> />
</Card> </Card>
</Col> </Col>
@ -145,32 +139,58 @@ class CompetitionContents extends Component{
<Card <Card
className={"Competitionfirst"} className={"Competitionfirst"}
cover={ cover={
<img <div className={"Competitionfirstbox center"}>
alt="example" <li className="pr Competitioncenter">
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png" <img src={getImageUrl("/images/educoder/huangguan.png")}/>
/> <div className={"mt10"}>
<a href="/users/p37219480" className="color-dark">
<img className={"rankingimg"} src={getImageUrl("/images/avatars/User/46128?t=1561087919")} />
<p className="task-hide rankName mt5 jinshaifont">李羿锟</p>
</a>
</div>
</li>
</div>
} }
> >
<Meta <Meta
title="Card title" title={<div className={"center"}>
description="This is the description" <div className={"rankfonttop"}>吉首大学</div>
<div className={"rankfontmid"}>78:01:02</div>
</div>}
description={
<div className={"rankfontbottoms"}>3423.45</div>
}
/> />
</Card> </Card>
</Col> </Col>
<Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}> <Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}>
<Card <Card
className={"Competitionsecondary"} className={"Competitionsecondary "}
cover={ cover={
<img <div className={"Competitionsecondarybox center"}>
alt="example" <li className=" pr Competitioncenter ">
src="https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png" <img src={getImageUrl("/images/educoder/huangguan-three.png")}/>
/> <div className={"mt10"}>
<a href="/users/p53601847" className="color-dark">
<img className={"rankingimg"} src={getImageUrl("/images/avatars/User/26650?t=1561087884")} />
<p className="task-hide rankName mt5 jinshaifont">陈翊</p>
</a>
</div>
</li>
</div>
} }
> >
<Meta <Meta
title="Card title" title={<div className={"center"}>
description="This is the description" <div className={"rankfonttop"}>吉首大学</div>
<div className={"rankfontmid"}>78:01:02</div>
</div>}
description={
<div className={"rankfontbottom"}>3423.45</div>
}
/> />
</Card> </Card>
</Col> </Col>

@ -385,10 +385,7 @@ class GraduationTasksedit extends Component{
{description===undefined?"": {description===undefined?"":
<div> <div>
{/*<Form >*/}
{/* <Form >*/}
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pt20 pl20 pr20 pb0 edu-back-white"> <div className="stud-class-set bor-bottom-greyE pt20 pl20 pr20 pb0 edu-back-white">
<Form.Item label="类型"> <Form.Item label="类型">
@ -407,12 +404,12 @@ class GraduationTasksedit extends Component{
<style> <style>
{ {
` `
.yslgraduainputedit .ant-input{ .yslgraduainputedit .ant-input{
border-right: none !important; border-right: none !important;
height: 40px !important; height: 40px !important;
} }
` `
} }
</style> </style>
<Form.Item label="任务标题" > <Form.Item label="任务标题" >

Loading…
Cancel
Save