diff --git a/pages/cloud/haveFun.vue b/pages/cloud/haveFun.vue index 759ad0e..d2e856c 100644 --- a/pages/cloud/haveFun.vue +++ b/pages/cloud/haveFun.vue @@ -162,6 +162,7 @@ export default { }, onShow() { + const memCityName = uni.getStorageSync('cityName') this.page = 1 this.currType = {} this.typeIndex = 0 @@ -171,13 +172,23 @@ export default { this.currType = data[this.typeIndex] this.getMapData() }) - const memCityName = uni.getStorageSync('cityName') if (memCityName.length) { this.cityName = memCityName uni.removeStorageSync('cityName') this.name = '' } }, + watch: { + cityName: { + handler(value) { + if(value) { + this.search() + } + }, + immediate: true, + deep: true + } + }, methods: { goCity() { uni.navigateTo({ @@ -197,7 +208,7 @@ export default { if(!this.cityName) { this.cityName = address[1].data.result.ad_info.city } - this.search() + // this.search() } }, tapType(index) {