From b0d784139c03396a2686ab794ccc7de69549e60e Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Mon, 14 Jul 2025 14:22:25 +0800 Subject: [PATCH] refactor message page --- .../src/components/NotificationContainer.vue | 49 ++++ open-isle-cli/src/views/MessagePageView.vue | 222 ++++-------------- 2 files changed, 89 insertions(+), 182 deletions(-) create mode 100644 open-isle-cli/src/components/NotificationContainer.vue diff --git a/open-isle-cli/src/components/NotificationContainer.vue b/open-isle-cli/src/components/NotificationContainer.vue new file mode 100644 index 000000000..19deee089 --- /dev/null +++ b/open-isle-cli/src/components/NotificationContainer.vue @@ -0,0 +1,49 @@ + + + + + + + + 标记为已读 + + 已读 + + + + + + + diff --git a/open-isle-cli/src/views/MessagePageView.vue b/open-isle-cli/src/views/MessagePageView.vue index 7f76627ab..24b08814e 100644 --- a/open-isle-cli/src/views/MessagePageView.vue +++ b/open-isle-cli/src/views/MessagePageView.vue @@ -12,8 +12,7 @@ - - + {{ item.comment.author.username }} 对我的评论 - - - 标记为已读 - - - 已读 - - + - - + {{ item.comment.author.username }} 对我的文章 @@ -47,18 +38,10 @@ {{ sanitizeDescription(item.comment.content) }} - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} 对我的文章 @@ -66,18 +49,10 @@ 进行了表态 - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} 对我的评论 @@ -85,18 +60,10 @@ 进行了表态 - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} @@ -104,18 +71,10 @@ {{ sanitizeDescription(item.post.title) }} - - - 标记为已读 - - - 已读 - - + - - + 您关注的帖子 {{ sanitizeDescription(item.post.title) }} @@ -124,50 +83,26 @@ {{ sanitizeDescription(item.comment.content) }} - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} 开始关注你了 - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} 取消关注你了 - - - 标记为已读 - - - 已读 - - + - - + 你关注的 {{ item.fromUser.username }} @@ -176,18 +111,10 @@ {{ sanitizeDescription(item.post.title) }} - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} @@ -195,18 +122,10 @@ {{ sanitizeDescription(item.post.title) }} - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} @@ -214,18 +133,10 @@ {{ sanitizeDescription(item.post.title) }} - - - 标记为已读 - - - 已读 - - + - - + {{ item.fromUser.username }} @@ -234,76 +145,45 @@ {{ sanitizeDescription(item.post.title) }} ,请审核 - - - 标记为已读 - - - 已读 - - + - - + 您发布的帖子 {{ sanitizeDescription(item.post.title) }} 已提交审核 - - - 标记为已读 - - - 已读 - - + - - + 您发布的帖子 {{ sanitizeDescription(item.post.title) }} 已审核通过 - - - 标记为已读 - 已读 - - + + + 标记为已读 + 已读 + + + - - + 您发布的帖子 {{ sanitizeDescription(item.post.title) }} 已被管理员拒绝 - - - 标记为已读 - - - 已读 - - + - - + {{ formatType(item.type) }} - - - 标记为已读 - - - 已读 - - + {{ TimeManager.format(item.createdAt) }} @@ -319,6 +199,7 @@ import { useRouter } from 'vue-router' import { API_BASE_URL } from '../main' import BaseTimeline from '../components/BaseTimeline.vue' import BasePlaceholder from '../components/BasePlaceholder.vue' +import NotificationContainer from '../components/NotificationContainer.vue' import { getToken } from '../utils/auth' import { markNotificationsRead } from '../utils/notification' import { toast } from '../main' @@ -329,7 +210,7 @@ hatch.register() export default { name: 'MessagePageView', - components: { BaseTimeline, BasePlaceholder }, + components: { BaseTimeline, BasePlaceholder, NotificationContainer }, setup() { const router = useRouter() const notifications = ref([]) @@ -580,16 +461,6 @@ export default { color: gray; } -.notif-content-container { - color: rgb(140, 140, 140); - font-weight: normal; - font-size: 14px; - opacity: 0.8; - display: flex; - justify-content: space-between; - align-items: center; -} - .notif-content-text { font-weight: bold; color: var(--primary-color) !important; @@ -606,18 +477,5 @@ export default { color: var(--text-color); } -.mark-read-button { - color: var(--primary-color); - font-size: 12px; - cursor: pointer; -} - -.mark-read-button:hover { - text-decoration: underline; -} - -.has-read-button { - font-size: 12px; -}