diff --git a/pages/indexNew/indexNew.js b/pages/indexNew/indexNew.js index 3dfd01f..50abf54 100644 --- a/pages/indexNew/indexNew.js +++ b/pages/indexNew/indexNew.js @@ -50,11 +50,9 @@ Page({ title: "e锦水", //导航栏 中间的标题 }, height: app.globalData.height * 2 + 20, - infoObj: { - time: "", - title: "", - amount: "" - }, + infoObj: [], + informationNum: 0, //新消息数量 + unreadSignUpActNum: 0, //未查看报名中活动数量 noticeList: [], innerHtmlStatus: true, visibilityStatus: true, @@ -292,14 +290,21 @@ Page({ getFirstInfo: function () { let that = this api.getFirstInfo().then(function (res) { - // console.log('infoObj', res.data) if (res.data !== null) { - that.setData({ - infoObj: res.data + that.data.infoObj = [ ...res.data ] + that.data.infoObj.forEach(item => { + if (item.dataType == 'informationNum') { + that.setData({ + informationNum: item.num + }) + } + if (item.dataType == 'unreadSignUpActNum') { + that.setData({ + unreadSignUpActNum: item.num + }) + } }) } - - // console.log('zheli', that.data.infoObj) }) }, getNoticeList: function () { @@ -310,14 +315,11 @@ Page({ } let that = this api.noticelist(para).then(function (res) { - // console.log('infoObj', res.data) if (res.data !== null) { that.setData({ noticeList: res.data }) } - - // console.log('zheli', that.data.infoObj) }) }, // 根据微信code查询用户当前状态 diff --git a/pages/indexNew/indexNew.wxml b/pages/indexNew/indexNew.wxml index e95deae..8bd3ebf 100644 --- a/pages/indexNew/indexNew.wxml +++ b/pages/indexNew/indexNew.wxml @@ -20,7 +20,7 @@ - + @@ -99,6 +99,7 @@