diff --git a/package1/group/groupBuyList.vue b/package1/group/groupBuyList.vue index 85b0dce..9515b01 100644 --- a/package1/group/groupBuyList.vue +++ b/package1/group/groupBuyList.vue @@ -64,10 +64,10 @@ - + - + {{item.shopName}} diff --git a/package1/group/groupBuySingle.vue b/package1/group/groupBuySingle.vue index 7c8bf76..c01965a 100644 --- a/package1/group/groupBuySingle.vue +++ b/package1/group/groupBuySingle.vue @@ -61,7 +61,7 @@ - + @@ -90,65 +90,62 @@ - - - {{item.categoryName}} - + + + + {{item.categoryName}} + - - - - - - - - - - - {{item.productName}} + + + + + + - - - 月售 100+ + + + {{item.productName}} - - - - + + + + 月售 100+ - - 差{{item.minGroupCount}}人拼成 + + + + + + + + + + 差{{item.minGroupCount}}人拼成 + - - - {{item.attributeListPrice | sliceMsg1}} - - - - - - - 直接购买¥{{item.attributeListPrice | sliceMsg}} - - 拼团购买¥{{ getGroupPrice(item) }} + + + + 拼团购买¥{{ getGroupPrice(item) }} + + + 直接购买¥{{item.attributeListPrice | sliceMsg}} + + + + - @@ -549,12 +546,6 @@ } return name; }, - sliceMsg1(val) { - var name = '正在有' - let aa = Math.floor(Math.random() * (15 - 5 + 1)) + 1; - name += aa + '人下单' - return name; - }, slicePrice(val) { let begin = '' if (val != null) { @@ -568,32 +559,6 @@ return begin; } }, - onPageScroll(e) { - const scrollTop = e.scrollTop; - const isScrollingUp = scrollTop < this.lastScrollTop; - // 向上滑到靠近页面顶部时(背景头图区域),切换到上一个分类 - // 门槛用 80px:用户需要明确地滑回头部较大区域,避免误触发 - if (isScrollingUp && scrollTop < 80 && !this.isSwitching) { - const currIdx = this.menuList.findIndex(m => m.checked); - if (currIdx > 0) { - this._switchCategory(currIdx - 1); - } - } - this.lastScrollTop = scrollTop; - }, - onReachBottom() { - // 当前分类还有更多页时,继续加载 - if (this.searchForm.pageNum < this.total) { - this.searchForm.pageNum++; - this.getProduct(this.searchForm.categoryId); - return; - } - // 当前分类已是最后一页,自动切换到下一分类 - const currIdx = this.menuList.findIndex(m => m.checked); - if (currIdx !== -1 && currIdx < this.menuList.length - 1) { - this._switchCategory(currIdx + 1); - } - }, onLoad(option) { this.type = option.type; if (option.groupId) { @@ -672,17 +637,6 @@ that.total = res.result.pages; // pages = 总页数 that.pageNum = that.searchForm.pageNum; - // 当前分类没有商品,自动跳过到下一个分类 - // 注意:这里不能用isSwitching拦戚,因为_switchCategory本身已置 isSwitching=true - if (res.result.records.length === 0) { - const currIdx = that.menuList.findIndex(m => m.checked); - if (currIdx !== -1 && currIdx < that.menuList.length - 1) { - console.log('000000000000') - // 重置锁再跳过,防止连锁导致永远跳不过 - that.isSwitching = false; - that._switchCategory(currIdx + 1); - } - } that.$forceUpdate(); } else { that.tui.toast(res.message); @@ -711,16 +665,6 @@ uni.hideLoading() }).catch((res) => {}) }, - // 内部切换方法:带isSwitching保护,防止程序化滚动期间闪回 - _switchCategory(index) { - if (this.isSwitching) return; - this.isSwitching = true; - this.checkTab(index); - // 400ms后解除锁(动画200ms,预留200ms缓冲) - setTimeout(() => { - this.isSwitching = false; - }, 400); - }, checkTab(index) { for (let i = 0; i < this.menuList.length; i++) { this.menuList[i].checked = (i === index); @@ -731,13 +675,6 @@ this.total = 1; this.productItem = []; this.getProduct(this.menuList[index].id); - // 滚动到正确位置:分类栏刚好吸顶在nav-bar下方 - // menuListOffsetTop - navBarHeight 使分类栏正好在sticky位置,首条商品可见 - const target = this.menuListOffsetTop - this.navBarHeight; - uni.pageScrollTo({ - scrollTop: target > 0 ? target : 0, - duration: 200 - }); }, openOrderWait(item){ this.chooseWaitType = false @@ -1284,6 +1221,7 @@ height: 100%; font-size: 24rpx; position: relative; + overflow: hidden; } /* 顶部背景图随页面滚动(不固定) */ @@ -1335,6 +1273,7 @@ margin-top: -150rpx; position: relative; z-index: 1; + height: 88%; } .shop-img { @@ -1498,9 +1437,8 @@ } .goods-member { - padding: 20rpx 0; - margin-bottom: 20rpx; - border-radius: 20rpx; + padding-bottom: 20rpx; + margin: 0 0 20rpx; background: #fff; } @@ -1509,10 +1447,11 @@ height: auto; border-radius: 20rpx; margin: 0 auto 20rpx; + overflow: scroll; } .goods-top { - padding: 20rpx 0; + padding: 20rpx; display: flex; } @@ -1559,7 +1498,7 @@ .goods-tag { display: flex; margin: 0; - width: 40%; + width: 100%; } .goods-content-bottom { @@ -1583,9 +1522,8 @@ } .goods-bottom { - display: flex; width: 95%; - margin: 20rpx auto; + margin: 0 auto; height: 70rpx; line-height: 70rpx; } @@ -1595,8 +1533,9 @@ width: 47%; text-align: center; font-size: 28rpx; - font-weight: 600; + font-weight: 700; border-radius: 20rpx; + float:right; } .bottom { @@ -1890,20 +1829,6 @@ margin-bottom: 10rpx; } - .menu-list { - height: 90rpx; - width: 100%; - overflow-x: scroll; - display: flex; - overflow-y: hidden; - position: sticky; - top: 0; - z-index: 90; - background: #F5F8F5; - align-items: center; - padding-bottom: 8rpx; - } - .checked-img { width: 180rpx; height: 20rpx; @@ -1913,10 +1838,10 @@ } .menu1 { - width: 180rpx; - height: 70rpx; + width: 160rpx; + height: 90rpx; position: relative; - margin-left: 30rpx; - line-height: 70rpx; + text-align: center; + line-height: 90rpx; } \ No newline at end of file