You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
zhishifufei_uniapp/components/Course/lineStyleCourse.vue

120 lines
2.4 KiB

<template>
<view>
<view v-for="item in specialList" :key="item.id" class="line-special-item flex" @click="$emit('detail', item)">
<view class="image">
<image :src="item.image" mode="aspectFill" :alt="item.title" />
<view v-if="item.type == 3" class="type">视频</view>
<view v-else class="type">直播</view>
</view>
<view class="text">
<view class="special-title">{{ item.title }}</view>
<view class="label">
<text v-for="(label, index) in item.label" :key="index">{{ label }}</text>
</view>
<view class="study-progress">
上次学到{{ item.progress || '' }}
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
specialList: {
type: Array,
default: [],
}
},
methods: {
getJumpUrl(item) {
return item.is_light ? this.singleDetailsURL : this.detailsURL + "?id=" + item.id;
},
},
};
</script>
<style lang="scss" scoped>
.line-special-item {
margin-bottom: 19rpx;
background: #fff;
&:last-child {
margin-bottom: 0;
}
}
.line-special-item .image {
position: relative;
width: 280rpx;
height: 174rpx;
}
.line-special-item image {
display: block;
width: 100%;
height: 100%;
border-radius: 10rpx;
object-fit: cover;
}
.line-special-item .type {
position: absolute;
right: 10rpx;
bottom: 10rpx;
height: 32rpx;
padding: 0 11rpx;
border-radius: 3rpx;
background-color: rgba(255, 255, 255, 0.8);
font-size: 20rpx;
line-height: 32rpx;
color: #494949;
}
.line-special-item .text {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
margin-left: 20rpx;
padding-top: 18rpx;
}
.line-special-item .special-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 28rpx;
line-height: 28rpx;
color: #333333;
}
.line-special-item .label {
margin-top: 16rpx;
font-size: 0;
}
.line-special-item .label text {
display: inline-block;
height: 38rpx;
padding: 0 12rpx;
border-radius: 4rpx;
background-color: #ECF6FC;
vertical-align: middle;
font-size: 20rpx;
line-height: 38rpx;
color: #2c8eff;
}
.line-special-item .study-progress {
color: #666;
font-size: 24rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 30rpx;
}
</style>