From 61c15f5d6711b77f4b6d9242153922f8ddccdc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Fri, 10 Oct 2025 10:56:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E5=95=86?= =?UTF-8?q?=E5=93=81=E7=9A=84=E6=8F=90=E4=BA=A4=E8=AE=A2=E5=8D=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E9=87=91=E9=A2=9D=E7=AD=89=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/advertising/goodsSubmit/index.vue | 47 ++++++++-------------- 1 file changed, 16 insertions(+), 31 deletions(-) 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, } })