|
|
|
@ -34,6 +34,7 @@ class Addcourses extends Component{
|
|
|
|
|
this.setState({
|
|
|
|
|
Addcoursestypes: true
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return response;
|
|
|
|
@ -213,25 +214,42 @@ class Addcourses extends Component{
|
|
|
|
|
student:student
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
console.log("submittojoinclass");
|
|
|
|
|
console.log(response);
|
|
|
|
|
if(response === undefined){
|
|
|
|
|
this.setState({
|
|
|
|
|
// Addcoursestype:false,
|
|
|
|
|
isSpin:false
|
|
|
|
|
});
|
|
|
|
|
// try {
|
|
|
|
|
// this.props.HideAddcoursestypess(3);
|
|
|
|
|
// }catch (e) {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(response.data.status===-2){
|
|
|
|
|
this.setState({
|
|
|
|
|
Addcoursestype:false,
|
|
|
|
|
isSpin:false
|
|
|
|
|
});
|
|
|
|
|
try {
|
|
|
|
|
if(response.data.message==="该课堂要求成员完成实名认证"){
|
|
|
|
|
this.props.HideAddcoursestypess(1);
|
|
|
|
|
}
|
|
|
|
|
if(response.data.message==="该课堂要求成员完成职业认证"){
|
|
|
|
|
this.props.HideAddcoursestypess(2);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if(response.data.message==="该课堂要求成员完成实名和职业认证"){
|
|
|
|
|
this.props.HideAddcoursestypess(3);
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
this.props.showNotification(response.data.message);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
// course_id: 1545
|
|
|
|
|
// message: "成功"
|
|
|
|
|
// status: 0
|
|
|
|
|
// this.setState({
|
|
|
|
|
// // loadtype:true,
|
|
|
|
|
// // modalsType:true,
|
|
|
|
|
// // modalsTopval:response.data.message,
|
|
|
|
|
// // modalSave:this.submitasyn,
|
|
|
|
|
// course_id:response.data.course_id
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// https://www.trustie.net/issues/22365
|
|
|
|
|
if (response.data.course_id == 2704) {
|
|
|
|
|
this.props.history.push('/courses/2704/boards/8367/messages/42072')
|
|
|
|
@ -263,14 +281,6 @@ class Addcourses extends Component{
|
|
|
|
|
this.props.hideAddcoursestype();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
// loadtype:true,
|
|
|
|
|
// modalsType:true,
|
|
|
|
|
// modalsTopval:response.data.message,
|
|
|
|
|
// modalSave:this.submitasyn,
|
|
|
|
|
// course_id:undefined
|
|
|
|
|
// })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
@ -285,52 +295,6 @@ class Addcourses extends Component{
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// if(value===0){
|
|
|
|
|
// const form = new FormData();
|
|
|
|
|
// form.append('invite_code', tojoinclasstitle);
|
|
|
|
|
// form.append('role', pamst);
|
|
|
|
|
// form.append('type', 1);
|
|
|
|
|
// axios.post(url,form,[true]
|
|
|
|
|
// ).then((response) => {
|
|
|
|
|
// if( response.data.state===0){
|
|
|
|
|
// this.submitstatevalue(0,"加入成功",response.data.course_id)
|
|
|
|
|
// }else if( response.data.state===1){
|
|
|
|
|
// }else if( response.data.state===2){
|
|
|
|
|
// this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)")
|
|
|
|
|
// }else if( response.data.state===3){
|
|
|
|
|
// this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id)
|
|
|
|
|
// }else if( response.data.state===4){
|
|
|
|
|
// this.submitstatevalue( 0,"您输入的邀请码错误)")
|
|
|
|
|
// }else if( response.data.state===5){
|
|
|
|
|
// this.submitstatevalue( 0,"您还未登录")
|
|
|
|
|
// }else if( response.data.state===6){
|
|
|
|
|
// this.submitstatevalue( 0,"申请已提交,请等待审核")
|
|
|
|
|
// }else if( response.data.state===7){
|
|
|
|
|
// this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待")
|
|
|
|
|
// }else if( response.data.state===8){
|
|
|
|
|
// this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id)
|
|
|
|
|
// }else if( response.data.state==9){
|
|
|
|
|
// this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id)
|
|
|
|
|
// }else if( response.data.state==10){
|
|
|
|
|
// this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id)
|
|
|
|
|
// }else if( response.data.state==11){
|
|
|
|
|
// this.submitstatevalue(0," 该课堂已归档,请联系老师")
|
|
|
|
|
// }else if( response.data.state==12){
|
|
|
|
|
// this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师")
|
|
|
|
|
// }else if( response.data.state==13){
|
|
|
|
|
// this.submitstatevalue(0,"您申请已提交,请等待审核")
|
|
|
|
|
// }else if( response.data.state==14){
|
|
|
|
|
// this.submitstatevalue("此邀请码已停用,请与老师联系")
|
|
|
|
|
// }else if( response.data.state==15){
|
|
|
|
|
// this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行")
|
|
|
|
|
// }else {
|
|
|
|
|
// this.submitstatevalue(0," 未知错误,请稍后再试")
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|