Commit 8c5d1cf5 by xuzhenghua

bug

parent 6e9f7399
...@@ -30,7 +30,7 @@ class HeaderBar extends Component { ...@@ -30,7 +30,7 @@ class HeaderBar extends Component {
} }
{ {
toHref && typeof toHref === 'function' && 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' && toHref && typeof toHref === 'string' &&
......
...@@ -66,7 +66,7 @@ class BargainMiddlePage extends Component { ...@@ -66,7 +66,7 @@ class BargainMiddlePage extends Component {
limitPeople: res.data.data.course.limit_people, limitPeople: res.data.data.course.limit_people,
bargainData: res.data.data.bargain, bargainData: res.data.data.bargain,
width: (res.data.data.bargain.bargain_price / res.data.data.bargain.total_price).toFixed(2) * 100 + '%' width: (res.data.data.bargain.bargain_price / res.data.data.bargain.total_price).toFixed(2) * 100 + '%'
}, },
() => { () => {
if (this.state.bargainData.expire_time) { if (this.state.bargainData.expire_time) {
let date = this.state.bargainData.expire_time * 1000 let date = this.state.bargainData.expire_time * 1000
...@@ -147,6 +147,19 @@ class BargainMiddlePage extends Component { ...@@ -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 = () => { getMore = () => {
...@@ -425,7 +438,7 @@ class BargainMiddlePage extends Component { ...@@ -425,7 +438,7 @@ class BargainMiddlePage extends Component {
bottom={ bottom={
<CourseBottom <CourseBottom
item={item} item={item}
toCart={this.toCart} toCartBottom={this.toCartBottom.bind(this,item.course_id)}
toDetail={this.toCourseDetail} toDetail={this.toCourseDetail}
/> />
} }
...@@ -533,7 +546,7 @@ function CourseBottom(props) { ...@@ -533,7 +546,7 @@ function CourseBottom(props) {
// Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link> // 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> Buttons = <a href="javascript:;" onClick={() => props.toDetail(props.item.course_id)} className={'bargain'}>我要砍价</a>
} else if (props.item.bargain_status === 3) { } 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 { } else {
Buttons = ( Buttons = (
<div className="btns"> <div className="btns">
...@@ -551,7 +564,7 @@ function CourseBottom(props) { ...@@ -551,7 +564,7 @@ function CourseBottom(props) {
} }
<button onClick={props.toCart} <button onClick={props.toCartBottom}
className={'purchase-btn'}>¥{props.item.pay_price}去支付 className={'purchase-btn'}>¥{props.item.pay_price}去支付
</button> </button>
</div> </div>
......
...@@ -454,7 +454,7 @@ class Video extends Component { ...@@ -454,7 +454,7 @@ class Video extends Component {
activeIndex: videoIndex activeIndex: videoIndex
}) })
let lesson = videoList[videoIndex] let lesson = videoList[videoIndex]
if (lesson['video_auth']) { if (lesson['video_auth']) {
this.setState({ this.setState({
isAuth: true 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