Commit 1bb24abd by FE

bargain status modify

parent a73c3fea
...@@ -846,8 +846,10 @@ class YearCourse extends Component { ...@@ -846,8 +846,10 @@ class YearCourse extends Component {
> >
<div className="coupon-course__footer"> <div className="coupon-course__footer">
{/* type 1 立即参团 2 已参团 3 我要砍价 4 已参加砍价 可以继续砍价 5 马上抢 6 开始学习 7 已参加一分钱拼团 8 砍价待支付 */}
{ {
val.type === 4 && (val.type === 4 || val.type === 8) &&
<div className="bargain-price">已砍{val.already_bargain}</div> <div className="bargain-price">已砍{val.already_bargain}</div>
} }
...@@ -882,7 +884,7 @@ class YearCourse extends Component { ...@@ -882,7 +884,7 @@ class YearCourse extends Component {
</> </>
} }
{ {
(val.type === 3 || val.type === 4) && (val.type === 3 || val.type === 4 || val.type === 8) &&
<> <>
<div className="type"> <div className="type">
<span className="tag" data-color="green">好友帮帮砍</span> <span className="tag" data-color="green">好友帮帮砍</span>
...@@ -904,7 +906,6 @@ class YearCourse extends Component { ...@@ -904,7 +906,6 @@ class YearCourse extends Component {
} }
<div className="status"> <div className="status">
{/* type 1 立即参团 2 已参团 3 我要砍价 4 待支付 5 马上抢 6 开始学习 */}
{ {
val.type === 0 && val.type === 0 &&
<a <a
...@@ -948,6 +949,13 @@ class YearCourse extends Component { ...@@ -948,6 +949,13 @@ class YearCourse extends Component {
</> </>
} }
{ {
val.type === 8 &&
<a
onClick={() => this.bargainToOrder(val.course_id)}
className="status-btn to-group"
>支付{val.actual_payment}</a>
}
{
val.type === 6 && val.type === 6 &&
<a <a
onClick={() => this.toCourse(val.course_id)} onClick={() => this.toCourse(val.course_id)}
......
...@@ -26,7 +26,6 @@ class YarnWish extends Component { ...@@ -26,7 +26,6 @@ class YarnWish extends Component {
} }
} }
fetchCourse = () => { fetchCourse = () => {
http.get(`${API.home}/activity/wish_course`).then(res => { http.get(`${API.home}/activity/wish_course`).then(res => {
const {code, data} = res.data const {code, data} = res.data
...@@ -39,6 +38,7 @@ class YarnWish extends Component { ...@@ -39,6 +38,7 @@ class YarnWish extends Component {
} }
}) })
} }
getStage = () => { getStage = () => {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data} = res.data const {code, data} = res.data
...@@ -75,6 +75,21 @@ class YarnWish extends Component { ...@@ -75,6 +75,21 @@ class YarnWish extends Component {
} }
} }
toContinueBargain = (id, code) => {
const { history } = this.props;
if(getParam('version')) {
let data = {
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
desc: '把这门超5万人报名的【Python基础入门 升级版】课程送给你,附200元红包,请笑纳!--七月在线',
link: `https://m.julyedu.com/bargain-middle-page?id=${id}&bargaincode=${code}&is_originator=1`,
imgUrl: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/index-share-img.png',
}
SendMessageToApp("toShare", data)
}else {
history.push(`/bargain-middle-page?id=${id}&bargaincode=${code}&is_originator=1`);
}
}
toCart = (id) => { toCart = (id) => {
const { history } = this.props; const { history } = this.props;
http.post(`${API.home}/m/cart/add`, { http.post(`${API.home}/m/cart/add`, {
...@@ -94,7 +109,28 @@ class YarnWish extends Component { ...@@ -94,7 +109,28 @@ class YarnWish extends Component {
Toast.info(msg, 2); Toast.info(msg, 2);
} }
}) })
}; }
// 砍完价去支付
bargainToOrder = (id) => {
const { history, user } = this.props;
if(user.hasError) {
this.toLogin();
}else{
if(getParam('version')) {
SendMessageToApp('toPay', id)
}else {
http.get(`${API['base-api']}/m/cart/addtopreorder/[${id}]`).then((res) => {
const { errno, msg } = res.data;
if (errno === 0) {
history.push(`/order?id=[${id}]`, {bargain: 1});
} else {
Toast.info(msg, 2);
}
})
}
}
}
render() { render() {
const { list, activityStage } = this.state const { list, activityStage } = this.state
...@@ -125,13 +161,13 @@ class YarnWish extends Component { ...@@ -125,13 +161,13 @@ class YarnWish extends Component {
> >
{/* {/*
* 拼团,正常:未开团1 已开2;一分:未开团5 已开7 * 拼团,正常:未开团1 已开2;一分:未开团5 已开7
* type 1 立即参团 2 已参团 3 我要砍价 4 待支付 5 马上抢 6 开始学习 * type 1 立即参团 2 已参团 3 我要砍价 4 已参加砍价 可以继续砍价 5 马上抢 6 开始学习 7 已参加一分钱拼团 8 砍价待支付
*/} */}
<div className="coupon-course__footer"> <div className="coupon-course__footer">
{ {
item.type === 4 && (item.type === 4 || item.type === 8) &&
<div className="bargain-price">已砍{item.already_bargain}</div> <div className="bargain-price">已砍{item.already_bargain}</div>
} }
...@@ -181,7 +217,7 @@ class YarnWish extends Component { ...@@ -181,7 +217,7 @@ class YarnWish extends Component {
</> </>
} }
{ {
(item.type === 3 || item.type === 4) && (item.type === 3 || item.type === 4 || val.type === 8) &&
<> <>
<div className="type"> <div className="type">
<span className="tag" data-color="green">好友帮帮砍</span> <span className="tag" data-color="green">好友帮帮砍</span>
...@@ -233,6 +269,26 @@ class YarnWish extends Component { ...@@ -233,6 +269,26 @@ class YarnWish extends Component {
>我要砍价</a> >我要砍价</a>
} }
{ {
item.type === 4 &&
<>
<a
onClick={() => this.toContinueBargain(item.bargain_code)}
className="status-btn to-group"
>继续砍价</a>
<a
onClick={() => this.bargainToOrder(item.course_id)}
className="status-btn to-group"
>支付{item.actual_payment}</a>
</>
}
{
item.type === 8 &&
<a
onClick={() => this.bargainToOrder(item.course_id)}
className="status-btn to-group"
>支付{item.actual_payment}</a>
}
{
item.type === 5 && item.type === 5 &&
<a <a
onClick={() => this.toCourse(item.course_id)} onClick={() => this.toCourse(item.course_id)}
......
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