精品课全部切换

This commit is contained in:
670788339
2025-11-12 10:51:14 +08:00
parent 7e8b807825
commit 426ed75bc3

View File

@@ -459,9 +459,9 @@ export default {
// } // }
// 添加计算是否所有热点标签都未选中(即"全部"选中状态) // 添加计算是否所有热点标签都未选中(即"全部"选中状态)
isAllHotTagsSelected() { // isAllHotTagsSelected() {
return !this.hotTagsList.some(tag => tag.checked); // return !this.hotTagsList.some(tag => tag.checked);
} // }
}, },
data() { data() {
return { return {
@@ -527,7 +527,8 @@ export default {
searchRecords: [], searchRecords: [],
hotList: [], hotList: [],
totalPages: 1, totalPages: 1,
localSessionKey: this.$xpage.constants.localCourseFiltersKey localSessionKey: this.$xpage.constants.localCourseFiltersKey,
isAllHotTagsSelected: true,
}; };
}, },
// 受众需要每次刷新 // 受众需要每次刷新
@@ -773,6 +774,7 @@ export default {
this.hotTagsList.forEach(tag => { this.hotTagsList.forEach(tag => {
tag.checked = false; tag.checked = false;
}); });
this.isAllHotTagsSelected = true;
// 清空course.tags // 清空course.tags
this.course.tags = ''; this.course.tags = '';
@@ -988,13 +990,15 @@ export default {
}, },
//点击标签 //点击标签
handleTagClick(item, list,type) { handleTagClick(item, list,type) {
this.isAllHotTagsSelected = false;
item.checked = !item.checked; item.checked = !item.checked;
// 更新course.tags // 更新course.tags
const checkedTags = this.hotTagsList.filter(tag => tag.checked); const checkedTags = this.hotTagsList.filter(tag => tag.checked);
let tagIds = checkedTags.map(tag => tag.id).join(','); let tagIds = checkedTags.map(tag => tag.id).join(',');
this.course.tags = tagIds; this.course.tags = tagIds;
this.$forceUpdate();
// 强制触发stagList重新计算 // 强制触发stagList重新计算
this.$nextTick(() => { this.$nextTick(() => {
this.searchData(type); this.searchData(type);