|
@@ -220,8 +220,9 @@
|
|
getLocation(){
|
|
getLocation(){
|
|
const that = this
|
|
const that = this
|
|
uni.getLocation({
|
|
uni.getLocation({
|
|
- type: 'wgs84',
|
|
|
|
|
|
+ type: 'gcj02',
|
|
geocode: true,
|
|
geocode: true,
|
|
|
|
+ altitude: true,
|
|
success: (res) => {
|
|
success: (res) => {
|
|
that.latLongItude = {latitude: res.latitude,longitude:res.longitude};
|
|
that.latLongItude = {latitude: res.latitude,longitude:res.longitude};
|
|
that.latitude = res.latitude;
|
|
that.latitude = res.latitude;
|
|
@@ -235,6 +236,8 @@
|
|
},
|
|
},
|
|
// 通过经纬度获取地区详细信息
|
|
// 通过经纬度获取地区详细信息
|
|
getCityNameByLonLat({longitude,latitude} = {}){
|
|
getCityNameByLonLat({longitude,latitude} = {}){
|
|
|
|
+ alert(latitude)
|
|
|
|
+ alert(longitude)
|
|
let that = this;
|
|
let that = this;
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '加载中',
|
|
title: '加载中',
|
|
@@ -280,7 +283,13 @@
|
|
},
|
|
},
|
|
cityChange(e){
|
|
cityChange(e){
|
|
console.log('cityChange',e);
|
|
console.log('cityChange',e);
|
|
- this.city = e.city.label;
|
|
|
|
|
|
+ if (e.area) {
|
|
|
|
+ this.city = e.area.label;
|
|
|
|
+ } else if (e.city) {
|
|
|
|
+ this.city = e.city.label;
|
|
|
|
+ } else {
|
|
|
|
+ this.city = e.province.label;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleGetIndexData(){
|
|
handleGetIndexData(){
|
|
this.$u.api.getIndexData()
|
|
this.$u.api.getIndexData()
|