feat(chat): 群聊隐藏左侧会话列表(对齐云客)+会话名WA去@s.whatsapp.net后缀显号码
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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(() =>
|
const filtered = computed(() =>
|
||||||
sessions.value
|
sessions.value
|
||||||
.filter((s) => (filter.value === 'all' ? true : s.type === filter.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) }"
|
:class="{ 'is-active': isActive(s) }"
|
||||||
@click="emit('select', s)"
|
@click="emit('select', s)"
|
||||||
>
|
>
|
||||||
<el-avatar :size="36" :src="s.avatar ?? undefined">{{ (s.name ?? '?').slice(0, 1) }}</el-avatar>
|
<el-avatar :size="36" :src="s.avatar ?? undefined">{{ sessionDisplayName(s.name).slice(0, 1) }}</el-avatar>
|
||||||
<div class="yk-chat-side__meta">
|
<div class="yk-chat-side__meta">
|
||||||
<div class="yk-chat-side__name">
|
<div class="yk-chat-side__name">
|
||||||
<span>{{ s.name ?? '--' }}</span>
|
<span>{{ sessionDisplayName(s.name) }}</span>
|
||||||
<span class="yk-chat-side__today">今日{{ s.today_count }}</span>
|
<span class="yk-chat-side__today">今日{{ s.today_count }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="yk-chat-side__time">{{ s.last_chat_time ? formatTime(s.last_chat_time) : '--' }}</div>
|
<div class="yk-chat-side__time">{{ s.last_chat_time ? formatTime(s.last_chat_time) : '--' }}</div>
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ onMounted(() => {
|
|||||||
<div class="yk-chat">
|
<div class="yk-chat">
|
||||||
<div class="yk-chat__body">
|
<div class="yk-chat__body">
|
||||||
<ChatSidebar
|
<ChatSidebar
|
||||||
|
v-if="!isGroup"
|
||||||
:channel="channelTyped"
|
:channel="channelTyped"
|
||||||
:owner-id="props.ownerId"
|
:owner-id="props.ownerId"
|
||||||
:active-type="activeType"
|
:active-type="activeType"
|
||||||
|
|||||||
Reference in New Issue
Block a user