This commit is contained in:
杨航
2025-09-02 09:04:23 +08:00
parent 24b7134b17
commit 6d1f3f1142
3 changed files with 21 additions and 10 deletions
+11 -4
View File
@@ -132,7 +132,7 @@ import {
queryCrsInfoByPopularApi,
queryCrsInfoByRecmdApi
} from "@/api/course.js"
import { onMounted, onActivated, ref, computed } from 'vue'
import { onMounted, onActivated, ref, computed, onUnmounted } from 'vue'
import { onShow } from "@dcloudio/uni-app"
const customStyle = {
backgroundColor: "#ffffff",
@@ -337,6 +337,13 @@ import { onShow } from "@dcloudio/uni-app"
tagsTree.value = res.body||[]
})
changeTab({name:'全部'})
uni.$on('refresh_course_list', () => {
changeTab({name:activeTab.value || '全部'})
});
})
onUnmounted(() => {
uni.$off('refresh_course_list');
})
onActivated(() => {
// 重新获取标签信息
@@ -345,9 +352,9 @@ import { onShow } from "@dcloudio/uni-app"
})
changeTab({name:activeTab.value || '全部'})
});
onShow(()=>{
changeTab({name:activeTab.value || '全部'})
})
// onShow(()=>{
// changeTab({name:activeTab.value || '全部'})
// })
</script>
+2
View File
@@ -347,6 +347,7 @@ const showOrder = ref(0)
const isLastPgrph = ref(false)
const backRouter = () => {
// common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
uni.$emit('refresh_course_list');
common.navigateBack()
}
@@ -395,6 +396,7 @@ const getGraphInfoUnStudy = (flag = 0) => {
})
.finally(() => {})
}
uni.$emit('refresh_course_list');
return
}
lastTalkingInfo.value = {
+8 -6
View File
@@ -19,7 +19,7 @@
line-color="#06f"></uv-tabs>
</view>
<scroll-view class="lists-view" :scroll-y="true">
<view class="ability-view model-view" v-show="!fromType || fromType === 'ability'">
<view class="ability-view model-view" v-show="showModelList('ability')">
<view class="view-title">
<image src="@/static/images/search/result/ability.png" class="view-title-img"></image>
功能
@@ -49,7 +49,7 @@
</view>
</view>
<view class="course-view model-view" v-show="!fromType || fromType === 'course'">
<view class="course-view model-view" v-show="showModelList('course')">
<view class="view-title">
<image src="@/static/images/search/result/course.png" class="view-title-img"></image>
课程
@@ -61,7 +61,7 @@
暂无数据
</view>
</view>
<view class="task-view model-view" v-show="!fromType || fromType === 'task'">
<view class="task-view model-view" v-show="showModelList('task')">
<view class="view-title">
<image src="@/static/images/search/result/task.png" class="view-title-img"></image>
任务
@@ -73,7 +73,7 @@
暂无数据
</view>
</view>
<view class="test-view model-view" v-if="false">
<view class="test-view model-view" v-show="showModelList('test')">
<view class="view-title">
<image src="@/static/images/search/result/test.png" class="view-title-img"></image>
AI陪练
@@ -84,7 +84,7 @@
暂无数据
</view>
</view>
<view class="exam-view model-view" v-show="!fromType || fromType === 'exam'">
<view class="exam-view model-view" v-show="showModelList('exam')">
<view class="view-title">
<image src="@/static/images/search/result/exam.png" class="view-title-img"></image>
考试
@@ -241,7 +241,9 @@
const taskList = ref([])
const examList = ref([])
const courseList = ref([])
const showModelList = (typeName) => {
return ['','all', typeName].indexOf(activeTab.value) >= 0
}
const changeTab = (item) => {
if (!item) return
activeTab.value = item.type