Commit 64305829 by zhanghaozhe

Merge branch 'limit-free' into dev

parents 81040e79 3316cba4
...@@ -298,7 +298,6 @@ class BtnStatus extends Component { ...@@ -298,7 +298,6 @@ class BtnStatus extends Component {
// 隐藏弹窗 // 隐藏弹窗
handleToHide = (key) => { handleToHide = (key) => {
console.log(key);
this.setState({ this.setState({
[key]: false [key]: false
}); });
...@@ -525,6 +524,10 @@ class BtnStatus extends Component { ...@@ -525,6 +524,10 @@ class BtnStatus extends Component {
} }
{ {
/*
*
* limit_free_status: 0 未领取 1已领取未过期 2已过期
* */
info.is_limit_free && info.limit_free_status == 0 && <div className='btns-box'> info.is_limit_free && info.limit_free_status == 0 && <div className='btns-box'>
<a className='consult consult-m' onClick={()=>this.qimoChatClick()}> <a className='consult consult-m' onClick={()=>this.qimoChatClick()}>
<i className='iconfont iconerji'></i> <i className='iconfont iconerji'></i>
...@@ -536,7 +539,7 @@ class BtnStatus extends Component { ...@@ -536,7 +539,7 @@ class BtnStatus extends Component {
if(user.hasError){ if(user.hasError){
history.push('/passport') history.push('/passport')
}else { }else {
getCourse(info.course_id) getCourse(info.course_id, info.v_course_id)
} }
}}>立即领取</button> }}>立即领取</button>
</div> </div>
......
...@@ -498,10 +498,10 @@ class Detail extends Component { ...@@ -498,10 +498,10 @@ class Detail extends Component {
m: Math.floor(seconds / 60 % 60).toString().padStart(2, '0') m: Math.floor(seconds / 60 % 60).toString().padStart(2, '0')
}) })
getCourse = id => { getCourse = (courseId, vCourseId) => {
const {history} = this.props const {history} = this.props
http.post(`${API.home}/sys/limitFree/receive`, { http.post(`${API.home}/sys/limitFree/receive`, {
course_id: id course_id: courseId
}) })
.then(res => { .then(res => {
const {code, msg} = res.data const {code, msg} = res.data
...@@ -522,7 +522,7 @@ class Detail extends Component { ...@@ -522,7 +522,7 @@ class Detail extends Component {
}}>知道了 }}>知道了
</button> </button>
<button onClick={() => { <button onClick={() => {
history.push(`/play/video?id=${id}`) history.push(`/play/video?id=${vCourseId}`)
instance.close() instance.close()
}}>立即学习 }}>立即学习
</button> </button>
......
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