|
|
@ -12,7 +12,7 @@ import { getImageUrl, toPath } from 'educoder'
|
|
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
import { Modal,Checkbox ,Radio,Input,message } from 'antd';
|
|
|
|
import { Modal,Checkbox ,Radio,Input,message,notification } from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
import Addcourses from '../courses/coursesPublic/Addcourses';
|
|
|
|
import Addcourses from '../courses/coursesPublic/Addcourses';
|
|
|
|
|
|
|
|
|
|
|
@ -113,6 +113,16 @@ class NewHeader extends Component {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
openNotification = (messge) => {
|
|
|
|
|
|
|
|
notification.open({
|
|
|
|
|
|
|
|
message: "提示",
|
|
|
|
|
|
|
|
description:
|
|
|
|
|
|
|
|
messge,
|
|
|
|
|
|
|
|
onClick: () => {
|
|
|
|
|
|
|
|
console.log('Notification Clicked!');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
componentWillReceiveProps(newProps, oldProps) {
|
|
|
|
componentWillReceiveProps(newProps, oldProps) {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
user:newProps.user
|
|
|
|
user:newProps.user
|
|
|
@ -158,12 +168,38 @@ class NewHeader extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tojoinclass=()=>{
|
|
|
|
tojoinclass=()=>{
|
|
|
|
|
|
|
|
let{user} =this.state;
|
|
|
|
|
|
|
|
if(user===undefined){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(user&&user.login===""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
Addcoursestypes:true,
|
|
|
|
Addcoursestypes:true,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tojoinitem=()=>{
|
|
|
|
tojoinitem=()=>{
|
|
|
|
|
|
|
|
let{user} =this.state;
|
|
|
|
|
|
|
|
if(user===undefined){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(user&&user.login===""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
tojoinitemtype:true
|
|
|
|
tojoinitemtype:true
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -235,7 +271,7 @@ class NewHeader extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
educoderlogin=()=>{
|
|
|
|
educoderlogin=()=>{
|
|
|
|
//退出账号
|
|
|
|
//登录账号
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
isRender:true
|
|
|
|
isRender:true
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -305,21 +341,21 @@ submittojoinclass=(value)=>{
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let newrolearr=rolearr;
|
|
|
|
let newrolearr=rolearr;
|
|
|
|
if(value===1){
|
|
|
|
// if(value===1){
|
|
|
|
if(tojoinclasstitle.length<6){
|
|
|
|
if(tojoinclasstitle.length<6){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
code_notice:true
|
|
|
|
code_notice:true
|
|
|
|
})
|
|
|
|
})
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else if(value===0){
|
|
|
|
// }else if(value===0){
|
|
|
|
if(tojoinclasstitle.length<5){
|
|
|
|
// if(tojoinclasstitle.length<5){
|
|
|
|
this.setState({
|
|
|
|
// this.setState({
|
|
|
|
code_notice:true
|
|
|
|
// code_notice:true
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
return
|
|
|
|
// return
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
if(tojoinclasstitle===""||tojoinclasstitle===undefined){
|
|
|
|
if(tojoinclasstitle===""||tojoinclasstitle===undefined){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
code_notice:true
|
|
|
|
code_notice:true
|
|
|
@ -440,6 +476,11 @@ submittojoinclass=(value)=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
inputjoinclassvalue=(e)=>{
|
|
|
|
inputjoinclassvalue=(e)=>{
|
|
|
|
|
|
|
|
console.log(e.target.value.length);
|
|
|
|
|
|
|
|
if(e.target.value.length>=7){
|
|
|
|
|
|
|
|
this.openNotification("请输入6位项目邀请码!");
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
tojoinclasstitle:e.target.value
|
|
|
|
tojoinclasstitle:e.target.value
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -483,6 +524,35 @@ submittojoinclass=(value)=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//头部获取是否已经登录了
|
|
|
|
|
|
|
|
getUser=(url)=>{
|
|
|
|
|
|
|
|
console.log("点击了503")
|
|
|
|
|
|
|
|
console.log(url);
|
|
|
|
|
|
|
|
let{user} =this.state;
|
|
|
|
|
|
|
|
if(user===undefined){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(user&&user.login===""){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:true
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(url !== undefined || url!==""){
|
|
|
|
|
|
|
|
window.location.href = url;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改登录方法
|
|
|
|
|
|
|
|
Modifyloginvalue=()=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
isRender:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
|
|
|
|
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
|
|
|
|
const {match ,} = this.props;
|
|
|
|
const {match ,} = this.props;
|
|
|
@ -529,12 +599,12 @@ submittojoinclass=(value)=>{
|
|
|
|
// rolearr:["",""],
|
|
|
|
// rolearr:["",""],
|
|
|
|
// console.log("618");
|
|
|
|
// console.log("618");
|
|
|
|
// console.log(user_phone_binded);
|
|
|
|
// console.log(user_phone_binded);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
|
|
|
|
|
|
|
|
<div className="newHeader" id="nHeader" >
|
|
|
|
<div className="newHeader" id="nHeader" >
|
|
|
|
|
|
|
|
|
|
|
|
{isRender===true?<LoginDialog
|
|
|
|
{isRender===true?<LoginDialog
|
|
|
|
|
|
|
|
Modifyloginvalue={()=>this.Modifyloginvalue()}
|
|
|
|
{...this.state}
|
|
|
|
{...this.state}
|
|
|
|
{...this.props}
|
|
|
|
{...this.props}
|
|
|
|
/>:""}
|
|
|
|
/>:""}
|
|
|
@ -705,10 +775,12 @@ submittojoinclass=(value)=>{
|
|
|
|
<div className="edu-menu-list" style={{top: '60px',width:"240px"}}>
|
|
|
|
<div className="edu-menu-list" style={{top: '60px',width:"240px"}}>
|
|
|
|
<div className="overPart"></div>
|
|
|
|
<div className="overPart"></div>
|
|
|
|
<ul className="fl with50 edu-txt-center pr ul-leftline">
|
|
|
|
<ul className="fl with50 edu-txt-center pr ul-leftline">
|
|
|
|
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":<li><Link to={"/courses/new"}>新建课堂</Link></li>}
|
|
|
|
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":<li><a onClick={(url)=>this.getUser("/courses/new")}>新建课堂</a></li>}
|
|
|
|
<li><a href="/shixuns/new">新建实训</a></li>
|
|
|
|
<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训</a></li>
|
|
|
|
<li><a href={this.props.Headertop===undefined?"":"/paths/new"}>新建实践课程</a></li>
|
|
|
|
{this.props.Headertop===undefined?"":
|
|
|
|
<li><a href={"/projects/new"} target="_blank">新建项目</a></li>
|
|
|
|
<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
<li><a onClick={(url)=>this.getUser("/projects/new")} target="_blank">新建项目</a></li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
<ul className="fl with50 edu-txt-center">
|
|
|
|
<ul className="fl with50 edu-txt-center">
|
|
|
|
|
|
|
|
|
|
|
@ -739,12 +811,12 @@ submittojoinclass=(value)=>{
|
|
|
|
<label className="panel-form-label fl">项目邀请码:</label>
|
|
|
|
<label className="panel-form-label fl">项目邀请码:</label>
|
|
|
|
<Input type="text" className="input-60-40 fl mt5" name="invite_code"
|
|
|
|
<Input type="text" className="input-60-40 fl mt5" name="invite_code"
|
|
|
|
style={{width: '275px'}}
|
|
|
|
style={{width: '275px'}}
|
|
|
|
placeholder="请输入5位项目邀请码或6位分班邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>
|
|
|
|
placeholder="请输入6位项目邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
<p id="none_invite_code_notice"
|
|
|
|
<p id="none_invite_code_notice"
|
|
|
|
className="color-orange none f12"
|
|
|
|
className="color-orange none f12"
|
|
|
|
style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入5位项目邀请码或6位分班邀请码</p>
|
|
|
|
style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入6位项目邀请码</p>
|
|
|
|
|
|
|
|
|
|
|
|
<li className="clearfix ">
|
|
|
|
<li className="clearfix ">
|
|
|
|
|
|
|
|
|
|
|
|