Commit 6527783f by wangshuo

学习的时候去APP

parent d888037e
......@@ -5,11 +5,13 @@ import {http, getParam} from '@/utils';
import './index.scss';
import {Link} from "react-router-dom"
import {connect} from "react-redux";
import Mask from './../poup/index.js'
class PythonStudy extends Component {
constructor(props) {
super(props);
this.state = {
toApp: false,
courseInfo: '',
syllabus: '',
learning: ''
......@@ -71,10 +73,21 @@ class PythonStudy extends Component {
}
}
toLearn = () => {
this.setState({
toApp: true
})
}
closePop = () => {
this.setState({
toApp: false,
})
}
render() {
const {user} = this.props;
const uid = user && user.data && user.data.uid
const {courseInfo, syllabus, learning} = this.state;
const {courseInfo, syllabus, learning, toApp} = this.state;
return (
<div className="python-study">
<HeaderBar title='Python基础语法' arrow={true}/>
......@@ -188,16 +201,20 @@ class PythonStudy extends Component {
</Accordion>
{
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 &&
<Link to={`/test/pythonStudy/${courseInfo.course_id}`} className="python-study__button">继续学习</Link>
<span onClick={this.toLearn} className="python-study__button">继续学习</span>
}
{
learning.schedule == 100 &&
<button className="python-study__button python-study__over">已学完全部课时</button>
}
{
toApp && <Mask closePop={this.closePop} type={2} />
}
</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