diff --git a/pages/index/index.js b/pages/index/index.js index f54f657..c58aaab 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -17,26 +17,27 @@ Page({ nodata:false, emptyHouseNum:'', catesNonIntResiNum:'', - readFlag:'' - + readFlag:'0', + agencyName:'--' }, // 事件处理函数 onLoad: async function () { - this.setData({ - statusHeight: app.globalData.deviceInfo.statusHeight, - navigationHeight: app.globalData.deviceInfo.navigationHeight, - share:app.globalData.share - }) + await this.getToken() // await this.getIntelligentMessage() await this.getStaffbasicinfo() + this.setData({ + statusHeight: app.globalData.deviceInfo.statusHeight, + navigationHeight: app.globalData.deviceInfo.navigationHeight, + share:app.globalData.share, + }) }, onShow(){ - this.getIntelligentMessage() this.getSituation() + }, onPullDownRefresh() { this.setData({ @@ -151,7 +152,10 @@ onScrollToLower(e){ }, getStaffbasicinfo(){ getStaffbasicinfo().then(res=>{ - app.globalData.user = res.data + app.globalData.user = res.data; + this.setData({ + agencyName:res.data.agencyName + }) }).catch(err=>{ console.log(err); wx.redirectTo({ diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 0d64401..0612ac6 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -2,7 +2,7 @@ - 海伦路街道 + {{agencyName}}