Bladeren bron

feat: 修改通知列表只显示未读,已读不计入首页familyFeed顶部

- loadNotifications() 仅过滤 isRead===0 的未读通知
- 已读通知仍可在 消息历史 页面的「全部」筛选中查看
- 平台公告 (/api/admin/notices/all) 逻辑不受影响
Sisyphus 1 dag geleden
bovenliggende
commit
cb319a2dd0
1 gewijzigde bestanden met toevoegingen van 3 en 4 verwijderingen
  1. 3 4
      cfc-frontend/pages/index-home/index.vue

+ 3 - 4
cfc-frontend/pages/index-home/index.vue

@@ -1114,7 +1114,7 @@ title: '添加家庭成员',
         }
       }).catch(function() {})
     },
-    // W3: 用户通知入动态(未读优先显示在 familyFeed 顶部)
+    // W3: 用户通知入动态(仅显示未读,已读不计入 familyFeed 顶部)
     loadNotifications: function() {
       var self = this
       getNotificationList().then(function(res) {
@@ -1135,10 +1135,9 @@ title: '添加家庭成员',
               notice: n
             }
           })
+          // 仅显示未读通知在 familyFeed 顶部(最多10条)
           var unread = notifications.filter(function(n) { return n.unread })
-          var read = notifications.filter(function(n) { return !n.unread })
-          // 未读在前,已读在后,合并到 familyFeed 顶部
-          self.familyFeed = unread.concat(read, self.familyFeed).slice(0, 10)
+          self.familyFeed = unread.slice(0, 10)
         }
       }).catch(function() {})
     },