zhengkaixin преди 4 години
родител
ревизия
3bbeb81d36
променени са 1 файла, в които са добавени 31 реда и са изтрити 5 реда
  1. 31 5
      pages/route/index.js

+ 31 - 5
pages/route/index.js

@@ -200,6 +200,7 @@ export default {
 			return name.substring(0,1)+'师傅';
 		},
 		getCar(){
+			
 			if(this.stationList.length==0){
 				return;
 			}
@@ -210,6 +211,7 @@ export default {
 			 
 			API.routeShiftList(obj).then((response) => {
 				this.carList=response.data;
+				
 				if(!this.centerBl&&this.carList.length){
 					this.centerBl=this.$refs.amap.setCenter(this.carList[0]);
 					//this.centerBl=true;
@@ -246,31 +248,43 @@ export default {
 						var station =this.stationList[j];
 						 station.currentStationStatus="1";
 					}
+					console.log("this.stationList")
+					
+					console.log(this.stationList)
+						console.log("this.stationList")
 					for(var j in this.stationList){
+						
 						var station =this.stationList[j];
 						// station.currentStationStatus="1";
 						 
 						for(var i in this.carList){
 							var car =this.carList[i];
-					
+							
 						
 						if(car.currentStationId==station.id){
-							
+							console.log(car.licensePlateNumber+"------"+station.name)
 							if(car.currentStationStatus==3){
 								
 								if(eval(j+"+"+1)!=this.stationList.length){
 									console.log(this.stationList[eval(j+"+"+1)].id);
 									car.currentStationId2=this.stationList[eval(j+"+"+1)].id
 									this.stationList[eval(j+"+"+1)].currentStationStatus="2";
+								
+									console.log("--------this.carList----A------"+car.licensePlateNumber)
+									
+									
 								}else{
-									car.currentStationStatus==1
+									car.currentStationStatus=1
 									this.stationList[j].currentStationStatus="1";
+									console.log("--------this.carList----B------"+car.licensePlateNumber)
 									
 								}
 								
 								
 							}else{
 								this.stationList[j].currentStationStatus=car.currentStationStatus;
+								console.log("--------this.carList----c------"+car.licensePlateNumber)
+								
 							}
 							
 							break;
@@ -278,10 +292,14 @@ export default {
 					}
 					
 				}
+				console.log("--------this.carList----------")
 				console.log(this.carList)
+				console.log("--------this.carList----------")
+				
 				this.$refs.amap.setCarList(this.carList);
 				this.vehicleStationDis();
-			}).catch(error => {
+			}).catch(error => {
+				console.log(error);
 				this.$refs.common.showLoading(false,error)
 			})
 		},
@@ -335,7 +353,7 @@ export default {
 			console.log(item)
 			if(item.type=="car"){
 				setTimeout(()=>{
-					this.carShow({id:item.obj.currentStationId})
+					this.carShow3(item.obj)
 				}, 100);
 			}
 			if(item.type=="point"){
@@ -357,6 +375,14 @@ export default {
 				}, 100);
 			}
 			
+		},
+		carShow3(item){
+			
+			var caritem =item;
+		
+			this.caritem=caritem;
+			this.caritemBl=true;
+	
 		},
 		carShow(item){