|
@@ -183,7 +183,7 @@
|
|
|
|
|
|
</view>
|
|
|
<view v-if="stationsmap.length>0" class="chargerCard" style="border-radius: 20rpx;">
|
|
|
- <swiper :current="currentIndex" @change="swiperChange" @transition="swiperTransition" style="height: 100%;">
|
|
|
+ <swiper :current="currentIndex" @change="swiperChange" slide-change-transition-end='swiperTransitionEnd' @transition="swiperTransition" style="height: 100%;">
|
|
|
<swiper-item v-for="(item,index) in stationsmap" :key="item.id" style="height: 100%;">
|
|
|
|
|
|
<view class="swiper-item" style="height: 100%; background-color: #ffffff;" @click="stationDetail(item)">
|
|
@@ -377,7 +377,7 @@ export default {
|
|
|
|
|
|
},
|
|
|
onReady() {
|
|
|
- console.log('长者模式'+JSON.stringify(this.carhelp.get("getElderModeClass")));
|
|
|
+// console.log('长者模式'+JSON.stringify(this.carhelp.get("getElderModeClass")));
|
|
|
this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
|
|
|
|
|
|
//this.elderMode = true;
|
|
@@ -774,6 +774,13 @@ export default {
|
|
|
data1.findType = pos.findType;
|
|
|
else
|
|
|
data1.findType = "0";
|
|
|
+
|
|
|
+ if(data1.findType == "0")
|
|
|
+ {
|
|
|
+ // console.log('getChargingStationData res1'+JSON.stringify(res));
|
|
|
+ _self.currentIndex = -1;
|
|
|
+ _self.stationsmap = [];
|
|
|
+ }
|
|
|
/*
|
|
|
if(this.preference.obc_power.minValue!=null)
|
|
|
data1.powerStart = this.preference.obc_power.minValue.toString();
|
|
@@ -795,7 +802,9 @@ export default {
|
|
|
if(data1.findType == "0")
|
|
|
{
|
|
|
// console.log('getChargingStationData res1'+JSON.stringify(res));
|
|
|
- _self.stationsmap = [];
|
|
|
+// _self.currentIndex = -1;
|
|
|
+// _self.stationsmap = [];
|
|
|
+ //let stations = [];
|
|
|
for(let i = 0;i<items.length;i++)
|
|
|
{
|
|
|
let obj = {
|
|
@@ -856,12 +865,23 @@ export default {
|
|
|
latitude: items[i].latitude
|
|
|
};*/
|
|
|
_self.stationsmap.push(obj);
|
|
|
+ //stations.push(obj);
|
|
|
}
|
|
|
_self.$refs.amap.calcDistances([_self.longitude, _self.latitude],_self.stationsmap)
|
|
|
- _self.$refs.amap.setChargerList(_self.stationsmap);
|
|
|
+ _self.$refs.amap.setChargerList(_self.stationsmap);
|
|
|
+ _self.currentIndex = 0;
|
|
|
+ //if(_self.stationsmap.length>0)
|
|
|
+ /*_self.$refs.amap.calcDistances([_self.longitude, _self.latitude],stations)
|
|
|
+ _self.stationsmap = stations;
|
|
|
+ _self.$refs.amap.setChargerList(stations);*/
|
|
|
if(_self.stationsmap.length>0)
|
|
|
{
|
|
|
+ console.log('刷新Map'+JSON.stringify(_self.stationsmap));
|
|
|
_self.$refs.amap.updateCharger(_self.stationsmap[0]);
|
|
|
+ //let index = _self.stationsmap.findIndex(item => item.id == _self.stationsmap[0].id);
|
|
|
+
|
|
|
+
|
|
|
+ console.log('刷新Map Index'+ _self.currentIndex)
|
|
|
}
|
|
|
}else if(data1.findType == "1")
|
|
|
{
|
|
@@ -949,6 +969,7 @@ export default {
|
|
|
|
|
|
}, */
|
|
|
moveEnd(e){
|
|
|
+ console.log('moveEnd')
|
|
|
this.close_all();
|
|
|
let posCenter = this.$refs.amap.logMapInfo();
|
|
|
//console.log('posCenter'+JSON.stringify(posCenter))
|
|
@@ -959,11 +980,12 @@ export default {
|
|
|
this.close_all();
|
|
|
},
|
|
|
clickTabItem (index) {
|
|
|
-
|
|
|
+ console.log('clickTabaItem'+JSON.stringify(index));
|
|
|
this.currentIndex = index
|
|
|
},
|
|
|
swiperChange (e) {
|
|
|
-// console.log('swiperChange'+JSON.stringify(e))
|
|
|
+ console.log('swiperChange currentIndex'+JSON.stringify(this.currentIndex))
|
|
|
+ console.log('swiperChange'+JSON.stringify(e))
|
|
|
this.currentIndex = e.detail.current
|
|
|
let station = this.stationsmap[this.currentIndex];
|
|
|
|
|
@@ -984,8 +1006,11 @@ export default {
|
|
|
this.$refs.amap.setCenter(posCenter);
|
|
|
|
|
|
},
|
|
|
+ swiperTransitionEnd(e){
|
|
|
+ console.log('swiperTransitionEnd'+JSON.stringify(e))
|
|
|
+ },
|
|
|
swiperTransition (e) {
|
|
|
- // console.log(e)
|
|
|
+ // console.log('swiperTransition'+JSON.stringify(e))
|
|
|
},
|
|
|
listMode() {
|
|
|
this.close_all();
|
|
@@ -1075,7 +1100,14 @@ export default {
|
|
|
// console.log('latitude1 ' + _self.latitude);
|
|
|
if (obj == null || obj.type == null) return;
|
|
|
if (obj.type == 'charger') {
|
|
|
- api.getChargerInfoById(obj).then(
|
|
|
+ if (obj.obj != null) {
|
|
|
+
|
|
|
+ //_self.$refs.amap.updateCharger(obj.obj);
|
|
|
+ let index = _self.stationsmap.findIndex(item => item.id == obj.obj.id);
|
|
|
+ _self.currentIndex = index;
|
|
|
+ console.log('find Index'+index);
|
|
|
+ }
|
|
|
+ /*api.getChargerInfoById(obj).then(
|
|
|
function(data) {
|
|
|
if (obj.obj != null) {
|
|
|
//obj.obj.price = 2.25;
|
|
@@ -1090,7 +1122,7 @@ export default {
|
|
|
function(err) {
|
|
|
console.log('点击2' + JSON.stringify(obj));
|
|
|
}
|
|
|
- );
|
|
|
+ );*/
|
|
|
}
|
|
|
},
|
|
|
mapdown() {
|