|
|
|
@ -114,16 +114,15 @@ class NewHeader extends Component {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openNotification = (messge) => {
|
|
|
|
|
notification.open({
|
|
|
|
|
message: "提示",
|
|
|
|
|
description:
|
|
|
|
|
messge,
|
|
|
|
|
onClick: () => {
|
|
|
|
|
console.log('Notification Clicked!');
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
componentWillReceiveProps(newProps, oldProps) {
|
|
|
|
|
this.setState({
|
|
|
|
|
user:newProps.user
|
|
|
|
@ -408,59 +407,62 @@ submittojoinclass=(value)=>{
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(value===0){
|
|
|
|
|
let url="/courses/join_course_multi_role.json"
|
|
|
|
|
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," 未知错误,请稍后再试")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// if(value===0){
|
|
|
|
|
// let url="/courses/join_course_multi_role.json"
|
|
|
|
|
// 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," 未知错误,请稍后再试")
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
if(value===1){
|
|
|
|
|
let url="/api/applied_project/applied_project_info.json"
|
|
|
|
|
const form = new FormData();
|
|
|
|
|
form.append('invite_code', tojoinclasstitle);
|
|
|
|
|
form.append('member', RadioGroupvalue);
|
|
|
|
|
form.append('type', 1);
|
|
|
|
|
axios.post(url,form,[true]
|
|
|
|
|
let url="/project_applies.json"
|
|
|
|
|
// const form = new FormData();
|
|
|
|
|
// form.append('code', tojoinclasstitle);
|
|
|
|
|
// form.append('role', RadioGroupvalue);
|
|
|
|
|
// form.append('type', 1);
|
|
|
|
|
axios.post(url,{
|
|
|
|
|
code:tojoinclasstitle,
|
|
|
|
|
role:RadioGroupvalue
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if( response.data.status===1){
|
|
|
|
|
this.submitstatevalue(1,"您输入的邀请码错误")
|
|
|
|
@ -474,9 +476,17 @@ submittojoinclass=(value)=>{
|
|
|
|
|
this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待")
|
|
|
|
|
}else if( response.data.status===6){
|
|
|
|
|
this.submitstatevalue( 1,"您已成功加入项目",response.data.project)
|
|
|
|
|
}else if( response.data.status===0){
|
|
|
|
|
if(RadioGroupvalue==="reporter"){
|
|
|
|
|
this.openNotification("您加入项目成功!");
|
|
|
|
|
window.location.href=`/projects/${response.data.project_id}`;
|
|
|
|
|
}else{
|
|
|
|
|
this.openNotification("您的申请已提交,请等待项目管理员审批!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.hidetojoinclass()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// trialapplications =()=>{
|
|
|
|
@ -617,6 +627,8 @@ submittojoinclass=(value)=>{
|
|
|
|
|
let activeShixuns = false;
|
|
|
|
|
let activePaths = false;
|
|
|
|
|
let coursestype=false;
|
|
|
|
|
let activePackages=false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (match.path === '/forums') {
|
|
|
|
|
activeForums = true;
|
|
|
|
@ -626,14 +638,12 @@ submittojoinclass=(value)=>{
|
|
|
|
|
activePaths = true;
|
|
|
|
|
} else if (match.path.startsWith('/courses')) {
|
|
|
|
|
coursestype = true;
|
|
|
|
|
}else if (match.path.startsWith('/crowdsourcing')) {
|
|
|
|
|
activePackages = true;
|
|
|
|
|
}else {
|
|
|
|
|
activeIndex = true;
|
|
|
|
|
}
|
|
|
|
|
// join_course_url: "https://www.educoder.net/courses/join_course_multi_role"
|
|
|
|
|
// join_project_url: "https://www.educoder.net/applied_project/applied_project_info"
|
|
|
|
|
// rolearr:["",""],
|
|
|
|
|
// console.log("618");
|
|
|
|
|
// console.log(user_phone_binded);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
|
|
<div className="newHeader" id="nHeader" >
|
|
|
|
@ -716,10 +726,9 @@ submittojoinclass=(value)=>{
|
|
|
|
|
/>
|
|
|
|
|
</li>
|
|
|
|
|
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.moop_cases_url}>教学案例</a></li>
|
|
|
|
|
<li className=""><a
|
|
|
|
|
// href={this.props.Headertop===undefined?"":this.props.Headertop.crowdsourcing_url}
|
|
|
|
|
href={'/crowdsourcings'}
|
|
|
|
|
>众包创新</a></li>
|
|
|
|
|
<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>
|
|
|
|
|
<a href={'/crowdsourcing'}>众包创新</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
|
|
|
|
|
<li
|
|
|
|
|
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
|
|
|
|
@ -816,7 +825,7 @@ submittojoinclass=(value)=>{
|
|
|
|
|
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li>
|
|
|
|
|
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
|
|
|
|
|
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
|
|
|
|
|
{/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
|
|
|
|
|
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>
|
|
|
|
|
<li><a href={`/account/profile`}>账号管理</a></li>
|
|
|
|
|
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
|
|
|
|
|
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}
|
|
|
|
@ -872,7 +881,7 @@ submittojoinclass=(value)=>{
|
|
|
|
|
{/*<li>*/}
|
|
|
|
|
<a onClick={this.tojoinitem}>加入项目</a>
|
|
|
|
|
{/*</li>*/}
|
|
|
|
|
<Modal
|
|
|
|
|
{tojoinitemtype===true?<Modal
|
|
|
|
|
keyboard={false}
|
|
|
|
|
title="加入项目"
|
|
|
|
|
visible={tojoinitemtype}
|
|
|
|
@ -897,15 +906,15 @@ submittojoinclass=(value)=>{
|
|
|
|
|
|
|
|
|
|
<label className="panel-form-label fl">身份:</label>
|
|
|
|
|
<RadioGroup className="mt10" onChange={this.onChangeRadioGroup}>
|
|
|
|
|
<Radio value={1}>管理人员</Radio>
|
|
|
|
|
<Radio value={2}>开发人员</Radio>
|
|
|
|
|
<Radio value={3}>报告人员</Radio>
|
|
|
|
|
<Radio value={"manager"}>管理人员</Radio>
|
|
|
|
|
<Radio value={"developer"}>开发人员</Radio>
|
|
|
|
|
<Radio value={"reporter"}>报告人员</Radio>
|
|
|
|
|
</RadioGroup>
|
|
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<p id="none_checked_notice" className="color-orange none f12"
|
|
|
|
|
style={{marginLeft: '90px',display:checked_notice===true?'block':"none"}}>请至少选择一个身份</p>
|
|
|
|
|
style={{marginLeft: '90px',display:checked_notice===true?'block':"none"}}>请选择一个身份</p>
|
|
|
|
|
|
|
|
|
|
<li className="clearfix mt10 edu-txt-center">
|
|
|
|
|
<a className="task-btn mr10"
|
|
|
|
@ -918,7 +927,7 @@ submittojoinclass=(value)=>{
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
</Modal>:""}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|