From 916e41e42438c3c949e6939c3790cd27bd5827fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Thu, 4 Sep 2025 18:04:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=93=E8=B4=AD=E9=83=A8?= =?UTF-8?q?=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shop/groupPurchaseSubmit/index.vue | 6 +-- packages/shop/index/index.css | 19 +++----- packages/shop/index/index.vue | 50 ++------------------- packages/shop/shopCar/index.vue | 4 ++ 4 files changed, 17 insertions(+), 62 deletions(-) diff --git a/packages/shop/groupPurchaseSubmit/index.vue b/packages/shop/groupPurchaseSubmit/index.vue index 68159cc5..442c2b4a 100644 --- a/packages/shop/groupPurchaseSubmit/index.vue +++ b/packages/shop/groupPurchaseSubmit/index.vue @@ -503,7 +503,7 @@ export default { submitPayment() { // 检查所有供应商是否都选择了自提点 const supplierIds = [...new Set(this.orderList2.map(item => - item.commodity_goods_info.group_buy_activity_info?.supplier_id || 'default' + item.supplier_id || 'default' ))]; const allHaveZTAddress = supplierIds.every(supplierId => { @@ -536,7 +536,7 @@ export default { const currentTime = new Date().getTime(); return { - supplier_id: firstItem.commodity_goods_info.group_buy_activity_info.supplier_id, + supplier_id: firstItem.supplier_id, supplier_name: firstItem.supplier_name || '', is_same_day: firstItem.commodity_goods_info.is_same_day, receiving_name: ztAddress.name || '', @@ -548,7 +548,7 @@ export default { const endTime = new Date(item.commodity_goods_info.group_buy_activity_info?.end_time).getTime(); const isGroupBuy = currentTime >= startTime && currentTime <= endTime; return { - goods_id: item.commodity_goods_info.goods_id, + goods_id: item.goods_id, count: item.count, price: isGroupBuy ? item.commodity_goods_info.group_buy_price : item.commodity_goods_info.sales_price, freight: item.commodity_goods_info.freight, diff --git a/packages/shop/index/index.css b/packages/shop/index/index.css index daeb484e..a63c778d 100644 --- a/packages/shop/index/index.css +++ b/packages/shop/index/index.css @@ -162,7 +162,7 @@ page { overflow: hidden; position: relative; overflow-y: auto; - margin-bottom: 150rpx; + padding-bottom: 260rpx; } .CateInfo_tit { @@ -403,7 +403,7 @@ page { padding-bottom: 30rpx; position: absolute; left: 0; - top: 0; + top: 160rpx; z-index: 11; } @@ -429,7 +429,7 @@ page { left: 0; right: 0; bottom: 0; - top: 0; + top: 160rpx; background-color: rgba(0, 0, 0, 0.3); z-index: 10; } @@ -578,17 +578,10 @@ page { .shop_car { width: 140rpx; height: 140rpx; - position: fixed; - right: -95rpx; - bottom: 180rpx; + position: absolute; + bottom: 100rpx; + right: 10rpx; z-index: 10; - transition: right 0.3s ease; -} - -.shop_car:hover, -.shop_car.show { - right: 33rpx; - /* 鼠标悬停或滚动时完全显示 */ } .shop_car image { diff --git a/packages/shop/index/index.vue b/packages/shop/index/index.vue index 42f6baaa..b51d0428 100644 --- a/packages/shop/index/index.vue +++ b/packages/shop/index/index.vue @@ -2,7 +2,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -312,28 +312,7 @@ export default { NavgateTo('1') }, - // 显示购物车图标 - showShopCar() { - this.$nextTick(() => { - try { - const shopCar = document.querySelector('.shop_car'); - if (shopCar) { - shopCar.classList.add('show'); - // 2秒后自动隐藏 - clearTimeout(this.hideShopCarTimer); - this.hideShopCarTimer = setTimeout(() => { - const carElement = document.querySelector('.shop_car'); - if (carElement) { - carElement.classList.remove('show'); - } - }, 2000); - } - } catch (error) { - console.log(error); - } - }); - }, changeCate(id) { // 更新当前选中的顶级分类ID @@ -360,6 +339,7 @@ export default { }, //选择右下角分类 checkItem(index) { + this.cateListShow = false this.rightTopActive = index; // 获取选中的标签ID this.selectedTagId = this.tagList[index].id; @@ -548,39 +528,17 @@ export default { this.localHeight = meun.height; this.getCateList(); // this.getShopCarList(); - - // 初始化定时器 - this.hideShopCarTimer = null; }, onShow() { this.getShopCarList(); this.getGoodsList(); - - // 添加滚动事件监听 - 使用nextTick确保DOM已渲染 - this.$nextTick(() => { - try { - const conRight = document.querySelector('.Con_right'); - if (conRight) { - this.conRightElement = conRight; - conRight.addEventListener('scroll', this.showShopCar); - } - } catch (error) { - console.log(error); - } - }); }, onHide() { // 移除滚动事件监听 if (this.conRightElement) { - this.conRightElement.removeEventListener('scroll', this.showShopCar); this.conRightElement = null; } - - // 清除定时器 - if (this.hideShopCarTimer) { - clearTimeout(this.hideShopCarTimer); - } }, onReachBottom() { if (this.flag) { diff --git a/packages/shop/shopCar/index.vue b/packages/shop/shopCar/index.vue index c2fb3b97..b68b27a4 100644 --- a/packages/shop/shopCar/index.vue +++ b/packages/shop/shopCar/index.vue @@ -293,6 +293,10 @@ export default { }) }); + if (arr.length == 0) { + this.$u.toast("请选择商品"); + return; + } // NavgateTo(`../submitOrder/index?shopCarList=${JSON.stringify(arr)}`); NavgateTo(`../groupPurchaseSubmit/index?shopCarList=${JSON.stringify(arr)}`); },