|
@@ -7,7 +7,8 @@
|
|
<label class="arrow">{{ area }}</label>
|
|
<label class="arrow">{{ area }}</label>
|
|
<u-icon name="arrow-down-fill" size="13" color="#c0c4cc"></u-icon>
|
|
<u-icon name="arrow-down-fill" size="13" color="#c0c4cc"></u-icon>
|
|
</view>
|
|
</view>
|
|
- <view style="margin-left: 20rpx;margin-right: 20rpx; flex:1"><u-search placeholder="搜索站点名称" v-model="keyword" :showAction="false"></u-search></view>
|
|
|
|
|
|
+ <view style="margin-left: 20rpx;margin-right: 20rpx; flex:1" >
|
|
|
|
+ <u-search placeholder="搜索站点名称" v-model="keyword" :showAction="false" @focus="navigate"></u-search></view>
|
|
<view style="margin-right: 20rpx;" v-show="viewMode" @click="listMode">
|
|
<view style="margin-right: 20rpx;" v-show="viewMode" @click="listMode">
|
|
<text class="iconfont"></text> <text class="list">列表</text>
|
|
<text class="iconfont"></text> <text class="list">列表</text>
|
|
<!-- <u-icon name="list-dot" size="26" color="#c0c4cc"></u-icon>
|
|
<!-- <u-icon name="list-dot" size="26" color="#c0c4cc"></u-icon>
|
|
@@ -229,6 +230,7 @@
|
|
</swiper-item>
|
|
</swiper-item>
|
|
</swiper>
|
|
</swiper>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<Tabbar :current="1"></Tabbar>
|
|
<Tabbar :current="1"></Tabbar>
|
|
@@ -286,6 +288,7 @@ export default {
|
|
{name:'荆鹏大道求助站充电站',position:'湖北省荆州市沙市区江津东路附158号',price:1.2,idle:10,total:10,distance:0.1,time:1,type:'快充'},
|
|
{name:'荆鹏大道求助站充电站',position:'湖北省荆州市沙市区江津东路附158号',price:1.2,idle:10,total:10,distance:0.1,time:1,type:'快充'},
|
|
*/
|
|
*/
|
|
],
|
|
],
|
|
|
|
+ first:true,
|
|
timer:null,
|
|
timer:null,
|
|
stationslist:[],
|
|
stationslist:[],
|
|
info: {
|
|
info: {
|
|
@@ -331,7 +334,6 @@ export default {
|
|
console.log(res)
|
|
console.log(res)
|
|
})
|
|
})
|
|
|
|
|
|
- this.getPoint();
|
|
|
|
// console.log('longitude2 '+this.longitude)
|
|
// console.log('longitude2 '+this.longitude)
|
|
// console.log('latitude2 '+this.latitude)
|
|
// console.log('latitude2 '+this.latitude)
|
|
this.$refs.amap.init();
|
|
this.$refs.amap.init();
|
|
@@ -353,15 +355,34 @@ export default {
|
|
this.end();
|
|
this.end();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ navigate(){
|
|
|
|
+ console.log('naviage to ')
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url:'/pages/search/search'
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getPoint() {
|
|
getPoint() {
|
|
|
|
|
|
-
|
|
|
|
|
|
+ console.log('getPoint')
|
|
WxJsApi.getLocation().then((res) => {
|
|
WxJsApi.getLocation().then((res) => {
|
|
|
|
|
|
var latitude = parseFloat(res.latitude);
|
|
var latitude = parseFloat(res.latitude);
|
|
var longitude = parseFloat(res.longitude);
|
|
var longitude = parseFloat(res.longitude);
|
|
let data = {position:{latitude:latitude,longitude:longitude}};
|
|
let data = {position:{latitude:latitude,longitude:longitude}};
|
|
|
|
+
|
|
|
|
+ if(_self.first)
|
|
|
|
+ {
|
|
|
|
+ var obj = {
|
|
|
|
+ longitude: longitude,
|
|
|
|
+ latitude: latitude
|
|
|
|
+ };
|
|
|
|
+ this.$refs.amap.setPerson(obj);
|
|
|
|
+ _self.first = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
this.location(data);
|
|
this.location(data);
|
|
|
|
+ console.log('当前位置' +JSON.stringify(data))
|
|
|
|
+
|
|
//this.latitude2 = latitude;
|
|
//this.latitude2 = latitude;
|
|
//this.longitude2 = longitude;
|
|
//this.longitude2 = longitude;
|
|
/*uni.showToast({
|
|
/*uni.showToast({
|
|
@@ -380,7 +401,7 @@ export default {
|
|
this.timer = setInterval(() => {
|
|
this.timer = setInterval(() => {
|
|
//console.log("开始---");
|
|
//console.log("开始---");
|
|
|
|
|
|
- self.$refs.amap.getLocation1();
|
|
|
|
|
|
+ //self.$refs.amap.getLocation1();
|
|
//self.$refs.amap.getLocation ();
|
|
//self.$refs.amap.getLocation ();
|
|
}, 10000);
|
|
}, 10000);
|
|
},
|
|
},
|
|
@@ -407,10 +428,10 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getChargingStationData(pos){
|
|
getChargingStationData(pos){
|
|
-
|
|
|
|
|
|
+ //return;
|
|
if(pos == null)
|
|
if(pos == null)
|
|
return ;
|
|
return ;
|
|
-// console.log('getChargingStationData'+JSON.stringify(pos))
|
|
|
|
|
|
+ console.log('getChargingStationData'+JSON.stringify(pos))
|
|
let data1 = { pageIndex:0,pageSize:20};
|
|
let data1 = { pageIndex:0,pageSize:20};
|
|
if(this.info.obc_type[this.preference.obc_type_index].text.indexOf('直流快充')>=0)
|
|
if(this.info.obc_type[this.preference.obc_type_index].text.indexOf('直流快充')>=0)
|
|
data1.type = "1";
|
|
data1.type = "1";
|
|
@@ -433,16 +454,20 @@ export default {
|
|
if(this.preference.obc_power.maxValue!=null)
|
|
if(this.preference.obc_power.maxValue!=null)
|
|
data1.powerEnd = this.preference.obc_power.maxValue.toString();
|
|
data1.powerEnd = this.preference.obc_power.maxValue.toString();
|
|
|
|
|
|
-// console.log('data1'+JSON.stringify(data1))
|
|
|
|
|
|
+ console.log('data1'+JSON.stringify(data1))
|
|
api.geChargingStationData(data1).then(function(res){
|
|
api.geChargingStationData(data1).then(function(res){
|
|
|
|
+
|
|
if(!res.result || !res.data || !res.data.data)
|
|
if(!res.result || !res.data || !res.data.data)
|
|
- return;
|
|
|
|
|
|
+ {
|
|
|
|
+ console.log('getChargingStationData res nulll')
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
let items = res.data.data;
|
|
let items = res.data.data;
|
|
|
|
|
|
|
|
|
|
if(data1.findType == "0")
|
|
if(data1.findType == "0")
|
|
{
|
|
{
|
|
-// console.log('res1'+JSON.stringify(res));
|
|
|
|
|
|
+ console.log('getChargingStationData res1'+JSON.stringify(res));
|
|
_self.stationsmap = [];
|
|
_self.stationsmap = [];
|
|
for(let i = 0;i<items.length;i++)
|
|
for(let i = 0;i<items.length;i++)
|
|
{
|
|
{
|
|
@@ -502,7 +527,7 @@ export default {
|
|
}else if(data1.findType == "1")
|
|
}else if(data1.findType == "1")
|
|
{
|
|
{
|
|
_self.stationslist = [];
|
|
_self.stationslist = [];
|
|
-// console.log('res2'+JSON.stringify(res));
|
|
|
|
|
|
+ console.log('getChargingStationData res2'+JSON.stringify(res));
|
|
for(let i = 0;i<items.length;i++)
|
|
for(let i = 0;i<items.length;i++)
|
|
{
|
|
{
|
|
|
|
|
|
@@ -546,14 +571,14 @@ export default {
|
|
}
|
|
}
|
|
_self.$refs.amap.searchBtn([_self.longitude, _self.latitude],_self.stationslist)
|
|
_self.$refs.amap.searchBtn([_self.longitude, _self.latitude],_self.stationslist)
|
|
|
|
|
|
- console.log('stations'+JSON.stringify(_self.stationslist))
|
|
|
|
|
|
+ console.log(' getChargingStationData stations'+JSON.stringify(_self.stationslist))
|
|
|
|
|
|
}
|
|
}
|
|
},function(err){
|
|
},function(err){
|
|
- console.log('err'+JSON.stringify(err))
|
|
|
|
|
|
+ console.log('getChargingStationData err'+JSON.stringify(err))
|
|
}
|
|
}
|
|
)
|
|
)
|
|
-
|
|
|
|
|
|
+ console.log('getChargingStationData end')
|
|
},
|
|
},
|
|
charge(item){
|
|
charge(item){
|
|
console.log('扫码充电')
|
|
console.log('扫码充电')
|
|
@@ -697,7 +722,7 @@ export default {
|
|
// console.log('latitude1 ' + this.latitude);
|
|
// console.log('latitude1 ' + this.latitude);
|
|
//this.start();
|
|
//this.start();
|
|
//this.$refs.amap.getLocation1();
|
|
//this.$refs.amap.getLocation1();
|
|
- this.getNearbyStationInfo();
|
|
|
|
|
|
+// this.getNearbyStationInfo();
|
|
this.isReady = true;
|
|
this.isReady = true;
|
|
//this.$refs.amap.getLocation ();
|
|
//this.$refs.amap.getLocation ();
|
|
//let state = {};
|
|
//let state = {};
|
|
@@ -730,20 +755,12 @@ export default {
|
|
_self.$refs.amap.setMyStyle("height:"+(scrollH-88-50)+ "px;width:100%;");
|
|
_self.$refs.amap.setMyStyle("height:"+(scrollH-88-50)+ "px;width:100%;");
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- var obj = {
|
|
|
|
- longitude: _self.longitude,
|
|
|
|
- latitude: _self.latitude
|
|
|
|
- };
|
|
|
|
-// console.log('obj ' + JSON.stringify(obj));
|
|
|
|
- this.$refs.amap.setPerson(obj);
|
|
|
|
- /* var obj2 = {
|
|
|
|
- longitude: this.nearbyStationInfo.longitude,
|
|
|
|
- latitude: this.nearbyStationInfo.latitude
|
|
|
|
- };*/
|
|
|
|
|
|
|
|
- //this.$refs.amap.setPerson(obj);
|
|
|
|
- //this.$refs.amap.setSite(obj2);
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.getPoint();
|
|
|
|
+
|
|
|
|
+ },
|
|
gotoLine(item, downid) {
|
|
gotoLine(item, downid) {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: '/pages/route/index?id=' + item.routeId + '&upid=' + item.startStationId + '&downid=' + downid
|
|
url: '/pages/route/index?id=' + item.routeId + '&upid=' + item.startStationId + '&downid=' + downid
|