feat: add BaseUserAvatar and unify avatar usage

This commit is contained in:
Tim
2025-09-24 00:26:51 +08:00
parent 26d1db79f4
commit efbb83924b
15 changed files with 263 additions and 91 deletions
+5 -7
View File
@@ -17,13 +17,14 @@
></div>
</div>
<div class="poll-participants">
<BaseImage
<BaseUserAvatar
v-for="p in pollOptionParticipants[idx] || []"
:key="p.id"
class="poll-participant-avatar"
:src="p.avatar"
alt="avatar"
@click="gotoUser(p.id)"
:user-id="p.id"
:avatar="p.avatar"
:username="p.username"
:width="30"
/>
</div>
</div>
@@ -152,8 +153,6 @@ watch([hasVoted, pollEnded], ([voted, ended]) => {
if (voted || ended) showPollResult.value = true
})
const gotoUser = (id) => navigateTo(`/users/${id}`, { replace: true })
const config = useRuntimeConfig()
const API_BASE_URL = config.public.apiBaseUrl
const voteOption = async (idx) => {
@@ -426,7 +425,6 @@ const submitMultiPoll = async () => {
.poll-participant-avatar {
width: 30px;
height: 30px;
border-radius: 50%;
cursor: pointer;
}
</style>