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 './myelearning.css'
import axios from 'axios'; import axios from 'axios';
import YslDetailCards from "./YslDetailCards.js"; import YslDetailCards from "./YslDetailCards.js";
import Jointheclass from '../../modals/Jointheclass' import Jointheclass from '../../modals/Jointheclass';
import LoginDialog from "../../login/LoginDialog";
//在线学习 //在线学习
class Elearning extends Component{ class Elearning extends Component{
constructor(props){ constructor(props){
@ -23,7 +25,8 @@ class Elearning extends Component{
shixunsmessage:"", shixunsmessage:"",
startshixunCombattype:false, startshixunCombattype:false,
isSpins: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=()=>{ Startlearning=()=>{
this.Tojoinclass();
if(this.props.isNotMember()===true){ if(this.props.isNotMember()===true){
this.setState({ this.setState({
yslJointhe:true yslJointhe:true
@ -206,7 +214,28 @@ class Elearning extends Component{
this.setState({ this.setState({
startshixunCombattypes:false 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(){ render(){
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages} =this.state; let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员 const isNotMembers=this.props.isNotMember();//非课堂成员
@ -214,6 +243,11 @@ class Elearning extends Component{
return( return(
<React.Fragment > <React.Fragment >
<div id={"zhudiv"}> <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> <Jointheclass {...this.props} {...this.state} ysljoinmodalCancel={()=>this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}></Jointheclass>
<Modal <Modal
keyboard={false} keyboard={false}
@ -317,7 +351,7 @@ class Elearning extends Component{
</div>: </div>:
<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> </div>
} }

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

Loading…
Cancel
Save