diff --git a/src/api/modules/contact.ts b/src/api/modules/contact.ts index ecc0ab5..45df62a 100644 --- a/src/api/modules/contact.ts +++ b/src/api/modules/contact.ts @@ -14,7 +14,7 @@ export function searchUsers(keyword: string, limit = 20) { return request.get('/contacts/search', { keyword, limit }) } -// 添加好友(发送申请) +// 添加好友.html(发送申请) export function addFriend(data: { to_user_id: string; message?: string }) { return request.post('/contacts/add-friend', data) } diff --git a/src/components/common/AppTabBar.vue b/src/components/common/AppTabBar.vue index d903f9a..85083d4 100644 --- a/src/components/common/AppTabBar.vue +++ b/src/components/common/AppTabBar.vue @@ -194,7 +194,7 @@ function switchTab(name: string) { - + diff --git a/src/pages/contact/add.vue b/src/pages/contact/add.vue index 8c30719..015f941 100644 --- a/src/pages/contact/add.vue +++ b/src/pages/contact/add.vue @@ -111,7 +111,7 @@ import type { User } from '@/types/api' const toast = useToast(); const message = useMessage(); const { isDark } = useTheme(); const keyword = ref(''); const loading = ref(false); const searched = ref(false); const results = ref([]); async function doSearch() { if (!keyword.value.trim()) { toast.show('请输入搜索内容'); return } loading.value = true; searched.value = true; try { results.value = await contactApi.searchUsers(keyword.value.trim()) } catch (error) { console.error('搜索失败:', error); toast.error('搜索失败') } finally { loading.value = false } } -async function addFriend(user: User) { try { const { value } = await message.prompt({ title: '添加好友', inputPlaceholder: '请输入验证消息', inputValue: '你好,我是...' }); await contactApi.addFriend({ to_user_id: user.id, message: value || '' }); toast.success('申请已发送') } catch (e: any) { if (e !== 'cancel') { toast.error('发送失败') } } } +async function addFriend(user: User) { try { const { value } = await message.prompt({ title: '添加好友.html', inputPlaceholder: '请输入验证消息', inputValue: '你好,我是...' }); await contactApi.addFriend({ to_user_id: user.id, message: value || '' }); toast.success('申请已发送') } catch (e: any) { if (e !== 'cancel') { toast.error('发送失败') } } } function scanQrCode() { uni.scanCode({ onlyFromCamera: false, success: (res) => { console.log('扫码结果:', res.result); toast.show('扫码功能开发中') }, fail: () => { toast.error('扫码失败') } }) } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 2ca176e..7c13564 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -206,7 +206,7 @@ const themeText = computed(() => { const plusMenuActions = [ { name: '创建群聊', value: 'createGroup' }, - { name: '添加好友', value: 'addFriend' }, + { name: '添加好友.html', value: 'addFriend' }, { name: '扫一扫', value: 'scan' } ] @@ -248,7 +248,7 @@ function goChat(item: Conversation) { } function handleLongPress(item: Conversation) { selectedConv.value = item; showConvActions.value = true } async function onConvActionSelect(event: any) { - // Wot-UI select 事件通常返回 { item, index },或者直接是 detail 对象 + // Wot-UI设计 select 事件通常返回 { item, index },或者直接是 detail 对象 // 防御性获取 item const action = event.item || event diff --git a/src/pages/moment/index.vue b/src/pages/moment/index.vue index 39dc88c..1097bdf 100644 --- a/src/pages/moment/index.vue +++ b/src/pages/moment/index.vue @@ -177,7 +177,7 @@ const { isDark } = useTheme() const toast = useToast() const messageBox = useMessage() -// --- UI 状态 (新增) --- +// --- UI设计 状态 (新增) --- const navOpacity = ref(0) const iconColor = computed(() => { // 当导航栏变白时,图标变黑;否则为白色