diff --git a/src/mods/AppVillageInfo/AppVillageInfo.vue b/src/mods/AppVillageInfo/AppVillageInfo.vue index c0c9ad0..1f7d99f 100644 --- a/src/mods/AppVillageInfo/AppVillageInfo.vue +++ b/src/mods/AppVillageInfo/AppVillageInfo.vue @@ -41,20 +41,27 @@ export default { }, data() { return { - areaId: '', info: {} } }, onLoad() { - if (uni.getStorageSync('areaId')) { - this.areaId = uni.getStorageSync('areaId')||this.user.areaId - } - this.getDetail() + this.getArea().then(areaId => this.getDetail(areaId)) }, methods: { - getDetail() { - this.$instance.post(`/app/appeveryvillagecode/queryDetailByAreaId?areaId=${this.areaId}`).then(res => { - if (res.code === 0) { + getArea() { + return this.$instance.post(`/app/appresident/detailForWx`, null, { + params: {id: this.user.residentId} + }).then(res => { + if (res?.data) { + return res.data.resident?.currentAreaId || "" + } + }) + }, + getDetail(areaId) { + areaId && this.$instance.post(`/app/appeveryvillagecode/queryDetailByAreaId`, null, { + params: {areaId} + }).then(res => { + if (res?.code === 0) { this.info = res.data } })