This commit is contained in:
yanghang
2025-07-10 10:05:38 +08:00
parent 3de6c6a5e0
commit ad7f7134df
2 changed files with 28 additions and 9 deletions
+25 -6
View File
@@ -8,7 +8,7 @@
<view class="item-title">{{itemInfo.crsName}}</view>
<uv-scroll-list class="item-tags" :indicator="false">
<view class="item-tag-view">
<view class="item-tag" v-for="item in itemInfo.tagCataList">{{item.tagName}}</view>
<view class="item-tag" v-for="item in tagsShowList">{{item.tagName}}</view>
</view>
</uv-scroll-list>
<view class="item-publish">发布{{itemInfo.issuTm}}</view>
@@ -26,13 +26,17 @@
},
props:{
itemInfo:{
type:Object,
type: Object,
default:()=>({
crsName: '银行核心业务全流程实践哒哒哒哒',
tagsList:[{tagName:'公斤业务'},{tagName:'初级'}],
publicTime:"2025-01-03",
learnedNum:'2222222'
crsName: '',
tagCataList:[],
publicTime:"",
learnedNum:''
})
},
activeTag:{
default: '',
type: String
}
},
data() {
@@ -40,6 +44,21 @@
};
},
watch:{
activeTag:{
handler(){},
deep: true,
immediate: true
}
},
computed:{
tagsShowList(){
if(!this.activeTag) return this.itemInfo.tagCataList
let _arr = this.itemInfo.tagCataList.filter(t=> t.tagId === this.activeTag)
let _arr1 = this.itemInfo.tagCataList.filter(t=> t.tagId !== this.activeTag)
return _arr.concat(_arr1)
}
},
methods:{
clickItem(){
this.$emit('clickItem', this.itemInfo)
+3 -3
View File
@@ -48,7 +48,7 @@
:type="activeTag === ''?'primary':'info'"
@click="chooseTag({value:''})"
></uv-tags>
<uv-tags :text="item.label+item.required"
<uv-tags :text="item.label"
v-for="item in tagsList"
:key="item.value"
shape="circle"
@@ -93,7 +93,7 @@
<view class="left-color"></view>
{{item.label}}
</view>
<CourseItem v-for="itemC in item.courseList" :key="itemC.crsNum" :itemInfo="itemC" @clickItem="toCourseDetail(itemC)"/>
<CourseItem v-for="itemC in item.courseList" :key="itemC.crsNum" :itemInfo="itemC" :activeTag="activeTag" @clickItem="toCourseDetail(itemC)"/>
<view
class="type-list"
v-for="itemT in item.children"
@@ -103,7 +103,7 @@
<view class="left-color"></view>
{{itemT.label}}
</view>
<CourseItem v-for="itemTC in itemT.courseList" :key="itemTC.crsNum" :itemInfo="itemTC" @clickItem="toCourseDetail(itemTC)"/>
<CourseItem v-for="itemTC in itemT.courseList" :key="itemTC.crsNum" :activeTag="activeTag" :itemInfo="itemTC" @clickItem="toCourseDetail(itemTC)"/>
</view>
</view>
</view>