|
|
|
@ -33,24 +33,29 @@ class Elearning extends Component{
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
// 记得删除退出课堂
|
|
|
|
|
console.log("获取到数据");
|
|
|
|
|
console.log(this.props);
|
|
|
|
|
// console.log("获取到数据");
|
|
|
|
|
// console.log(this.props);
|
|
|
|
|
this.getdata();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getdata=()=>{
|
|
|
|
|
console.log("更新了数据了");
|
|
|
|
|
let url = `/courses/${this.props.match.params.coursesId}/online_learning.json`;
|
|
|
|
|
// //
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response){
|
|
|
|
|
if(response.data){
|
|
|
|
|
console.log("获取到到数据");
|
|
|
|
|
console.log(response);
|
|
|
|
|
this.setState({
|
|
|
|
|
description: response.data.description,
|
|
|
|
|
start_learning:response.data.start_learning,
|
|
|
|
|
learned:response.data.learned,
|
|
|
|
|
last_shixun:response.data.last_shixun,
|
|
|
|
|
stages:response.data.stages,
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// console.log("获取到到数据");
|
|
|
|
|
// console.log(response);
|
|
|
|
|
this.setState({
|
|
|
|
|
description: response.data.description,
|
|
|
|
|
start_learning:response.data.start_learning,
|
|
|
|
|
learned:response.data.learned,
|
|
|
|
|
last_shixun:response.data.last_shixun,
|
|
|
|
|
stages:response.data.stages,
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
isSpin:false,
|
|
|
|
@ -71,13 +76,11 @@ class Elearning extends Component{
|
|
|
|
|
console.log("12312312312")
|
|
|
|
|
console.log(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
|
console.log("componentDidUpdate");
|
|
|
|
|
console.log(prevProps);
|
|
|
|
|
console.log(this.props);
|
|
|
|
|
console.log("componentDidUpdate");
|
|
|
|
|
// console.log(prevProps);
|
|
|
|
|
// console.log(this.props);
|
|
|
|
|
if(prevProps.current_user!=this.props.current_user){
|
|
|
|
|
if(this.props.current_user!==undefined){
|
|
|
|
|
// console.log(this.props.current_user.login);
|
|
|
|
@ -87,6 +90,17 @@ class Elearning extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(prevProps.yslElearning===this.props.yslElearning) {
|
|
|
|
|
if(prevProps.yslElearning===true && this.props.yslElearning===true){
|
|
|
|
|
console.log("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
|
|
|
|
|
console.log(prevProps.yslElearning);
|
|
|
|
|
console.log(this.props.yslElearning);
|
|
|
|
|
this.getdata();
|
|
|
|
|
this.props.comyslElearning(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -274,6 +288,8 @@ class Elearning extends Component{
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
console.log("Elearning++++++++");
|
|
|
|
|
// console.log(this.props.Chapterupdate);
|
|
|
|
|
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages,isRender} =this.state;
|
|
|
|
|
const isNotMembers=this.props.isNotMember();//非课堂成员
|
|
|
|
|
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
|
|
|
|
|