路由回调为newcompetitions

dev_auth
杨树明 5 years ago
parent 803c92d509
commit 94fdd66cf2

@ -486,7 +486,7 @@ class App extends Component {
{/*/!*众包创新*!/*/} {/*/!*众包创新*!/*/}
{/*<Route path={"/crowdsourcing"} component={ProjectPackages}/>*/} {/*<Route path={"/crowdsourcing"} component={ProjectPackages}/>*/}
{/*竞赛*/} {/*竞赛*/}
<Route path={"/competitions"} <Route path={"/newcompetitions"}
render={ render={
(props) => { (props) => {

@ -814,9 +814,9 @@ class Registration extends React.Component {
<div style={{marginBottom: '12px'}}> <div style={{marginBottom: '12px'}}>
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item><Link to={"/competitions"}>在线竞赛</Link></Breadcrumb.Item> <Breadcrumb.Item><Link to={"/newcompetitions"}>在线竞赛</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link <Breadcrumb.Item><Link
to={`/competitions/${this.props.match.params.identifier}/common_header`}>{competition_name === undefined || competition_name === null || competition_name === "" ? "全国高校计算机大赛" : competition_name}</Link></Breadcrumb.Item> to={`/newcompetitions/${this.props.match.params.identifier}/common_header`}>{competition_name === undefined || competition_name === null || competition_name === "" ? "全国高校计算机大赛" : competition_name}</Link></Breadcrumb.Item>
{/*<Breadcrumb.Item*/} {/*<Breadcrumb.Item*/}
{/* href={`/competitions/${this.props.match.params.identifier}/common_header`}></Breadcrumb.Item>*/} {/* href={`/competitions/${this.props.match.params.identifier}/common_header`}></Breadcrumb.Item>*/}
<Breadcrumb.Item>报名</Breadcrumb.Item> <Breadcrumb.Item>报名</Breadcrumb.Item>

@ -304,7 +304,7 @@ class PersonalCompetititem extends React.Component {
> >
<div className="regitemimgs555"> <div className="regitemimgs555">
<a <a
href={`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`} href={`/newcompetitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
style={{ style={{
color: "#459be5", color: "#459be5",
width: "100%", width: "100%",
@ -364,7 +364,7 @@ class PersonalCompetititem extends React.Component {
> >
<div className="regitemimgs555"> <div className="regitemimgs555">
<a <a
href={`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`} href={`/newcompetitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
style={{ style={{
color: "#459be5", color: "#459be5",
width: "100%", width: "100%",

@ -124,7 +124,7 @@ class CompetitionsIndex extends Component{
size="large" size="large"
dataSource={datas&&datas} dataSource={datas&&datas}
renderItem={(item,key) => ( renderItem={(item,key) => (
<a href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/competitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null} <a href={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}
className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"? className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
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.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}
> >
@ -182,7 +182,7 @@ class CompetitionsIndex extends Component{
title={<a className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"? title={<a className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
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.props.current_user&&this.props.current_user.admin===true?"competitionstitlesshou":this.props.current_user&&this.props.current_user.business===true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}>
<a className={"competitionstitles"} <a className={"competitionstitles"}
href={item.competition_status==="ended"?`/competitions/${item.identifier}/common_header`:item.competition_status==="nearly_published"? this.props.current_user&&this.props.current_user.business===true?`/competitions/${item.identifier}/common_header`:this.props.current_user&&this.props.current_user.admin===true?`/competitions/${item.identifier}/common_header`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}/common_header`:null} href={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}`}</a> >{item.name}{item.sub_title===null?"":`——${item.sub_title}`}</a>
{/*<span>{item.sub_title===null?"":*/} {/*<span>{item.sub_title===null?"":*/}
{/*<Tag className="competitionsrelative" color="#87d068">{item.sub_title}</Tag>}*/} {/*<Tag className="competitionsrelative" color="#87d068">{item.sub_title}</Tag>}*/}

@ -241,8 +241,8 @@ class Competitionteams extends Component{
<div className={"educontent clearfix mt20 "}> <div className={"educontent clearfix mt20 "}>
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item><Link to={"/competitions"}>{data&&data.name}</Link></Breadcrumb.Item> <Breadcrumb.Item><Link to={"/newcompetitions"}>{data&&data.name}</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link to={`/competitions/${this.props.match.params.identifier}/enroll`}>报名</Link></Breadcrumb.Item> <Breadcrumb.Item><Link to={`/newcompetitions/${this.props.match.params.identifier}/enroll`}>报名</Link></Breadcrumb.Item>
<Breadcrumb.Item>战队详情</Breadcrumb.Item> <Breadcrumb.Item>战队详情</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>

@ -240,7 +240,7 @@ class CompetitionCommon extends Component{
data===undefined?"":<div className={"educontent clearfix mt20 "}> data===undefined?"":<div className={"educontent clearfix mt20 "}>
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item><Link to={"/competitions"}>在线竞赛</Link></Breadcrumb.Item> <Breadcrumb.Item><Link to={"/newcompetitions"}>在线竞赛</Link></Breadcrumb.Item>
<Breadcrumb.Item>{data&&data.name}</Breadcrumb.Item> <Breadcrumb.Item>{data&&data.name}</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
@ -284,7 +284,7 @@ class CompetitionCommon extends Component{
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status==="nearly_published"?"--":data&&data.visits_count}</div> <div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status==="nearly_published"?"--":data&&data.visits_count}</div>
</Col> </Col>
<Col className="gutter-row rankbeicenter" span={6}> <Col className="gutter-row rankbeicenter" span={6}>
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516" onClick={data.competition_status==="nearly_published"?"":()=>this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}>{data.competition_status==="nearly_published"?"--":data&&data.member_count}</div> <div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516" onClick={data.competition_status==="nearly_published"?"":()=>this.gotocourse(`/newcompetitions/${this.props.match.params.identifier}/enroll`)}>{data.competition_status==="nearly_published"?"--":data&&data.member_count}</div>
</Col> </Col>
</Row> </Row>
</Col> </Col>
@ -317,7 +317,7 @@ class CompetitionCommon extends Component{
报名截止 报名截止
</Button>: </Button>:
data.competition_status==="progressing"?<Button type="primary" block className={"Competitionfontsize22"}> data.competition_status==="progressing"?<Button type="primary" block className={"Competitionfontsize22"}>
{data.mode===2?<a onClick={()=>this.gotocourse()}>立即报名</a>:<a onClick={()=>this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}></a>} {data.mode===2?<a onClick={()=>this.gotocourse()}>立即报名</a>:<a onClick={()=>this.gotocourse(`/newcompetitions/${this.props.match.params.identifier}/enroll`)}></a>}
</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>

@ -68,7 +68,7 @@ class CompetitionContents extends Component{
const operations = <div> const operations = <div>
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button> <Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
<Button className={"fr mr20"} type="primary" ghost> <Button className={"fr mr20"} type="primary" ghost>
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx`)}>导出</a> <a onClick={()=>this.derivefun(`/newcompetitions/${this.props.match.params.identifier}/charts.xlsx`)}>导出</a>
</Button> </Button>
</div> </div>
const columns = [ const columns = [

@ -53,7 +53,7 @@ class Competitions extends Component {
<Switch> <Switch>
{/*新版竞赛战队详情*/} {/*新版竞赛战队详情*/}
<Route path="/competitions/:identifier/competition_teams/:competition_team_id" <Route path="/newcompetitions/:identifier/competition_teams/:competition_team_id"
render={ render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />) (props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
} }
@ -62,21 +62,21 @@ class Competitions extends Component {
{/*新版竞赛报名*/} {/*新版竞赛报名*/}
<Route <Route
path="/competitions/:identifier/enroll" path="/newcompetitions/:identifier/enroll"
render={ render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>) (props) => (<Registration {...this.props} {...props} {...this.state}/>)
} }
/> />
{/*新版竞赛详情页面*/} {/*新版竞赛详情页面*/}
<Route path="/competitions/:identifier/common_header" <Route path="/newcompetitions/:identifier/common_header"
render={ render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />) (props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*新版竞赛首页*/} {/*新版竞赛首页*/}
<Route path="/competitions" <Route path="/newcompetitions"
render={ render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />) (props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
} }

Loading…
Cancel
Save