feat: support featured medals

This commit is contained in:
Tim
2025-08-21 16:10:53 +08:00
parent cd57d478f2
commit 41a5eda311
16 changed files with 141 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
export const medalTitles = {
COMMENT: '评论达人',
POST: '发帖达人',
FEATURED: '精选作者',
SEED: '种子用户',
CONTRIBUTOR: '贡献者',
PIONEER: '开山鼻祖',

View File

@@ -27,6 +27,7 @@ const iconMap = {
LOTTERY_DRAW: 'fas fa-bullhorn',
MENTION: 'fas fa-at',
POST_DELETED: 'fas fa-trash',
POST_FEATURED: 'fas fa-star',
}
export async function fetchUnreadCount() {
@@ -267,6 +268,17 @@ function createFetchNotifications() {
}
},
})
} else if (n.type === 'POST_FEATURED') {
arr.push({
...n,
icon: iconMap[n.type],
iconClick: () => {
if (n.post) {
markNotificationRead(n.id)
navigateTo(`/posts/${n.post.id}`, { replace: true })
}
},
})
} else if (n.type === 'REGISTER_REQUEST') {
arr.push({
...n,