wangguoyu 1 month ago
parent
commit
8ed5faf9ec
4 changed files with 16 additions and 14 deletions
  1. 1 1
      App.vue
  2. 1 1
      pages/chanpinXuanze/banben.vue
  3. 10 8
      pages/chanpinneirong/index.vue
  4. 4 4
      pages/login/login.vue

+ 1 - 1
App.vue

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

+ 1 - 1
pages/chanpinXuanze/banben.vue

@@ -46,7 +46,7 @@
 
   function handleSelect(item) {
     uni.redirectTo({
-      url: `/pages/chanpinneirong/index?banbenId=${item.id}`
+      url: `/pages/chanpinneirong/index?banbenId=${item.id}&danyuanId=1&customType=3&chanpinId=${item.chanpinId}`
     })
   }
 

+ 10 - 8
pages/chanpinneirong/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="ezy-xuexi-page">
 		<view class="icon-title-navBar-box">
-			<!-- <view @click="handleBack" class="nav-bar-icon"></view> -->
+			<view @click="handleBack" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">学习</text>
 		</view>
 		<view class="ezy-page-body xuexi-page-body">
@@ -82,11 +82,11 @@
 				danyuanInfo: {},
 				banbenId: '',
 				danyuanId: '',
-				typeId: '',
+				chanpinId: '',
 				fontDanyuanId: '',
 				nextDanyuanId: '',
 				customType: '',
-				cacheManagerLocal:null
+				cacheManagerLocal: null
 
 
 
@@ -108,13 +108,13 @@
 			console.log('options', options);
 			this.customType = options.customType
 			if (this.customType) {
-				this.typeId = options.typeId
+				this.chanpinId = options.chanpinId
 				this.danyuanId = options.danyuanId
 				this.banbenId = options.banbenId
 				this.loadDataFromApi()
 			} else {
-				this.typeId  = cacheManager.get('auth').typeId
-				this.cacheManagerLocal =  cacheManager.get('xuexi-'+this.typeId)
+				this.chanpinId = cacheManager.get('auth').chanpinId
+				this.cacheManagerLocal = cacheManager.get('xuexi-' + this.chanpinId)
 				// 使用缓存
 				this.danyuanInfo = this.cacheManagerLocal.data
 				this.fontDanyuanId = this.cacheManagerLocal.data.fontDanyuanId
@@ -125,7 +125,9 @@
 
 		methods: {
 
+			handleBack() {
 
+			},
 			loadDataFromApi() {
 				const req = {
 					banbenId: this.banbenId,
@@ -136,9 +138,9 @@
 					this.fontDanyuanId = res.data.fontDanyuanId
 					this.nextDanyuanId = res.data.nextDanyuanId
 					this.dagangList = res.data.dagangList || []
-					cacheManager.set('xuexi-' + this.typeId, res.data)
+					cacheManager.set('xuexi-' + this.chanpinId, res.data)
 					cacheManager.updateObject('auth', {
-						typeId: this.typeId,
+						chanpinId: this.chanpinId,
 						banbenId: this.banbenId,
 						danyuanId: this.danyuanId
 

+ 4 - 4
pages/login/login.vue

@@ -58,7 +58,7 @@
 					captchaId: "9d5837b0807b8de44da0de310a0b2813",
 				},
 				banbenId: '',
-				typeId: '',
+				chanpinId: '',
 				danyuanId:''
 
 			}
@@ -126,9 +126,9 @@
 								if (res.code == 0) {
 									debugger
 									this.banbenId = res.data.banbenId
-									this.typeId = res.data.typeId
+									this.chanpinId = res.data.typeId
 									this.danyuanId = res.data.danyuanId
-									if(this.typeId ==0){
+									if(this.chanpinId ==0){
 										// 没学过
 										uni.redirectTo({
 											url: `/pages/chanpinXuanze/index`
@@ -136,7 +136,7 @@
 									}else{
 										// 学过直接到学习页面
 										uni.redirectTo({
-											url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&typeId=${res.data.typeId}&customType=2`,
+											url: `/pages/chanpinneirong/index?banbenId=${res.data.banbenId}&danyuanId=${res.data.danyuanId}&chanpinId=${res.data.typeId}&customType=2`,
 										})
 									}
 								}