Commit 6527783f by wangshuo

学习的时候去APP

parent d888037e
...@@ -5,11 +5,13 @@ import {http, getParam} from '@/utils'; ...@@ -5,11 +5,13 @@ import {http, getParam} from '@/utils';
import './index.scss'; import './index.scss';
import {Link} from "react-router-dom" import {Link} from "react-router-dom"
import {connect} from "react-redux"; import {connect} from "react-redux";
import Mask from './../poup/index.js'
class PythonStudy extends Component { class PythonStudy extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
toApp: false,
courseInfo: '', courseInfo: '',
syllabus: '', syllabus: '',
learning: '' learning: ''
...@@ -71,10 +73,21 @@ class PythonStudy extends Component { ...@@ -71,10 +73,21 @@ class PythonStudy extends Component {
} }
} }
toLearn = () => {
this.setState({
toApp: true
})
}
closePop = () => {
this.setState({
toApp: false,
})
}
render() { render() {
const {user} = this.props; const {user} = this.props;
const uid = user && user.data && user.data.uid const uid = user && user.data && user.data.uid
const {courseInfo, syllabus, learning} = this.state; const {courseInfo, syllabus, learning, toApp} = this.state;
return ( return (
<div className="python-study"> <div className="python-study">
<HeaderBar title='Python基础语法' arrow={true}/> <HeaderBar title='Python基础语法' arrow={true}/>
...@@ -188,16 +201,20 @@ class PythonStudy extends Component { ...@@ -188,16 +201,20 @@ class PythonStudy extends Component {
</Accordion> </Accordion>
{ {
learning.schedule == 0 && learning.schedule == 0 &&
<Link to={`/test/pythonStudy/${courseInfo.course_id}`} className="python-study__button">开始学习</Link> <span onClick={this.toLearn} className="python-study__button">开始学习</span>
} }
{ {
learning.schedule != 0 && learning.schedule != 100 && learning.schedule != 0 && learning.schedule != 100 &&
<Link to={`/test/pythonStudy/${courseInfo.course_id}`} className="python-study__button">继续学习</Link> <span onClick={this.toLearn} className="python-study__button">继续学习</span>
} }
{ {
learning.schedule == 100 && learning.schedule == 100 &&
<button className="python-study__button python-study__over">已学完全部课时</button> <button className="python-study__button python-study__over">已学完全部课时</button>
} }
{
toApp && <Mask closePop={this.closePop} type={2} />
}
</div> </div>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment