wangguoyu 1 month ago
parent
commit
3f851eeb9c
3 changed files with 19 additions and 9 deletions
  1. 2 2
      App.vue
  2. 16 6
      pages/chanpinneirong/index.vue
  3. 1 1
      pages/login/login.vue

+ 2 - 2
App.vue

@@ -23,9 +23,9 @@
 				banbenImpinfo({}).then(res => {
 					if (res.code == 0) {
 						//学过 增加customType  = 1 是App级别的
-						if (res.data.typeId != 0) {
+						if (res.data.chanpinTypeId != 0) {
 							uni.reLaunch({
-								url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.typeId}&customType=1`,
+								url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.chanpinId}&chanpinTypeId=${res.data.chanpinTypeId}&dengjiId=${res.data.dengjiId}&customType=1`,
 								success() {
 									plus.navigator.closeSplashscreen();
 								}

+ 16 - 6
pages/chanpinneirong/index.vue

@@ -83,9 +83,11 @@
 				danyuanInfo: {},
 				banbenId: '',
 				danyuanId: '',
+				chanpinTypeId: '',
 				chanpinId: '',
 				fontDanyuanId: '',
 				nextDanyuanId: '',
+				dengjiId: '',
 				customType: '',
 				cacheManagerLocal: null
 
@@ -113,6 +115,8 @@
 				this.chanpinId = options.chanpinId
 				this.danyuanId = options.danyuanId
 				this.banbenId = options.banbenId
+				this.dengjiId = options.dengjiId
+				this.chanpinTypeId = options.chanpinTypeId
 				this.loadDataFromApi()
 			} else {
 				console.log('使用缓存');
@@ -120,6 +124,9 @@
 				this.chanpinId = cacheManager.get('auth').chanpinId
 				this.danyuanId = cacheManager.get('auth').danyuanId
 				this.banbenId = cacheManager.get('auth').banbenId
+				this.chanpinTypeId = cacheManager.get('auth').chanpinTypeId
+				//用于返回
+				this.dengjiId = cacheManager.get('auth').dengjiId
 				this.cacheManagerLocal = cacheManager.get('xuexi-' + this.chanpinId)
 				// 使用缓存
 				this.danyuanInfo = this.cacheManagerLocal
@@ -137,7 +144,9 @@
 				this.$refs.dyMlRef.showPopup(this.banbenId)
 			},
 			handleBack() {
-
+				uni.navigateTo({
+					url: `/pages/chanpinXuanze/banben?dengjiId=`+this.dengjiId
+				})
 			},
 			loadDataFromApi() {
 				const req = {
@@ -152,9 +161,10 @@
 					cacheManager.set('xuexi-' + this.chanpinId, res.data)
 					cacheManager.updateObject('auth', {
 						chanpinId: this.chanpinId,
+						chanpinTypeId: this.chanpinTypeId,
 						banbenId: this.banbenId,
-						danyuanId: this.danyuanId
-
+						danyuanId: this.danyuanId,
+						dengjiId: this.dengjiId
 					})
 					// 初始化当前单元
 					// if (this.danyuanList.length > 0) {
@@ -183,14 +193,14 @@
 				console.log('da', da)
 				let jieId = null;
 				if (code == 'jixu') {
-					
+
 					// 判断学习状态
 					/* if (已学完) {
 						
 						return;
 					} */
-					
-					
+
+
 					jieId = da.curJieId;
 					uni.navigateTo({
 						url: `/pages/xinshuxue/lookShipin?jieId=${jieId}`

+ 1 - 1
pages/login/login.vue

@@ -136,7 +136,7 @@
 									}else{
 										// 学过直接到学习页面
 										uni.redirectTo({
-											url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.typeId}&customType=2`,
+											url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.chanpinId}&chanpinTypeId=${res.data.chanpinTypeId}&dengjiId=${res.data.dengjiId}&customType=2`,
 										})
 									}
 								}