|
|
@ -72,16 +72,19 @@ class CompetitionCommon extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取头部信息
|
|
|
|
//获取头部信息
|
|
|
|
getbannerdata=()=>{
|
|
|
|
getbannerdata=()=>{
|
|
|
|
let menuid=this.props.location.search.replace('?menu=', '');
|
|
|
|
// let menuid=this.props.location.search.replace('?menu=', '');
|
|
|
|
|
|
|
|
let query=this.props.location&&this.props.location.search;
|
|
|
|
|
|
|
|
const types = query.split('&')
|
|
|
|
|
|
|
|
const menuid = types[0].split('?menu=')
|
|
|
|
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
|
|
|
|
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
if(response.status===200){
|
|
|
|
if(response.status===200){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
data: response.data,
|
|
|
|
data: response.data,
|
|
|
|
thiskeys: menuid === undefined || menuid === "" ? response.data.competition_modules[0].id : menuid,
|
|
|
|
thiskeys: menuid[1] === undefined || menuid[1] === "" ? response.data.competition_modules[0].id : menuid[1],
|
|
|
|
mode: response.data.mode
|
|
|
|
mode: response.data.mode
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if(menuid===undefined||menuid===""){
|
|
|
|
if(menuid[1]===undefined||menuid[1]===""){
|
|
|
|
this.getrightdata(
|
|
|
|
this.getrightdata(
|
|
|
|
response.data.competition_modules[0].id,
|
|
|
|
response.data.competition_modules[0].id,
|
|
|
|
response.data.competition_modules[0].module_type,
|
|
|
|
response.data.competition_modules[0].module_type,
|
|
|
@ -91,7 +94,7 @@ class CompetitionCommon extends Component{
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
let newlist=response.data.competition_modules;
|
|
|
|
let newlist=response.data.competition_modules;
|
|
|
|
newlist.map((item,key)=>{
|
|
|
|
newlist.map((item,key)=>{
|
|
|
|
if(`${item.id}`===`${menuid}`){
|
|
|
|
if(`${item.id}`===`${menuid[1]}`){
|
|
|
|
this.getrightdata(
|
|
|
|
this.getrightdata(
|
|
|
|
item.id,
|
|
|
|
item.id,
|
|
|
|
item.module_type,
|
|
|
|
item.module_type,
|
|
|
@ -267,7 +270,9 @@ class CompetitionCommon extends Component{
|
|
|
|
).then((response) => {
|
|
|
|
).then((response) => {
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
// this.props.history.replace();
|
|
|
|
// this.props.history.replace();
|
|
|
|
this.Personalregistration(`/courses/${data.course_id}`)
|
|
|
|
this.getbannerdata()
|
|
|
|
|
|
|
|
window.open(`/courses/${data.course_id}`);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -305,6 +310,7 @@ class CompetitionCommon extends Component{
|
|
|
|
if (response.data) {
|
|
|
|
if (response.data) {
|
|
|
|
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
|
|
|
|
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
|
|
|
|
// this.props.history.replace(urls);
|
|
|
|
// this.props.history.replace(urls);
|
|
|
|
|
|
|
|
this.getbannerdata()
|
|
|
|
window.open(urls)
|
|
|
|
window.open(urls)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -393,9 +399,9 @@ class CompetitionCommon extends Component{
|
|
|
|
<Col className="gutter-row rankbeicenter" span={6}>
|
|
|
|
<Col className="gutter-row rankbeicenter" span={6}>
|
|
|
|
|
|
|
|
|
|
|
|
{data.competition_status === "ended" ?
|
|
|
|
{data.competition_status === "ended" ?
|
|
|
|
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer"
|
|
|
|
<div className={data.mode === 2 ?data.member_of_course==true?"gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer":"gutter-box CompetitionsIndexbottomvalue Competitioncolor516":"gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer"}
|
|
|
|
// 已结束onClick={data.competition_status === "nearly_published" ? "" : () => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
|
|
|
|
// 已结束onClick={data.competition_status === "nearly_published" ? "" : () => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
|
|
|
|
onClick={ data.mode === 2 ?() => this.newgotocourse(`/courses/${data.course_id}`):() => this.newgotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
|
|
|
|
onClick={ data.mode === 2 ?data.member_of_course==true?() => this.newgotocourse(`/courses/${data.course_id}`):"":() => this.newgotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
|
|
|
|
>{data && data.member_count}</div>
|
|
|
|
>{data && data.member_count}</div>
|
|
|
|
:data.competition_status === "nearly_published" ?
|
|
|
|
:data.competition_status === "nearly_published" ?
|
|
|
|
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516"
|
|
|
|
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516"
|
|
|
|