...
|
...
|
@@ -3,20 +3,52 @@ |
|
|
<div class="swiper-item swiper-item-left">
|
|
|
<LayoutLink :href="list[0].url" class="img-link" :report="{PAGE_URL, ...list[0].reportParams}" reportEvent="XY_UFO_MAIN_EVENT">
|
|
|
<ImageFormat :lazy="false" class="item-imge" :src="list[0].src" :width="310" :height="402"></ImageFormat>
|
|
|
<div
|
|
|
v-if="videoInfo && videoInfo.id === list[0].id"
|
|
|
class="video-mask"
|
|
|
@click="e => onClickHandler(e, list[0].url)"></div>
|
|
|
<VideoPlayer
|
|
|
ref="videoPlayer"
|
|
|
class="video-player"
|
|
|
v-if="videoInfo && videoInfo.id === list[0].id"
|
|
|
:source="videoInfo.url"
|
|
|
/>
|
|
|
</LayoutLink>
|
|
|
</div>
|
|
|
<div class="swiper-item swiper-item-right">
|
|
|
<LayoutLink :href="list[1].url" class="img-link" :report="{PAGE_URL, ...list[1].reportParams}" reportEvent="XY_UFO_MAIN_EVENT">
|
|
|
<ImageFormat :lazy="false" class="item-imge" :src="list[1].src" :width="380" :height="196"></ImageFormat>
|
|
|
<div
|
|
|
v-if="videoInfo && videoInfo.id === list[1].id"
|
|
|
class="video-mask"
|
|
|
@click="e => onClickHandler(e, list[1].url)"></div>
|
|
|
<VideoPlayer
|
|
|
ref="videoPlayer"
|
|
|
class="video-player"
|
|
|
v-if="videoInfo && videoInfo.id === list[1].id"
|
|
|
:source="videoInfo.url"
|
|
|
/>
|
|
|
</LayoutLink>
|
|
|
<LayoutLink :href="list[2].url" class="img-link img-link2" :report="{PAGE_URL, ...list[2].reportParams}" reportEvent="XY_UFO_MAIN_EVENT">
|
|
|
<ImageFormat :lazy="false" class="item-imge" :src="list[2].src" :width="380" :height="196"></ImageFormat>
|
|
|
<div
|
|
|
v-if="videoInfo && videoInfo.id === list[2].id"
|
|
|
class="video-mask"
|
|
|
@click="e => onClickHandler(e, list[2].url)"></div>
|
|
|
<VideoPlayer
|
|
|
ref="videoPlayer"
|
|
|
class="video-player"
|
|
|
v-if="videoInfo && videoInfo.id === list[2].id"
|
|
|
:source="videoInfo.url"
|
|
|
/>
|
|
|
</LayoutLink>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import VideoPlayer from "@/components/video-player";
|
|
|
|
|
|
export default {
|
|
|
name: 'swiper',
|
|
|
props: {
|
...
|
...
|
@@ -27,21 +59,59 @@ export default { |
|
|
type: String,
|
|
|
}
|
|
|
},
|
|
|
components: {VideoPlayer},
|
|
|
computed: {
|
|
|
videoInfo() {
|
|
|
let videoInfo = null;
|
|
|
for(const resourceInfo of this.list) {
|
|
|
const { url, id } = resourceInfo;
|
|
|
if(/(\.mp4)/.test(url)) {
|
|
|
videoInfo = {url, id};
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
return videoInfo;
|
|
|
},
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
params: {},
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
// console.log(this.list)
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
onClickHandler(e, url) {
|
|
|
e.stopPropagation();
|
|
|
e.preventDefault();
|
|
|
if(/(\.mp4)/.test(url)) {
|
|
|
this.$refs.videoPlayer.parentHandleclick()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.video-mask {
|
|
|
z-index: 10;
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
}
|
|
|
|
|
|
.video-player {
|
|
|
display: block;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
opacity: 0;
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
}
|
|
|
|
|
|
.swiper {
|
|
|
display: flex;
|
|
|
align-content: stretch;
|
...
|
...
|
@@ -50,6 +120,10 @@ export default { |
|
|
margin-left: 8px;
|
|
|
margin-right: 8px;
|
|
|
|
|
|
/deep/ .layout-link {
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
.swiper-item-left {
|
|
|
width: 44%;
|
|
|
}
|
...
|
...
|
|