From 8b4145a8b34ddbc80b1893420fd5a6e2b45ea84f Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Tue, 31 Mar 2026 09:34:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/home/index.vue b/pages/home/index.vue index af4ba48..e603753 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -487,14 +487,14 @@ export default { methods: { loadSelectedCityFromCache() { // 假设缓存中的键名为 'selectedCity' - const cachedCity = uni.getStorageSync("selectedCity"); - console.log("this.selectedCity", this.selectedCity); - console.log("this.selectedCity", cachedCity); - if (cachedCity && this.selectedCity != cachedCity) { - this.selectedCity = cachedCity; - } return new Promise((reso, rej) => { - reso(); + const cachedCity = uni.getStorageSync("selectedCity"); + console.log("this.selectedCity", this.selectedCity); + console.log("this.selectedCity", cachedCity); + if (cachedCity && this.selectedCity != cachedCity) { + this.selectedCity = cachedCity; + reso(); + } }); }, checkScroll() {