From dabdcbfd45cf4541c8b30e40811a2f06379b5a2d Mon Sep 17 00:00:00 2001 From: ZhaoTongYao <531131322@qq.com> Date: Tue, 27 Oct 2020 17:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E5=8E=BB=E5=93=AA?= =?UTF-8?q?=E5=84=BF=E4=B8=AD=E5=A2=9E=E5=8A=A0=E6=9C=AA=E8=AF=BB=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E6=8F=90=E7=A4=BA=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/indexNew/indexNew.js | 28 +++++++++++++++------------- pages/indexNew/indexNew.wxml | 3 ++- pages/indexNew/indexNew.wxss | 12 ++++++++++++ project.config.json | 13 ++----------- utils/api.js | 3 ++- 5 files changed, 33 insertions(+), 26 deletions(-) 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 @@