From 7f94a55cbe54f444b817cb43cd31c1e2fd60ee7c Mon Sep 17 00:00:00 2001 From: Daniel Kou Date: Fri, 10 Jul 2026 11:16:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=AE=B6=E5=88=86=E7=B1=BB=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index2/index2.vue | 52 ++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 35 deletions(-) diff --git a/pages/index2/index2.vue b/pages/index2/index2.vue index a71596fc..ca2025dc 100644 --- a/pages/index2/index2.vue +++ b/pages/index2/index2.vue @@ -69,12 +69,14 @@ - + 附近 - - {{ item.title }} + + + {{ item.cate_name }} + 更多 @@ -201,7 +203,6 @@ export default { serverRightList: [], // 分类条:生活圈(位6-11) - lifeCircleList: [], currentTab: 'recommend', // 当前分类条选中项:'recommend' 或某生活圈标题 // 分类(驱动好店列表) @@ -293,35 +294,27 @@ export default { // #endif }, - // 「附近」对应的商品分类 id:暂取美食圈(无则取第一个生活圈,再无则第一个分类) + // 「附近」对应的分类 id:取商家分类表第一个 recommendCateId() { - const target = this.lifeCircleList.find(c => c.title === '美食圈') || this.lifeCircleList[0] - if (target) { - const cate = this.categoryList.find(c => c.cate_name === target.title) - if (cate) return cate.id - } return this.categoryList.length ? this.categoryList[0].id : null }, - // 点击「附近」:暂时显示美食圈内容 + // 点击「附近」:显示默认(第一个)分类内容 async selectRecommend() { this.currentTab = 'recommend' const id = this.recommendCateId() if (id) await this.switchCategory(id) }, - // 点击某生活圈:只显示该圈对应分类的好店瀑布 + // 点击某商家分类:显示该分类对应的好店瀑布(merchant_cate_id = 该分类 id) async selectCircle(item) { - if (item.title == '更多') { - return NavgateTo('/packages/localLife/index/index', { isLogin: false }) - } - const cate = this.categoryList.find(c => c.cate_name === item.title) - if (cate && cate.id) { - this.currentTab = item.title - await this.switchCategory(cate.id) - } else { - uni.showToast({ title: '暂无「' + item.title + '」相关好店', icon: 'none' }) - } + this.currentTab = item.id + await this.switchCategory(item.id) + }, + + // 「更多」:进入本地生活完整列表 + goMoreLocalLife() { + NavgateTo('/packages/localLife/index/index', { isLogin: false }) }, async headershopEnterClick() { @@ -370,17 +363,15 @@ export default { // 一次拉取各广告位(1-11),后续各 getHomeXxx 读缓存 await this.prefetchBannerGroups() - const [bannerList, serverLeft, serverRightList, lifeCircleList, tabList] = await Promise.all([ + const [bannerList, serverLeft, serverRightList, tabList] = await Promise.all([ this.getHomeBanner(), this.getServerLeft(), this.getServerRight(), - this.getLifeCircle(), // 生活圈 6-11 → 分类条 this.getButtonNum(), // 金刚区 ]) this.bannerList = bannerList this.serverLeft = serverLeft this.serverRightList = serverRightList - this.lifeCircleList = lifeCircleList this.tabList = tabList // 先渲染首屏(轮播/金刚/广告/分类条),好店瀑布再异步加载填充, @@ -498,15 +489,6 @@ export default { return !!(item && item.pic_src) }, - // 生活圈:中部 6-11,取各位第一条已发布,作为顶部分类条 - async getLifeCircle() { - const list = await this.getBannersAt([ - AD_POS.MID_CENTER_TOP, AD_POS.MID_CENTER, AD_POS.MID_CENTER_BOTTOM, - AD_POS.MID_RIGHT_TOP, AD_POS.MID_RIGHT_CENTER, AD_POS.MID_RIGHT_BOTTOM, - ]) - return list.filter(Boolean).filter(item => item.title) - }, - /* ---------- 金刚区 ---------- */ async getButtonNum() { const res = await request(apiArr2.getButtonNum, 'POST', {}, { slice: false })