|
@@ -68,18 +68,20 @@
|
|
|
<text class="iconfont park-font"></text></view>
|
|
|
|
|
|
</view>
|
|
|
- <template v-if="stationDetail&&stationDetail.stationAddressList&&stationDetail.stationAddressList.length" >
|
|
|
+ <template v-if="stationDetail&&stationAddressList&&stationAddressList.length" >
|
|
|
|
|
|
|
|
|
- <view class=" stationAddressListClass " v-for="(item ,i) in stationDetail.stationAddressList" :key="i" >
|
|
|
+ <view class=" stationAddressListClass " v-for="(item ,i) in stationAddressList" :key="i" >
|
|
|
<view class="stationAddressListClassAddress">
|
|
|
<span class="areaTitleClass">{{item.areaTitle}}</span>
|
|
|
<span >{{item.address}}</span>
|
|
|
</view>
|
|
|
- <view @click="map(item)" class="stationAddressListClassDistance" >
|
|
|
+ <view @click="map(item)" class="stationAddressListClassDistance" v-if="item.distance" >
|
|
|
{{item.distance!=null&&item.distance>0.1 ? item.distance.toFixed(1)+'公里':'小于100米'}}
|
|
|
<text class="iconfont park-font"></text>
|
|
|
</view>
|
|
|
+ <view @click="map(item)" class="stationAddressListClassDistance" v-else>
|
|
|
+ 导航<text class="iconfont park-font"></text></view>
|
|
|
|
|
|
</view>
|
|
|
</template >
|
|
@@ -501,6 +503,7 @@
|
|
|
longitude: 112.28468,
|
|
|
latitude: 30.307094,*/
|
|
|
},
|
|
|
+ stationAddressList:[],
|
|
|
station: {},
|
|
|
stationDetail: {
|
|
|
|
|
@@ -642,7 +645,7 @@
|
|
|
if(!it2.enableShare||it2.enableShare&&!it2.enableShareWithinTime){
|
|
|
i=-1
|
|
|
}
|
|
|
- console.log(it1,i)
|
|
|
+ //console.log(it1,i)
|
|
|
return i
|
|
|
})
|
|
|
|
|
@@ -680,6 +683,7 @@
|
|
|
distance=this.stationDetail.station.distance
|
|
|
//防止重新获取定位
|
|
|
}
|
|
|
+
|
|
|
api.getChargingStationDetail(data).then(function(res) {
|
|
|
uni.hideLoading()
|
|
|
|
|
@@ -688,6 +692,10 @@
|
|
|
let data = res.data;
|
|
|
|
|
|
_self.stationDetail = data;
|
|
|
+
|
|
|
+ if(_self.stationAddressList.length==0){
|
|
|
+ _self.stationAddressList=_self.stationDetail.stationAddressList
|
|
|
+ }
|
|
|
|
|
|
if(_self.stationDetail.station.parkingDescription != null&&_self.stationDetail.station.parkingSimpleDescription!= null) {
|
|
|
var tagList = _self.stationDetail.station.tagList;
|
|
@@ -822,16 +830,23 @@
|
|
|
}
|
|
|
var list=_self.stationDetail.stationAddressList;
|
|
|
MapLoader().then(AMap1 => {
|
|
|
+
|
|
|
for(var i in list){
|
|
|
var endLngLat=list[i]
|
|
|
var lnglat = new AMap.LngLat(startLngLat.longitude, startLngLat.latitude);
|
|
|
var myDistance = lnglat.distance([endLngLat.longitude, endLngLat.latitude]);
|
|
|
+
|
|
|
endLngLat.distance = myDistance / 1000;
|
|
|
endLngLat.time = myDistance / 500;
|
|
|
}
|
|
|
+ _self.stationAddressList=list;
|
|
|
+ _self.$forceUpdate()
|
|
|
+ console.log("11111111111111")
|
|
|
+ console.log(_self.stationDetail.stationAddressList)
|
|
|
+
|
|
|
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
calculateDistance(startLngLat, endLngLat) {
|
|
|
var _this = this;
|
|
@@ -1005,7 +1020,7 @@
|
|
|
})
|
|
|
},
|
|
|
map(item) {
|
|
|
- this.navigate()
|
|
|
+ this.navigate(item)
|
|
|
//var item= _self.stationDetail.station
|
|
|
//window.location.href="https://uri.amap.com/marker?position="+ item.longitude+","+item.latitude+"&name="+item.name;
|
|
|
|
|
@@ -1061,6 +1076,7 @@
|
|
|
min-width: 180rpx;
|
|
|
color:#00B962;
|
|
|
float: right;
|
|
|
+ text-align: end;
|
|
|
width: 180rpx;
|
|
|
}
|
|
|
}
|