浏览代码

调整显示

zhengkaixin 1 年之前
父节点
当前提交
62cece6968
共有 1 个文件被更改,包括 24 次插入35 次删除
  1. 24 35
      pages/index/index.vue

+ 24 - 35
pages/index/index.vue

@@ -867,23 +867,7 @@
 
 		},
 		onReady() {
-			// if (this.carhelp.get("getElderModeClass")) {
-			// 	if(this.carhelp.get("getElderModeClass") == "长辈模式") {
-			// 		this.fontMode = '1';
-			// 	} else {
-			// 		this.fontMode = '0';
-			// 	}
-			// 	API.changeFont({fontMode: this.fontMode}).then((res) => {
-
-			// 	}).catch(error => {
-			// 		uni.showToast({
-			// 			title: error,
-			// 			icon: "none"
-			// 		})
-			// 	})
-			// }
-
-			//this.getUserInfo();
+			 
 
 
 			WxJsApi.getWxConfig(['getLocation', 'addEventListener', 'scanQRCode']).then((res) => {
@@ -913,25 +897,29 @@
 		},
 		onPageScroll(e) {
 			
+			this.onPageScrollMethod()
 			
-			
-			const query = uni.createSelectorQuery().in(this);
-			query.select('#options-item').boundingClientRect(data => {
-				 // console.log("节点离页面顶部的距离为" + data.top);
-				//console.log(this.windowHeight,e.scrollTop ,data.top)
-			  if (this.windowHeight>= data.top+80) {
-			  	this.flag =false;
-			  } else {
-			  	this.flag = true;
-			  }
-			  
-			}).exec();
-			
-			
-			
+		},
+		updated(){
+			this.onPageScrollMethod()
 		},
 		methods: {
-			
+			onPageScrollMethod(){
+				const query = uni.createSelectorQuery().in(this);
+				query.select('#options-item').boundingClientRect(data => {
+					 // console.log("节点离页面顶部的距离为" + data.top);
+					 console.log("onPageScrollMethod" );
+					//console.log(this.windowHeight,e.scrollTop ,data.top)
+					if(data){
+						if (this.windowHeight>= data.top+80) {
+							this.flag =false;
+						} else {
+							this.flag = true;
+						}
+					}
+				
+				}).exec();
+			},
 			getChargingStationDetail(){
 				var defaultStation=process.car.defaultStation
 				for(var item in defaultStation){
@@ -1560,7 +1548,8 @@
 			},
 			getFindChargeData() {
 
-				API.findChargeData().then((res) => {
+				API.findChargeData().then((res) => {
+					//this.onPageScrollMethod()
 					this.chargeList = res.data.chargingRecordList;
 
 					var list = res.data.chargingRecordList;
@@ -1742,7 +1731,7 @@
 				this.loading = false
 				siteApi.searchStationData(data).then((response) => {
 
-					
+					//this.onPageScrollMethod()
 					if (this.pageIndex2 == 1) {
 						this.stationList = response.data.data;