Conf(地图):使用天地图定位获取省市区
This commit is contained in:
@@ -457,13 +457,11 @@ export default {
|
||||
},
|
||||
async getMapData() {
|
||||
const map = await getLocation()
|
||||
if (map.length > 1) {
|
||||
if (map.length > 1 && !this.cityName) {
|
||||
const {latitude, longitude} = map[1]
|
||||
const address = await getCurAddress(latitude, longitude)
|
||||
if(!this.cityName) {
|
||||
this.cityName = address[1].data.result.ad_info.city
|
||||
}
|
||||
// this.search()
|
||||
getCurAddress(latitude, longitude, address => {
|
||||
this.cityName = address.city
|
||||
})
|
||||
}
|
||||
},
|
||||
tapType(index) {
|
||||
|
||||
Reference in New Issue
Block a user