Refactor(首页):首页定位获取逻辑调整为只用于左上角显示之用
This commit is contained in:
@@ -716,6 +716,7 @@ export default {
|
|||||||
console.timeEnd()
|
console.timeEnd()
|
||||||
console.log('^^^^^^^^^^^^^^^^获取定位开始')
|
console.log('^^^^^^^^^^^^^^^^获取定位开始')
|
||||||
console.time()
|
console.time()
|
||||||
|
this.getPageData()
|
||||||
this.getLocationData()
|
this.getLocationData()
|
||||||
},
|
},
|
||||||
// 定位失败,重新唤起定位授权
|
// 定位失败,重新唤起定位授权
|
||||||
@@ -729,7 +730,7 @@ export default {
|
|||||||
const cityName = uni.getStorageSync('locationCityName')
|
const cityName = uni.getStorageSync('locationCityName')
|
||||||
if (cityName) {
|
if (cityName) {
|
||||||
this.cityName = cityName
|
this.cityName = cityName
|
||||||
this.getPageData()
|
// this.getPageData()
|
||||||
}
|
}
|
||||||
this.isLocating = true
|
this.isLocating = true
|
||||||
getLocationPromise().then(mapData => {
|
getLocationPromise().then(mapData => {
|
||||||
@@ -742,16 +743,16 @@ export default {
|
|||||||
if (resCityName !== this.cityName) {
|
if (resCityName !== this.cityName) {
|
||||||
this.cityName = address.city
|
this.cityName = address.city
|
||||||
uni.setStorageSync('locationCityName', this.cityName)
|
uni.setStorageSync('locationCityName', this.cityName)
|
||||||
this.getPageData()
|
// this.getPageData()
|
||||||
}
|
}
|
||||||
this.isLocating = false
|
this.isLocating = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.isLocating = false
|
this.isLocating = false
|
||||||
this.getPageData()
|
// this.getPageData()
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.getPageData()
|
// this.getPageData()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPageData() {
|
getPageData() {
|
||||||
|
|||||||
Reference in New Issue
Block a user