|
@@ -8,7 +8,7 @@
|
|
|
:circular='false' @change="swiperChange" :current="swiperCurrent" :vertical="true" duration="200">
|
|
|
<block v-for="content in swiperList" :key="content">
|
|
|
<swiper-item>
|
|
|
- <view :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'">
|
|
|
+ <view :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'" v-if="isShowVideo(content)">
|
|
|
<!-- @controlstoggle="controlstoggle" -->
|
|
|
<video v-if="isShowVideo(content)" autoplay :key="content" id="myVideo" :controls="controls"
|
|
|
:loop="!isplay" preload="auto" :enable-progress-gesture="true"
|
|
@@ -17,8 +17,7 @@
|
|
|
:style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'"
|
|
|
:src="currentVideoInfo.video_url" class="tsvideo">
|
|
|
</video>
|
|
|
- <image v-else :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'"
|
|
|
- :src="videoInfo.cover_image"></image>
|
|
|
+
|
|
|
<view v-if="isqp" class="userInfo">
|
|
|
<!-- 2.点赞 -->
|
|
|
<view style="opacity: 0.9; margin-top: 17px;">
|
|
@@ -67,6 +66,9 @@
|
|
|
<text class="userName">选集</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <image v-if="shouldRender(content)"
|
|
|
+ :style="'width: '+ windowWidth +'px; height:'+heightxw+'vh;'" :src="videoInfo.cover_image">
|
|
|
+ </image>
|
|
|
</swiper-item>
|
|
|
</block>
|
|
|
</swiper>
|
|
@@ -273,6 +275,12 @@
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
+ shouldRender(index) {
|
|
|
+ return (index) => {
|
|
|
+ // 判断是否应该渲染当前索引的前后各一个索引的swiper item
|
|
|
+ return Math.abs(index - this.swiperCurrent) <= 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
swiperList() {
|
|
|
return Number(this.videoInfo.updated_episode_num) + 1
|
|
|
},
|