From 394bfa8a7c1fafd9a42b9cbcd281094cb1580310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Sat, 8 Aug 2026 15:13:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat):=20getSessions=20+=20ChatSidebar=20?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E5=88=97=E8=A1=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- yunkes/src/api/index.ts | 18 +++++ yunkes/src/api/types.ts | 18 +++++ yunkes/src/components/ChatSidebar.vue | 96 +++++++++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 yunkes/src/components/ChatSidebar.vue diff --git a/yunkes/src/api/index.ts b/yunkes/src/api/index.ts index 906fd26..77bf4d8 100644 --- a/yunkes/src/api/index.ts +++ b/yunkes/src/api/index.ts @@ -15,6 +15,7 @@ import type { Message, Page, PhoneCall, + SessionList, Sms, Staff, StaffChatStats, @@ -238,6 +239,22 @@ export function getStaffChatStats(query: StaffChatStatsQuery): Promise { + return getJson( + '/sessions', + clean({ owner_account_id: query.owner_account_id, channel: query.channel }), + ) +} + // --------------------------------------------------------------------------- // Sync monitor // --------------------------------------------------------------------------- @@ -300,6 +317,7 @@ export type { Message, Page, PhoneCall, + SessionList, Sms, Staff, StaffChatStats, diff --git a/yunkes/src/api/types.ts b/yunkes/src/api/types.ts index 026fd32..05dfdd2 100644 --- a/yunkes/src/api/types.ts +++ b/yunkes/src/api/types.ts @@ -277,3 +277,21 @@ export interface StaffChatStats { summary: StaffChatStatsSummary customers: StaffChatCustomer[] } + +/** 账号会话列表一行(好友或群),镜像 backend SessionOut。 */ +export interface ChatSession { + type: 'friend' | 'group' + talker_id?: string | null + room_id?: string | null + name?: string | null + avatar?: string | null + today_count: number + last_chat_time?: number | null +} + +export interface SessionList { + owner_account_id: string + channel: string + today_start: number + sessions: ChatSession[] +} diff --git a/yunkes/src/components/ChatSidebar.vue b/yunkes/src/components/ChatSidebar.vue new file mode 100644 index 0000000..cb85f1b --- /dev/null +++ b/yunkes/src/components/ChatSidebar.vue @@ -0,0 +1,96 @@ + + + + +