优化 P0 工作台与访客 Widget,对齐设计稿 UI
- 工作台改为设计稿三栏:320 会话列表 + 聊天区 + 320 客户信息 - 会话列表展示头像色条、最后消息预览、相对时间与未读角标 - 消息方向对齐设计(访客左、客服右)并补系统会话条 - 访客 Widget 还原欢迎语、快捷问题、输入状态动画与实色顶栏 - 会话列表 API 返回 last_message 供列表预览
This commit is contained in:
@@ -1,23 +1,30 @@
|
||||
import { useState } from 'react'
|
||||
import VisitorChat from '@/widgets/VisitorChat'
|
||||
|
||||
const WidgetPreview = () => {
|
||||
const [showWidget, setShowWidget] = useState(true)
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-neutral-100 flex flex-col">
|
||||
<div className="flex-1 flex items-center justify-center">
|
||||
<div className="text-center">
|
||||
<h1 className="text-2xl font-bold text-neutral-800 mb-2">示例网站页面</h1>
|
||||
<p className="text-neutral-400 mb-4">Widget 在右下角,发送消息会写入数据库</p>
|
||||
{!showWidget && (
|
||||
<button onClick={() => setShowWidget(true)} className="text-sm text-blue-500 hover:text-blue-600 underline">
|
||||
重新显示 Widget
|
||||
</button>
|
||||
)}
|
||||
<div className="min-h-screen bg-neutral-100 relative overflow-hidden">
|
||||
{/* 模拟宿主站点骨架,贴近设计稿模糊背景 */}
|
||||
<div className="max-w-[960px] mx-auto px-6 py-10 opacity-40 select-none pointer-events-none">
|
||||
<div className="h-10 w-3/5 bg-neutral-200 rounded mb-4" />
|
||||
<div className="h-4 w-[90%] bg-neutral-200 rounded mb-3" />
|
||||
<div className="h-4 w-3/4 bg-neutral-200 rounded mb-6" />
|
||||
<div className="flex gap-4 mb-6">
|
||||
<div className="w-[200px] h-[120px] bg-neutral-200 rounded-lg" />
|
||||
<div className="w-[200px] h-[120px] bg-neutral-200 rounded-lg" />
|
||||
<div className="w-[200px] h-[120px] bg-neutral-200 rounded-lg" />
|
||||
</div>
|
||||
<div className="h-4 w-[85%] bg-neutral-200 rounded mb-3" />
|
||||
<div className="h-4 w-[70%] bg-neutral-200 rounded mb-3" />
|
||||
<div className="h-4 w-4/5 bg-neutral-200 rounded mb-6" />
|
||||
<div className="h-[200px] w-full bg-neutral-200 rounded-lg" />
|
||||
</div>
|
||||
<div className="absolute inset-0 flex items-start justify-center pt-16 pointer-events-none">
|
||||
<div className="text-center pointer-events-auto">
|
||||
<h1 className="text-xl font-semibold text-neutral-700 mb-1">访客 Widget 预览</h1>
|
||||
<p className="text-sm text-neutral-400">右下角为可嵌入聊天组件 · 消息会写入数据库</p>
|
||||
</div>
|
||||
</div>
|
||||
{showWidget && <VisitorChat />}
|
||||
<VisitorChat defaultOpen />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user