Conf(地图):使用天地图定位获取省市区
This commit is contained in:
@@ -1399,13 +1399,12 @@ export default {
|
||||
getLocationPromise().then(mapData => {
|
||||
if (mapData.errMsg) {
|
||||
const { latitude, longitude } = mapData
|
||||
getCurAddress(latitude, longitude).then(address => {
|
||||
this.cityName = address[1].data.result.ad_info.city
|
||||
getCurAddress(latitude, longitude, address => {
|
||||
console.log(address)
|
||||
this.cityName = address.city
|
||||
uni.setStorageSync('locationCityName', this.cityName)
|
||||
this.isLocating = false
|
||||
this.getPageData()
|
||||
}).catch(() => {
|
||||
this.getPageData()
|
||||
})
|
||||
} else {
|
||||
this.isLocating = false
|
||||
|
||||
Reference in New Issue
Block a user