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() { },