zhengkaixin 4 سال پیش
والد
کامیت
9955dc0a16
3فایلهای تغییر یافته به همراه38 افزوده شده و 17 حذف شده
  1. 9 5
      pages/buytickets/selectSite.js
  2. 17 3
      pages/buytickets/selectSite.vue
  3. 12 9
      pages/route/index.js

+ 9 - 5
pages/buytickets/selectSite.js

@@ -253,7 +253,7 @@ export default {
 						const query = uni.createSelectorQuery().in(this);
 						query.select('.map-down').boundingClientRect(data => {
 							if(data){
-								document.getElementById('map-route-main').scrollLeft = data.left-20;
+								document.getElementById('map-route-main').scrollLeft = data.left-100;
 							}
 							this.$refs.common.showLoading(false);
 							//this.downBtn()
@@ -273,7 +273,8 @@ export default {
 				
 				//this.car.currentStationId=this.stationList[this.k].id
 				//this.car.currentStationStatus="2"
-				
+				//this.car.currentStationId=this.stationList[2].id
+				//this.car.currentStationStatus="2";
 				
 				this.$refs.amap.setCar(this.car);
 				var bl = false;
@@ -292,7 +293,10 @@ export default {
 					
 					if (stat.id == this.car.currentStationId) {
 						if(this.car.currentStationStatus=="3"){
-							this.car.currentStationId2=this.stationList[eval(i+"+"+1)].id;
+							if(eval(i+"+"+1)!=this.stationList.length){
+								this.car.currentStationId2=this.stationList[eval(i+"+"+1)].id;
+								
+							}
 						}
 						bl = true;
 						if(i==this.stationList.length-1){
@@ -310,7 +314,7 @@ export default {
 						const query = uni.createSelectorQuery().in(this);
 						query.select('#map-now').boundingClientRect(data => {
 							if(data){
-								document.getElementById('map-route-main').scrollLeft = data.left-20;
+								document.getElementById('map-route-main').scrollLeft = data.left-100;
 							}
 							this.$refs.common.showLoading(false);
 						}).exec();
@@ -379,7 +383,7 @@ export default {
 				const query = uni.createSelectorQuery().in(this);
 				query.select('#map-now').boundingClientRect(data => {
 					if(data){
-						document.getElementById('map-route-main').scrollLeft = data.left-20;
+						document.getElementById('map-route-main').scrollLeft = data.left-100;
 					}
 					this.$refs.common.showLoading(false);
 				}).exec();

+ 17 - 3
pages/buytickets/selectSite.vue

@@ -58,7 +58,8 @@
 		 <view class="map-route-main"  id="map-route-main">
 			<template v-for="item,i in stationList">
 				<view :id="item.status==1?'map-now':''" class="scroll-view-item "
-				 :class="{'map-route-origin':i==0,'map-route-item':i!=0,'map-after':item.status==0&&!(item.id == car.currentStationId&&car.currentStationStatus=='2'),
+				 :class="{'map-route-origin':i==0,'map-route-item':i!=0,'map-after':item.status==0&&!(item.id == car.currentStationId&&car.currentStationStatus=='2'),
+				 'map-after ':(item.id == car.currentStationId&&car.currentStationStatus=='1'),
 					'map-now':(item.id == car.currentStationId2&&car.currentStationStatus=='3')||(item.id == car.currentStationId&&car.currentStationStatus=='2'),
 					'map-geton':upid==item.id||downId==item.id||(item.id == car.currentStationId&&i==0)}">
 					
@@ -73,7 +74,7 @@
 					<view class="map-route-circle"  @click="downBtn(item)">{{upid==item.id?'上':''}}{{downId==item.id?'下':''}}</view>
 					<view class="map-route-line"  @click="downBtn(item)"></view>
 					<view class="map-route-name"  @click="downBtn(item)">
-						{{item.stationName}}
+						{{item.stationName}}  
 					</view>
 				</view>
 
@@ -452,6 +453,19 @@
 				text-align: center;
 				line-height: 90rpx;
 			}
-		}
+		}
+		.navbar-right {
+				display: flex;
+				margin-right: 20rpx;
+				span{
+					color:rgb(96, 98, 102);
+					margin-left: 3px;
+				}
+			}
+			.slot-wrap {
+					display: flex;
+					align-items: center;
+					flex: 1;
+				}
 </style>
 

+ 12 - 9
pages/route/index.js

@@ -215,7 +215,7 @@ export default {
 							const query = uni.createSelectorQuery().in(this);
 							query.select('.map-route-car').boundingClientRect(data => {
 								if(data){
-									document.getElementById('map-route-main').scrollLeft = data.left-20;
+									document.getElementById('map-route-main').scrollLeft = data.left-100;
 								}
 								
 								//this.downBtn()
@@ -225,17 +225,20 @@ export default {
 				}
 				for(var i in this.carList){
 					var car =this.carList[i];
-					
-					//car.currentStationStatus="3";
+					//car.currentStationId=this.stationList[this.stationList.length-1].id
+					//car.currentStationStatus="1";
 					for(var j in this.stationList){
 						var station =this.stationList[j];
 						
 						if(car.currentStationId==station.id){
 							if(car.currentStationStatus==3){
-								console.log(this.stationList[eval(j+"+"+1)].id);
-								car.currentStationId2=this.stationList[eval(j+"+"+1)].id
 								
-								this.stationList[eval(j+"+"+1)].currentStationStatus="2";
+								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";
+								}
+								
 								
 							}else{
 								this.stationList[j].currentStationStatus=car.currentStationStatus;
@@ -315,7 +318,7 @@ export default {
 						const query = uni.createSelectorQuery().in(this);
 						query.select('.map-down').boundingClientRect(data => {
 							if(data){
-								document.getElementById('map-route-main').scrollLeft = data.left-20;
+								document.getElementById('map-route-main').scrollLeft = data.left-100;
 							}
 							this.$refs.common.showLoading(false);
 							//this.downBtn()
@@ -354,7 +357,7 @@ export default {
 				const query = uni.createSelectorQuery().in(this);
 				query.select('.map-down').boundingClientRect(data => {
 					if(data){
-						document.getElementById('map-route-main').scrollLeft = data.left-20;
+						document.getElementById('map-route-main').scrollLeft = data.left-100;
 					}
 					this.$refs.common.showLoading(false);
 					//this.downBtn()
@@ -451,7 +454,7 @@ export default {
 					const query = uni.createSelectorQuery().in(this);
 					query.select('.map-down').boundingClientRect(data => {
 						if(data){
-							document.getElementById('map-route-main').scrollLeft = data.left-20;
+							document.getElementById('map-route-main').scrollLeft = data.left-100;
 						}
 						this.$refs.common.showLoading(false);
 						//this.downBtn()