修复Safari 浏览器没有最下面的工具栏跳转到视频详情时引起的选集被遮挡以及购买支付被遮挡问题

解决方案:跳转视频前先让页面滚动然后再跳转,让浏览器最下方工具栏出现再跳转
This commit is contained in:
2024-12-18 09:14:04 +08:00
parent 0636654dc2
commit de3cf30105

View File

@@ -201,6 +201,9 @@
</template>
<script>
import {
returnIsSafari
} from '@/utils/app.js'
import empty from '../../components/empty.vue'
import videoList from '../../components/videoList/videoList.vue'
import recommendVideo from '../../components/recommendVideo/recommendVideo.vue'
@@ -256,6 +259,7 @@
draw: Math.floor((Math.random() * 12) + 1),
isWeixin: false,
isIos: true,
scrollTop: 0,
};
},
onShareAppMessage(res) {
@@ -274,6 +278,10 @@
imageUrl: this.bgImg
}
},
onPageScroll(e) {
console.log(e);
this.scrollTop = e.scrollTop
},
onLoad(options) {
// barWidth
// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-KUAISHOU
@@ -508,13 +516,79 @@
})
}
},
pageScrollTo(time = 100) {
uni.pageScrollTo({
scrollTop: this.scrollTop - 50,
duration: time,
complete() {
}
})
},
//查看视频
seVideo(item) {
const time = 100;
// #ifdef H5
if (returnIsSafari()) {
this.pageScrollTo(time)
setTimeout(() => {
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item
.courseDetailsId +
'&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
.dyEpisodeId
})
}, time)
} else {
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId +
'&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
.dyEpisodeId
})
}
// #endif
// #ifndef H5
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId +
'&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
.dyEpisodeId
})
// #endif
},
//点击回调
posterSuccess(item) {
const time = 100;
// #ifdef H5
if (returnIsSafari()) {
this.pageScrollTo(time)
setTimeout(() => {
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item
.courseDetailsId +
'&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
.dyEpisodeId
})
}, 100)
} else {
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId +
'&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
.dyEpisodeId
})
}
// #endif
// #ifndef H5
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId +
'&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
.dyEpisodeId
})
// #endif
},
//获取推荐视频
getrecomVideo(sort) {
@@ -633,14 +707,7 @@
}
});
},
//点击回调
posterSuccess(item) {
uni.navigateTo({
url: '/me/detail/detail?id=' + item.courseId + '&courseDetailsId=' + item.courseDetailsId +
'&tt_album_id=' + item.dyCourseId + '&tt_episode_id=' + item
.dyEpisodeId
})
},
// 获取资源列表
getCourseList() {
let typeId = '';
@@ -1199,7 +1266,8 @@
text-align: justify;
line-height: 1.6;
}
.top-zhanwei{
.top-zhanwei {
/* #ifdef H5 */
padding-top: 32rpx;
/* #endif */