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() {