From 03ef856fd37f532f686d6a512c44851e611315c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Fri, 5 Sep 2025 14:35:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A2=E8=B4=AD=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=92=8C=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E8=A7=84=E6=A0=BC=20=E6=95=B0=E6=8D=AE=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shop/groupPurchaseDetail/index.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/shop/groupPurchaseDetail/index.vue b/packages/shop/groupPurchaseDetail/index.vue index 78da38c5..b49c89f4 100644 --- a/packages/shop/groupPurchaseDetail/index.vue +++ b/packages/shop/groupPurchaseDetail/index.vue @@ -328,6 +328,7 @@ export default { boxshadow1: false, boxshadow2: false, id: "", + groupById: "", info: "", currentIndex: "1", //当前轮播图 @@ -568,9 +569,11 @@ export default { }, //商品详情 getGoodsInfo() { - request(apiArr.getGoodsInfo, "POST", { + const params = { id: this.id, - }).then((res) => { + group_buy_activity_id: this.groupById + } + request(apiArr.getGoodsInfo, "POST", params).then((res) => { // 分割图片 res.commodity_goods_info_list.forEach((item) => { item.goods_detail_pic = item.goods_detail_pic ? item.goods_detail_pic.split(",") : []; @@ -590,10 +593,14 @@ export default { }); } + const currentTime = new Date().getTime(); + // 过滤掉group_buy_activity_info为空的数据 if (res.commodity_goods_info_list && Array.isArray(res.commodity_goods_info_list)) { res.commodity_goods_info_list = res.commodity_goods_info_list.filter(item => { - return item.group_buy_activity_info !== null + const startTime = new Date(item.group_buy_goods_activity.group_buy_activity_info?.start_time).getTime(); + const endTime = new Date(item.group_buy_goods_activity.group_buy_activity_info?.end_time).getTime(); + return item.group_buy_activity_info !== null && currentTime >= startTime && currentTime <= endTime }); } @@ -806,9 +813,10 @@ export default { onLoad(options) { this.itemObj = JSON.parse(decodeURIComponent(options.item)); const meun = menuButtonInfo(); - this.top = meun.top; - this.localHeight = meun.height; + this.top = meun.top; + this.localHeight = meun.height; this.id = this.itemObj.commodity_id ? this.itemObj.commodity_id : this.itemObj.id; + this.groupById = this.itemObj.groupById if (this.itemObj.commodity_id) { this.endTime = this.itemObj.group_buy_activity_info.end_time } else {