From 480a10911435bd78b48bd2db4d97a342df19000a Mon Sep 17 00:00:00 2001 From: jing <1683105490@qq.com> Date: Fri, 18 Sep 2026 17:44:03 +0800 Subject: [PATCH] =?UTF-8?q?chore=EF=BC=9A=E5=95=86=E5=93=81=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E6=A8=A1=E6=9D=BF1=E6=9B=B4=E6=94=B9=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E6=9C=89=E3=80=8C=E5=8A=A0=E8=BD=BD=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20=E4=B8=94=20=E8=AF=A5=E4=BA=8C=E7=BA=A7=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E4=B8=8B=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E9=9D=9E=E7=A9=BA?= =?UTF-8?q?=E3=80=8D=E6=89=8D=E6=B8=B2=E6=9F=93=EF=BC=8C=E5=90=A6=E5=88=99?= =?UTF-8?q?=E6=A0=87=E9=A2=98=20+=20=E7=BD=91=E6=A0=BC=E6=95=B4=E5=9D=97?= =?UTF-8?q?=E9=83=BD=E4=B8=8D=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components-diy/diy-category-item.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components-diy/diy-category-item.vue b/components-diy/diy-category-item.vue index 76ab68e..4fe9db6 100644 --- a/components-diy/diy-category-item.vue +++ b/components-diy/diy-category-item.vue @@ -651,10 +651,9 @@ export default { return this.value.template == 1 && this.value.level == 3; }, /** - * 模板1三级分类: 渲染所有二级分类(包括无商品的空分类) - * 不再按"是否有商品"过滤, 保证一级分类下的二级分类全部显示, - * 避免 10 个二级分类只显示 8 个(2 个被当成空分类过滤掉)的问题 - * 加载中(template1ChildLoading[id] === true)的二级分类暂不渲染, 避免闪烁 + * 模板1三级分类: 只渲染"有商品"的二级分类 + * 无商品的二级分类整块(标题 + 网格)都不渲染; 加载中的二级分类也暂不渲染(避免闪烁) + * 判定时机: 该二级分类加载完成(template1ChildLoading[id] === false)且商品列表非空 */ filteredGroupedChildren() { if (!this.isGroupedDisplay) return []; @@ -662,8 +661,9 @@ export default { return this.category.child_list.filter(one => { // 还在加载中: 暂不渲染(避免闪烁) if (this.template1ChildLoading[one.category_id]) return false; - // 加载完成(无论是否有商品)都渲染, 无商品时显示空状态 - return true; + // 加载完成: 只有该二级分类下有商品时才显示, 无商品则整块隐藏 + const list = this.template1ChildGoodsList[one.category_id]; + return !!(list && list.length); }); }, /**