diff --git a/assets/js/http/userApi.js b/assets/js/http/userApi.js index d9302b0..ff7ef01 100644 --- a/assets/js/http/userApi.js +++ b/assets/js/http/userApi.js @@ -61,6 +61,8 @@ const UserApi = { messageOverTimeUnreadList: (params) => http.get(`${URL_CONFIG}sys/sysAnnouncementSend/getDeadlineUnreadSend`, params), // 将超时未读消息全部变已读 messageOverTimeToRead: (params) => http.get(`${URL_CONFIG}sys/sysAnnouncementSend/allReadDeadlineUnreadSend`, params), + // 公告列表 + noticeList: (params) => http.get(`${URL_CONFIG}sysNotice/page`, params), // 工作组分页 workList: (params) => http.get(`${URL_CONFIG}project/payWorkingGroupSubitem/queryCompanyPageList`, params), // 分标委列表 diff --git a/pages/home/home.js b/pages/home/home.js index 0a87d78..1f2bb91 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -36,7 +36,14 @@ Page({ content: '', // 消息内容 showModal: false, // 是否显示弹窗 clickItem: null, - signUpBool: false // 是否跳转可报名 + signUpBool: false, // 是否跳转可报名 + // 2023-07变更:添加公告面板 + tabList: [ + { key: 'message', tab: '消息' }, + { key: 'notice', tab: '公告' } + ], + tabActiveKey: 'message', + noticeList: [] // 公告列表 }, showDialogBtn: function (e) { let content = e.currentTarget.dataset.message.msgContent @@ -129,6 +136,33 @@ Page({ }) }) }, + loadNoticeData () { + wx.showToast({ + title: '加载中...', + icon: 'loading' + }) + UserApi.noticeList(this.data.searchParams).then(res => { + if (res.success) { + // 搜索时,把原数据清空,重新筛选 + if (this.data.searchParams.pageNo === 1) { + this.setData({ + list: [] + }) + } + if (res.result.records && res.result.records.length) { + this.setData({ + noticeList: [...this.data.noticeList, ...res.result.records] + }) + } + } + }).catch(err => { + wx.showToast({ + title: '登录后查看消息通知!', + icon: 'none', + duration: 2000 + }) + }) + }, // 点击首页的五个选项跳转页面 clickSelect(e) { let index = e.currentTarget.dataset.index @@ -267,6 +301,26 @@ Page({ }) this.loadData() }, + // tab选中 + changeTab: function (e) { + const that = this + that.setData({ + tabActiveKey: e.currentTarget.dataset.key, + searchParams: { + pageNo: 1, + pageSize: 10, + titile: '', // 提醒类型 3:会议 6:文件 7:邮寄 8:催款 + startTime: '', // 开始日期 + endTime: '' // 结束日期 + }, + }) + if (e.currentTarget.dataset.key === 'message') { + // 选中的是消息 + that.loadData() + } else { + that.loadNoticeData() + } + }, /** * 生命周期函数--监听页面显示 diff --git a/pages/home/home.wxml b/pages/home/home.wxml index 897a738..18435c8 100644 --- a/pages/home/home.wxml +++ b/pages/home/home.wxml @@ -19,7 +19,14 @@ - + + {{item.tab}} +
+
+
+ + @@ -47,8 +54,8 @@ - - + + @@ -68,9 +75,27 @@ - + + + + + + {{item.noticeName}} + + {{item.createTime}} + + + + + + + 暂无消息通知! + + 暂无公告! + @@ -98,4 +123,4 @@
- \ No newline at end of file + diff --git a/pages/home/home.wxss b/pages/home/home.wxss index 6a5bb39..e8ec78c 100644 --- a/pages/home/home.wxss +++ b/pages/home/home.wxss @@ -148,7 +148,7 @@ page{ background: #f9f9f9; margin: -180rpx 105rpx; border-radius: 8rpx; -} +} .modal-content { position: relative; padding: 50rpx; @@ -215,4 +215,60 @@ page{ } .modal-img { position: relative; -} \ No newline at end of file +} + +/* tab栏 */ +.swiper-tab { + width: 100%; + height: 80rpx; + text-align: center; + display: flex; + justify-content: space-between; + background: white; + /*border-bottom: 2rpx solid rgba(193, 193, 193, 0.3);*/ +} + +.selected-menu { + display: flex; + flex-direction: column; + align-items: center; + color: #069F99; + background: #fff; + font-size: 32rpx; + font-weight: bold; + font-family: PingFang SC; + font-weight: 400; + width: 50%; + height: 60rpx; + line-height: 60rpx; + opacity: 1; + /*border-bottom: 2rpx solid #069F99;*/ + position: relative; +} + +.unselect-menu { + display: flex; + flex-direction: column; + align-items: center; + font-size: 16px; + font-family: PingFang SC; + font-weight: 400; + color: #4f4f50; + width: 50%; + height: 60rpx; + line-height: 60rpx; + background: #fff; + opacity: 1; + position: relative; + /* border-radius: 34rpx; */ +} + +.selected-line { + background: #069F99; + height: 4rpx; + width: 90rpx; + position: absolute; + /* margin-top: 10rpx; */ + bottom: -18rpx; + width: 60rpx; +}