diff --git a/pages/index/learning.vue b/pages/index/learning.vue index dba05e9..b8ce6a6 100644 --- a/pages/index/learning.vue +++ b/pages/index/learning.vue @@ -1,17 +1,17 @@ @@ -623,4 +679,4 @@ } } - --> \ No newline at end of file + --> diff --git a/pages/index/personal.vue b/pages/index/personal.vue index 556cd7e..026f356 100644 --- a/pages/index/personal.vue +++ b/pages/index/personal.vue @@ -115,15 +115,39 @@ } }, - onShow: function() { + onShow() { var userInfos = uni.getStorageSync('weapp_session_userInfo_data'); this.name = userInfos.name, this.photo = userInfos.picUrl, this.mobile = userInfos.loginName this.updateInit() + this.initrealTimeStatistics() console.log(config.service.host.indexOf('xitong.pachira.cn') != -1) }, methods: { + //实时统计 + initrealTimeStatistics() { + uni.request({ + url: config.service.realTimeStatistics, + method: "POST", + header: { + 'content-type': 'application/json', + 'Access-Token': uni.getStorageSync('weapp_session_login_data').token + }, + data: { + houseId: uni.getStorageSync('buildingID').id + }, + success: (data) => { + if (data.data.data == null) { + return + } else { + this.tabbarList[1].count = data.data.data.receivingCustomer || 0 + this.$forceUpdate() + } + }, + fail: () => {} + }) + }, updateInit() { uni.request({ url: config.service.notReadNum, @@ -167,10 +191,12 @@ content: '确定要退出?', cancelColor: "#999999", showCancel: true, - success:(res) => { + success: (res) => { if (res.confirm) { uni.clearStorageSync(); //清除缓存 - this.$u.post('/user/exitSystem', {id: uni.getStorageSync('exitSystemId')}) + this.$u.post('/user/exitSystem', { + id: uni.getStorageSync('exitSystemId') + }) uni.showToast({ icon: "none", title: "退出成功" @@ -310,4 +336,4 @@ } } } - \ No newline at end of file +