From efbb83924b2e2d3b713a68e892323fc03f331d1d Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Wed, 24 Sep 2025 00:26:51 +0800 Subject: [PATCH] feat: add BaseUserAvatar and unify avatar usage --- frontend_nuxt/components/BaseTimeline.vue | 25 ++-- frontend_nuxt/components/BaseUserAvatar.vue | 116 ++++++++++++++++++ frontend_nuxt/components/CommentItem.vue | 15 ++- frontend_nuxt/components/HeaderComponent.vue | 10 +- .../components/PostChangeLogItem.vue | 11 +- frontend_nuxt/components/PostLottery.vue | 22 ++-- frontend_nuxt/components/PostPoll.vue | 12 +- .../components/SearchPersonDropdown.vue | 15 +-- frontend_nuxt/components/UserList.vue | 11 +- frontend_nuxt/pages/index.vue | 33 ++--- frontend_nuxt/pages/message-box/[id].vue | 14 ++- frontend_nuxt/pages/message-box/index.vue | 21 +++- frontend_nuxt/pages/posts/[id]/index.vue | 29 +++-- frontend_nuxt/pages/users/[id].vue | 10 +- frontend_nuxt/utils/notification.js | 10 ++ 15 files changed, 263 insertions(+), 91 deletions(-) create mode 100644 frontend_nuxt/components/BaseUserAvatar.vue diff --git a/frontend_nuxt/components/BaseTimeline.vue b/frontend_nuxt/components/BaseTimeline.vue index b95d5e422..f5bb3f7d0 100644 --- a/frontend_nuxt/components/BaseTimeline.vue +++ b/frontend_nuxt/components/BaseTimeline.vue @@ -3,10 +3,19 @@
- + + + + + + + + + diff --git a/frontend_nuxt/components/CommentItem.vue b/frontend_nuxt/components/CommentItem.vue index 584f0a90b..be12aaf29 100644 --- a/frontend_nuxt/components/CommentItem.vue +++ b/frontend_nuxt/components/CommentItem.vue @@ -26,10 +26,14 @@ - {{ comment.parentUserName }} @@ -253,16 +257,19 @@ const submitReply = async (parentUserName, text, clear) => { replyList.push({ id: data.id, userName: data.author.username, + userId: data.author.id, time: TimeManager.format(data.createdAt), avatar: data.author.avatar, medal: data.author.displayMedal, text: data.content, parentUserName: parentUserName, parentUserAvatar: props.comment.avatar, + parentUserId: props.comment.userId, reactions: [], reply: (data.replies || []).map((r) => ({ id: r.id, userName: r.author.username, + userId: r.author.id, time: TimeManager.format(r.createdAt), avatar: r.author.avatar, text: r.content, @@ -394,9 +401,7 @@ const handleContentClick = (e) => { .reply-avatar { width: 20px; height: 20px; - border-radius: 50%; margin-right: 5px; - cursor: pointer; } .reply-icon { diff --git a/frontend_nuxt/components/HeaderComponent.vue b/frontend_nuxt/components/HeaderComponent.vue index 0f1176a9f..51605425c 100644 --- a/frontend_nuxt/components/HeaderComponent.vue +++ b/frontend_nuxt/components/HeaderComponent.vue @@ -70,7 +70,14 @@ @@ -434,7 +441,6 @@ onMounted(async () => { height: 32px; border-radius: 50%; background-color: lightgray; - object-fit: cover; } .dropdown-icon { diff --git a/frontend_nuxt/components/PostChangeLogItem.vue b/frontend_nuxt/components/PostChangeLogItem.vue index 31988452a..5f0198957 100644 --- a/frontend_nuxt/components/PostChangeLogItem.vue +++ b/frontend_nuxt/components/PostChangeLogItem.vue @@ -1,12 +1,13 @@