课程视频回退页面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

@@ -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({