Commit 8c5d1cf5 by xuzhenghua

bug

parent 6e9f7399
......@@ -30,7 +30,7 @@ class HeaderBar extends Component {
}
{
toHref && typeof toHref === 'function' &&
<i className='iconfont iconiconfront-68' onClick={toHref}>1</i>
<i className='iconfont iconiconfront-68' onClick={toHref}></i>
}
{
toHref && typeof toHref === 'string' &&
......
......@@ -66,7 +66,7 @@ class BargainMiddlePage extends Component {
limitPeople: res.data.data.course.limit_people,
bargainData: res.data.data.bargain,
width: (res.data.data.bargain.bargain_price / res.data.data.bargain.total_price).toFixed(2) * 100 + '%'
},
},
() => {
if (this.state.bargainData.expire_time) {
let date = this.state.bargainData.expire_time * 1000
......@@ -147,6 +147,19 @@ class BargainMiddlePage extends Component {
}
})
}
// 我要砍价列表的去支付
toCartBottom=(id)=>{
let data = {
course_id: id
}
http.post(`${API.home}/m/cart/add`, data).then((res) => {
if (res.data.code === 200 || res.data.code === 15001) {
this.props.history.push('/shopcart')
} else {
Toast.info(res.data.msg, 2);
}
})
}
// 查看更多
getMore = () => {
......@@ -425,7 +438,7 @@ class BargainMiddlePage extends Component {
bottom={
<CourseBottom
item={item}
toCart={this.toCart}
toCartBottom={this.toCartBottom.bind(this,item.course_id)}
toDetail={this.toCourseDetail}
/>
}
......@@ -533,7 +546,7 @@ function CourseBottom(props) {
// Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
Buttons = <a href="javascript:;" onClick={() => props.toDetail(props.item.course_id)} className={'bargain'}>我要砍价</a>
} else if (props.item.bargain_status === 3) {
Buttons = <Link to={`/play/video?id=${props.item.course_id}`} className={'bargain'}>去学习</Link>
Buttons = <Link to={`/play/video?id=${props.item.v_course_id}`} className={'bargain'}>去学习</Link>
} else {
Buttons = (
<div className="btns">
......@@ -551,7 +564,7 @@ function CourseBottom(props) {
}
<button onClick={props.toCart}
<button onClick={props.toCartBottom}
className={'purchase-btn'}>¥{props.item.pay_price}去支付
</button>
</div>
......
......@@ -454,7 +454,7 @@ class Video extends Component {
activeIndex: videoIndex
})
let lesson = videoList[videoIndex]
if (lesson['video_auth']) {
this.setState({
isAuth: true
......
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