From 0a1a31241828ec40560020430282f9e67dc9e2f5 Mon Sep 17 00:00:00 2001 From: zhaichao Date: Thu, 24 Sep 2026 14:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=A4=E8=81=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/chat/chat.vue | 14 ++++++++------ pages/chat/create.vue | 26 ++++++++++++++------------ pages/chat/group.vue | 15 +++++++++++---- pages/contact/detail.vue | 3 ++- pages/tabs/messages.vue | 9 +++++++++ utils/store.js | 27 +++++++++++++++++++-------- 6 files changed, 63 insertions(+), 31 deletions(-) diff --git a/pages/chat/chat.vue b/pages/chat/chat.vue index f5489dc..0e9675d 100644 --- a/pages/chat/chat.vue +++ b/pages/chat/chat.vue @@ -26,7 +26,7 @@ 暂无消息,发一条试试 {{ timeOf(m) }} - {{ m.text || '已撤回一条消息' }} + {{ m.text || '已撤回一条消息' }} - + {{ initialOf(m) }} @@ -61,7 +61,7 @@ {{ readLabel(m) }} - + {{ myInitial }} @@ -779,7 +779,9 @@ export default { } }, openSender(m) { - if (m.fromId) uni.navigateTo({ url: '/pages/contact/detail?id=' + encodeURIComponent(m.fromId) }) + const id = m && m.fromId + if (!id || !store.person(id)) return + uni.navigateTo({ url: '/pages/contact/detail?id=' + encodeURIComponent(id) }) }, goMore() { if (this.isGroup) uni.navigateTo({ url: '/pages/chat/group?sid=' + encodeURIComponent(this.sid) }) @@ -836,8 +838,8 @@ export default { .col { max-width: 72%; display: flex; flex-direction: column; } .col.mine { align-items: flex-end; } .av { width: 76rpx; height: 76rpx; border-radius: 16rpx; background: #E8F1FF; color: #1677FF; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 28rpx; font-weight: 650; } -.av.self { background: #1677FF; color: #fff; } -.av image { width: 76rpx; height: 76rpx; } +.av.self { background: #E8F1FF; color: #1677FF; } +.face { width: 76rpx; height: 76rpx; display: block; } .who { font-size: 22rpx; color: #9CA3AF; margin: 0 4rpx 8rpx; } .ball { background: #fff; diff --git a/pages/chat/create.vue b/pages/chat/create.vue index 5c1dbf7..d367e8f 100644 --- a/pages/chat/create.vue +++ b/pages/chat/create.vue @@ -8,7 +8,8 @@ - {{ p.name.slice(0, 1) }} + + {{ (p.name || '?').slice(0, 1) }} {{ p.name }} {{ p.title }} · {{ p.department }} @@ -16,7 +17,7 @@ - 创建并进入 + 创建并进入 @@ -65,17 +66,18 @@ export default { diff --git a/pages/chat/group.vue b/pages/chat/group.vue index 677fe4a..6014609 100644 --- a/pages/chat/group.vue +++ b/pages/chat/group.vue @@ -3,7 +3,10 @@ - {{ (p.name || '?').slice(0, 1) }} + + + {{ (p.name || '?').slice(0, 1) }} + {{ title }} @@ -17,7 +20,8 @@ - {{ (p.name || '?').slice(0, 1) }} + + {{ (p.name || '?').slice(0, 1) }} {{ p.name }} @@ -76,6 +80,7 @@ export default { this.members = ids.map((id) => store.person(id) || { id, name: id, title: '', department: '' }) }, open(p) { + if (!p || !store.person(p.id)) return uni.navigateTo({ url: '/pages/contact/detail?id=' + encodeURIComponent(p.id) }) }, toggle(field) { @@ -106,7 +111,8 @@ export default {