From 80d5c1448fed44ad9d84827ba3ea55aa8ef5870a Mon Sep 17 00:00:00 2001 From: liqi Date: Thu, 11 Dec 2025 14:46:00 +0800 Subject: [PATCH] =?UTF-8?q?UI=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 3 + src/App.vue | 4 + src/components/call/CallWindow.vue | 417 +++++++--- src/components/call/GroupCallBanner.vue | 147 +++- src/components/call/GroupCallIncoming.vue | 225 +++--- src/components/call/GroupCallModal.vue | 394 +++++++--- src/components/call/GroupCallWindow.vue | 494 ++++++------ src/components/chat/MessageBubble.vue | 6 + src/components/chat/MessageInput.vue | 534 +++++++++++-- src/components/common/AppLoading.vue | 6 + src/components/common/AppTabBar.vue | 196 ++--- src/components/index.ts | 3 + src/pages/chat/index.vue | 905 +++++++++++++++++----- src/pages/contact/add.vue | 653 ++++++++++++---- src/pages/contact/detail.vue | 397 +++++++--- src/pages/contact/index.vue | 660 +++++++++++++--- src/pages/index/index.vue | 731 ++++++++++++----- src/pages/moment/detail.vue | 5 +- src/pages/moment/index.vue | 415 ++++++---- src/pages/moment/notify.vue | 5 +- src/pages/profile/edit.vue | 222 +++++- src/pages/profile/index.vue | 302 ++++++-- src/pages/search/index.vue | 321 ++++++-- src/pages/settings/index.vue | 342 +++++++- src/pages/settings/theme.vue | 385 +++++++-- src/static/icons/chat-active.png | 6 + src/static/icons/chat.png | 6 + src/static/icons/contact-active.png | 6 + src/static/icons/contact.png | 6 + src/static/icons/moment-active.png | 6 + src/static/icons/moment.png | 6 + src/static/images/moment-cover.jpg | 6 + src/styles/common.scss | 483 +++++++++++- src/styles/variables.scss | 164 ++-- 34 files changed, 6480 insertions(+), 1981 deletions(-) diff --git a/components.d.ts b/components.d.ts index 5b09001..fca6a51 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,6 +8,7 @@ export {} declare module 'vue' { export interface GlobalComponents { AppAvatar: typeof import('./src/components/common/AppAvatar.vue')['default'] + AppDrawer: typeof import('./src/components/common/AppDrawer.vue')['default'] AppEmpty: typeof import('./src/components/common/AppEmpty.vue')['default'] AppFooter: typeof import('./src/components/AppFooter.vue')['default'] AppLoading: typeof import('./src/components/common/AppLoading.vue')['default'] @@ -15,6 +16,7 @@ declare module 'vue' { AppNavBar: typeof import('./src/components/common/AppNavBar.vue')['default'] AppTabBar: typeof import('./src/components/common/AppTabBar.vue')['default'] CallWindow: typeof import('./src/components/call/CallWindow.vue')['default'] + GlobalCallProvider: typeof import('./src/components/call/GlobalCallProvider.vue')['default'] GroupCallBanner: typeof import('./src/components/call/GroupCallBanner.vue')['default'] GroupCallIncoming: typeof import('./src/components/call/GroupCallIncoming.vue')['default'] GroupCallModal: typeof import('./src/components/call/GroupCallModal.vue')['default'] @@ -28,6 +30,7 @@ declare module 'vue' { MomentCommentInput: typeof import('./src/components/moment/MomentCommentInput.vue')['default'] MomentCommentList: typeof import('./src/components/moment/MomentCommentList.vue')['default'] MomentNotificationPanel: typeof import('./src/components/moment/MomentNotificationPanel.vue')['default'] + PlusMenu: typeof import('./src/components/common/PlusMenu.vue')['default'] SelectContactsModal: typeof import('./src/components/chat/SelectContactsModal.vue')['default'] UserInfoCard: typeof import('./src/components/common/UserInfoCard.vue')['default'] UserMomentsModal: typeof import('./src/components/moment/UserMomentsModal.vue')['default'] diff --git a/src/App.vue b/src/App.vue index 202ea71..3417c02 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,11 +3,13 @@ import { onLaunch, onShow } from '@dcloudio/uni-app' import { useTheme } from '@/composables/useTheme' import { useAuthStore, useConversationStore } from '@/stores' import { wsManager } from '@/api/websocket' +import { useGroupWebRTC } from '@/composables/useGroupWebRTC' import type { ChatMessage } from '@/types/api' const { initTheme } = useTheme() const authStore = useAuthStore() const conversationStore = useConversationStore() +const groupWebRTC = useGroupWebRTC() // 全局消息处理器 function handleGlobalMessage(message: ChatMessage) { @@ -28,6 +30,8 @@ async function initWebSocket() { await wsManager.connect(userId) // 注册全局消息处理器 wsManager.onMessage(handleGlobalMessage) + // 初始化群通话信令监听器 + groupWebRTC.initListener() console.log('✅ WebSocket 全局初始化成功') } catch (error) { console.error('WebSocket 初始化失败:', error) diff --git a/src/components/call/CallWindow.vue b/src/components/call/CallWindow.vue index dd5388f..6711f0d 100644 --- a/src/components/call/CallWindow.vue +++ b/src/components/call/CallWindow.vue @@ -1,27 +1,36 @@ @@ -86,15 +86,32 @@ function handleJoin() { - diff --git a/src/components/call/GroupCallIncoming.vue b/src/components/call/GroupCallIncoming.vue index d1c76a4..404732c 100644 --- a/src/components/call/GroupCallIncoming.vue +++ b/src/components/call/GroupCallIncoming.vue @@ -1,30 +1,33 @@ @@ -164,7 +165,6 @@ const { callState, participants, formatDuration, localStream } = webRTC const localVideoRef = ref(null) -// 绑定本地视频流 watchEffect(() => { const stream = localStream.value const videoEl = localVideoRef.value @@ -180,69 +180,92 @@ watchEffect(() => { function toggleMinimize() { callState.minimized = !callState.minimized } - -function handleMinimize() { - if (callState.minimized) { - toggleMinimize() - } -} - diff --git a/src/components/chat/MessageBubble.vue b/src/components/chat/MessageBubble.vue index 01f49ba..5884ce7 100644 --- a/src/components/chat/MessageBubble.vue +++ b/src/components/chat/MessageBubble.vue @@ -112,3 +112,9 @@ const bubbleClass = computed(() => { + + + + + + diff --git a/src/components/chat/MessageInput.vue b/src/components/chat/MessageInput.vue index 262617c..2c19724 100644 --- a/src/components/chat/MessageInput.vue +++ b/src/components/chat/MessageInput.vue @@ -1,11 +1,16 @@