Browse Source

消息改通知

integral
zhaoyongnian 5 years ago
parent
commit
680e42d340
  1. 18
      epdc-resident-mp-yushan/pages/index/index.js
  2. 3
      epdc-resident-mp-yushan/pages/index/index.wxml

18
epdc-resident-mp-yushan/pages/index/index.js

@ -12,6 +12,7 @@ Page({
newsList: [], // 新闻列表 newsList: [], // 新闻列表
projectList: [], // 项目列表 projectList: [], // 项目列表
infoList: [], // 消息列表 infoList: [], // 消息列表
noticeList: [], // 通知公告列表
unReadNum: 0, // 未读数量 unReadNum: 0, // 未读数量
loadMoreType: 'none', loadMoreType: 'none',
loadMoreVisible: false, loadMoreVisible: false,
@ -47,6 +48,7 @@ Page({
this.getUserState() this.getUserState()
}, },
onShow () { onShow () {
this.getUnreadNum() // 实时获取有无未读消息
// 检查版本更新 // 检查版本更新
checkoutVersion() checkoutVersion()
}, },
@ -187,6 +189,21 @@ Page({
}).catch((err) => { }).catch((err) => {
console.log('获取消息列表失败') console.log('获取消息列表失败')
}) })
},
// 获取通知公告列表
getNoticeList () {
let para = {
pageIndex: 1,
pageSize: 10,
timestamp: this.data.timestamp
}
homeApi.getNoticeList(para).then(res => {
this.setData({
noticeList: res.data
})
}).catch(err => {
console.log(err)
})
}, },
// 九宫格检查状态 // 九宫格检查状态
getIndexSudokuState () { getIndexSudokuState () {
@ -280,6 +297,7 @@ Page({
this.getIndexSudokuState() this.getIndexSudokuState()
this.getProjectList() this.getProjectList()
this.getInfoList() this.getInfoList()
this.getNoticeList()
this.getUnreadNum() this.getUnreadNum()
this.getNewsList() this.getNewsList()
}, },

3
epdc-resident-mp-yushan/pages/index/index.wxml

@ -30,8 +30,7 @@
<!--通知公告列表 注 以前是消息列表,通知公告需求还没有定下来,数据获取的还是消息的列表数据--> <!--通知公告列表 注 以前是消息列表,通知公告需求还没有定下来,数据获取的还是消息的列表数据-->
<notice <notice
bind:navigateToInfoList="navigateToInfoList" bind:navigateToInfoList="navigateToInfoList"
infoList="{{infoList}}" noticeList="{{noticeList}}">
unreadnum="{{unReadNum}}">
</notice> </notice>
<!--sudoku九宫格--> <!--sudoku九宫格-->

Loading…
Cancel
Save