From 20b03f0f0251b32be39ab6c103355881679c6734 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com>
Date: Tue, 2 Sep 2025 16:09:59 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=AF=E4=BB=98=E9=87=91?=
=?UTF-8?q?=E9=A2=9D=E7=9A=84=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/shop/groupPurchaseSubmit/index.vue | 19 +++++++++++--------
packages/shop/shopCar/index.vue | 7 ++++++-
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/packages/shop/groupPurchaseSubmit/index.vue b/packages/shop/groupPurchaseSubmit/index.vue
index a28196a2..01760201 100644
--- a/packages/shop/groupPurchaseSubmit/index.vue
+++ b/packages/shop/groupPurchaseSubmit/index.vue
@@ -43,7 +43,7 @@
¥{{ item.commodity_goods_info.sales_price }}/{{
item.commodity_goods_info.goods_unit
- }}
+ }}
运费 ¥{{
item.commodity_goods_info.freight }}
@@ -386,7 +386,7 @@ export default {
} else {
item.count--
}
-
+
// 当数量减到0时,从carList中删除该商品
if (item.count === 0) {
const index = this.carList.findIndex(carItem => carItem.goods_id === item.goods_id);
@@ -396,7 +396,7 @@ export default {
this.getGoodsList();
}
}
-
+
this.changeCart(item)
}
},
@@ -461,7 +461,7 @@ export default {
}
});
// 加运费
- return total;
+ return total.toFixed(2);
} else {
let total = 0;
this.orderList2.forEach(goods => {
@@ -475,7 +475,7 @@ export default {
}
});
// 加运费
- return total;
+ return total.toFixed(2);
}
},
selectPayment(payment) {
@@ -498,13 +498,16 @@ export default {
const params = {
user_id: uni.getStorageSync('userId'),
- // TODO 应该判断是否为团购
is_group_buy: true,
goods_list: this.orderList2.map(item => {
// 团购活动id
this.group_buy_activity_id = item.commodity_goods_info.group_buy_activity_id
const ztAddress = this.defZTAddress.find(adItem => adItem.id === item.goods_id) || {};
-
+ // 团购活动时间判断
+ const currentTime = new Date().getTime();
+ const startTime = new Date(item.commodity_goods_info.group_buy_activity_info?.start_time).getTime();
+ const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time).getTime();
+ const isGroupBuy = currentTime >= startTime && currentTime <= endTime;
return {
supplier_id: item.commodity_goods_info.group_buy_activity_info.supplier_id,
supplier_name: item.supplier_name || '',
@@ -516,7 +519,7 @@ export default {
goods_and_count: [{
goods_id: item.commodity_goods_info.goods_id,
count: item.count,
- price: item.commodity_goods_info.group_buy_price
+ price: isGroupBuy ? item.commodity_goods_info.group_buy_price : item.commodity_goods_info.sales_price
}]
}
})
diff --git a/packages/shop/shopCar/index.vue b/packages/shop/shopCar/index.vue
index b8313f99..c2fb3b97 100644
--- a/packages/shop/shopCar/index.vue
+++ b/packages/shop/shopCar/index.vue
@@ -493,7 +493,7 @@ export default {
});
});
- this.shopMoney = total;
+ this.shopMoney = total.toFixed(2);
},
// 减少数量
@@ -717,6 +717,11 @@ export default {
},
onShow() {
this.getShopCar();
+ // 取消所有选中状态并重置金额
+ this.isAllchecked = false;
+ this.isDaychecked = false;
+ this.isParcelPostchecked = false;
+ this.shopMoney = 0.00;
},
onReachBottom() { },