wangguoyu пре 2 месеци
родитељ
комит
1fd09175df
1 измењених фајлова са 43 додато и 13 уклоњено
  1. 43 13
      pages/study/lookShipinNew.vue

+ 43 - 13
pages/study/lookShipinNew.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="ezy-course-page" :style="{backgroundImage: 'url(' + courseBjFun() + ')'}">
 		<view class="icon-title-navBar-box">
-			<view @click="goUpPage" class="nav-bar-icon"></view>
+			<view @click="goBack" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">{{shipinTitle}}</text>
 		</view>
 		<view class="ezy-video-box course-video-box">
@@ -132,7 +132,7 @@
 					toast('数据错误,缓存丢失/ jieId丢失')
 					return false
 				}
-				
+
 				const curZhangId = cacheManager.get('zhangInfo').curZhangId;
 				const resZhangList = cacheManager.get('zhangInfo').zhangList;
 				const index = resZhangList.findIndex(item => item.zhangId == curZhangId)
@@ -158,8 +158,8 @@
 				this.progressMarkers = this.pageData.jiedianList || []
 				this.getLive(); //获取播放凭证
 			},
-			
-	
+
+
 			playEnd(data) {
 				console.log('data', data);
 				console.log('111111');
@@ -198,7 +198,25 @@
 				plus.screen.unlockOrientation();
 				// #endif
 				this.$refs.popupRef.close();
-				this.goUpPage()
+
+
+				if (!cacheManager.get('auth')) {
+					uni.redirectTo({
+						url: '/pages/study/index?levelId=' + this.levelId + '&typeId=' + this.typeId +
+							'&subjectId=' +
+							this.subjectId + '&tipFlag=' + this.tipFlag
+					})
+				} else {
+					uni.redirectTo({
+						url: `/pages/study/index`
+
+					})
+
+				}
+
+
+
+
 			},
 			goNext() {
 				// #ifdef APP-PLUS
@@ -232,7 +250,7 @@
 						})
 					} else if (this.pageData.lastFlag == 1 && this.pageData.type == 1) {
 						// 当前是本章最后一节,并且是 视频 切换下一章
-						this.goUpPage()
+						this.goNextZhang()
 					} else {
 						uni.redirectTo({
 							//url: '/pages/study/lookShipin?studyData=' + JSON.stringify(pageData)
@@ -271,7 +289,7 @@
 					this.seekTime = data.offset
 				});
 			},
-			goUpPage() {
+			goNextZhang() {
 				if (!cacheManager.get('auth')) {
 					uni.redirectTo({
 						url: '/pages/study/index?levelId=' + this.levelId + '&typeId=' + this.typeId +
@@ -279,14 +297,26 @@
 							this.subjectId + '&tipFlag=' + this.tipFlag
 					})
 				} else {
-					uni.redirectTo({
-						url: `/pages/study/index`
+					let zhang = this.cacheZhangInfo.zhangList[this.cacheCurrentZhangIndex]
+					if (zhang.zhangId == this.pageData.nextZhangId) {
+						cacheManager.updateObject('zhangInfo', {
+							curZhangId: zhang.zhangId
+						})
+						// 证明他是这个章最后一个
+						uni.redirectTo({
+							url: `/pages/study/index`
 
-					})
+						})
+					} else {
+						let zhang = this.cacheZhangInfo.zhangList[this.cacheCurrentZhangIndex + 1]
+						cacheManager.updateObject('zhangInfo', {
+							curZhangId: zhang.zhangId
+						})
+						uni.redirectTo({
+							url: '/pages/study/lookShipinNew?jieId=' + zhang.jieList[0].jieId
+						})
+					}
 				}
-
-
-
 			},
 			goPayPage() {
 				let zhangInfoLocal = cacheManager.get('zhangInfo')