Conf(地图):使用天地图定位获取省市区

This commit is contained in:
lifizer
2026-01-05 11:03:48 +08:00
parent f4fcc7e8f5
commit 1780c4ff0a
12 changed files with 115 additions and 364 deletions
+4 -6
View File
@@ -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) {