From ce94e5d7396e4afec1e3285134b3d1842cf05bf0 Mon Sep 17 00:00:00 2001 From: linxi <957440651@qq.com> Date: Tue, 14 Jul 2026 14:17:31 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A5371=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E7=94=84=E9=80=89=E5=A5=BD?= =?UTF-8?q?=E7=A4=BC=E5=AF=B9=E5=BA=94=E5=88=86=E7=B1=BB=E4=B8=8B=E6=97=A0?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=B8=8D=E4=BC=9A=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 8f7ff49641c3ba86ad4704b413e4746e951c0bce) --- pages/home/newZone.vue | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/pages/home/newZone.vue b/pages/home/newZone.vue index c185413..a76ff92 100644 --- a/pages/home/newZone.vue +++ b/pages/home/newZone.vue @@ -36,7 +36,7 @@ - + @@ -53,6 +53,9 @@ + + 暂无数据 + { this.details = res.data - this.tabs = res.data.categories - this.handleClick(0, this.tabs[0]) + this.tabs = Array.isArray(res.data.categories) ? res.data.categories : [] + if (this.tabs.length > 0) { + this.handleClick(0, this.tabs[0]) + } else { + this.products = [] + } }) }, computed: { @@ -112,7 +119,7 @@ export default{ methods: { handleClick(index, tab) { this.activeIndex = index - this.products = tab.products + this.products = Array.isArray(tab && tab.products) ? tab.products : [] }, handleChange(e) { this.current = e.detail.current @@ -144,6 +151,17 @@ export default{ justify-content: space-between; flex-wrap: wrap; } +.empty-wrap{ + min-height: 260rpx; + display: flex; + align-items: center; + justify-content: center; +} +.empty-text{ + font-size: 28rpx; + color: #999999; + text-align: center; +} .tab-line{ position: absolute; bottom: 0;