From f846d5934044f4811c9d2501473f3be61763f8d7 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Wed, 7 Jan 2026 17:34:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E4=BD=8D=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useLocation.ts | 4 +++- src/pages/index/index.vue | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/useLocation.ts b/src/hooks/useLocation.ts index 0ffd7c1..1672beb 100644 --- a/src/hooks/useLocation.ts +++ b/src/hooks/useLocation.ts @@ -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) // 通知页面 diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 394b8c9..89aabcb 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -225,7 +225,6 @@ city.value = location.city latitude.value = location.latitude longitude.value = location.longitude - console.log("🚀 ~ latitude.value:", latitude.value, longitude.value) Index.handleResetSearch() })