张文飞 3 tahun lalu
induk
melakukan
164ece3eee
1 mengubah file dengan 11 tambahan dan 8 penghapusan
  1. 11 8
      pages/homePage/homePage.vue

+ 11 - 8
pages/homePage/homePage.vue

@@ -267,11 +267,11 @@
 				optionType:1,
 				registAmount:null,
 				shareToken:"",
-				isFirst:true,
+				isVisiable:true
 			}
 		},
 		mounted() {
-			this.isFirst = true;
+			this.isFirst = true
 			this.color4 = app.globalData.color4;
 			this.getData();
 			uni.$on("request",()=>{
@@ -283,11 +283,11 @@
 			this.toPage(projectId);
 		},
 		onShow() {
-			if(!this.isFirst){
-				this.getSingle();
-			}else{
-				this.isFirst = false
-			}
+			this.isVisiable = true;
+			this.getSingle();
+		},
+		onHide() {
+			this.isVisiable = false
 		},
 		onPullDownRefresh() {
 			this.getData();
@@ -320,6 +320,7 @@
 				this.getUserInfo();
 				this.getHomePage();
 				this.getRegistTask(); 
+				this.getSingle();
 			},
 			chooiceType(e){
 				this.city = e.city==''?"城市":(e.city).split('市')[0];
@@ -508,7 +509,9 @@
 				});
 				if(res.data.success){
 					let single = res.data.single;
-					this.config(single.shareName,single.shareRemark,location.origin+location.pathname +"?shareToken="+this.shareToken,single.shareLogoImage)
+					if(this.isVisiable){
+						this.config(single.shareName,single.shareRemark,location.origin+location.pathname +"?shareToken="+this.shareToken,single.shareLogoImage)
+					}
 				}
 			}
 		},