mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-18 15:26:45 +08:00
201 lines
5.4 KiB
Vue
201 lines
5.4 KiB
Vue
<template>
|
||
<div style="">
|
||
<div class="uc-course" @click="jumpRouter(item)" v-for="(item, idx) in items" :key="idx">
|
||
<div class="uc-course-img" style="width: 212px;height: 119px;">
|
||
<course-image :course="item"></course-image>
|
||
<!-- <img :src="imageUrl(item)" /><span class="two-line-ellipsis">{{item.title}}</span> -->
|
||
</div>
|
||
<div class="uc-course-info">
|
||
<div style="height: 100%;display: flex;justify-content:space-between;">
|
||
<div style="display: flex;flex-direction: column;justify-content: space-between;">
|
||
<div class="uc-course-name">
|
||
<span class="uc-course-font" :class="contentTypeFilter(item.contentType).class">{{ contentTypeFilter(item.contentType).text }}</span>
|
||
<span v-html="$keywordActiveShow(item.title,keyword)"></span>
|
||
</div>
|
||
<!-- <div class="uc-course-text" v-if="type=='myShare'">-->
|
||
<!-- 分享给:{{ item.toAname }}
|
||
</div> -->
|
||
<!-- <div class="uc-course-text" v-else>分享人:{{ item.toAname }}</div> -->
|
||
<div style="display:flex;flex-direction: column;">
|
||
<div class="uc-course-textTo">分享时间:{{ item.time }}</div>
|
||
<div class="uc-course-textToInfo">
|
||
<span v-if="type=='myShare'" style="margin-right:10px">分享给{{item.toAname}}</span>
|
||
<span v-else style="margin-right:10px">{{item.authorName}}分享给我</span>
|
||
<el-button type="text" v-if="item.isRead" icon="el-icon-folder-opened" style="color: #8590A6;padding:0;">已查看</el-button>
|
||
<el-button type="text" icon="el-icon-folder" v-else style="color: #8590A6;padding:0;">未查看</el-button>
|
||
<el-button v-if="!item.isRead&&type=='myShare'" type="text" @click.stop="deleteshares(item)" icon="el-icon-refresh-right" style="color: #8590A6;">撤回</el-button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- <div class="btn" > -->
|
||
<!-- <span>{{item.isRead?'[已查看]':'[未查看]'}}</span> -->
|
||
|
||
|
||
<!-- </div> -->
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
// import interactBar from '@/components/Portal/interactBar.vue';
|
||
import courseImage from "@/components/Course/courseImage.vue"
|
||
import apiShares from '@/api/modules/shares.js';
|
||
export default {
|
||
name: 'comStudyItem',
|
||
props: {
|
||
items: {
|
||
//name,
|
||
type: Array,
|
||
default: () => []
|
||
},
|
||
type:{
|
||
type:String,
|
||
default:()=>{
|
||
return 'myShare'
|
||
}
|
||
},
|
||
keyword:{
|
||
type:String,
|
||
default:()=>{
|
||
return ''
|
||
}
|
||
}
|
||
},
|
||
methods: {
|
||
imageUrl(item) {
|
||
if (item && item.image && item.image != '') {
|
||
return process.env.VUE_APP_FILE_BASE_URL + item.image;
|
||
} else {
|
||
return this.webBaseUrl + "/images/bgimg/course.png";
|
||
}
|
||
},
|
||
deleteshares(item){
|
||
this.$emit('confirm',item)
|
||
},
|
||
contentTypeFilter(value) {
|
||
let obj = {};
|
||
switch (value) {
|
||
case '10': {
|
||
obj.class = 'uc-course-type2';
|
||
obj.text = '录播';
|
||
break;
|
||
}
|
||
case '21': {
|
||
obj.class = 'uc-course-type2';
|
||
obj.text = '直播';
|
||
break;
|
||
}
|
||
case '20': {
|
||
obj.class = 'uc-course-type2';
|
||
obj.text = '录播';
|
||
break;
|
||
}
|
||
case '30': {
|
||
obj.class = 'uc-course-type2';
|
||
obj.text = '面授';
|
||
break;
|
||
}
|
||
case '90': {
|
||
obj.class = 'uc-course-type2';
|
||
obj.text = '混合';
|
||
break;
|
||
}
|
||
}
|
||
return obj;
|
||
},
|
||
jumpRouter(item){
|
||
if(this.type!='myShare'){
|
||
apiShares.updateIsRead(item.id).then(res=>{
|
||
if(res.status==200){
|
||
this.$emit('confirm',item)
|
||
}
|
||
})
|
||
}
|
||
this.$router.push({path:'/course/detail',query:{id:item.objId}})
|
||
// window.open(`${this.webBaseUrl}/course/detail?id=${item.objId}`)
|
||
},
|
||
},
|
||
components: {
|
||
courseImage
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
// .uc-course-type1 {
|
||
// padding: 3px;
|
||
// border: 1px dotted #1ea0fa;
|
||
// color: #1ea0fa;
|
||
// }
|
||
// .uc-course-type2 {
|
||
// padding: 3px;
|
||
// border: 1px dotted #ffaa00;
|
||
// color: #ffaa00;
|
||
// }
|
||
.uc-course {
|
||
display: flex;
|
||
justify-content: space-around;
|
||
// border: 1px solid #f0f0f0;
|
||
// padding: 10px;
|
||
padding-bottom: 24px;
|
||
margin-top: 24px;
|
||
border-bottom: 1px solid #eeeeee;
|
||
cursor: pointer;
|
||
.uc-course-img {
|
||
position: relative;
|
||
img {
|
||
width: 160px;
|
||
height: 90px;
|
||
border: 1px solid #f4f4f5;
|
||
}
|
||
>span{
|
||
position: absolute;
|
||
top: 30px;
|
||
left: 10px;
|
||
width: 100%;
|
||
height: 100%;
|
||
color: #ffffff;
|
||
font-size: 16px;
|
||
}
|
||
}
|
||
.uc-course-info {
|
||
flex: 1;
|
||
line-height: 28px;
|
||
padding: 0px 12px;
|
||
.uc-course-name {
|
||
font-size: 18px;
|
||
font-weight: 400;
|
||
.uc-course-font{
|
||
width: 58px;
|
||
height: 26px;
|
||
font-size: 14px;
|
||
margin-right: 8px;
|
||
}
|
||
}
|
||
.uc-course-text {
|
||
color: #747474;
|
||
font-size: 16px;
|
||
}
|
||
.uc-course-textTo{
|
||
font-size: 14px;
|
||
color: #666666;
|
||
}
|
||
.readed{
|
||
color: #2AB28B;
|
||
}
|
||
.noRead{
|
||
color:#FF3E3E;
|
||
}
|
||
.btn{
|
||
text-align: right;
|
||
width: 250px;
|
||
font-size: 14px;
|
||
// margin-top: 70px;
|
||
padding-top:90px;
|
||
}
|
||
}
|
||
}
|
||
</style>
|