Browse Source

bug修改

twt 1 year ago
parent
commit
104780b75e
3 changed files with 20 additions and 5 deletions
  1. 1 0
      pages/index/index.vue
  2. 18 4
      pages/shop/shop.vue
  3. 1 1
      utils/common.js

+ 1 - 0
pages/index/index.vue

@@ -983,6 +983,7 @@
 			 },
 			 queryHomeCardList(){
 				 //console.log(this.wxOpenData)
+				 var that=this;
 				 uni.showLoading({
 				 	title: '加载中'
 				 })

+ 18 - 4
pages/shop/shop.vue

@@ -155,10 +155,10 @@
 		onLoad(opt) {	
 			console.log(getApp().globalData.shopcategoryID)
 			//this.userInfo = uni.getStorageSync("userInfo");
-			this.shopcategoryID=getApp().globalData.shopcategoryID;
+			/* this.shopcategoryID=getApp().globalData.shopcategoryID;
 			if(this.shopcategoryID){
 				this.categoryID=this.shopcategoryID
-			}
+			} */
 			this.userInfo=this.$store.state.userInfo;
 			this.wxOpenData=this.$store.state.wxOpenData;
 			this.themeColor = uni.getStorageSync("themeColor");
@@ -211,7 +211,13 @@
 						  this.topIndex=index	
 						}
 					})
-					this.categoryID=shopcategoryID;
+					console.log("this.categoryID"+this.categoryID)
+					if(this.topIndex){
+						this.categoryID=shopcategoryID;
+					}else{
+						this.categoryID=''
+					}
+					
 					this.list=[];
 					this.page=1;
 					this.getlistOpenGoodsPage()
@@ -342,6 +348,7 @@
 				 img.onerror = null; //防止闪图 */
 			 },
 			topClick(index,item){
+				//console.log(item)
 				this.topIndex=index;
 				this.list=[];
 				this.page=1;
@@ -375,7 +382,8 @@
 							name:'全部'
 						}
 						this.categoryList.unshift(obj);
-						if(this.shopcategoryID){
+						var shopcategoryID  = uni.getStorageSync("shopcategoryID")
+						if(shopcategoryID){
 							//console.log(this.shopcategoryID)
 							this.categoryList.forEach((item,index)=>{
 								//console.log(item.id)
@@ -383,12 +391,18 @@
 								  this.topIndex=index	
 								}
 							})
+							if(this.topIndex){
+								this.categoryID=shopcategoryID;
+							}else{
+								this.categoryID=''
+							}
 						}
 				 })
 			},
 			
 			getlistOpenGoodsPage(){
 				uni.showLoading({ title: '加载中'});
+				console.log(this.categoryID)
 				var that=this;
 				this.$http('openMall/listOpenGoodsPage', {
 				   page:this.page,

+ 1 - 1
utils/common.js

@@ -73,7 +73,7 @@ function noMultipleClicks(methods, info) {
 function getExtStoreId(type){
 	try{
 		var extConfig = uni.getExtConfigSync ? uni.getExtConfigSync() : {shopId:'默认的门店id'};
-		/* extConfig={
+		 /* extConfig={
 		  	"shopId": "1F12DB68-D8E8-4B76-9E20-287ACB72889F",
 		  	"url":"https://apidms.66km.com",
 		  	"unionId":"EF7981B9-2D1D-4006-9C0A-66CE7177134D",