瀏覽代碼

实时刷新提前

zhengkaixin 4 年之前
父節點
當前提交
bec19eafc9
共有 3 個文件被更改,包括 21 次插入20 次删除
  1. 1 0
      components/Carmap.vue
  2. 19 19
      pages/route/index.js
  3. 1 1
      pages/route/index.vue

+ 1 - 0
components/Carmap.vue

@@ -341,6 +341,7 @@
 						strokeWeight: 3, //线宽
 						strokeWeight: 3, //线宽
 						//strokeStyle: "solid"  //线样式
 						//strokeStyle: "solid"  //线样式
 					});
 					});
+					
 					this.$emit('onload')
 					this.$emit('onload')
 				}, e => {
 				}, e => {
 					//_this.mui.toast('地图加载失败');
 					//_this.mui.toast('地图加载失败');

+ 19 - 19
pages/route/index.js

@@ -204,6 +204,7 @@ export default {
 				routeId:this.id,
 				routeId:this.id,
 				startStationId:this.stationList[0].id,
 				startStationId:this.stationList[0].id,
 			}
 			}
+			 
 			API.routeShiftList(obj).then((response) => {
 			API.routeShiftList(obj).then((response) => {
 				this.carList=response.data;
 				this.carList=response.data;
 				if(!this.centerBl&&this.carList.length){
 				if(!this.centerBl&&this.carList.length){
@@ -337,11 +338,18 @@ export default {
 			var caritem =null;
 			var caritem =null;
 			for(var i in this.carList){
 			for(var i in this.carList){
 				var car= this.carList[i]
 				var car= this.carList[i]
-				
-				if(car.currentStationId==item.id){
-					var caritem=car;
-					break
-				}
+				if(car.currentStationStatus==3){
+					if(car.currentStationId2==item.id){
+						var caritem=car;
+						break
+					}
+				}else{
+					if(car.currentStationId==item.id){
+						var caritem=car;
+						break
+					}
+				}
+				
 				
 				
 			}
 			}
 			this.caritem=caritem;
 			this.caritem=caritem;
@@ -350,7 +358,7 @@ export default {
 			
 			
 		},
 		},
 		reverse(){
 		reverse(){
-			
+			this.centerBl=false;
 			this.stationList.reverse();
 			this.stationList.reverse();
 			this.getCar()
 			this.getCar()
 			 this.passengerShiftRemindList();
 			 this.passengerShiftRemindList();
@@ -452,25 +460,17 @@ export default {
 				this.drawing(point,startend);
 				this.drawing(point,startend);
 				this.$refs.common.showLoading(false)
 				this.$refs.common.showLoading(false)
 				
 				
-				this.getPoint()
+				//this.getPoint()
 				
 				
-				this.$nextTick(function() {
-					const query = uni.createSelectorQuery().in(this);
-					query.select('.map-down').boundingClientRect(data => {
-						if(data){
-							document.getElementById('map-route-main').scrollLeft = data.left-100;
-						}
-						this.$refs.common.showLoading(false);
-						//this.downBtn()
-					}).exec();
-				});
+			
 				
 				
 			}).catch(error => {
 			}).catch(error => {
 				this.$refs.common.showLoading(false,error)
 				this.$refs.common.showLoading(false,error)
 			})
 			})
 		},
 		},
 		mapdown(){
 		mapdown(){
-		
+			this.getPoint();
+			
 				if(this.downid=="null"){
 				if(this.downid=="null"){
 					this.downid="";
 					this.downid="";
 				}else{
 				}else{
@@ -482,7 +482,7 @@ export default {
 			
 			
 		},
 		},
 		getPoint() {
 		getPoint() {
-
+			
 			if (!this.info.init) {
 			if (!this.info.init) {
 				WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
 				WxJsApi.getWxConfig([ 'getLocation','getSetting']).then(() => {
 					// this.$refs.common.showLoading(false)
 					// this.$refs.common.showLoading(false)

+ 1 - 1
pages/route/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view>
 	<view>
-		<car-common    ref="common"  ></car-common>
+		<car-common    ref="common"    ></car-common>
 	 
 	 
 		<u-popup v-model="show1" mode="center" border-radius="20">
 		<u-popup v-model="show1" mode="center" border-radius="20">
 					<view class="sitePopup">
 					<view class="sitePopup">