78 lines
1.4 KiB
Plaintext
78 lines
1.4 KiB
Plaintext
<template>
|
|
<view class="video-list">
|
|
<list
|
|
class="list"
|
|
show-scrollbar="false">
|
|
<cell
|
|
class="cell"
|
|
:key="item.videoId"
|
|
v-for="item in lists">
|
|
<view
|
|
class="video-item"
|
|
@click="handleClick(item)">
|
|
<image class="video-cover" :src="item.videoCover" mode="aspectFill"></image>
|
|
<view class="right-view">
|
|
<text
|
|
class="video-title"
|
|
:class="{active : item.definition ? item.videoId === currentVideo && item.quality == currentDefinition : item.videoId === currentVideo}"
|
|
>{{ item.videoTitle }}</text>
|
|
<!-- <text class="video-time">{{ item.videoTime }}</text> -->
|
|
</view>
|
|
</view>
|
|
</cell>
|
|
</list>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name:"VideoList",
|
|
data() {
|
|
return {};
|
|
},
|
|
props: {
|
|
lists: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
currentVideo: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
currentDefinition: {
|
|
type: Number,
|
|
default: 20
|
|
}
|
|
},
|
|
methods: {
|
|
handleClick(item) {
|
|
this.$emit('listClick', item);
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus" scoped>
|
|
.video-list
|
|
flex 1
|
|
.list
|
|
flex 1
|
|
padding 0 20rpx
|
|
.video-item
|
|
flex-direction row
|
|
margin 15rpx 0
|
|
.right-view
|
|
margin-left 20rpx
|
|
flex 1
|
|
.video-cover
|
|
width 160rpx
|
|
height 90rpx
|
|
border-radius 2rpx
|
|
.video-title
|
|
font-size 26rpx
|
|
line-height 39rpx
|
|
color #FFF
|
|
&.active
|
|
color #FF920A
|
|
</style>
|