Commit c2fe95b8 authored by 张九刚's avatar 张九刚

优化 Home 组件的视频弹窗逻辑,增加视频高度动态调整功能,并修复跳转链接时的参数传递

parent 85a08561
......@@ -53,7 +53,7 @@
<image class="contentbg" :src="$baseUrl + 'homepage/contentbg.png'" alt="" />
<image class="contentitem" :key="index" :style="contentItem._style"
v-for="(contentItem, index) in contentImgList" :src="$baseUrl + contentItem.bgUrl"
@tap="jumpLink(contentItem.link, contentItem.videoUrl)"></image>
@tap="jumpLink(contentItem.link, contentItem.videoUrl,index)"></image>
</view>
<view class="channelbox">
<text class="maintitle">有声频道</text>
......@@ -130,7 +130,12 @@
</uni-popup>
</view>
<view v-if="showVideo" class="video-popup">
<video :src="currentVideoUrl" controls autoplay style="width: 100vw; height: 56vw;"></video>
<video
:src="currentVideoUrl"
controls
autoplay
:style="{ width: '100vw', height: videoHeight }"
></video>
<view class="close-btn-bottom" @tap="closeVideo">×</view>
</view>
<RegisterLayer v-model="showRegisterLayer" />
......@@ -175,7 +180,8 @@ export default {
currentVideoUrl: '',
isClickPhoneAuth:false,
voiceStory:{},
suggest:{}
suggest:{},
videoHeight:'56vw'
}
},
components:{
......@@ -280,13 +286,18 @@ export default {
jump(item.link);
}
},
jumpLink(link, videoUrl) {
jumpLink(link, videoUrl,index) {
if (videoUrl) {
if(videoUrl.indexOf('http') === -1){
videoUrl = this.$baseUrl + videoUrl;
}
// 弹出视频
this.currentVideoUrl = videoUrl;
if(index === 1){
this.videoHeight = "100vw";
}else{
this.videoHeight = "56vw";
}
this.showVideo = true;
return;
// 视频弹窗出现后,video标签的autoplay会自动播放
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment