竞赛调整

dev_auth
杨树明 5 years ago
parent 11885a70a0
commit 50052d34f2

@ -56,7 +56,8 @@ class CompetitionsIndex extends Component{
setcompetitonurl=(url)=>{
if(url!=null){
this.props.history.replace(url);
// this.props.history.push(url);
window.location.href=url;
}
}
@ -145,8 +146,8 @@ class CompetitionsIndex extends Component{
<List.Item
key={key}
actions={[
<span>竞赛时间: 2019-08-07 24: 002019-09-10 24: 00</span>,
<span>报名截止时间2019-08-07 08:10</span>,
<span>竞赛时间: {item.start_time}{item.end_time}</span>,
<span>报名截止时间{item.enroll_end_time}</span>,
]}
extra={
<div className={"pt50"} style={{"width":'305px'}}>
@ -181,9 +182,10 @@ class CompetitionsIndex extends Component{
this.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}>
<span className={"competitionstitles"}
onClick={()=>this.setcompetitonurl(item.competition_status==="ended"?`/newcompetitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/newcompetitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/newcompetitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/newcompetitions/${item.identifier}/common_header`:null)}
>{item.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
item.sub_title
}</Tag>}</span>
>{item.name}{item.sub_title===null?"":`——${item.sub_title}`}</span>
{/*<span>{item.sub_title===null?"":*/}
{/*<Tag className="competitionsrelative" color="#87d068">{item.sub_title}</Tag>}*/}
{/*</span>*/}
</a>}
/>
{item.description}

@ -77,13 +77,14 @@
font-weight: 400;
color: #777777;
margin-bottom: 14px;
margin-right: 20px;
text-align: center;
}
.CompetitionsIndexbottomvalue{
font-size: 24px;
font-family: ArialMT;
color: rgba(5,16,26,1);
text-align: center;
}
.CompetitionsIndex .gutter-row{
@ -127,9 +128,12 @@
display: none;
background: rgba(0,0,0,0.33);
text-align: center;
line-height: 170px;
color: #fff;
font-size: 50px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
}
.CompetitionsList:hover .CompetitionsListzhezhao{
display: block;

@ -331,9 +331,12 @@
display: none;
background: rgba(0,0,0,0.33);
text-align: center;
line-height: 416px;
color: #fff;
font-size: 50px;
font-size: 22px;
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
}
.relative{position: relative;}

@ -30,16 +30,16 @@ class CompetitionCommon extends Component{
window.document.title = '竞赛';
if(this.props.match.params.identifier!=null){
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)
})
// 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)
// })
}
}
@ -85,14 +85,17 @@ class CompetitionCommon extends Component{
}
getlistdata=(keys,listkey)=>{
let{data}=this.state;
this.setState({
thiskeys:keys
})
data&&data.competition_modules.map((item,key)=>{
if(keys===item.position){
this.getrightdata(item.id,item.module_type,item.module_url,item.has_url,listkey)
return
if(item.module_type!="enroll") {
if (keys === item.position) {
this.getrightdata(item.id, item.module_type, item.module_url, item.has_url, listkey)
return
}
}
})
}
@ -117,10 +120,10 @@ class CompetitionCommon extends Component{
}
getrightdata=(id,typeid,module_url,has_url,listkey)=>{
if(typeid==="enroll"){
this.props.history.replace(`/newcompetitions/${this.props.match.params.identifier}/enroll`);
return
}
// if(typeid==="enroll"){
// this.props.history.replace(`/newcompetitions/${this.props.match.params.identifier}/enroll`);
// return
// }
this.getnewchartdata(typeid,listkey)
@ -232,7 +235,7 @@ class CompetitionCommon extends Component{
<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`):""} />
<Col span={15}>
<img className={"image_urlbox"} src={getImageUrl(`images/educoder/competitions/mainbanner.jpg`)}/>
<img className={"image_urlbox"} src={data===undefined?getImageUrl(`images/educoder/competitions/mainbanner.jpg`):data.avatar_url===null?getImageUrl(`images/educoder/competitions/mainbanner.jpg`):getImageUrl(data.avatar_url)}/>
</Col>
<Col className={"CompetitionCommonbannerfont"} span={9}>
@ -293,7 +296,9 @@ class CompetitionCommon extends Component{
{data.competition_status==="ended"?
<Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
已结束
</Button>:
</Button>:data.enroll_end===true?<Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
报名截止
</Button>:
data.competition_status==="progressing"?<Button type="primary" block className={"Competitionfontsize22"}>
{data.mode===2?<a onClick={()=>this.gotocourse()}>立即报名</a>:<a onClick={()=>this.gotocourse(`/newcompetitions/${this.props.match.params.identifier}/enroll`)}></a>}
</Button>:""}

@ -40,7 +40,7 @@ class CompetitionContents extends Component{
key: 'userimg',
render: (text, record) =>(
<a href={`/users/${record.user_login}`} className="color-dark">
<img className={"Competitionuserimg"} src={getImageUrl(record.userimg)}/>
<img className={"Competitionuserimg"} src={getImageUrl(`images/${record.userimg===null?`avatars/User/0?1442652658`:record.userimg}`)}/>
</a>),
},
{
@ -71,8 +71,9 @@ class CompetitionContents extends Component{
const data = [];
let {chart_rules,chartdata}=this.props;
chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
if(key>3){
chartdata===undefined?"":chartdata.teams.length===0||chartdata.teams.length<3?"":chartdata.teams.map((item,key)=>{
if(key>2){
let list={
usersum:key,
userimg:item.user_image,
@ -120,19 +121,20 @@ class CompetitionContents extends Component{
<Row calssName={"Competition399"}>
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
if(key===1){
if(key===3){
return(
<Col xs={{ span: 11, offset: 1 }} lg={{ span: 6, offset: 1 }}>
<Col className="mt40" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 2 }}>
<Card
className={"Competitionfirst"}
className={"Competitionthird"}
cover={
<div className={"Competitionfirstbox center"}>
<div className={"Competitionthirdbox center"}>
<li className="pr Competitioncenter">
<img src={getImageUrl("images/educoder/huangguan.png")}/>
<img src={getImageUrl("images/educoder/huangguan-two.png")}/>
<div className={"mt10"}>
<a href={`/users/${item.user_login}`} className="color-dark">
<img className={"rankingimg"} src={getImageUrl(item.user_image)} />
<p className="task-hide rankName mt5 jinshaifont">{item.record_user_name}</p>
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<p className="task-hide rankName mt5 jinshaifont">{item.user_name}</p>
</a>
</div>
</li>
@ -145,28 +147,29 @@ class CompetitionContents extends Component{
<div className={"rankfontmid"}>{item.spend_time}</div>
</div>}
description={
<div className={"rankfontbottoms"}>{item.score}</div>
<div className={"rankfontbottom"}>{item.score}</div>
}
/>
</Card>
</Col>
)
}
if(key===2){
})}
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
if(key===1){
return(
<Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}>
<Col xs={{ span: 11, offset: 1 }} lg={{ span: 6, offset: 1 }}>
<Card
className={"Competitionsecondary "}
className={"Competitionfirst"}
cover={
<div className={"Competitionsecondarybox center"}>
<li className=" pr Competitioncenter ">
<img src={getImageUrl("images/educoder/huangguan-three.png")}/>
<div className={"Competitionfirstbox center"}>
<li className="pr Competitioncenter">
<img src={getImageUrl("images/educoder/huangguan.png")}/>
<div className={"mt10"}>
<a href={`/users/${item.user_login}`} className="color-dark">
<img className={"rankingimg"} src={getImageUrl(item.user_image)} />
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<p className="task-hide rankName mt5 jinshaifont">{item.record_user_name}</p>
</a>
</div>
@ -180,28 +183,30 @@ class CompetitionContents extends Component{
<div className={"rankfontmid"}>{item.spend_time}</div>
</div>}
description={
<div className={"rankfontbottom"}>{item.score}</div>
<div className={"rankfontbottoms"}>{item.score}</div>
}
/>
</Card>
</Col>
)
}
if(key===3){
})}
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
if(key===2){
return(
<Col className="mt40" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 2 }}>
<Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}>
<Card
className={"Competitionthird"}
className={"Competitionsecondary "}
cover={
<div className={"Competitionthirdbox center"}>
<li className="pr Competitioncenter">
<img src={getImageUrl("images/educoder/huangguan-two.png")}/>
<div className={"Competitionsecondarybox center"}>
<li className=" pr Competitioncenter ">
<img src={getImageUrl("images/educoder/huangguan-three.png")}/>
<div className={"mt10"}>
<a href={`/users/${item.user_login}`} className="color-dark">
<img className={"rankingimg"} src={getImageUrl(item.user_image)} />
<p className="task-hide rankName mt5 jinshaifont">{item.user_name}</p>
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<p className="task-hide rankName mt5 jinshaifont">{item.record_user_name}</p>
</a>
</div>
</li>
@ -216,17 +221,19 @@ class CompetitionContents extends Component{
description={
<div className={"rankfontbottom"}>{item.score}</div>
}
/>
</Card>
</Col>
)
}
})}
</Row>
{chartdata===undefined?"":chartdata.user_ranks.length===0?"":<div className={"youranklist"}>
{chartdata===undefined?"":chartdata.user_ranks.length===0?"":<div className={"youranklist mt50"}>
<style>
{
`
@ -261,7 +268,7 @@ class CompetitionContents extends Component{
})}
</div>}
<Row className={"mt80 mb80"}>
{chartdata===undefined?"":chartdata.teams.length===0?"":<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>}
{chartdata===undefined?"":chartdata.teams.length===0||chartdata.teams.length<3?"":<Table className="Competitiontransparent" columns={columns} dataSource={data} showHeader={false} pagination={false}/>}
</Row>

Loading…
Cancel
Save