From 610a6450925eb8fc18dc8ac7b3104cddf8e39307 Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 27 Aug 2025 12:30:08 +0800 Subject: [PATCH] Revert "feat: create BaseTabs component" This reverts commit 0fc1415a14707d332268124fc0ba78fa9abc087e. --- frontend_nuxt/components/BaseTabs.vue | 50 ---------- frontend_nuxt/pages/about/index.vue | 42 ++++---- frontend_nuxt/pages/message-box/index.vue | 39 ++++---- frontend_nuxt/pages/message.vue | 33 ++++--- frontend_nuxt/pages/points.vue | 27 ++--- frontend_nuxt/pages/users/[id].vue | 114 ++++++++++++++-------- 6 files changed, 145 insertions(+), 160 deletions(-) delete mode 100644 frontend_nuxt/components/BaseTabs.vue diff --git a/frontend_nuxt/components/BaseTabs.vue b/frontend_nuxt/components/BaseTabs.vue deleted file mode 100644 index f90befed1..000000000 --- a/frontend_nuxt/components/BaseTabs.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - - - diff --git a/frontend_nuxt/pages/about/index.vue b/frontend_nuxt/pages/about/index.vue index 23e7760ed..8d5aaa60f 100644 --- a/frontend_nuxt/pages/about/index.vue +++ b/frontend_nuxt/pages/about/index.vue @@ -1,16 +1,15 @@ diff --git a/frontend_nuxt/pages/message-box/index.vue b/frontend_nuxt/pages/message-box/index.vue index 30c85f3b7..ffb91ffb2 100644 --- a/frontend_nuxt/pages/message-box/index.vue +++ b/frontend_nuxt/pages/message-box/index.vue @@ -7,13 +7,14 @@
- +
+
+ 站内信 +
+
+ 频道 +
+
@@ -131,7 +132,6 @@ import TimeManager from '~/utils/time' import { stripMarkdownLength } from '~/utils/markdown' import SearchPersonDropdown from '~/components/SearchPersonDropdown.vue' import BasePlaceholder from '~/components/BasePlaceholder.vue' -import BaseTabs from '~/components/BaseTabs.vue' const config = useRuntimeConfig() const conversations = ref([]) @@ -146,24 +146,13 @@ const { fetchUnreadCount: refreshGlobalUnreadCount } = useUnreadCount() const { fetchChannelUnread: refreshChannelUnread, setFromList: setChannelUnreadFromList } = useChannelsUnreadCount() let subscription = null -const tabs = [ - { name: 'messages', label: '站内信' }, - { name: 'channels', label: '频道' }, -] + const activeTab = ref('channels') const channels = ref([]) const loadingChannels = ref(false) const isFloatMode = computed(() => route.query.float === '1') const floatRoute = useState('messageFloatRoute') -watch(activeTab, (tab) => { - if (tab === 'messages') { - fetchConversations() - } else { - fetchChannels() - } -}) - async function fetchConversations() { const token = getToken() if (!token) { @@ -227,6 +216,16 @@ async function fetchChannels() { } } +function switchToMessage() { + activeTab.value = 'messages' + fetchConversations() +} + +function switchToChannels() { + activeTab.value = 'channels' + fetchChannels() +} + async function goToChannel(id) { const token = getToken() if (!token) { diff --git a/frontend_nuxt/pages/message.vue b/frontend_nuxt/pages/message.vue index 8496e2ccc..d694b1b2d 100644 --- a/frontend_nuxt/pages/message.vue +++ b/frontend_nuxt/pages/message.vue @@ -1,13 +1,26 @@