Browse Source

手环报错修改

zhaomiao 4 năm trước cách đây
mục cha
commit
6b7b8a8aac
1 tập tin đã thay đổi với 106 bổ sung48 xóa
  1. 106 48
      pages/forecast/Forecast.vue

+ 106 - 48
pages/forecast/Forecast.vue

@@ -23,7 +23,7 @@
 		<!-- 地图组件 -->
 		
 				<div>
-					<drawer ref="drawer" @tap="closeDrawer"></drawer>
+					<drawer ref="drawer" @tap="closeDrawer" ></drawer>
 				</div>
 				<div class="plusDrawer" @tap="hideModal">
 					<plusDrawer ref="plusDrawer"></plusDrawer>
@@ -74,7 +74,7 @@
 		<view class="Personal_information_W">
 				<view class="name">姓名:李占国</view>
 
-				<view class="history"  @click="mapDate"> <span class="navigation"></span> </view>
+				<view class="history"  @click="mapDate;mapdelete();"> <span  class="navigation"></span> </view>
 
 				<view class="skills">技能:电力类,机械类</view>
 		</view>
@@ -406,57 +406,113 @@ export default {
 		monitoringAuthority: function() {
 			this.drawerList=uni.getStorageSync('leftlist3');
 		},
+		mapdelete(){
+			//#ifdef H5
+			
+			   if(this.bool){
+			   	
+			   	this.$delete(this.polyline[0],'points');
+			   	this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
+			   	this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
+			   	
+			   	this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
+			   	this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
+			   	this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
+			   	this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
+			   	for(let val of this.polyline){
+			   	
+			   		this.$set(val,'points',this.points);					
+			   		this.bool = false;
+			   		console.log("true");
+			   	
+			   }
+			   	/* 定义地图经纬度中心 */
+			   	 var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
+			   	 var lng=  parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
+			   	 
+			   	 this.latitude = lat/2;
+			   	 this.longitude = lng/2;
+			   }else{
+			   	/* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
+			   	this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
+			   	
+			   	this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
+			   	this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
+			   	this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
+			   	this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
+			   	 */
+			   	
+			   		/* this.$replace(this.polyline[0],'points'); */
+			   		
+			   	  /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
+			   	   this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
+			   	   
+			   		console.log("false");
+			   		/* 还原定位中心位置 */
+			   		this.latitude = this.mapBegin_2;
+			   		this.longitude = this.mapBegin_1;	
+			   			
+			   		this.bool = true;
+			   }
+			   this.$forceUpdate();
+			
+			//#endif
+			
+			//#ifdef APP-PLUS
+			  if(this.bool){
+			  	
+			  	this.$delete(this.polyline[0],'points');
+			  	this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
+			  	this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
+			  	
+			  	this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
+			  	this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
+			  	this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
+			  	this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
+			  	for(let val of this.polyline){
+			  	
+			  		this.$set(val,'points',this.points);					
+			  		this.bool = false;
+			  		console.log("true");
+			  	
+			  }
+			  	/* 定义地图经纬度中心 */
+			  	 var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
+			  	 var lng=  parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
+			  	 
+			  	 this.latitude = lat/2;
+			  	 this.longitude = lng/2;
+			  }else{
+			  	/* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
+			  	this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
+			  	
+			  	this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
+			  	this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
+			  	this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
+			  	this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
+			  	 */
+			  	
+			  		this.$delete(this.polyline[0],'points');
+			  		
+			  	  /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
+			  	   this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
+			  	   
+			  		console.log("false");
+			  		/* 还原定位中心位置 */
+			  		this.latitude = this.mapBegin_2;
+			  		this.longitude = this.mapBegin_1;	
+			  			
+			  		this.bool = true;
+			  }
+			  this.$forceUpdate();
+			//#endif
+		},
 		mapDate(){
 			
 		
 			
 			
-				if(this.bool){
-					
-					this.$delete(this.polyline[0],'points');
-					this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
-					this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
-					
-					this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
-					this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
-					this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
-					this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
-					for(let val of this.polyline){
-					
-						this.$set(val,'points',this.points);					
-						this.bool = false;
-						console.log("true");
-					
-				}
-					/* 定义地图经纬度中心 */
-					 var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
-					 var lng=  parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
-					 
-					 this.latitude = lat/2;
-					 this.longitude = lng/2;
-				}else{
-					/* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
-					this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
-					
-					this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
-					this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
-					this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
-					this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
-					 */
-					
-						this.$delete(this.polyline[0],'points');
-						
-					  /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
-					   this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
-					   
-						console.log("false");
-						/* 还原定位中心位置 */
-						this.latitude = this.mapBegin_2;
-						this.longitude = this.mapBegin_1;	
-							
-						this.bool = true;
-				}
-				this.$forceUpdate();
+				
 			},
 		openDrawer: function() {
 			this.kg=false;
@@ -465,7 +521,9 @@ export default {
 		closeDrawer: function() {
 			
 			this.drawerIsShow = false;
+			
 		},
+		
 		pushWindPowerStationNameToSessionStorage(windpowerstationName) {
 			uni.setStorageSync('windpowerstationName', windpowerstationName);
 			//sessionStorage.setItem('windpowerstationName', windpowerstationName);