修改活动商品价格显示不对的问题

This commit is contained in:
赵毅 2025-10-08 14:56:12 +08:00
parent 12f43b2dff
commit b8a0a13ad3
3 changed files with 35 additions and 29 deletions

View File

@ -163,7 +163,7 @@
</view>
</view>
<view v-else>
{{ '¥' + item.commodity_goods_info.sales_price }}
{{ '¥' + item.price }}
/{{ item.commodity_goods_info.goods_unit }}
</view>
</view>
@ -553,16 +553,17 @@ export default {
} else {
let total = 0;
this.orderList2.forEach(goods => {
//
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
// total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
// total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
total += goods.commodity_goods_info.sales_price * goods.count;
}
// //
// const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
// const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
// if (currentTime >= startTime && currentTime <= endTime) {
// // total += goods.commodity_goods_info.group_buy_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.group_buy_price * goods.count;
// } else {
// // total += goods.commodity_goods_info.sales_price * goods.count + goods.commodity_goods_info.freight;
// total += goods.commodity_goods_info.sales_price * goods.count;
// }
total += goods.price * goods.count;
});
//
return total.toFixed(2);

View File

@ -172,6 +172,7 @@ export default {
{
goods_id: item.goods_id,
count: item.quantity,
price: item.promotional_price,
},
],
adver_id: item.adver_id
@ -195,6 +196,7 @@ export default {
{
goods_id: item.goods_id,
count: item.quantity,
price: item.promotional_price,
},
],
adver_id: item.adver_id

View File

@ -70,7 +70,7 @@
</view>
<view class="goodsItem_msg_right_msg">
<view class="goodsItem_msg_right_msg_left">
<span></span>{{ getPrice(item) }}
<span></span>{{ item.price }}
<!-- {{ item.commodity_goods_info.group_buy_price ?
item.commodity_goods_info.group_buy_price :
item.commodity_goods_info.sales_price }} -->
@ -154,7 +154,7 @@
</view>
<view class="goodsItem_msg_right_msg">
<view class="goodsItem_msg_right_msg_left">
<span></span>{{ getPrice(item) }}
<span></span>{{ item.price }}
<!-- {{ item.commodity_goods_info.group_buy_price ?
item.commodity_goods_info.group_buy_price :
item.commodity_goods_info.sales_price }} -->
@ -491,14 +491,15 @@ export default {
this.isDayCarList.forEach(carItem => {
carItem.commodity_cart_and_goods_model.forEach(goods => {
if (goods.checked) {
//
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
total += goods.commodity_goods_info.sales_price * goods.count;
}
// //
// const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
// const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
// if (currentTime >= startTime && currentTime <= endTime) {
// total += goods.commodity_goods_info.group_buy_price * goods.count;
// } else {
// total += goods.commodity_goods_info.sales_price * goods.count;
// }
total += goods.price * goods.count
}
});
});
@ -507,14 +508,15 @@ export default {
this.shopCarList.forEach(carItem => {
carItem.commodity_cart_and_goods_model.forEach(goods => {
if (goods.checked) {
//
const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
if (currentTime >= startTime && currentTime <= endTime) {
total += goods.commodity_goods_info.group_buy_price * goods.count;
} else {
total += goods.commodity_goods_info.sales_price * goods.count;
}
// //
// const startTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
// const endTime = new Date(goods.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
// if (currentTime >= startTime && currentTime <= endTime) {
// total += goods.commodity_goods_info.group_buy_price * goods.count;
// } else {
// total += goods.commodity_goods_info.sales_price * goods.count;
// }
total += goods.price * goods.count
}
});
});
@ -718,6 +720,7 @@ export default {
goods_id_and_count: [{
goods_id: item.goods_id,
count: val,
price: item.price,
},],
};
request(apiArr.updateCar, "POST", params).then((res) => {