From d5ec4c1833b3954fa11fbbe49413c1204f06e525 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Sun, 9 Nov 2025 16:25:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/course/qualityCourse.vue | 167 +++++++++++++++------- 1 file changed, 113 insertions(+), 54 deletions(-) diff --git a/src/views/portal/course/qualityCourse.vue b/src/views/portal/course/qualityCourse.vue index 8f2d1e96..41013f36 100644 --- a/src/views/portal/course/qualityCourse.vue +++ b/src/views/portal/course/qualityCourse.vue @@ -89,6 +89,32 @@ +
+ +
+
+
+ 全部 + +
+ +
+ {{tag.tagName}} + +
+
+
+
@@ -328,25 +354,45 @@ export default { let list = []; }, - // 取消搜索条件标签展示 - stagList() { //计算出选择的内容 + stagList() { let list = []; + + // 关键词 if (this.keyword) { list.push({ type: 0, id: 'keyword', name: this.keyword, + tagName: this.keyword, checked: true - }) + }); } - // 取消 全部 内部专享 外部精选 三种的显示 - // this.ctypeList.forEach(item => { - // if (item.checked) { - // list.push(item); - // } - // }); + + // 课程类型 + this.ctypeList.forEach(item => { + if (item.checked) { + list.push({ + ...item, + tagName: item.name + }); + } + }); + + // 热点标签 - 这是关键修复 + this.hotTagsList.forEach(item => { + if (item.checked) { + list.push({ + ...item, + name: item.tagName || item.name, + tagName: item.tagName || item.name, + type: 14 + }); + } + }); + + // 三级分类 this.oneList.forEach(one => { - var twoChildChecked = false;//是否有下级 + var twoChildChecked = false; one.children.forEach(two => { if (two.checked) { twoChildChecked = true; @@ -354,34 +400,28 @@ export default { var threeChildChecked = false; two.children.forEach(three => { if (three.checked) { - list.push(three); + list.push({ + ...three, + tagName: three.name + }); threeChildChecked = true; } }); if (two.checked && !threeChildChecked) { - list.push(two); + list.push({ + ...two, + tagName: two.name + }); } }); if (one.checked && !twoChildChecked) { - list.push(one); + list.push({ + ...one, + tagName: one.name + }); } - }) - // this.oneList.forEach(item=>{ - // if(item.checked){ - // list.push(item); - // } - // }); - // this.twoList.forEach(item=>{ - // if(item.checked){ - // list.push(item); - // } - // }); - // this.threeList.forEach(item=>{ - // if(item.checked){ - // list.push(item); - // } - // }); - //console.log(list,'list'); + }); + return list; }, ctypeTagAll() { @@ -575,6 +615,37 @@ export default { // window.removeEventListener("scroll", this.handleScroll); }, methods: { + isAllHotTagsSelected() { + return !this.hotTagsList.some(tag => tag.checked); + }, + handleClearHotTags() { + // 清除所有热点标签的选中状态 + this.hotTagsList.forEach(tag => { + tag.checked = false; + }); + // 清空course.tags + this.course.tags = ''; + + // 触发搜索 + this.searchData(); + }, + handleTagClick(item, list,type) { + item.checked = !item.checked; + + // 更新course.tags + const checkedTags = this.hotTagsList.filter(tag => tag.checked); + let tagIds = checkedTags.map(tag => tag.id).join(','); + this.course.tags = tagIds; + this.$forceUpdate(); + this.searchData(type); + + // 强制触发stagList重新计算 + // this.$nextTick(() => { + // this.searchData(type); + // }); + }, + + // 改变分页 currentChange(val) { this.course.pageIndex = val @@ -2219,30 +2290,18 @@ export default { } } } - -// .course-form { -// width: 100%; -// margin: 10px 0; -// ::v-deep.el-button { -// width: 100%; -// color: #fff; -// } -// } - -// .right-box { -// .add-btn { -// width: 100%; -// padding: 15px 0; -// } -// .ranking-card { -// margin-top: 0px; -// } - -// .ranking-data { -// margin: 10px 0; -// color: #999999; -// } -// }] +.hot-tags-wrapper { + display: flex; + flex-wrap: wrap; + gap: 15px; + align-items: center; + padding-top: 2px; +} +.search-div.nav { + display: block; + width: 100%; + clear: both; +} .search-item-type { line-height: 25px; padding-right: 10px; From 1d20f1186182adb8ab4710e2f6012ca85c743c66 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Mon, 10 Nov 2025 08:54:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=B2=BE=E5=93=81=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=8A=A0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/course/qualityCourse.vue | 476 +++++++++------------- 1 file changed, 182 insertions(+), 294 deletions(-) diff --git a/src/views/portal/course/qualityCourse.vue b/src/views/portal/course/qualityCourse.vue index 41013f36..0a58f422 100644 --- a/src/views/portal/course/qualityCourse.vue +++ b/src/views/portal/course/qualityCourse.vue @@ -2,48 +2,32 @@
+ @showClass="showClass">
-
-
精品课程
-
{{ one.name }}
+ @click.stop="handleOptionClick(twoList, 2, one.children)" + :class="{ courseTwoActive: twoList.id == twoId || twoList.checked }" @mouseleave.stop="leaveIndex" + @mouseenter.stop="changeIndex(twoList.id)"> + :disabled="!twoList.children.length" :open-delay="0" :close-delay="0" trigger="hover" + :visible-arrow="false" @hide="leaveIndex" @show="changeIndex(twoList.id)" transition="none">
{{ - twoList.name }}
+ twoList.name }}
@@ -51,8 +35,8 @@
+ :key="threeList.id" @click.stop="handleOptionClick(threeList, 3, twoList.children)" + class="course-three"> {{ threeList.name }}
@@ -70,31 +54,49 @@
-
-