diff --git a/open-isle-cli/src/components/BaseTimeline.vue b/open-isle-cli/src/components/BaseTimeline.vue index e3ebadc12..0c14729c6 100644 --- a/open-isle-cli/src/components/BaseTimeline.vue +++ b/open-isle-cli/src/components/BaseTimeline.vue @@ -44,7 +44,7 @@ export default { width: 32px; height: 32px; border-radius: 50%; - color: white; + color: var(--text-color); display: flex; justify-content: center; align-items: center; diff --git a/open-isle-cli/src/components/CommentItem.vue b/open-isle-cli/src/components/CommentItem.vue index b4e7c9dfa..17ae9e420 100644 --- a/open-isle-cli/src/components/CommentItem.vue +++ b/open-isle-cli/src/components/CommentItem.vue @@ -18,27 +18,14 @@
-
-
-
-
🤣
-
❤️
-
👏
-
-
1882
-
-
+
- - + -
+
({ id: r.id, userName: r.author.username, time: new Date(r.createdAt).toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' }), avatar: r.author.avatar, text: r.content, + reactions: r.reactions || [], reply: [], openReplies: false, src: r.author.avatar, @@ -174,7 +164,7 @@ const CommentItem = { return { showReplies, toggleReplies, showEditor, toggleEditor, submitReply, copyCommentLink, renderMarkdown, isWaitingForReply } } } -CommentItem.components = { CommentItem, CommentEditor, BaseTimeline } +CommentItem.components = { CommentItem, CommentEditor, BaseTimeline, ReactionsGroup } export default CommentItem diff --git a/open-isle-cli/src/components/ReactionsGroup.vue b/open-isle-cli/src/components/ReactionsGroup.vue new file mode 100644 index 000000000..fa563e939 --- /dev/null +++ b/open-isle-cli/src/components/ReactionsGroup.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/open-isle-cli/src/utils/notification.js b/open-isle-cli/src/utils/notification.js index 8e912d8f9..6cce96cab 100644 --- a/open-isle-cli/src/utils/notification.js +++ b/open-isle-cli/src/utils/notification.js @@ -15,3 +15,21 @@ export async function fetchUnreadCount() { return 0 } } + +export async function markNotificationsRead(ids) { + try { + const token = getToken() + if (!token || !ids || ids.length === 0) return false + const res = await fetch(`${API_BASE_URL}/api/notifications/read`, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ ids }) + }) + return res.ok + } catch (e) { + return false + } +} diff --git a/open-isle-cli/src/views/HomePageView.vue b/open-isle-cli/src/views/HomePageView.vue index 84920a147..ced03100b 100644 --- a/open-isle-cli/src/views/HomePageView.vue +++ b/open-isle-cli/src/views/HomePageView.vue @@ -9,7 +9,13 @@
-
+
{{ topic }}
@@ -18,60 +24,71 @@
-
-
-
话题
-
-
-
参与人员
-
-
-
回复
-
-
-
浏览
-
-
-
活动
-
-
- -
- -
- -
-
-
暂时没有帖子 :( 点击发帖发送第一篇相关帖子吧!
-
-
- -
-
- - {{ article.title }} - -
{{ sanitizeDescription(article.description) }}
-