|
|
@ -235,13 +235,16 @@ class CompetitionCommon extends Component{
|
|
|
|
this.props.showProfileCompleteDialog()
|
|
|
|
this.props.showProfileCompleteDialog()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(url===undefined){
|
|
|
|
if(url===undefined){
|
|
|
|
let {data,signupdata}=this.state;
|
|
|
|
let {data,signupdata}=this.state;
|
|
|
|
if(signupdata.enrolled===true){
|
|
|
|
// if(signupdata.enrolled===true){
|
|
|
|
this.props.history.replace(`/courses/${data.course_id}`);
|
|
|
|
// this.props.history.replace(`/courses/${data.course_id}`);
|
|
|
|
}else{
|
|
|
|
// }else{ }
|
|
|
|
|
|
|
|
|
|
|
|
if (data.member_of_course === true) {
|
|
|
|
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 {
|
|
|
|
} else {
|
|
|
|
// 以学生身份调用加入课堂 进入课堂首页
|
|
|
|
// 以学生身份调用加入课堂 进入课堂首页
|
|
|
|
let url = "/courses/apply_to_join_course.json"
|
|
|
|
let url = "/courses/apply_to_join_course.json"
|
|
|
@ -251,15 +254,18 @@ class CompetitionCommon extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
).then((response) => {
|
|
|
|
).then((response) => {
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
this.props.history.replace(`/courses/${data.course_id}`);
|
|
|
|
// this.props.history.replace();
|
|
|
|
|
|
|
|
this.Personalregistration(`/courses/${data.course_id}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
|
|
if (url === "personal") {
|
|
|
|
if (url === "personal") {
|
|
|
|
this.Personalregistration()
|
|
|
|
let urls = `/competitions/${this.props.match.params.identifier}/enroll`;
|
|
|
|
|
|
|
|
this.Personalregistration(urls)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.props.history.replace(url);
|
|
|
|
this.props.history.replace(url);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -268,10 +274,10 @@ class CompetitionCommon extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Personalregistration = () => {
|
|
|
|
Personalregistration = (urls) => {
|
|
|
|
|
|
|
|
|
|
|
|
let {signupdata} = this.state;
|
|
|
|
let {signupdata} = this.state;
|
|
|
|
let urls = `/competitions/${this.props.match.params.identifier}/enroll`;
|
|
|
|
|
|
|
|
if (signupdata.enroll_ended === true) {
|
|
|
|
if (signupdata.enroll_ended === true) {
|
|
|
|
//已截止
|
|
|
|
//已截止
|
|
|
|
this.props.showNotification(`报名已截止`);
|
|
|
|
this.props.showNotification(`报名已截止`);
|
|
|
@ -286,7 +292,8 @@ class CompetitionCommon extends Component{
|
|
|
|
if (response) {
|
|
|
|
if (response) {
|
|
|
|
if (response.data) {
|
|
|
|
if (response.data) {
|
|
|
|
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
|
|
|
|
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
|
|
|
|
this.props.history.replace(urls);
|
|
|
|
// this.props.history.replace(urls);
|
|
|
|
|
|
|
|
window.open(urls)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|