Commit 9002dfc5 by xuzhenghua

detail

parent aee2b63b
......@@ -135,31 +135,42 @@ class BargainMiddlePage extends Component {
})
}
// 加入购物车
// 直接支付
toCart = () => {
let data = {
course_id: getParam('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')
http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => {
if (res.data.errno === 0) {
this.props.history.push(`/order?id=[${getParam('id')}]`, {bargain: 1});
} else {
Toast.info(res.data.msg, 2);
}
})
// let data = {
// course_id: getParam('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);
// }
// })
}
// 我要砍价列表的去支付
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')
http.get(`${API['base-api']}/m/cart/addtopreorder/[${id}]`).then((res) => {
if (res.data.errno === 0) {
this.props.history.push(`/order?id=[${getParam('id')}]`, {bargain: 1});
} else {
Toast.info(res.data.msg, 2);
}
})
// 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);
// }
// })
}
// 查看更多
......@@ -565,7 +576,7 @@ function CourseBottom(props) {
}
<button onClick={props.toCartBottom}
<button onClick={() => props.toCartBottom(props.item.course_id)}
className={'purchase-btn'}>¥{props.item.pay_price}去支付
</button>
</div>
......
......@@ -29,10 +29,7 @@ class Bargain extends Component {
}
componentDidMount() {
const { user= {} } = this.props;
if(user.data && user.data.uid) {
this.getBargainInfo();
}
this.getBargainInfo();
}
// 获取助理好友
......@@ -184,7 +181,6 @@ class Bargain extends Component {
render() {
const { list, outList, barInfo } = this.state;
console.log(barInfo)
const {user} = this.props
const uid = user && user.data && user.data.uid
return (
......@@ -260,7 +256,7 @@ function BargainIntro(props) {
<Flex direction={'column'} justify={'center'} className={'intro-wrapper'}>
<p>
邀请
<span className={'indicator'}>{props.limit_people}</span>
<span className={'indicator'}>{props.limitPeople}</span>
好友帮忙砍价可获得
<span className={'indicator'}>【砍价神器】</span>
</p>
......
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