From 1393b1d3a920b683758ae504c6ec9f8d7d5c9b4b Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Fri, 24 May 2024 16:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/app.js | 4 ++-- pages/index/index.vue | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/app.js b/config/app.js index d0d2d85..840fb8a 100644 --- a/config/app.js +++ b/config/app.js @@ -1,9 +1,9 @@ let BASE_URL import store from "@/store/user.js" // 环境 -let env = "dev" +// let env = "dev" // let env = "test" -// let env = "prod" +let env = "prod" // let env = "local" switch (env) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 2612d4c..9082f0f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -24,7 +24,7 @@ - + @@ -311,6 +311,7 @@ page_size: 30 }).then(res => { if (pid == 0) { // 加载一级分类时设置全部分类 + if(!res.data?.lists?.length) return ; res.data?.lists?.unshift({ id: "", name: "全部", @@ -336,7 +337,7 @@ return item; }) // 给所有子级分配 - goodClassList.value = res.data?.lists || []; + goodClassList.value = [...goodClassList.value, ...res.data?.lists]; goodClassTow.value = goodClassList.value[0]?.children || []; goodClassThree.value = goodClassTow.value[0]?.children || []; topActive.value = goodClassList.value[0]?.id; @@ -426,7 +427,7 @@ } onLoad(() => { - getgoodClassList(); + getgoodClassList(0); getGoodList(); })