mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-07-24 05:26:16 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba5f0148af | |||
| cfe24b5e8e | |||
| 52633c8073 | |||
| 4802c78156 | |||
| cf2299f9bf | |||
| f03bf92641 | |||
| 8bb9c3e3d9 | |||
| 05d56df44e | |||
| 5b0cbe8ce9 | |||
| 140d33d024 |
@@ -7,7 +7,11 @@
|
|||||||
@click="item.iconClick && item.iconClick()"
|
@click="item.iconClick && item.iconClick()"
|
||||||
>
|
>
|
||||||
<BaseImage v-if="item.src" :src="item.src" class="timeline-img" alt="timeline item" />
|
<BaseImage v-if="item.src" :src="item.src" class="timeline-img" alt="timeline item" />
|
||||||
<i v-else-if="item.icon" :class="item.icon"></i>
|
<component
|
||||||
|
v-else-if="item.icon && (typeof item.icon !== 'string' || !item.icon.includes(' '))"
|
||||||
|
:is="item.icon"
|
||||||
|
:size="20"
|
||||||
|
/>
|
||||||
<BaseImage v-else-if="item.emoji" :src="item.emoji" class="timeline-emoji" alt="emoji" />
|
<BaseImage v-else-if="item.emoji" :src="item.emoji" class="timeline-emoji" alt="emoji" />
|
||||||
</div>
|
</div>
|
||||||
<div class="timeline-content">
|
<div class="timeline-content">
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
<template #option="{ option }">
|
<template #option="{ option }">
|
||||||
<div class="option-container">
|
<div class="option-container">
|
||||||
<div class="option-main">
|
<div class="option-main">
|
||||||
<template v-if="option.icon">
|
<template v-if="option.smallIcon || option.icon">
|
||||||
<BaseImage
|
<BaseImage
|
||||||
v-if="isImageIcon(option.icon)"
|
v-if="isImageIcon(option.smallIcon || option.icon)"
|
||||||
:src="option.icon"
|
:src="option.smallIcon || option.icon"
|
||||||
class="option-icon"
|
class="option-icon"
|
||||||
:alt="option.name"
|
:alt="option.name"
|
||||||
/>
|
/>
|
||||||
<i v-else :class="['option-icon', option.icon]"></i>
|
<component v-else :is="option.smallIcon || option.icon" class="option-icon" />
|
||||||
</template>
|
</template>
|
||||||
<span>{{ option.name }}</span>
|
<span>{{ option.name }}</span>
|
||||||
<span class="option-count" v-if="option.count > 0"> x {{ option.count }}</span>
|
<span class="option-count" v-if="option.count > 0"> x {{ option.count }}</span>
|
||||||
|
|||||||
@@ -368,11 +368,11 @@ const selectedTab = ref(
|
|||||||
: 'summary',
|
: 'summary',
|
||||||
)
|
)
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ key: 'summary', label: '总结', icon: 'ChartLine' },
|
{ key: 'summary', label: '总结', icon: 'chart-line' },
|
||||||
{ key: 'timeline', label: '时间线', icon: 'AlarmClock' },
|
{ key: 'timeline', label: '时间线', icon: 'alarm-clock' },
|
||||||
{ key: 'following', label: '关注', icon: 'AddUser' },
|
{ key: 'following', label: '关注', icon: 'add-user' },
|
||||||
{ key: 'favorites', label: '收藏', icon: 'Bookmark' },
|
{ key: 'favorites', label: '收藏', icon: 'bookmark' },
|
||||||
{ key: 'achievements', label: '勋章', icon: 'MedalOne' },
|
{ key: 'achievements', label: '勋章', icon: 'medal-one' },
|
||||||
]
|
]
|
||||||
const followTab = ref('followers')
|
const followTab = ref('followers')
|
||||||
|
|
||||||
@@ -415,19 +415,19 @@ const fetchSummary = async () => {
|
|||||||
const postsRes = await fetch(`${API_BASE_URL}/api/users/${username}/hot-posts`)
|
const postsRes = await fetch(`${API_BASE_URL}/api/users/${username}/hot-posts`)
|
||||||
if (postsRes.ok) {
|
if (postsRes.ok) {
|
||||||
const data = await postsRes.json()
|
const data = await postsRes.json()
|
||||||
hotPosts.value = data.map((p) => ({ icon: 'fas fa-book', post: p }))
|
hotPosts.value = data.map((p) => ({ icon: 'file-text', post: p }))
|
||||||
}
|
}
|
||||||
|
|
||||||
const repliesRes = await fetch(`${API_BASE_URL}/api/users/${username}/hot-replies`)
|
const repliesRes = await fetch(`${API_BASE_URL}/api/users/${username}/hot-replies`)
|
||||||
if (repliesRes.ok) {
|
if (repliesRes.ok) {
|
||||||
const data = await repliesRes.json()
|
const data = await repliesRes.json()
|
||||||
hotReplies.value = data.map((c) => ({ icon: 'fas fa-comment', comment: c }))
|
hotReplies.value = data.map((c) => ({ icon: 'comment-icon', comment: c }))
|
||||||
}
|
}
|
||||||
|
|
||||||
const tagsRes = await fetch(`${API_BASE_URL}/api/users/${username}/hot-tags`)
|
const tagsRes = await fetch(`${API_BASE_URL}/api/users/${username}/hot-tags`)
|
||||||
if (tagsRes.ok) {
|
if (tagsRes.ok) {
|
||||||
const data = await tagsRes.json()
|
const data = await tagsRes.json()
|
||||||
hotTags.value = data.map((t) => ({ icon: 'fas fa-tag', tag: t }))
|
hotTags.value = data.map((t) => ({ icon: 'tag-one', tag: t }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,19 +443,19 @@ const fetchTimeline = async () => {
|
|||||||
const mapped = [
|
const mapped = [
|
||||||
...posts.map((p) => ({
|
...posts.map((p) => ({
|
||||||
type: 'post',
|
type: 'post',
|
||||||
icon: 'fas fa-book',
|
icon: 'file-text',
|
||||||
post: p,
|
post: p,
|
||||||
createdAt: p.createdAt,
|
createdAt: p.createdAt,
|
||||||
})),
|
})),
|
||||||
...replies.map((r) => ({
|
...replies.map((r) => ({
|
||||||
type: r.parentComment ? 'reply' : 'comment',
|
type: r.parentComment ? 'reply' : 'comment',
|
||||||
icon: 'fas fa-comment',
|
icon: 'comment-icon',
|
||||||
comment: r,
|
comment: r,
|
||||||
createdAt: r.createdAt,
|
createdAt: r.createdAt,
|
||||||
})),
|
})),
|
||||||
...tags.map((t) => ({
|
...tags.map((t) => ({
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
icon: 'fas fa-tag',
|
icon: 'tag-one',
|
||||||
tag: t,
|
tag: t,
|
||||||
createdAt: t.createdAt,
|
createdAt: t.createdAt,
|
||||||
})),
|
})),
|
||||||
@@ -477,7 +477,7 @@ const fetchFavorites = async () => {
|
|||||||
const res = await fetch(`${API_BASE_URL}/api/users/${username}/subscribed-posts`)
|
const res = await fetch(`${API_BASE_URL}/api/users/${username}/subscribed-posts`)
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
favoritePosts.value = data.map((p) => ({ icon: 'fas fa-bookmark', post: p }))
|
favoritePosts.value = data.map((p) => ({ icon: 'bookmark', post: p }))
|
||||||
} else {
|
} else {
|
||||||
favoritePosts.value = []
|
favoritePosts.value = []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,28 +9,28 @@ export const notificationState = reactive({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const iconMap = {
|
const iconMap = {
|
||||||
POST_VIEWED: 'fas fa-eye',
|
POST_VIEWED: 'HistoryIcon',
|
||||||
COMMENT_REPLY: 'fas fa-reply',
|
COMMENT_REPLY: 'MessageOne',
|
||||||
POST_REVIEWED: 'fas fa-shield-alt',
|
POST_REVIEWED: 'CheckCorrect',
|
||||||
POST_REVIEW_REQUEST: 'fas fa-gavel',
|
POST_REVIEW_REQUEST: 'FileText',
|
||||||
POST_UPDATED: 'fas fa-comment-dots',
|
POST_UPDATED: 'Edit',
|
||||||
USER_ACTIVITY: 'fas fa-user',
|
USER_ACTIVITY: 'UserIcon',
|
||||||
FOLLOWED_POST: 'fas fa-feather-alt',
|
FOLLOWED_POST: 'Pin',
|
||||||
USER_FOLLOWED: 'fas fa-user-plus',
|
USER_FOLLOWED: 'AddUser',
|
||||||
USER_UNFOLLOWED: 'fas fa-user-minus',
|
USER_UNFOLLOWED: 'ReduceUser',
|
||||||
POST_SUBSCRIBED: 'fas fa-bookmark',
|
POST_SUBSCRIBED: 'Bookmark',
|
||||||
POST_UNSUBSCRIBED: 'fas fa-bookmark',
|
POST_UNSUBSCRIBED: 'Bookmark',
|
||||||
REGISTER_REQUEST: 'fas fa-user-clock',
|
REGISTER_REQUEST: 'AlarmClock',
|
||||||
ACTIVITY_REDEEM: 'fas fa-coffee',
|
ACTIVITY_REDEEM: 'PaperMoneyTwo',
|
||||||
POINT_REDEEM: 'fas fa-gift',
|
POINT_REDEEM: 'Gift',
|
||||||
LOTTERY_WIN: 'fas fa-trophy',
|
LOTTERY_WIN: 'MedalOne',
|
||||||
LOTTERY_DRAW: 'fas fa-bullhorn',
|
LOTTERY_DRAW: 'Fireworks',
|
||||||
POLL_VOTE: 'fas fa-square-poll-vertical',
|
POLL_VOTE: 'ChartHistogram',
|
||||||
POLL_RESULT_OWNER: 'fas fa-flag-checkered',
|
POLL_RESULT_OWNER: 'RankingList',
|
||||||
POLL_RESULT_PARTICIPANT: 'fas fa-flag-checkered',
|
POLL_RESULT_PARTICIPANT: 'ChartLine',
|
||||||
MENTION: 'fas fa-at',
|
MENTION: 'HashtagKey',
|
||||||
POST_DELETED: 'fas fa-trash',
|
POST_DELETED: 'ClearIcon',
|
||||||
POST_FEATURED: 'fas fa-star',
|
POST_FEATURED: 'Star',
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchUnreadCount() {
|
export async function fetchUnreadCount() {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default (apiBaseUrl, websiteBaseUrl) => {
|
|||||||
return (
|
return (
|
||||||
body.map((item) => ({
|
body.map((item) => ({
|
||||||
value: `[🔗${item.title}](${websiteBaseUrl}/posts/${item.id})`,
|
value: `[🔗${item.title}](${websiteBaseUrl}/posts/${item.id})`,
|
||||||
html: `<div><i class="fas fa-link"></i> ${item.title}</div>`,
|
html: `<div><link-icon /> ${item.title}</div>`,
|
||||||
})) ?? []
|
})) ?? []
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user