diff --git a/subpages/house/pages/housePortrait/housePortrait.js b/subpages/house/pages/housePortrait/housePortrait.js index 29933e5..ec6a903 100644 --- a/subpages/house/pages/housePortrait/housePortrait.js +++ b/subpages/house/pages/housePortrait/housePortrait.js @@ -30,25 +30,24 @@ Page({ this.setData({ detail: res.data, houseName: res.data.houseName - }) - }).catch((error) => { - }); - api.houseResidentChangeRecord({ houseId: this.data.houseId }).then((res) => { + }); + return api.houseResidentChangeRecord({ houseId: this.data.houseId }); + }).then((res) => { this.setData({ logs: res.data - }) - }).catch((error) => { - console.error("发生错误:", error); - }); - api.getResiList({ homeId: this.data.houseId, pageNo: 1, pageSize: 1000 }).then(res => { - const arr = res.data.list.map(item => { - return item.resiId - }) + }); + return api.getResiList({ homeId: this.data.houseId, pageNo: 1, pageSize: 1000 }); + }).then((res) => { + const arr = res.data.list.map(item => item.resiId); this.setData({ residIds: arr, - }) - this.getTabData() - }) + }); + this.getTabData(); + }).catch((error) => { + this.setData({ + detail: null, + }); + }); }, handelClickAddResi(){ wx.navigateTo({ diff --git a/subpages/house/pages/housePortrait/housePortrait.wxml b/subpages/house/pages/housePortrait/housePortrait.wxml index 9feace6..2080854 100644 --- a/subpages/house/pages/housePortrait/housePortrait.wxml +++ b/subpages/house/pages/housePortrait/housePortrait.wxml @@ -24,13 +24,13 @@ - 关系图谱 + 关系图谱 新增居民 - +