diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js index 4f55fb178..4d469274e 100644 --- a/public/react/src/modules/courses/elearning/Elearning.js +++ b/public/react/src/modules/courses/elearning/Elearning.js @@ -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(
+ {isRender===true?this.Modifyloginvalue()} + {...this.props} + {...this.state} + />:""} this.ysljoinmodalCancel()} ysljoinmodalCanceltwo={()=>this.ysljoinmodalCanceltwo()}> :
{/*开始学习*/} - this.Startlearningtwo()} Myreload={()=>this.Myreload()} > + this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()}>
} diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js index 1d5c77284..38cc32d18 100644 --- a/public/react/src/modules/courses/elearning/YslDetailCards.js +++ b/public/react/src/modules/courses/elearning/YslDetailCards.js @@ -33,6 +33,9 @@ class YslDetailCards extends Component{ }) }; startgameid=(id)=>{ + // 上面传过来的方法是用来没登入弹出弹框的 + this.props.Tojoinclass(); + if(this.props.isNotMember()===true){ //这个是外部传过来的 this.props.Startlearningtwo();