1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
<div class="mp4">
<div class="flex flex-wrap justify-between video-list">
<div v-for="item in files" :key="item.annexId">
<div class="item">
<div class="shrink-0 play-bt" @click="start(item)">
<doc-icon type="doc-play" />
</div>
</div>
<div v-if="item.annexFileName" class="text-12 my-1 text-ellipsis">{{ item.annexFileName }}</div>
</div>
</div>
<van-popup v-model:show="visible" :close-on-click-overlay="false" closeable
close-icon-position="top-right">
<video controls width="100%" v-if="visible">
<source :src="activeVideo.annexUrl" type="video/mp4" />
播放失败!
</video>
</van-popup>
</div>
</template>
<script>
export default {
props: {
files: { default: () => [] }
},
data() {
return {
visible: false,
activeVideo: {}
}
},
methods: {
start(item) {
this.activeVideo = item
this.visible = true
}
}
}
</script>
<style lang="less" scoped>
.video-list {
>div {
width: calc(50% - 5px);
.item {
background: url('@/assets/image/residentWX/video-default.png') no-repeat;
background-size: 100%;
height: .84rem;
display: flex;
align-items: center;
justify-content: center;
}
}
.play-bt {
display: inline-flex;
width: 36px;
height: 36px;
align-items: center;
justify-content: center;
border-radius: 50%;
background-color: #E4F2F0;
font-size: 15px;
padding-left: 2px;
}
}
</style>