diff --git a/yunkes/src/views/CallList.vue b/yunkes/src/views/CallList.vue index a7211b0..43e8ac0 100644 --- a/yunkes/src/views/CallList.vue +++ b/yunkes/src/views/CallList.vue @@ -134,6 +134,11 @@ function openDrawer(row: PhoneCall): void { drawerOpen.value = true } +/** 把通话类型(voice_call/wa_voice_call)映射到聊天渠道(wechat/whatsapp)。电话返回 null。 */ +function chatChannel(ch: CallChannel): 'wechat' | 'whatsapp' | null { + return ch === 'voice_call' ? 'wechat' : ch === 'wa_voice_call' ? 'whatsapp' : null +} + /** 客户昵称 → 该员工×客户 1:1 聊天(复用 Phase B 导航)。 */ function viewCallCustomer(row: PhoneCall): void { const owner = cell(row, 'weChatId') @@ -141,7 +146,11 @@ function viewCallCustomer(row: PhoneCall): void { if (!owner || !talker) return router.push({ name: 'chat', - params: { channel: 'wechat', ownerId: String(owner), talkerId: String(talker) }, + params: { + channel: chatChannel(row.channel) ?? 'wechat', + ownerId: String(owner), + talkerId: String(talker), + }, }) } @@ -149,7 +158,10 @@ function viewCallCustomer(row: PhoneCall): void { function viewCallStaff(row: PhoneCall): void { const owner = cell(row, 'weChatId') if (!owner) return - router.push({ name: 'chat', params: { channel: 'wechat', ownerId: String(owner) } }) + router.push({ + name: 'chat', + params: { channel: chatChannel(row.channel) ?? 'wechat', ownerId: String(owner) }, + }) } const drawerSections = computed(() => @@ -250,13 +262,18 @@ onMounted(load) - {{ cell(row, 'talkerNickName') || '--' }} + {{ cell(row, 'talkerNickName') }} + -- {{ cell(row, 'talkerAlias') || row.call_number || '--' }} - {{ row.user_id_name || '--' }} · {{ cell(row, 'userPhone') || '--' }} + + {{ row.user_id_name }} + -- + · {{ cell(row, 'userPhone') || '--' }} + {{ cell(row, 'userWeChatNickName') || '--' }} · {{ cell(row, 'userWeChatAlias') || '--' }}