课程视频回退页面tab被重置的问题

This commit is contained in:
liuyuan
2025-04-29 10:24:00 +08:00
parent 861d047eb5
commit 19dcd82a63
12 changed files with 302 additions and 263 deletions

View File

@@ -334,7 +334,7 @@
},
})
.then(async (res) => {
console.log('获取播放凭证666', res.video);
console.log('获取播放凭证666',res.video.m3u8Url);
this.reaquestFlag = false
if (this.$platform == 'ios') {
if (res.video.type == 1 && res.video.m3u8Url == null || res.video

View File

@@ -4,13 +4,13 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<template v-show="!screenLoading">
<z-nav-bar bgColor="#333" fontColor="#fff" title="教学内容"></z-nav-bar>
<z-nav-bar title="教学内容"></z-nav-bar>
<!-- <view class="contentBox curriculum_box" :style="`height:calc(100% - ${60 + statusBarHeight}px !important; -->
<view class="contentBox curriculum_box" :style="`height:calc(100% - ${60 + statusBarHeight}px !important; width:100%; overflow-x: hidden; ${
isFullScreen ? 'background:#000' : ''
}`">
<!-- 加密视频 -->
<view style="background:#000; position: fixed; top: 120rpx; left: 0; width: 100%; z-index: 88;">
<view style="background:#000; position: fixed; top: 120rpx; left: 0; width: 100%; z-index: 88;" v-if="videoArray.length>0">
<common-video @changeScreen="changeScreen" @changeScreenLoading="changeScreenLoading"
@hideNextVideo="hideNextVideo" @startNextVideoCountDown="startNextVideoCountDown"
@unlockChangeVideo="unlockChangeVideo" v-if="isfresh " ref="commonVideo"
@@ -20,9 +20,9 @@
<view style="height: 200px" v-else></view>
</view>
<!-- <scroll-view :style="`height:calc(100% - 200px - 40rpx) ;`" scroll-y="true" class="scroll-Y" style="background-color: #fff"> -->
<view class="PM_font" style="padding: 20rpx; font-size: 40rpx; color: #2979ff; margin-top: 400rpx;">视频教学
<view class="PM_font" style="padding: 20rpx; font-size: 40rpx; color: #2979ff;" :style="videoArray.length>0?'margin-top: 400rpx;':''" v-if="videoArray.length>0">视频教学
</view>
<view class="scroll-view-item">
<view class="scroll-view-item" :style="videoArray.length==0?'margin-top: 20rpx;':''">
<view style="padding: 20rpx; font-size: 26rpx">
课程{{ options.navTitle }}
</view>
@@ -246,11 +246,7 @@
praise: "",
reward: "",
commentLst: [],
correlationiList: [
// { name: "点赞", type: 'dianzan', icon: "thumb-up-fill", iconType: 'uview', iconSize: 22, color: '$themeColor' },
//{ name: "打赏", type: 'dashang', icon: "red-packet-fill", iconType: 'uview', iconSize: 22, color: '#ff3d00' },
//{ name: "评论", type: 'pinglun', icon: "chat-fill", iconType: 'uview', iconSize: 22 },
],
correlationiList: [],
options: {},
videoArrayHW: [],
videoArray: [],
@@ -346,9 +342,8 @@
},
onHide() {
// this.hideNextVideo()
// this.showSearchList = false
// this.searchList = []
console.log('回去了 .....................');
},
onPullDownRefresh() {
uni.stopPullDownRefresh();
@@ -814,7 +809,11 @@
.then(async (res) => {
that.curriculumData = res.data.detail;
that.videoArray = res.data.videos;
console.log("that.videoArray at line 这是关联的视频519:", res);
//判断没有视频的情况
if(that.videoArray.length==0){
}
console.log("that.videoArray at line 这是关联的视频519---------------:", that.videoArray.length);
var isHaveHistorySeekVideo = that.videoArray.findIndex(
(e) => e.id == res.data.current
);

View File

@@ -616,16 +616,19 @@
};
},
//第一次加载
onLoad(e) {
async onLoad(e) {
this.courseId = e.id;
// 隐藏原生的tabbar
uni.hideTabBar();
this.windowWidth = uni.getSystemInfoSync().windowWidth;
this.getUserInfo();
await this.getUserInfo();
this.courseId = e.id;
await this.getData(this.courseId);
//是否是vip
this.getCourseByVip();
this.getSayList();
await this.getCourseByVip();
await this.getSayList();
await this.setCatalogueId();
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
@@ -643,12 +646,16 @@
// 隐藏原生的tabbar
uni.hideTabBar();
this.canJoinTestTime = false
await this.getData(this.courseId);
// #ifdef APP-PLUS
plus.screen.unlockOrientation();
plus.screen.lockOrientation("portrait-primary");
// #endif
await this.request()
this.$nextTick(()=>{
this.getData(this.courseId);
})
},
onUnload() {
this.selectGoodsData = {};
@@ -1059,7 +1066,6 @@
});
}else{
if(v.isAudition == 1||this.librayList[this.curIndex].isBuy == 1){
console.log(11111111)
uni.navigateTo({
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
});
@@ -1754,11 +1760,11 @@
_list = _list.map(item => item.id)
this.curIndex = _list.findIndex((element) => element == this.catalogueId)
} else {
this.catalogueId = this.librayList[0].id;
this.curId = this.librayList[0].id;
this.curIndex = 0
// this.catalogueId = this.librayList[0].id;
// this.curId = this.librayList[0].id;
// this.curIndex = 0
}
this.clicklib(this.librayList[0], 0)
// this.clicklib(this.librayList[0], 0)
if (
res.data.shopProductList &&
res.data.shopProductList.length > 0
@@ -1776,6 +1782,13 @@
uni.hideLoading()
});
},
//设置catalogueId
async setCatalogueId(){
this.catalogueId = this.librayList[0].id;
this.curId = this.librayList[0].id;
this.curIndex = 0
await this.clicklib(this.librayList[0], 0)
},
goBuy() {
$http
.request({

View File

@@ -593,7 +593,6 @@ export default {
showCountDown: false,
classId: undefined,
//下标
currentIndex: 0,
currentIndex: null,
fixed: null,
//vip活动
@@ -619,7 +618,6 @@ export default {
async onShow() {
//存储的需要固定分类
this.fixed = uni.getStorageSync("fixed");
//固定分类
if (this.fixed) {
this.curseClick(this.currentItem, this.currentIndex);