From 50052d34f2a3342b8c3b81325a3e1e536e425591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 26 Oct 2019 14:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitimain/CompetitionsIndex.js | 14 ++-- .../Competitimain/Competitionsindex.css | 10 ++- .../Competitioncommon/CompetitionCommon.css | 7 +- .../Competitioncommon/CompetitionCommon.js | 43 ++++++----- .../CompetitionContentsChart.js | 73 ++++++++++--------- 5 files changed, 84 insertions(+), 63 deletions(-) diff --git a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js index a6e99e5a6..eb4cb431f 100644 --- a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js +++ b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js @@ -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{ 竞赛时间: 2019-08-07 24: 00~2019-09-10 24: 00, - 报名截止时间:2019-08-07 08:10, + 竞赛时间: {item.start_time}~{item.end_time}, + 报名截止时间:{item.enroll_end_time}, ]} extra={
@@ -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"}> 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}{item.sub_title===null?"":{ - item.sub_title - }} + >{item.name}{item.sub_title===null?"":`——${item.sub_title}`} + {/*{item.sub_title===null?"":*/} + {/*{item.sub_title}}*/} + {/**/} } /> {item.description} diff --git a/public/react/src/modules/competitions/Competitimain/Competitionsindex.css b/public/react/src/modules/competitions/Competitimain/Competitionsindex.css index fd87643a4..dda7fcf40 100644 --- a/public/react/src/modules/competitions/Competitimain/Competitionsindex.css +++ b/public/react/src/modules/competitions/Competitimain/Competitionsindex.css @@ -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; diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css index 077b58ef4..22810c4b5 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css @@ -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;} diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index 8c7b44ad2..9c80366f3 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -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{ - + @@ -293,7 +296,9 @@ class CompetitionCommon extends Component{ {data.competition_status==="ended"? : + :data.enroll_end===true?: data.competition_status==="progressing"?:""} diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js index daa6a815e..3bc6ba6d3 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js @@ -40,7 +40,7 @@ class CompetitionContents extends Component{ key: 'userimg', render: (text, record) =>( - + ), }, { @@ -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{ {chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{ - if(key===1){ + + if(key===3){ return( - + +
  • - +
  • @@ -145,28 +147,29 @@ class CompetitionContents extends Component{
    {item.spend_time}
    } description={ -
    {item.score}分
    +
    {item.score}分
    } - />
    - + ) } - if(key===2){ + })} + {chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{ + if(key===1){ return( - + -
  • - +
    +
  • + @@ -180,28 +183,30 @@ class CompetitionContents extends Component{
    {item.spend_time}
  • } description={ -
    {item.score}分
    +
    {item.score}分
    } /> + ) } - - if(key===3){ + })} + {chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{ + if(key===2){ return( - + -
  • - +
    +
  • +
    - -

    {item.user_name}

    + +

    {item.record_user_name}

  • @@ -216,17 +221,19 @@ class CompetitionContents extends Component{ description={
    {item.score}分
    } + />
    - ) } + + })} - {chartdata===undefined?"":chartdata.user_ranks.length===0?"":
    + {chartdata===undefined?"":chartdata.user_ranks.length===0?"":