From b34fdc9c2d13167652ca1b33aca4e76c3fb7bb5f Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Fri, 17 Feb 2023 16:41:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=8F=90=E9=86=92=E7=9A=84bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/images/main/clear.png | Bin 0 -> 1020 bytes src/assets/images/main/close.png | Bin 0 -> 560 bytes src/assets/scss/common.scss | 6 +- src/views/main-navbar.vue | 140 +++++++++++++++++++++++++++--- src/views/modules/home/notice.vue | 134 ++++++++++++++++++++-------- 5 files changed, 231 insertions(+), 49 deletions(-) create mode 100644 src/assets/images/main/clear.png create mode 100644 src/assets/images/main/close.png diff --git a/src/assets/images/main/clear.png b/src/assets/images/main/clear.png new file mode 100644 index 0000000000000000000000000000000000000000..c78f41b377e50a629fecee90a1eba2f8771869c9 GIT binary patch literal 1020 zcmVPx&wn;=mR9HvFmrZCKWf;eQ&s29~toVTkd(gIsIx~vWmTC_oC@mh;gO}Y@DlOQ= z5A;wdMg?&NMXaK|C~dS*X*4_QO;bErS`Qwg#rB|`*;+A*Vxb^fZKcL!9+`RfV|KH< zGubGaQ^>yW^Zz~1^MBrXM_A%VmRO(p0II^~>ULBgLAe=No)K~e;RMK0gjXm#KV;e0 z3b4gr!HkT9-jii>*EPauEguwT=MBTOq<@$>~@eKvFysSY|!UggxE@Al7cs0A&~G<(Lt@rG8HI1}N!8oceB% z_iy-PUQ61=g*hgjS2><=5k+r_b7rD8wR z0@=w^#o!}UA3!*c=dLwFQh(YvJasD1nc1IFy&9NBtcPNVEaFKMCQV%kUIu**n4#k4 zdjrHls&_*;2@KXCc0#x#Hk{erTJ~fKI#pmOC=u!l@v@2=C!cP@R)~Z|hqC`K0P`ym z9TxL@-tN->tO5;>e0vu%7adTOc+MNC2UQ;ce*-xziQeUrQTl&Mn!^vGcu}>Ur((Yp z|Jl<6MgJJe8jyojocsG%2cntRxi5{rwVkrPF9SfZ7u6AvIYjTobEo=-CV|4&c&Z> qBKw%I-)+AcX9virw$Nou4)8C6_0up-Fk!C%0000Px$>PbXFR9Hvt)<>??KoE!V-@5=g!;YMD5E2sc1}s@{BJRKmSRyhTR*#$!If^LY z0)R>?OC!UKyZt0)Gv3;+@9Te6w>@Rd*VLH#CIXWLMkR0x8*u_(dJgL>oW@U_{8x=p z0vB-v_iz|rDwfmWXzI8&Ysi!gu2Z4q+%fYLp1Hlem*fv?T(50lN|&vA^w_n^J+Ovn1QG z4sD6Kx$=NN&)DB}!D|v|Y7I)nWXCS~oh#poXBm4DypKSW#8s@#?ez;g@HFA?OIF@I zQ`3UMx=XViArV)=qvs!L;C&N__vRxGs%;6pmF@WcKLi4P30v_bchVZ%#8Fg9)V5$j zt~}t6^N5Zbabot8s1XQwtb9wtlE1D|0@tt~0go?W?O)NLM4TBhm{kI2Fb~Ijzz35!o5OgZR-kKu yOYb)+$49Fwfl|PXp6l8LGb@
- +
+ +
- +
{{ unreadMsgNum }} - +
+ +
@@ -136,6 +140,23 @@ > + +
+
新提醒
+
+ +
+
+ {{ noticeList[0].createdTime }} + NEW +
+
+ {{ noticeList[0].content }} +
+
@@ -157,6 +178,10 @@ export default { customerName: "", unreadMsgNum: 0, + + noticeList: [], + + displayedNoticeList: true, }; }, components: { @@ -182,7 +207,8 @@ export default { }, }, methods: { - toRemindPage() { + toNoticePage() { + this.displayedNoticeList = false; this.$router.replace("/main/home-notice"); }, @@ -284,15 +310,39 @@ export default { const { data, code, msg } = await requestGet(url, {}); if (code === 0) { console.log("列表请求成功!!!!!!!!!!!!!!"); + if (data.unreadNum > 0 && this.unreadMsgNum < data.unreadNum) { + this.getNoticeList(); + this.displayedNoticeList = true; + } this.unreadMsgNum = data.unreadNum; } else { } }, + + //加载组织数据 + async getNoticeList() { + const url = "/message/intelligentMessage/page"; + let params = { + page: this.pageNo, + limit: this.pageSize, + readFlag: 0, + }; + + const { data, code, msg } = await requestGet(url, params); + + if (code === 0) { + this.noticeList = data.list; + } else { + this.$message.error(msg); + } + }, }, }; diff --git a/src/views/modules/home/notice.vue b/src/views/modules/home/notice.vue index 0cc1a9f72..83288500b 100644 --- a/src/views/modules/home/notice.vue +++ b/src/views/modules/home/notice.vue @@ -2,14 +2,13 @@
-
- - - - - +
+
全部提醒
+
+ + 全部标记已读 +
-
- + 已读 + 未读
{{ item.content }}
+
+ + 标记已读 +
{{ item.createdTime }}
@@ -75,7 +80,7 @@ export default { }, computed: {}, watch: {}, - mounted() { + activated() { this.getList(); }, methods: { @@ -89,21 +94,21 @@ export default { this.read(item, index); }, - async read(item) { - if (item.readFlag == 1) return; + async read(item, index) { + if (item && item.readFlag == 1) return; const url = "/message/intelligentMessage/msg/clear"; - let params = { - id: item.id, - }; + let params = {}; + + if (item.id) { + params.id = item.id; + } const { data, code, msg } = await requestPost(url, params); if (code === 0) { - const { noticeData } = this; - noticeData[index].readFlag = 1; - this.noticeData = noticeData; console.log("消息已读"); + this.getList(); } else { this.$message.error(msg); } @@ -183,6 +188,7 @@ export default { } .item { + position: relative; display: flex; align-items: center; padding: 16px 0 12px; @@ -191,12 +197,31 @@ export default { border-bottom: none; } - .item-tag { + &:hover { + .item-title { + color: #0056d6; + } + .item-btn-clear { + display: block; + } + } + + .i-tag { display: block; margin-right: 15px; - width: 24px; - height: 24px; + width: 40px; + height: 22px; + border-radius: 4px; + border: 1px solid rgba(0, 0, 0, 0.15); + font-size: 12px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: rgba(0, 0, 0, 0.88); + line-height: 20px; + font-style: normal; + text-align: center; } + .item-title { // @include toe; width: 60%; @@ -207,7 +232,29 @@ export default { color: rgba(0, 0, 0, 0.85); line-height: 22px; } + + .item-btn-clear { + position: absolute; + display: none; + top: 50%; + left: 65%; + width: 80px; + font-size: 14px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #0042a3; + line-height: 16px; + cursor: pointer; + transform: translateY(-50%); + + img { + width: 16px; + margin-right: 3px; + } + } + .item-date { + margin-left: 100px; font-size: 12px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; @@ -216,21 +263,32 @@ export default { } } } - .btn-clear { - position: absolute; - top: 14px; - right: 15px; - width: 32px; - height: 12px; - width: 75px; - height: 25px; - background: linear-gradient(0deg, #db3b3b 1%, #ff8080 100%); - border-radius: 3px; - font-size: 14px; - font-weight: 500; - color: #ffffff; - line-height: 25px; - text-align: center; + .header { + display: flex; + justify-content: space-between; + padding: 12px 0; + margin-bottom: 10px; + border-bottom: 1px solid #f0f5fa; + .title { + height: 22px; + font-size: 16px; + font-family: PingFangSC-Medium, PingFang SC; + font-weight: 500; + color: rgba(0, 0, 0, 0.85); + line-height: 22px; + } + .btn-clear { + font-size: 14px; + font-family: PingFangSC-Regular, PingFang SC; + font-weight: 400; + color: #0042a3; + line-height: 16px; + cursor: pointer; + img { + width: 16px; + margin-right: 3px; + } + } } }