From 918c27c57fd40f7e5b73ac0a0237a6fe73d0aa92 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Sun, 9 Nov 2025 16:48:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/course/qualityCourse.vue | 65 +++++++++++++++++++++-- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/src/views/portal/course/qualityCourse.vue b/src/views/portal/course/qualityCourse.vue index a95676c1..457109db 100644 --- a/src/views/portal/course/qualityCourse.vue +++ b/src/views/portal/course/qualityCourse.vue @@ -710,15 +710,55 @@ export default { } }, //搜索条件 + // 搜索条件 stagClose(tag, tagIndex) { this.courseChosen = void 0; tag.checked = false; + if (tag.type == 0) { + // 关键词类型 this.keyword = ''; + } else if (tag.type == 1) { + // 课程类型 + this.ctypeList.forEach(item => { + if (item.id == tag.id) { + item.checked = false; + } + }); + } else if (tag.type == 14) { + // 热点标签类型 + this.hotTagsList.forEach(item => { + if (item.id == tag.id) { + item.checked = false; + } + }); + // 更新course.tags + const checkedHotTags = this.hotTagsList.filter(tag => tag.checked); + let tagIds = checkedHotTags.map(tag => tag.id).join(','); + this.course.tags = tagIds; + } else if (tag.type == 11 || tag.type == 12 || tag.type == 13) { + // 三级分类标签 + this.oneList.forEach(one => { + if (one.id == tag.id) { + one.checked = false; + } + one.children.forEach(two => { + if (two.id == tag.id) { + two.checked = false; + } + two.children.forEach(three => { + if (three.id == tag.id) { + three.checked = false; + } + }); + }); + }); } + this.navTitle = [] this.searchData(); }, + isTagMatched(tag) { // 检查stagList中是否有匹配的标签 return this.stagList.some(searchTag => @@ -762,10 +802,23 @@ export default { handleClearTags() { //清空所有的条件 this.keyword = ''; - // 取消搜索条件标签展示 - // this.ctypeList.forEach(item => { - // item.checked = false; - // }); + + // 清除课程类型 + this.ctypeList.forEach(item => { + item.checked = false; + }); + + // 清除热点标签 + this.hotTagsList.forEach(item => { + item.checked = false; + }); + // 清空course.tags + this.course.tags = ''; + + // 清除年份选择 + this.yearChosen = []; + + // 清除三级分类 this.oneList.forEach(one => { one.checked = false; one.children.forEach(two => { @@ -775,7 +828,8 @@ export default { }) }) }); - // 清除左侧被选中的内容 + + // 清除左侧被选中的内容 this.courseChosen = void 0; this.twoList = []; this.threeList = []; @@ -784,6 +838,7 @@ export default { sessionStorage.removeItem(this.localSessionKey) this.searchData(); }, + // 导航切换(录播课,线下课,学习项目) handleTypeClick(item, list) { // item.checked = !item.checked;