支持访客实时输入草稿展示与联系方式自动识别

坐席输入框上方显示「对方正在输入」草稿;从草稿/消息提取手机微信邮箱QQ并追加入库,不覆盖已有联系方式。
This commit is contained in:
yml2213
2026-07-19 00:19:24 +08:00
parent fea5f4acf5
commit 6070cf47dc
11 changed files with 465 additions and 17 deletions
+16 -1
View File
@@ -18,6 +18,9 @@ export interface Session {
current_url?: string
current_title?: string
last_seen_at?: string | null
/** 访客输入框未发送草稿 */
draft_text?: string
draft_updated_at?: string | null
created_at: string; ended_at: string | null
/** 列表接口补全字段 */
message_count?: number
@@ -27,6 +30,16 @@ export interface Session {
channel_type?: string
}
export interface CustomerContact {
id: number
tenant_id?: number
customer_id: number
kind: string // phone | wechat | email | qq
value: string
source?: string
created_at?: string
}
export interface VisitorPageView {
id: number
session_id: number
@@ -50,6 +63,7 @@ export interface AvailableAgent { id: number; nickname: string; status: string }
export interface Customer {
id: number; tenant_id: number; name: string; phone: string; email: string; tags: string
source: string; status: string; conversation_count: number; last_contact_at: string
contacts?: CustomerContact[]
}
export interface KnowledgeCategory {
@@ -303,7 +317,8 @@ export const exportSessionsCSV = (params?: {
export const exportStatisticsCSV = () =>
downloadFile('/statistics/export', `statistics_${Date.now()}.csv`)
export const getCustomer = (id: number) => get<{ customer: Customer; sessions: Session[] }>(`/customers/${id}`)
export const getCustomer = (id: number) =>
get<{ customer: Customer; sessions: Session[]; contacts?: CustomerContact[] }>(`/customers/${id}`)
export const createCustomer = (data: Partial<Customer>) => post<Customer>('/customers', data)
export const updateCustomer = (id: number, data: Partial<Customer>) => put<Customer>(`/customers/${id}`, data)
export const deleteCustomer = (id: number) => del(`/customers/${id}`)