Browse Source

首页精简

zhengkaixin 2 years ago
parent
commit
759311b9f0
1 changed files with 8 additions and 5 deletions
  1. 8 5
      pages/index/index.vue

+ 8 - 5
pages/index/index.vue

@@ -625,7 +625,7 @@
 					this.getBannerInfoTop("home-top");
 				}
 			
-			this.getBannerInfoTop("home-top");
+			//this.getBannerInfoTop("home-top");
 			
 			this.getPointTimeOut();
 			this.getNewsList();
@@ -1089,27 +1089,30 @@
 				}
 			},
 			getBannerInfoTop(code){
+				var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
+				var time=this.carhelp.get("bannerListTop");
+				if((time&&nowtime==time)){
+					return;
+				}
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
-				var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
 				
 				newsApi.getBannerInfo(code).then((res) => {
 					
 					
 					this.bannerListTop =res.data;
 					
-					var time=this.carhelp.get("bannerListTop");
 					
-					if(this.bannerListTop.length&&!(time&&nowtime==time)){
+					if(this.bannerListTop.length){
 						this.showTop=true;
 						this.showTopImg=this.bannerListTop[0].picUrl;
 						this.showTopIndex=0;
 						this.carhelp.set("bannerListTop",nowtime);
 					}
 					//this.test()
-					if (this.userId) {
+					if (this.userId&&false) {
 						API.readCoupon().then((res2) => {
 							var mod=res2.data.userCoupon;
 							console.log(mod)