diff --git a/packages/advertising/goodsSubmit/index.vue b/packages/advertising/goodsSubmit/index.vue
index 5ac8dc16..67cc253b 100644
--- a/packages/advertising/goodsSubmit/index.vue
+++ b/packages/advertising/goodsSubmit/index.vue
@@ -43,7 +43,7 @@
¥{{ item.commodity_goods_info.sales_price }}/{{
item.commodity_goods_info.goods_unit
- }}
+ }}
运费 ¥{{
item.commodity_goods_info.freight }}
@@ -246,7 +246,8 @@
-
+
石榴分
@@ -259,7 +260,8 @@
-
+
石榴籽
@@ -272,7 +274,8 @@
-
+
石榴金
@@ -374,6 +377,7 @@ export default {
// 核销码
verifyCode: '',
+ totalPrice: 0,
};
},
computed: {
@@ -520,8 +524,10 @@ export default {
{
goods_id: item.goods_id,
count: item.count,
+ price: item.price,
},
],
+ adver_id: item.adver_id,
}
request(apiArr.updateCar, "POST", params).then(res => {
uni.showToast({
@@ -533,37 +539,20 @@ export default {
// 计算总金额
calculateTotal(order) {
- const currentTime = new Date().getTime();
if (order === 'order1') {
let total = 0;
this.orderList1.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;
- }
+ // 直接使用item.price进行计算
+ total += goods.price * goods.count;
});
// 加运费
return total.toFixed(2);
} 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;
- // }
+ // 直接使用item.price进行计算
total += goods.price * goods.count;
+ this.totalPrice = total.toFixed(2);
});
// 加运费
return total.toFixed(2);
@@ -654,7 +643,7 @@ export default {
const params = {
user_id: uni.getStorageSync('userId'),
// 先判断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 : (isGroupBuyValid ? 2 : 1),
goods_list: Object.keys(this.supplierGroups).map(supplierId => {
const group = this.supplierGroups[supplierId];
const firstItem = group[0];
@@ -675,14 +664,10 @@ export default {
merchant_id: ztAddress.address_id,
group_buy_activity_id: firstItem.commodity_goods_info.group_buy_activity_id,
goods_and_count: group.map(item => {
- const activityInfo = item.commodity_goods_info.group_buy_activity_info;
- const isGroupBuy = activityInfo &&
- currentTime >= new Date(activityInfo.start_time).getTime() &&
- currentTime <= new Date(activityInfo.end_time).getTime();
return {
goods_id: item.goods_id,
count: item.count,
- price: isGroupBuy ? item.commodity_goods_info.group_buy_price : item.commodity_goods_info.sales_price,
+ price: item.price,
freight: item.commodity_goods_info.freight,
}
})