wangguoyu 1 month ago
parent
commit
821cdcaf60
4 changed files with 15 additions and 5 deletions
  1. 3 0
      App.vue
  2. 3 0
      pages/chanpinXuanze/banben.vue
  3. 6 5
      pages/chanpinneirong/index.vue
  4. 3 0
      pages/login/login.vue

+ 3 - 0
App.vue

@@ -24,6 +24,9 @@
 					if (res.code == 0) {
 					if (res.code == 0) {
 						//学过 增加customType  = 1 是App级别的
 						//学过 增加customType  = 1 是App级别的
 						if (res.data.chanpinId != 0) {
 						if (res.data.chanpinId != 0) {
+							if (cacheManager.get('xuexi-shuxue')) {
+								cacheManager.remove("xuexi-shuxue")
+							}
 							uni.reLaunch({
 							uni.reLaunch({
 								url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.chanpinId}&dengjiId=${res.data.dengjiId}&customType=1`,
 								url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.chanpinId}&dengjiId=${res.data.dengjiId}&customType=1`,
 								success() {
 								success() {

+ 3 - 0
pages/chanpinXuanze/banben.vue

@@ -50,6 +50,9 @@
 	}
 	}
 
 
   function handleSelect(item) {
   function handleSelect(item) {
+	  if (cacheManager.get('xuexi-shuxue')) {
+	  	cacheManager.remove("xuexi-shuxue")
+	  }
     uni.redirectTo({
     uni.redirectTo({
       url: `/pages/chanpinneirong/index?banbenId=${item.id}&danyuanId=1&customType=3&chanpinId=${item.chanpinId}&dengjiId=${item.dengjiId}`
       url: `/pages/chanpinneirong/index?banbenId=${item.id}&danyuanId=1&customType=3&chanpinId=${item.chanpinId}&dengjiId=${item.dengjiId}`
     })
     })

+ 6 - 5
pages/chanpinneirong/index.vue

@@ -113,8 +113,10 @@
 
 
 		onLoad(options) {
 		onLoad(options) {
 			console.log('options', options);
 			console.log('options', options);
-			this.customType = options.customType
-			if (this.customType) {
+
+			if (!cacheManager.get('xuexi-shuxue')) {
+				console.log('没有缓存');
+				this.customType = options.customType
 				this.chanpinId = options.chanpinId
 				this.chanpinId = options.chanpinId
 				this.danyuanId = options.danyuanId
 				this.danyuanId = options.danyuanId
 				this.banbenId = options.banbenId
 				this.banbenId = options.banbenId
@@ -122,14 +124,13 @@
 				this.loadDataFromApi()
 				this.loadDataFromApi()
 			} else {
 			} else {
 				console.log('使用缓存');
 				console.log('使用缓存');
-
 				this.chanpinId = cacheManager.get('auth').chanpinId
 				this.chanpinId = cacheManager.get('auth').chanpinId
 				this.danyuanId = cacheManager.get('auth').danyuanId
 				this.danyuanId = cacheManager.get('auth').danyuanId
 				this.banbenId = cacheManager.get('auth').banbenId
 				this.banbenId = cacheManager.get('auth').banbenId
 				//用于返回
 				//用于返回
 				this.dengjiId = cacheManager.get('auth').dengjiId
 				this.dengjiId = cacheManager.get('auth').dengjiId
-				this.cacheManagerLocal = cacheManager.get('xuexi-shuxue') ||{}
-				// 使用缓存
+				this.cacheManagerLocal = cacheManager.get('xuexi-shuxue') || {}
+				// 使用缓存A@
 				this.danyuanInfo = this.cacheManagerLocal
 				this.danyuanInfo = this.cacheManagerLocal
 				this.curProcess = this.cacheManagerLocal.curProcess
 				this.curProcess = this.cacheManagerLocal.curProcess
 				this.fontDanyuanId = this.cacheManagerLocal.fontDanyuanId
 				this.fontDanyuanId = this.cacheManagerLocal.fontDanyuanId

+ 3 - 0
pages/login/login.vue

@@ -133,6 +133,9 @@
 											url: `/pages/chanpinXuanze/index`
 											url: `/pages/chanpinXuanze/index`
 										})
 										})
 									}else{
 									}else{
+										if (cacheManager.get('xuexi-shuxue')) {
+											cacheManager.remove("xuexi-shuxue")
+										}
 										// 学过直接到学习页面
 										// 学过直接到学习页面
 										uni.redirectTo({
 										uni.redirectTo({
 											url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.chanpinId}&dengjiId=${res.data.dengjiId}&customType=2`,
 											url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.chanpinId}&dengjiId=${res.data.dengjiId}&customType=2`,