修复选集弹窗ios偶发性不出现问题

This commit is contained in:
2025-01-17 16:19:23 +08:00
parent 169b3ca31e
commit 48154cf82f
6 changed files with 247 additions and 55 deletions

View File

@@ -3,22 +3,28 @@
<video class="u-flex-1 video" :show-fullscreen-btn="false" @controlstoggle="controlstoggles" v-if="showVideo"
play-btn-position="center"
show-center-play-btn
:show-center-play-btn="false"
:show-play-btn="false"
@timeupdate="timeupdate" @waiting="waiting()" object-fit="cover" @pause="onpause" @click="videoClick()"
:controls="true"
@click.stop="videoClick()"
@timeupdate="timeupdate" @waiting="waiting()" object-fit="cover" @pause="onpause"
@play="videoPlay('myVideo'+item.courseDetailsId,item.courseDetailsId)" :play-strategy="2"
:show-loading="true" codec="software" :muted="false" :show-center-play-btn="true" :loop="loop"
:show-loading="true" codec="software" :muted="false" :loop="loop"
:enable-progress-gesture="false" :poster="item.titleImg" :ref="'myVideo'+item.courseDetailsId"
:autoplay="autoplay" @ended="ended" :id="'myVideo'+item.courseDetailsId" :src="item.videoUrl"></video>
<image class="poster" v-else @click="!item.videoUrl?popupShow('pay',item):''" :src="item.titleImg"
<image class="poster" v-else @click.stop="posterClick" :src="item.titleImg"
mode="aspectFill">
</image>
<view class="play-icon" v-if="showVideo&&!isPlying" @click.stop="videoClick()" :style="playStyle">
<image class="icon" src="@/static/images/play.png" mode=""></image>
</view>
<view class="info" v-if="!isCommand" :style="infoStyle">
<text class="color-fff" v-if="item.courseDetailsName">{{item.courseDetailsName}}</text>
<view v-if="item.content" v-html="item.content"></view>
<view class="u-m-t-20 color-fff" @click="popupShow('show')">
<view class="u-m-t-20 color-fff" @click.stop="popupShow('show')">
<text class="color-fff">
{{item.courseDetailsName}}{{total}}选集 >
</text>
@@ -28,7 +34,7 @@
<view class="info" v-if="isCommand" :style="infoStyle">
<text class="color-fff" v-if="item.courseDetailsName">{{item.courseDetailsName}}</text>
<view v-if="item.content" v-html="item.content"></view>
<view class="u-m-t-20 color-fff" @click="toDetail">
<view class="u-m-t-20 color-fff" @click.stop="toDetail">
<text class="color-fff">
查看更多续集 >
</text>
@@ -100,6 +106,10 @@
}
}
},
isTabbar:{
type: Boolean,
default: false
},
isCommand: {
type: Boolean,
default: false
@@ -148,7 +158,11 @@
const emits = defineEmits(['controlstoggles', 'disappear', 'appear', 'waiting', 'videoPlay', 'ended', 'dianzanClick',
'share', 'zhuijuClick', 'popupShow', 'itemMounted', 'toDetail', 'showInfo', 'playStatusChange'
])
function posterClick(){
if(!props.item.videoUrl){
popupShow('pay',props.item)
}
}
function controlstoggles(e) {
emits('controlstoggles', e)
}
@@ -283,17 +297,17 @@
let video = null
function disappear() {
emits('disappear')
if (video) {
video.pause()
}
emits('disappear')
}
const showVideo = computed(() => {
// #ifdef H5
return props.current === props.index && props.item.videoUrl
// #endif
// #ifdef APP
return props.nowIndex === props.index && props.item.videoUrl
return props.nowIndex === props.index && props.item.videoUrl ?true :false
// #endif
})
onMounted(() => {
@@ -332,8 +346,27 @@
video = null
}
})
const customStyle = computed(() => {
// #ifdef H5
return {
bottom: props.isTabbar ? '50px' : '0'
}
// #endif
// #ifndef H5
return {}
// #endif
})
const playStyle=computed(()=>{
if(isPlying.value){
return {
bottom:'0'
}
}
return {
bottom: props.isTabbar ? (50+44 +'px') : '44px'
}
})
const infoStyle = computed(() => {
return {
transform: `translateX(${(!isPlying.value||!props.item.videoUrl)?0:'-750rpx'})`
@@ -467,7 +500,21 @@
justify-content: center;
align-items: center;
}
.play-icon{
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
justify-content: center;
align-items: center;
$icon-size:80rpx;
.icon{
width: $icon-size;
height: $icon-size;
}
}
.ji-list {
.ji-item {
width: 210rpx;
@@ -503,10 +550,12 @@
}
}
}
/* #ifdef H5 */
.ji-item:nth-of-type(3n) {
margin-right: 0;
}
/* #endif */
.hot {
width: 40rpx;