From 2973b7c1a572d6b694b8fd6673879a37591761c8 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Thu, 24 Oct 2024 18:14:26 +0800 Subject: [PATCH] 1 --- components/VNavigationBar.vue | 18 ++ pages-home/home/home.vue | 122 +++++++++++++- pages-home/msg/message.vue | 253 ++++++++++++++++++++++++++++ pages-home/notice/notice.vue | 194 +++++++++++++++++++++ pages-home/notice/noticeContent.vue | 82 +++++++++ pages-home/static/msg.png | Bin 0 -> 512 bytes pages-home/static/notice.png | Bin 0 -> 681 bytes pages-warehouse/home/home.vue | 126 +++++++++++++- pages.json | 18 ++ static/images/clear.png | Bin 0 -> 2173 bytes 10 files changed, 798 insertions(+), 15 deletions(-) create mode 100644 pages-home/msg/message.vue create mode 100644 pages-home/notice/notice.vue create mode 100644 pages-home/notice/noticeContent.vue create mode 100644 pages-home/static/msg.png create mode 100644 pages-home/static/notice.png create mode 100644 static/images/clear.png diff --git a/components/VNavigationBar.vue b/components/VNavigationBar.vue index 27bd040..00718e1 100644 --- a/components/VNavigationBar.vue +++ b/components/VNavigationBar.vue @@ -19,6 +19,9 @@ {{ title }} + + + @@ -46,6 +49,10 @@ export default { leftTitle: { type: Boolean, default: false + }, + showClear: { + type: Boolean, + default: false } }, mounted() { @@ -78,6 +85,9 @@ export default { methods: { back() { uni.navigateBack() + }, + clearNoReadFun(){ + this.$emit('clearNoRead') } } } @@ -109,5 +119,13 @@ export default { font-size: 36rpx; font-weight: bold; } + .navigationBarIcon { + display: flex; + } + .clear-icon{ + width: 40rpx; + height: 40rpx; + border-radius: 50%; + } } diff --git a/pages-home/home/home.vue b/pages-home/home/home.vue index 9cc4c3c..93e78fc 100644 --- a/pages-home/home/home.vue +++ b/pages-home/home/home.vue @@ -3,14 +3,18 @@ - - - - + + + + {{ userInfo.nickname }} {{ userInfo.roleNames }} - + + + {{noReadNum}} + + @@ -54,6 +58,14 @@ + + + + + 你有{{noticeNum}}条来自平台的通知公告 + + + @@ -163,7 +175,11 @@ export default { workingNum:0, doneNum:0 }, - defaultAvatar: require('@/static/icons/avatar.png') + defaultAvatar: require('@/static/icons/avatar.png'), + //未读消息数量 + noReadNum:0, + //通知公告数量 + noticeNum:0, } }, onLoad(){ @@ -185,6 +201,8 @@ export default { }else{ //直接取缓存中的用户信息 this.userInfo = getUserInfo() + this.getNoReadNum() + this.getNoticeList() this.onRefresherrefresh() if(this.userInfo.roleCodes.includes('repair_staff')){ //维修工 @@ -199,6 +217,12 @@ export default { } }, methods: { + gotoMsg(){ + //去消息中心 + uni.navigateTo({ + url: '/pages-home/msg/message' + }) + }, /** * 上滑加载数据 */ @@ -392,7 +416,49 @@ export default { uni.navigateTo({ url: '/pages-home/service/applyList' }) - } + }, + /** + * 获取未读消息数量 + * @returns {Promise} + */ + async getNoReadNum(){ + await request({ + url: "/admin-api/system/notify-message/get-unread-count", + method: "GET" + }).then((res) => { + if(res.code==200){ + this.noReadNum = res.data>99?99:res.data + } + }) + }, + /** + * 跳转通知公告列表页 + */ + gotoNotice(){ + uni.navigateTo({ + url: '/pages-home/notice/notice' + }) + }, + /** + * 查通知公告--查数量 + */ + async getNoticeList(){ + const res = await request({ + url: "/admin-api/base/notice/page", + method: "get", + params: { + pageNo:1, + pageSize:1, + type:1, + parentServer: "weixiu", + server: "app" + }, + tenantIdFlag:false + }) + if(res.code==200){ + this.noticeNum = res.data.total + } + }, } } @@ -459,6 +525,25 @@ export default { padding: 8rpx 16rpx; } } + + .msg-box{ + position: relative; + margin-right: 40rpx; + .msg-num{ + position: absolute; + right: -15rpx; + color: white; + background: #d74a43; + width: 35rpx; + height: 35rpx; + line-height: 35rpx; + text-align: center; + font-weight: 800; + font-size: 11px; + border-radius: 50%; + top: -15rpx; + } + } } .body-top-grid { display: grid; @@ -556,7 +641,30 @@ export default { } } } + .notice-dom { + margin: 40rpx 32rpx; + background: #FFFFFF; + border-radius: 8rpx 8rpx 8rpx 8rpx; + padding: 20rpx; + display: flex; + align-items: center; + .notice-box{ + display: flex; + width: 100%; + .left-img{ + width: 48rpx; + height: 48rpx; + } + .center-text{ + width: calc(100% - 70rpx); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding:0 20rpx; + } + } + } .orderCount { margin: 40rpx 32rpx; background: #FFFFFF; diff --git a/pages-home/msg/message.vue b/pages-home/msg/message.vue new file mode 100644 index 0000000..a9b005f --- /dev/null +++ b/pages-home/msg/message.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/pages-home/notice/notice.vue b/pages-home/notice/notice.vue new file mode 100644 index 0000000..2421de1 --- /dev/null +++ b/pages-home/notice/notice.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/pages-home/notice/noticeContent.vue b/pages-home/notice/noticeContent.vue new file mode 100644 index 0000000..fe71858 --- /dev/null +++ b/pages-home/notice/noticeContent.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/pages-home/static/msg.png b/pages-home/static/msg.png new file mode 100644 index 0000000000000000000000000000000000000000..4e3dbf4e5c83ddc4f875db1bd5c51234f86c4ae3 GIT binary patch literal 512 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAF%}28J29*~C-V}>*&E;!;tHgJ zz}VPWOG`^dMa96tKu=E($Oei)*g85oMn*GO}DzyJOd;d)RG zG-`jNIx!;I>m4kGgES=TSy_Ft#xdrU}B}MwJl#tVOX%S zA&2*!GgCx8ovwEAAA7Pn#I@t|jTH(Or?%}W*fxn*deY+@k%u|F!YSOoCJ%jbb5l5F zb7h2XnM_D{W^N+l!qnFG$0vc4)0#(t^D1M|@>D$)4UL?ItV!G(6lUsVEkAa0WuAJA rq%xOTS=qI&8%YzQy{2_fn!?E7*DLyeeu#h`DDFI6{an^LB{Ts5+Ps)9 literal 0 HcmV?d00001 diff --git a/pages-home/static/notice.png b/pages-home/static/notice.png new file mode 100644 index 0000000000000000000000000000000000000000..ae0d7d1eafb8c06592e41c803c910c580288f5d0 GIT binary patch literal 681 zcmXAndq`7p6vuz_flFFyi_~Q@?FmH~X*d{?rkG~amM9q1A}KJi)o%Hm=G$2)iul4z zsPL`$M~|tQ^@o|V>2S5&G+()C8#?Co-s|q}{dH&XJ>T=;ob$)wa1=?RSdJ&p69B-8 zyAmyCvY#{9u8ixtRFh0%$;7cypkE!Z!SKqEos!KyD=crExdTfE3Sf;jfh9X&n6BSw>H8%0rvgF?n%63i`qRb>6wcpMHt@Jr|Zv+6h)S-F~7&F$l zEO)!+kCL|fkiaKBVG?R5m7v^KjeTCJm*xwG`(I?d3bfKQc}wJU%30~74~yK@kgqip zZ@V+P?6}n@MgFX*yf?jR(r{QWWyw^6`^MIh%sW3KT}}&13iOids;c10ryk$hq?!Eq zxd46zSD4t`tW5toth$gO?_Z+Z3{yVU(;nJ+E$`RXc&%>s$cS1cyvWbeY!5CWo$ZSN zWT%Bb)-xO5<2BqhgK*gFE%6(0O(HKxg7Sz14@|;DcZWv}T9rCCS^C-eW^pm1=>8~4 F@ju#CbyNTV literal 0 HcmV?d00001 diff --git a/pages-warehouse/home/home.vue b/pages-warehouse/home/home.vue index ecfb038..31412e0 100644 --- a/pages-warehouse/home/home.vue +++ b/pages-warehouse/home/home.vue @@ -3,18 +3,31 @@ - - + - - + {{ userInfo.nickname }} {{ userInfo.roleNames }} - + + + {{noReadNum}} + + + + + + + 你有{{ noticeNum }}条来自平台的通知公告 + + + + } + */ + async getNoReadNum(){ + await request({ + url: "/admin-api/system/notify-message/get-unread-count", + method: "GET" + }).then((res) => { + if(res.code==200){ + this.noReadNum = res.data>99?99:res.data + } + }) + }, + /** + * 跳转通知公告列表页 + */ + gotoNotice(){ + uni.navigateTo({ + url: '/pages-home/notice/notice' + }) + }, + /** + * 查通知公告--查数量 + */ + async getNoticeList(){ + const res = await request({ + url: "/admin-api/base/notice/page", + method: "get", + params: { + pageNo:1, + pageSize:1, + type:1, + parentServer: "weixiu", + server: "app" + }, + tenantIdFlag:false + }) + if(res.code==200){ + this.noticeNum = res.data.total + } + }, } } @@ -302,6 +368,31 @@ export default { flex-direction: column; } + .notice-dom { + margin: 40rpx 32rpx; + background: #FFFFFF; + border-radius: 8rpx 8rpx 8rpx 8rpx; + padding: 20rpx; + display: flex; + align-items: center; + + .notice-box{ + display: flex; + + .left-img{ + width: 48rpx; + height: 48rpx; + } + .center-text{ + width: calc(100% - 130rpx); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding:0 20rpx; + } + } + } + .userInfoBox { margin: 0 32rpx 40rpx; @@ -330,6 +421,25 @@ export default { padding: 8rpx 16rpx; } } + + .msg-box{ + position: relative; + margin-right: 40rpx; + .msg-num{ + position: absolute; + right: -15rpx; + color: white; + background: #d74a43; + width: 35rpx; + height: 35rpx; + line-height: 35rpx; + text-align: center; + font-weight: 800; + font-size: 11px; + border-radius: 50%; + top: -15rpx; + } + } } .body-top { diff --git a/pages.json b/pages.json index a348fd6..7773820 100644 --- a/pages.json +++ b/pages.json @@ -129,6 +129,24 @@ "navigationBarTitleText": "" } }, + { + "path": "msg/message", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "notice/notice", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "notice/noticeContent", + "style": { + "navigationBarTitleText": "" + } + }, { "path": "service/todoDetail", "style": { diff --git a/static/images/clear.png b/static/images/clear.png new file mode 100644 index 0000000000000000000000000000000000000000..2c0f153b46e5637daed82ba8b0e6147dc81ab5e2 GIT binary patch literal 2173 zcmV-@2!i*CP)uA z+eQ$cS;-a)QtkKu&;j0_X{1PJr7I@&MLu zXI7T9k|ld3OE#qM573w8-B-Iav+sQsE%~tGrU_mg9=bC5x-s6h4<4d zrDSX3&SxPY#l1g(-=BA(B$Pu06VR`<6^d7>=auRyLBm|a6$r`0{1P6V9vm-pW7qK% za{6`p0Fmf4h|E<~s*y!1ojWOukjaQ>T`voFeqYhn&^hirz()Ytfuo;0FbQay5iuLo z*mY`gJ$bqeLW&dd>$eT`;8XHxQRm6Pc?T1BJ_}3=I{Vb{Cd9wEs~l{@yM;fY0P+)& zF$yXtV5l8DjnoH3*f0-MhmK|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