|
|
@ -371,9 +371,9 @@ |
|
|
|
app.globalData.latitude = res.latitude; |
|
|
|
app.globalData.latitude = res.latitude; |
|
|
|
app.globalData.longitude = res.longitude; |
|
|
|
app.globalData.longitude = res.longitude; |
|
|
|
|
|
|
|
|
|
|
|
// that.findByLatAndLng(res.longitude, res.latitude); |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
// #ifdef H5 |
|
|
|
that.getUserLocation(res.longitude, res.latitude); |
|
|
|
that.findByLatAndLng(res.longitude, res.latitude); |
|
|
|
|
|
|
|
// that.getUserLocation(res.longitude, res.latitude); |
|
|
|
//#endif |
|
|
|
//#endif |
|
|
|
// #ifdef MP |
|
|
|
// #ifdef MP |
|
|
|
uni.request({ |
|
|
|
uni.request({ |
|
|
@ -415,26 +415,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
//H5 获取定位 |
|
|
|
|
|
|
|
getCoordinates() { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
// 获取当前地理位置信息 |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
key: "7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB" //密钥,需要在腾讯位置服务官网(https://lbs.qq.com/)申请自己的密钥。 |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
let url = "https://apis.map.qq.com/ws/location/v1/ip"; //地理位置信息接口(根据IP自动获取当前城市位置信息) |
|
|
|
|
|
|
|
data.output = "jsonp"; |
|
|
|
|
|
|
|
//判断用户是否输入了搜索关键字,若没有输入搜索关键字则调用根据IP自动获取当前城市位置信息的接口。 |
|
|
|
|
|
|
|
this.$jsonp(url, data) |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
|
|
|
|
app.globalData.latitude = res.result.location.lat; |
|
|
|
|
|
|
|
app.globalData.longitude = res.result.location.lng; |
|
|
|
|
|
|
|
that.getUserLocation(res.result.location.lng, res.result.location.lat); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(error => { |
|
|
|
|
|
|
|
console.log(error); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//经纬度转换 |
|
|
|
//经纬度转换 |
|
|
|
findByLatAndLng(item, item1) { |
|
|
|
findByLatAndLng(item, item1) { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
@ -449,6 +429,7 @@ |
|
|
|
.province; |
|
|
|
.province; |
|
|
|
app.globalData.cityId = res.return_data.result.addressComponent.adcode; |
|
|
|
app.globalData.cityId = res.return_data.result.addressComponent.adcode; |
|
|
|
// app.globalData.cityId = '500100'; |
|
|
|
// app.globalData.cityId = '500100'; |
|
|
|
|
|
|
|
if (res.return_data.result.addressComponent.adcode) { |
|
|
|
that.getCouponListArea(); |
|
|
|
that.getCouponListArea(); |
|
|
|
that.getCouponListgold(); |
|
|
|
that.getCouponListgold(); |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
@ -457,6 +438,21 @@ |
|
|
|
that.getCmsContentcmshome(); |
|
|
|
that.getCmsContentcmshome(); |
|
|
|
that.getCmsContentcmsContent(); |
|
|
|
that.getCmsContentcmsContent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
uni.getStorage({ |
|
|
|
|
|
|
|
key: 'accountType', |
|
|
|
|
|
|
|
success(e) { |
|
|
|
|
|
|
|
if (e.data) { |
|
|
|
|
|
|
|
app.globalData.accountType = e.data; |
|
|
|
|
|
|
|
if (e.data == '000000#/' && app.globalData.h5code) { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: '../../goods/refuel-details/refuel-details' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
//H5 获取openId |
|
|
|
//H5 获取openId |
|
|
|