From 51ba185e8111cae754e3eb8e87c8235cdad386f6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 10 Aug 2024 10:25:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E8=BF=9B=E5=85=A5=E5=88=86=E7=B1=BB=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=EF=BC=88?= =?UTF-8?q?=E6=AF=94=E5=A6=82=E4=BB=8E=E9=A6=96=E9=A1=B5=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/index.vue | 2 +- pages/goods/seckill.vue | 2 +- pages/index/category.vue | 15 +++++---------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/pages/goods/index.vue b/pages/goods/index.vue index bf0b0cb9..dc3f73aa 100644 --- a/pages/goods/index.vue +++ b/pages/goods/index.vue @@ -157,7 +157,7 @@ items: [{ skuId: e.id, count: e.goods_num, - categoryId: state.goodsInfo.categoryId + categoryId: state.goodsInfo.categoryId }] }), }); diff --git a/pages/goods/seckill.vue b/pages/goods/seckill.vue index 6ae46d6e..30a64305 100644 --- a/pages/goods/seckill.vue +++ b/pages/goods/seckill.vue @@ -196,7 +196,7 @@ }); } - // 分享信息 TODO 芋艿:待接入 + // 分享信息 const shareInfo = computed(() => { if (isEmpty(unref(activity))) return {}; return sheep.$platform.share.getShareInfo( diff --git a/pages/index/category.vue b/pages/index/category.vue index b4ab3b00..4c88f388 100644 --- a/pages/index/category.vue +++ b/pages/index/category.vue @@ -133,16 +133,11 @@ onLoad(async (params) => { await getList(); - - // 首页点击分类的处理:查找满足条件的分类 - const foundCategory = state.categoryList.find(category => category.id == params.id); - // 如果找到则调用 onMenu 自动勾选相应分类,否则调用 onMenu(0) 勾选第一个分类 - onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0); - - // 如果是 first 风格,需要加载商品分页 - if (state.style === 'first_one' || state.style === 'first_two') { - onMenu(0); - } + + // 首页点击分类的处理:查找满足条件的分类 + const foundCategory = state.categoryList.find(category => category.id === params.id); + // 如果找到则调用 onMenu 自动勾选相应分类,否则调用 onMenu(0) 勾选第一个分类 + onMenu(foundCategory ? state.categoryList.indexOf(foundCategory) : 0); }); onReachBottom(() => {