修复团购订单支付后报错的bug
This commit is contained in:
parent
17698bf1b8
commit
5121c23802
@ -374,6 +374,9 @@ export default {
|
|||||||
|
|
||||||
// 核销码
|
// 核销码
|
||||||
verifyCode: '',
|
verifyCode: '',
|
||||||
|
|
||||||
|
// 是否在团购活动时间内
|
||||||
|
isGroupBuyValid: true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -592,7 +595,7 @@ export default {
|
|||||||
|
|
||||||
// 团购活动时间判断
|
// 团购活动时间判断
|
||||||
const currentTime = new Date().getTime();
|
const currentTime = new Date().getTime();
|
||||||
let isGroupBuyValid = true;
|
this.isGroupBuyValid = true;
|
||||||
|
|
||||||
// 检查所有商品是否在团购活动时间内
|
// 检查所有商品是否在团购活动时间内
|
||||||
for (let supplierId in this.supplierGroups) {
|
for (let supplierId in this.supplierGroups) {
|
||||||
@ -601,18 +604,18 @@ export default {
|
|||||||
const activityInfo = item.commodity_goods_info.group_buy_activity_info;
|
const activityInfo = item.commodity_goods_info.group_buy_activity_info;
|
||||||
// 如果没有团购活动信息,或者不在活动时间内,则isGroupBuyValid设为false
|
// 如果没有团购活动信息,或者不在活动时间内,则isGroupBuyValid设为false
|
||||||
if (!activityInfo) {
|
if (!activityInfo) {
|
||||||
isGroupBuyValid = false;
|
this.isGroupBuyValid = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const startTime = new Date(activityInfo.start_time).getTime();
|
const startTime = new Date(activityInfo.start_time).getTime();
|
||||||
const endTime = new Date(activityInfo.end_time).getTime();
|
const endTime = new Date(activityInfo.end_time).getTime();
|
||||||
if (!(currentTime >= startTime && currentTime <= endTime)) {
|
if (!(currentTime >= startTime && currentTime <= endTime)) {
|
||||||
isGroupBuyValid = false;
|
this.isGroupBuyValid = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isGroupBuyValid) break;
|
if (!this.isGroupBuyValid) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否存在isafterSale属性且值为true
|
// 检查是否存在isafterSale属性且值为true
|
||||||
@ -653,7 +656,7 @@ export default {
|
|||||||
const params = {
|
const params = {
|
||||||
user_id: uni.getStorageSync('userId'),
|
user_id: uni.getStorageSync('userId'),
|
||||||
// 先判断shopCarList数据中是否包含isAdver且为true
|
// 先判断shopCarList数据中是否包含isAdver且为true
|
||||||
order_cate : this.carList.some(item => item.isAdver === true) ? 3 : (isGroupBuyValid ? 2 : 1),
|
order_cate : this.carList.some(item => item.isAdver === true) ? 3 : (this.isGroupBuyValid ? 2 : 1),
|
||||||
goods_list: Object.keys(this.supplierGroups).map(supplierId => {
|
goods_list: Object.keys(this.supplierGroups).map(supplierId => {
|
||||||
const group = this.supplierGroups[supplierId];
|
const group = this.supplierGroups[supplierId];
|
||||||
const firstItem = group[0];
|
const firstItem = group[0];
|
||||||
@ -715,7 +718,7 @@ export default {
|
|||||||
success: (payRes) => {
|
success: (payRes) => {
|
||||||
const params = {
|
const params = {
|
||||||
order_id: orderId,
|
order_id: orderId,
|
||||||
from: this.carList.some(item => item.isAdver === true) ? 3 : (isGroupBuyValid ? 2 : 1),
|
from: this.carList.some(item => item.isAdver === true) ? 3 : (this.isGroupBuyValid ? 2 : 1),
|
||||||
group_buy_activity_id: this.group_buy_activity_id,
|
group_buy_activity_id: this.group_buy_activity_id,
|
||||||
adver_id: this.carList.some(item => item.isAdver === true) ? this.carList.find(item => item.isAdver === true).adver_id : ''
|
adver_id: this.carList.some(item => item.isAdver === true) ? this.carList.find(item => item.isAdver === true).adver_id : ''
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user