From 3bcb710d3419e1ab5b5b7df62b173c10b6290268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Fri, 19 Sep 2025 16:47:51 +0800 Subject: [PATCH] fix: bug --- src/pages/search/result.vue | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/pages/search/result.vue b/src/pages/search/result.vue index d286b354..9c4997dc 100644 --- a/src/pages/search/result.vue +++ b/src/pages/search/result.vue @@ -33,7 +33,8 @@ - + 暂无数据 + 功能 @@ -54,7 +55,7 @@ 暂无数据 - + 课程 @@ -69,7 +70,7 @@ 暂无数据 - + 任务 @@ -84,7 +85,7 @@ 暂无数据 - + AI陪练 @@ -92,7 +93,7 @@ 暂无数据 - + 考试 @@ -231,9 +232,22 @@ const testList = ref([]) const taskList = ref([]) const examList = ref([]) const courseList = ref([]) -const showModelList = typeName => { - return ['', 'all', typeName].indexOf(activeTab.value) >= 0 +const showModelList = (typeName, list=[]) => { + console.log(typeName, list.length > 0) + if ( ['', 'all'].indexOf(activeTab.value) >= 0){ + return list.length > 0 + }else{ + return [typeName].indexOf(activeTab.value) >= 0 + } } +const showEmptyBox = computed(() => { + if ( ['', 'all'].indexOf(activeTab.value) >= 0){ + let _num = testList.value.length + taskList.value.length + courseList.value.length + examList.value.length + abilityListShow.value.length + return _num === 0 + }else{ + return false + } +}) const changeTab = item => { if (!item) return activeTab.value = item.type