修改定位方式
This commit is contained in:
@ -32,7 +32,7 @@ export function handleCheckLocationCacheHooks() {
|
||||
export function handleSetLocationCacheHooks(lat: number, lng: number) {
|
||||
uni.setStorageSync(LOCATION_LAT_KEY, lat)
|
||||
uni.setStorageSync(LOCATION_LNG_KEY, lng)
|
||||
uni.setStorageSync(LOCATION_EXPIRE_KEY, Date.now() + LOCATION_EXPIRE_MS)
|
||||
// uni.setStorageSync(LOCATION_EXPIRE_KEY, Date.now() + LOCATION_EXPIRE_MS)
|
||||
}
|
||||
|
||||
// TODO VERSION2: 在获取经纬度之前还有弹出是否搜索附近茶室?-初始化经纬度
|
||||
@ -290,6 +290,8 @@ export async function handleGetLocationCity(lat: number, lng: number) {
|
||||
longitude: res.result.location.lng,
|
||||
city: res.result.ad_info.city
|
||||
}
|
||||
// 通过腾讯地图返回的经纬度重新设置缓存
|
||||
handleSetLocationCacheHooks(res.result.location.lat, res.result.location.lng)
|
||||
setLocationCity(params.city)
|
||||
uni.setStorageSync(LOCATION_CURRENT, params)
|
||||
// uni.$emit('locationUpdate', params) // 通知页面
|
||||
|
||||
Reference in New Issue
Block a user