From a7ef8632a0981cc700f35d79bef811ce5a7a90c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Mon, 24 Aug 2026 18:29:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat):=20=E7=BE=A4=E8=81=8A=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E5=B7=A6=E4=BE=A7=E4=BC=9A=E8=AF=9D=E5=88=97=E8=A1=A8?= =?UTF-8?q?(=E5=AF=B9=E9=BD=90=E4=BA=91=E5=AE=A2)+=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E5=90=8DWA=E5=8E=BB@s.whatsapp.net=E5=90=8E=E7=BC=80=E6=98=BE?= =?UTF-8?q?=E5=8F=B7=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- yunkes/src/components/ChatSidebar.vue | 13 +++++++++++-- yunkes/src/views/ChatTimeline.vue | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/yunkes/src/components/ChatSidebar.vue b/yunkes/src/components/ChatSidebar.vue index cb85f1b..3eb1af7 100644 --- a/yunkes/src/components/ChatSidebar.vue +++ b/yunkes/src/components/ChatSidebar.vue @@ -32,6 +32,15 @@ async function load() { } } +/** 会话显示名:WA 无昵称时去掉 @s.whatsapp.net 后缀只显号码。 */ +function sessionDisplayName(name: string | null | undefined): string { + if (!name) return '--' + if (name.includes('@s.whatsapp.net')) { + return name.replace('@s.whatsapp.net', '') + } + return name +} + const filtered = computed(() => sessions.value .filter((s) => (filter.value === 'all' ? true : s.type === filter.value)) @@ -69,10 +78,10 @@ watch(() => [props.ownerId, props.channel] as const, load, { immediate: true }) :class="{ 'is-active': isActive(s) }" @click="emit('select', s)" > - {{ (s.name ?? '?').slice(0, 1) }} + {{ sessionDisplayName(s.name).slice(0, 1) }}
- {{ s.name ?? '--' }} + {{ sessionDisplayName(s.name) }} 今日{{ s.today_count }}
{{ s.last_chat_time ? formatTime(s.last_chat_time) : '--' }}
diff --git a/yunkes/src/views/ChatTimeline.vue b/yunkes/src/views/ChatTimeline.vue index 12c9699..e38e641 100644 --- a/yunkes/src/views/ChatTimeline.vue +++ b/yunkes/src/views/ChatTimeline.vue @@ -330,6 +330,7 @@ onMounted(() => {