|
|
@ -1,6 +1,6 @@
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination} from 'antd';
|
|
|
|
import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination,Alert} from 'antd';
|
|
|
|
import {getImageUrl} from 'educoder';
|
|
|
|
import {getImageUrl} from 'educoder';
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
import './Competitionsindex.css';
|
|
|
|
import './Competitionsindex.css';
|
|
|
@ -78,8 +78,7 @@ class CompetitionsIndex extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let {datas,page,count}=this.state;
|
|
|
|
let {datas,page,count}=this.state;
|
|
|
|
admin: true
|
|
|
|
|
|
|
|
business: false
|
|
|
|
|
|
|
|
console.log(this.props.current_user&&this.props.current_user.business)
|
|
|
|
console.log(this.props.current_user&&this.props.current_user.business)
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
@ -133,7 +132,11 @@ class CompetitionsIndex extends Component{
|
|
|
|
dataSource={datas&&datas}
|
|
|
|
dataSource={datas&&datas}
|
|
|
|
renderItem={(item,key) => (
|
|
|
|
renderItem={(item,key) => (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={"CompetitionsList"} >
|
|
|
|
<div className={"CompetitionsList"} >
|
|
|
|
|
|
|
|
{item.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>:""}
|
|
|
|
|
|
|
|
{/*<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>*/}
|
|
|
|
{item.description===null||item.description===undefined||item.description===""?<style>
|
|
|
|
{item.description===null||item.description===undefined||item.description===""?<style>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
`
|
|
|
|
`
|
|
|
@ -181,7 +184,7 @@ class CompetitionsIndex extends Component{
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<List.Item.Meta
|
|
|
|
<List.Item.Meta
|
|
|
|
title={<a className={item.competition_status==="ended"?"endedfont":item.competition_status==="nearly_published"?
|
|
|
|
title={<a className={item.competition_status==="ended"?"endedfont":item.competition_status==="nearly_published"?
|
|
|
|
this.props.current_user&&this.props.current_user.business===true?"":this.props.current_user&&this.props.current_user.admin===true?"":"endedfont":""}>
|
|
|
|
this.props.current_user&&this.props.current_user.admin===true?"":this.props.current_user&&this.props.current_user.business===true?"":"endedfont":""}>
|
|
|
|
<span className={"competitionstitles"}
|
|
|
|
<span className={"competitionstitles"}
|
|
|
|
onClick={()=>this.setcompetitonurl(item.competition_status==="ended"?null: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)}
|
|
|
|
onClick={()=>this.setcompetitonurl(item.competition_status==="ended"?null: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.name}</span><span>{item.sub_title===null?"":<Tag className="competitionsrelative" color="#87d068">{
|
|
|
@ -199,7 +202,7 @@ class CompetitionsIndex extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/>}
|
|
|
|
/>}
|
|
|
|
|
|
|
|
|
|
|
|
{datas===undefined?'none':datas.task_count >20 ?<div className="mb40 edu-txt-center padding20-30"
|
|
|
|
{datas===undefined?"":datas.task_count >20 ?<div className="mb40 edu-txt-center padding20-30"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
<Pagination
|
|
|
|
<Pagination
|
|
|
|