wangguoyu 1 month ago
parent
commit
c86afb51c8
1 changed files with 42 additions and 21 deletions
  1. 42 21
      pages/chanpinneirong/index.vue

+ 42 - 21
pages/chanpinneirong/index.vue

@@ -105,6 +105,27 @@
 		},
 		onShow() {
 			console.log('学习页面显示,尝试恢复滚动位置')
+			this.chanpinId = cacheManager.get('auth').chanpinId
+			this.danyuanId = cacheManager.get('auth').danyuanId
+			this.banbenId = cacheManager.get('auth').banbenId
+			//用于返回
+			this.dengjiId = cacheManager.get('auth').dengjiId
+			this.cacheManagerLocal = cacheManager.get('xuexi-shuxue') || {}
+			// 使用缓存A@
+			this.danyuanInfo = this.cacheManagerLocal
+			this.curProcess = this.cacheManagerLocal.curProcess
+			this.fontDanyuanId = this.cacheManagerLocal.fontDanyuanId
+			this.nextDanyuanId = this.cacheManagerLocal.nextDanyuanId
+			this.dagangList = this.cacheManagerLocal.dagangList || []
+			const result = this.jisuanWanchengStatus(this.dagangList);
+			if (result.allCompleted) {
+				console.log('全部完成');
+			} else {
+				this.danyuanInfo.curJieId = result.firstUncompleted.jieId
+				console.log('未完成项目:', result.firstUncompleted);
+				console.log('未完成项目jieId:', result.firstUncompleted.jieId);
+			}
+			
 		},
 		onHide() {
 
@@ -123,27 +144,27 @@
 				this.dengjiId = options.dengjiId
 				this.loadDataFromApi()
 			} else {
-				console.log('使用缓存');
-				this.chanpinId = cacheManager.get('auth').chanpinId
-				this.danyuanId = cacheManager.get('auth').danyuanId
-				this.banbenId = cacheManager.get('auth').banbenId
-				//用于返回
-				this.dengjiId = cacheManager.get('auth').dengjiId
-				this.cacheManagerLocal = cacheManager.get('xuexi-shuxue') || {}
-				// 使用缓存A@
-				this.danyuanInfo = this.cacheManagerLocal
-				this.curProcess = this.cacheManagerLocal.curProcess
-				this.fontDanyuanId = this.cacheManagerLocal.fontDanyuanId
-				this.nextDanyuanId = this.cacheManagerLocal.nextDanyuanId
-				this.dagangList = this.cacheManagerLocal.dagangList || []
-				const result = this.jisuanWanchengStatus(this.dagangList);
-				if (result.allCompleted) {
-					console.log('全部完成');
-				} else {
-					this.danyuanInfo.curJieId = result.firstUncompleted.jieId
-					console.log('未完成项目:', result.firstUncompleted);
-					console.log('未完成项目jieId:', result.firstUncompleted.jieId);
-				}
+				console.log('使用缓存onLoad');
+				// this.chanpinId = cacheManager.get('auth').chanpinId
+				// this.danyuanId = cacheManager.get('auth').danyuanId
+				// this.banbenId = cacheManager.get('auth').banbenId
+				// //用于返回
+				// this.dengjiId = cacheManager.get('auth').dengjiId
+				// this.cacheManagerLocal = cacheManager.get('xuexi-shuxue') || {}
+				// // 使用缓存A@
+				// this.danyuanInfo = this.cacheManagerLocal
+				// this.curProcess = this.cacheManagerLocal.curProcess
+				// this.fontDanyuanId = this.cacheManagerLocal.fontDanyuanId
+				// this.nextDanyuanId = this.cacheManagerLocal.nextDanyuanId
+				// this.dagangList = this.cacheManagerLocal.dagangList || []
+				// const result = this.jisuanWanchengStatus(this.dagangList);
+				// if (result.allCompleted) {
+				// 	console.log('全部完成');
+				// } else {
+				// 	this.danyuanInfo.curJieId = result.firstUncompleted.jieId
+				// 	console.log('未完成项目:', result.firstUncompleted);
+				// 	console.log('未完成项目jieId:', result.firstUncompleted.jieId);
+				// }