Commit 25f26e6c authored by jyx's avatar jyx

代码优化

parent ad1f73cb
...@@ -7,12 +7,9 @@ ...@@ -7,12 +7,9 @@
<video v-if="Math.abs(displayIndex-index)==0 && list.vedioUrl" :id="list.vedioIndex" @play="play" <video v-if="Math.abs(displayIndex-index)==0 && list.vedioUrl" :id="list.vedioIndex" @play="play"
@ended="ended" :controls="controls" :loop="!isplay" :enable-progress-gesture="false" @ended="ended" :controls="controls" :loop="!isplay" :enable-progress-gesture="false"
:show-loading="true" :show-fullscreen-btn="false" @controlstoggle="controlstoggle" :show-loading="true" :show-fullscreen-btn="false" @controlstoggle="controlstoggle"
@click="tapVides()" @timeupdate="timeupdate" style="width:100%; height:100%;" :autoplay="!list.lock" :poster="data.coverImage" @click="tapVides()" @timeupdate="timeupdate"
:src="list.vedioUrl" class="tsvideo" play-btn-position="center" object-fit="contain"> style="width:100%; height:100%;" :autoplay="!list.lock" :src="list.vedioUrl" class="tsvideo"
<cover-view v-if="showCover" style="margin:0 auto;"> play-btn-position="center" object-fit="contain" />
<cover-image mode="widthFix" :src="data.coverImage" />
</cover-view>
</video>
<view v-if="!isqp" class="userInfo"> <view v-if="!isqp" class="userInfo">
<!-- 点赞 --> <!-- 点赞 -->
<view class="flex" style="opacity: 0.9; margin-top: 10rpx;"> <view class="flex" style="opacity: 0.9; margin-top: 10rpx;">
...@@ -168,7 +165,6 @@ ...@@ -168,7 +165,6 @@
showTap: false, showTap: false,
showCoinPop: false, showCoinPop: false,
vipBackPage: '', vipBackPage: '',
showCover: true
}; };
}, },
onLoad(options) { onLoad(options) {
...@@ -351,12 +347,8 @@ ...@@ -351,12 +347,8 @@
} }
}); });
}, },
play() { play() {},
this.showCover = false
},
ended() { ended() {
this.showCover = true
// 1.播放当前视频结束时触发,自动切换下一个视频 // 1.播放当前视频结束时触发,自动切换下一个视频
if (this.isplay) { if (this.isplay) {
if (this.displayIndex < 2) { if (this.displayIndex < 2) {
...@@ -372,8 +364,6 @@ ...@@ -372,8 +364,6 @@
* @originIndex 从源数据的哪个开始显示默认0,如从其他页面跳转进来,要显示第n个,这个参数就是他的下标 * @originIndex 从源数据的哪个开始显示默认0,如从其他页面跳转进来,要显示第n个,这个参数就是他的下标
*/ */
initSwiperData(originIndex = this.originIndex) { initSwiperData(originIndex = this.originIndex) {
this.showCover = true
console.log('--------当前数据 Index:', originIndex) console.log('--------当前数据 Index:', originIndex)
const originListLength = this.originList.length; // 源数据长度 const originListLength = this.originList.length; // 源数据长度
const displayList = []; const displayList = [];
...@@ -547,7 +537,7 @@ ...@@ -547,7 +537,7 @@
z-index: 99; z-index: 99;
bottom: 30%; bottom: 30%;
right: 10px; right: 10px;
width: 90rpx; width: 100rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
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