-
-
-
{{ tab.label }}
+
+
+
-
-
-
-
-
+
+
@@ -97,7 +89,7 @@ export default {
margin: 0 auto;
}
-.about-tabs {
+:deep(.base-tabs-header) {
top: calc(var(--header-height) + 1px);
background-color: var(--background-color-blur);
display: flex;
@@ -108,13 +100,13 @@ export default {
scrollbar-width: none;
}
-.about-tabs-item {
+:deep(.base-tabs-item) {
padding: 10px 20px;
cursor: pointer;
white-space: nowrap;
}
-.about-tabs-item.selected {
+:deep(.base-tabs-item.selected) {
color: var(--primary-color);
border-bottom: 2px solid var(--primary-color);
}
diff --git a/frontend_nuxt/pages/message-box/index.vue b/frontend_nuxt/pages/message-box/index.vue
index ffb91ffb2..4c52f9d86 100644
--- a/frontend_nuxt/pages/message-box/index.vue
+++ b/frontend_nuxt/pages/message-box/index.vue
@@ -7,116 +7,113 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
- {{
- convo.lastMessage ? stripMarkdownLength(convo.lastMessage.content, 100) : '暂无消息'
- }}
-
-
- {{ convo.unreadCount }}
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
{{
- ch.lastMessage ? stripMarkdownLength(ch.lastMessage.content, 100) : ch.description
+ convo.lastMessage
+ ? stripMarkdownLength(convo.lastMessage.content, 100)
+ : '暂无消息'
}}
-
成员 {{ ch.memberCount }}
+
+ {{ convo.unreadCount }}
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ ch.lastMessage
+ ? stripMarkdownLength(ch.lastMessage.content, 100)
+ : ch.description
+ }}
+
+
成员 {{ ch.memberCount }}
+
+
+
+
+
+
@@ -132,6 +129,7 @@ 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([])
@@ -148,6 +146,10 @@ const { fetchChannelUnread: refreshChannelUnread, setFromList: setChannelUnreadF
let subscription = null
const activeTab = ref('channels')
+const tabs = [
+ { key: 'messages', label: '站内信' },
+ { key: 'channels', label: '频道' },
+]
const channels = ref([])
const loadingChannels = ref(false)
const isFloatMode = computed(() => route.query.float === '1')
@@ -216,15 +218,13 @@ async function fetchChannels() {
}
}
-function switchToMessage() {
- activeTab.value = 'messages'
- fetchConversations()
-}
-
-function switchToChannels() {
- activeTab.value = 'channels'
- fetchChannels()
-}
+watch(activeTab, (tab) => {
+ if (tab === 'messages') {
+ fetchConversations()
+ } else {
+ fetchChannels()
+ }
+})
async function goToChannel(id) {
const token = getToken()
@@ -323,18 +323,18 @@ function minimize() {
cursor: pointer;
}
-.tabs {
+:deep(.base-tabs-header) {
display: flex;
border-bottom: 1px solid var(--normal-border-color);
margin-bottom: 16px;
}
-.tab {
+:deep(.base-tabs-item) {
padding: 10px 20px;
cursor: pointer;
}
-.tab.active {
+:deep(.base-tabs-item.selected) {
border-bottom: 2px solid var(--primary-color);
color: var(--primary-color);
}
@@ -500,7 +500,7 @@ function minimize() {
display: block;
}
- .tabs,
+ :deep(.base-tabs-header),
.loading-message,
.error-container,
.search-container,
diff --git a/frontend_nuxt/pages/message.vue b/frontend_nuxt/pages/message.vue
index d694b1b2d..ed67cd2cb 100644
--- a/frontend_nuxt/pages/message.vue
+++ b/frontend_nuxt/pages/message.vue
@@ -1,515 +1,157 @@
-