杨树林 5 years ago
parent 224b8db169
commit eefbac5d22

@ -247,19 +247,28 @@ const Messagerouting= Loadable({
class App extends Component {
constructor(props) {
super(props)
// this.state = {
// mydisplay:false
// }
this.state = {
Addcoursestype:false,
Addcoursestypes:false,
mydisplay:false,
occupation:0,
}
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
Addcoursestype:false,
Addcoursestypes:false,
mydisplay:true,
occupation:i,
})
};
hideAddcoursestypes=()=>{
this.setState({
Addcoursestypes:false
})
};
ModalCancelsy=()=>{
this.setState({
mydisplay:false,
@ -315,9 +324,9 @@ class App extends Component {
<Notcompletedysl {...this.props} {...this.state}></Notcompletedysl>
<Trialapplicationysl {...this.props} {...this.state}></Trialapplicationysl>
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
{/*<Addcourses {...this.props} {...this.state} HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}/>*/}
<Addcourses {...this.props} {...this.state} HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}/>
<AccountProfile {...this.props} {...this.state} />
{/*<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy}/>*/}
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy}/>
<Router>
<Switch>

@ -792,10 +792,10 @@ class Coursesleftnav extends Component{
// // console.log(item.category_url)
// console.log(this.props.location.pathname)
console.log("778");
console.log("CoursesLeftNav");
console.log(this.props);
console.log(course_modules);
// console.log("778");
// console.log("CoursesLeftNav");
// console.log(this.props);
// console.log(course_modules);
return(

@ -34,8 +34,6 @@ class Addcourses extends Component{
this.setState({
Addcoursestypes: true
})
return
}
return response;
}, (error) => {
@ -49,6 +47,16 @@ class Addcourses extends Component{
})
}
componentDidUpdate = (prevProps) => {
console.log(prevProps);
console.log(this.props);
if(prevProps.occupation!==this.props.occupation){
this.setState({
Addcoursestype:false,
Addcoursestypes:false,
})
}
}
openNotification = (messge) => {
notification.open({
message: "提示",
@ -233,24 +241,26 @@ class Addcourses extends Component{
Addcoursestype:false,
isSpin:false
});
try {
// try {
if(response.data.message==="该课堂要求成员完成实名认证"){
this.props.HideAddcoursestypess(1);
this.props.HideAddcoursestypess(1);
return;
}
if(response.data.message==="该课堂要求成员完成职业认证"){
this.props.HideAddcoursestypess(2);
this.props.HideAddcoursestypess(2);
return;
}
if(response.data.message==="该课堂要求成员完成实名和职业认证"){
this.props.HideAddcoursestypess(3);
this.props.HideAddcoursestypess(3);
return;
}
}catch (e) {
// }catch (e) {
notification.open({
message:"提示",
description:response.data.message
});
// this.props.showNotification(response.data.message);
}
// // this.props.showNotification(response.data.message);
// }
return;
}
if(response.data.status===0){
@ -316,6 +326,8 @@ class Addcourses extends Component{
Addcoursestypes
}=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
console.log("Addcourses");
console.log(Addcoursestypes)
return(
<div>
<Modals

Loading…
Cancel
Save