From dafcb467c771da0a0c60936448d65d0305531d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 6 Nov 2019 13:57:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=BE=E5=A0=82=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=AB=9E=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index ec77f7e97..ed129d8bd 100755 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -235,13 +235,16 @@ class CompetitionCommon extends Component{ this.props.showProfileCompleteDialog() return } + if(url===undefined){ let {data,signupdata}=this.state; - if(signupdata.enrolled===true){ - this.props.history.replace(`/courses/${data.course_id}`); - }else{ + // if(signupdata.enrolled===true){ + // this.props.history.replace(`/courses/${data.course_id}`); + // }else{ } + if (data.member_of_course === true) { - this.props.history.replace(`/courses/${data.course_id}`); + // this.props.history.replace(`/courses/${data.course_id}`); + window.open(`/courses/${data.course_id}`) } else { // 以学生身份调用加入课堂 进入课堂首页 let url = "/courses/apply_to_join_course.json" @@ -251,15 +254,18 @@ class CompetitionCommon extends Component{ } ).then((response) => { if (response.data.status === 0) { - this.props.history.replace(`/courses/${data.course_id}`); + // this.props.history.replace(); + this.Personalregistration(`/courses/${data.course_id}`) } }) + } - } + }else{ if (url === "personal") { - this.Personalregistration() + let urls = `/competitions/${this.props.match.params.identifier}/enroll`; + this.Personalregistration(urls) } else { this.props.history.replace(url); } @@ -268,10 +274,10 @@ class CompetitionCommon extends Component{ } - Personalregistration = () => { + Personalregistration = (urls) => { let {signupdata} = this.state; - let urls = `/competitions/${this.props.match.params.identifier}/enroll`; + if (signupdata.enroll_ended === true) { //已截止 this.props.showNotification(`报名已截止`); @@ -286,7 +292,8 @@ class CompetitionCommon extends Component{ if (response) { if (response.data) { this.props.showNotification(`报名成功,预祝您夺得桂冠!`); - this.props.history.replace(urls); + // this.props.history.replace(urls); + window.open(urls) } } }).catch((error) => {