Merge branches 'dev_Ysm' and 'dev_admin' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl

# Conflicts:
#	app/controllers/application_controller.rb
dev_hs
杨树林 6 years ago
parent 1889e8794f
commit 28280a7d7d

@ -4,7 +4,9 @@ import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder';
import './myelearning.css'
import axios from 'axios';
import YslDetailCards from "./YslDetailCards.js";
import Jointheclass from '../../modals/Jointheclass'
import Jointheclass from '../../modals/Jointheclass';
import LoginDialog from "../../login/LoginDialog";
//在线学习
class Elearning extends Component{
constructor(props){
@ -23,7 +25,8 @@ class Elearning extends Component{
shixunsmessage:"",
startshixunCombattype:false,
isSpins:false,
userlogin:"",
isRender:false,
}
}
@ -58,6 +61,10 @@ class Elearning extends Component{
})
});
this.setState({
userlogin:this.props.current_user.login,
})
}
@ -68,6 +75,7 @@ class Elearning extends Component{
};
//开始学习
Startlearning=()=>{
this.Tojoinclass();
if(this.props.isNotMember()===true){
this.setState({
yslJointhe:true
@ -206,7 +214,28 @@ class Elearning extends Component{
this.setState({
startshixunCombattypes:false
})
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
Tojoinclass=()=> {
let {userlogin} = this.state;
if (userlogin === undefined) {
this.setState({
isRender: true
})
return
}
if (userlogin === "") {
this.setState({
isRender: true
})
return;
}
}
render(){
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员
@ -214,6 +243,11 @@ class Elearning extends Component{
return(
<React.Fragment >
<div id={"zhudiv"}>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>
<Modal
keyboard={false}
@ -317,7 +351,7 @@ class Elearning extends Component{
</div>:
<div>
{/*开始学习*/}
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} ></YslDetailCards>
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()}></YslDetailCards>
</div>
}

@ -33,6 +33,9 @@ class YslDetailCards extends Component{
})
};
startgameid=(id)=>{
// 上面传过来的方法是用来没登入弹出弹框的
this.props.Tojoinclass();
if(this.props.isNotMember()===true){
//这个是外部传过来的
this.props.Startlearningtwo();

Loading…
Cancel
Save