fix: bug
This commit is contained in:
@@ -33,7 +33,8 @@
|
||||
<uv-tabs :list="tabList" @click="changeTab" :scrollable="false" active-style="font-weight:bold; color:#000;" line-color="#06f"></uv-tabs>
|
||||
</view>
|
||||
<scroll-view class="lists-view" :scroll-y="true" @scrolltolower="scrolltolower">
|
||||
<view class="ability-view model-view" v-show="showModelList('ability')">
|
||||
<list-no-data v-if="showEmptyBox">暂无数据</list-no-data>
|
||||
<view class="ability-view model-view" v-show="showModelList('ability', abilityListShow)">
|
||||
<view class="view-title">
|
||||
<image src="@/static/images/search/result/ability.png" class="view-title-img"></image>
|
||||
功能
|
||||
@@ -54,7 +55,7 @@
|
||||
<view class="view-result" v-show="abilityListShow.length === 0">暂无数据</view>
|
||||
</view>
|
||||
|
||||
<view class="course-view model-view" v-show="showModelList('course')">
|
||||
<view class="course-view model-view" v-show="showModelList('course',courseList )">
|
||||
<view class="view-title">
|
||||
<image src="@/static/images/search/result/course.png" class="view-title-img"></image>
|
||||
课程
|
||||
@@ -69,7 +70,7 @@
|
||||
</view>
|
||||
<view class="view-result" v-show="courseList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="task-view model-view" v-show="showModelList('task')">
|
||||
<view class="task-view model-view" v-show="showModelList('task', taskList)">
|
||||
<view class="view-title">
|
||||
<image src="@/static/images/search/result/task.png" class="view-title-img"></image>
|
||||
任务
|
||||
@@ -84,7 +85,7 @@
|
||||
</view>
|
||||
<view class="view-result" v-show="taskList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="test-view model-view" v-show="showModelList('test')">
|
||||
<view class="test-view model-view" v-show="showModelList('test', testList)">
|
||||
<view class="view-title">
|
||||
<image src="@/static/images/search/result/test.png" class="view-title-img"></image>
|
||||
AI陪练
|
||||
@@ -92,7 +93,7 @@
|
||||
<view class="view-list"></view>
|
||||
<view class="view-result" v-show="testList.length === 0">暂无数据</view>
|
||||
</view>
|
||||
<view class="exam-view model-view" v-show="showModelList('exam')">
|
||||
<view class="exam-view model-view" v-show="showModelList('exam', examList)">
|
||||
<view class="view-title">
|
||||
<image src="@/static/images/search/result/exam.png" class="view-title-img"></image>
|
||||
考试
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user