Commit 1e1d5ac9 by luoqi

feat(web): 详情页顶栏收口潜在/预约/回访三动作 + 宠物引导评价

- 潜在治疗/新建预约/回访 从身份卡·执行表单·通话结果头 上移到顶栏右上角动作区
  (潜在·预约=默认样式,回访=主按钮);删除已成死代码 call-widget.tsx。
- 宠物引导:话术生成后停留 15s→引导给话术打是否好用;hover 回访/通话结果→引导做召回反馈
  (60s 冷却、已反馈不扰),复用 emitPetEvent 气泡,不代评价。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
parent c1267e65
'use client';
import { CalendarClock } from 'lucide-react';
import { postToHost } from '@/lib/host-message';
/**
* 通话结果区右上角「回访」按钮 —— postMessage 通知宿主打开它自己的回访组件(带 patientId)。
* 固定就是这套(不分嵌入与否);未配置 HOST_ORIGIN 时点击会提示去配。
*/
export function CallWidget({ patientId }: { patientId?: string }) {
return (
<button
type="button"
onClick={() => postToHost('OPEN_RETURN_VISIT', patientId ?? '')}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md bg-teal-600 text-white text-[12px] font-medium hover:bg-teal-700 transition-colors"
>
<CalendarClock className="w-3.5 h-3.5" />
回访
</button>
);
}
......@@ -86,7 +86,6 @@ const ABANDON_REASONS = ['号码空号 / 错号', '已转介他人', '明确不
export function OutcomeForm({
plan,
onSubmit,
onCreateAppointment,
defaultChannel = 'phone',
}: {
plan: { contactAttempts: number; status?: string };
......@@ -97,7 +96,6 @@ export function OutcomeForm({
scheduledNextAt: string;
abandonReasons: string[];
}) => void;
onCreateAppointment: () => void;
defaultChannel?: string;
}) {
const [channel, setChannel] = useState(defaultChannel);
......@@ -312,25 +310,7 @@ export function OutcomeForm({
本次为第 <strong className="text-slate-600 tabular-nums">{plan.contactAttempts + 1}</strong> 次触达
</span>
<div className="flex items-center gap-1.5">
{/* 新建预约按钮常显(不再仅"成功"时出现)— 客服任何时候都能手动建预约 */}
<button
onClick={onCreateAppointment}
className="px-3 py-1.5 rounded text-[12px] border border-teal-300 text-teal-700 hover:bg-teal-50 inline-flex items-center gap-1 transition-colors"
>
<svg
viewBox="0 0 24 24"
className="w-3.5 h-3.5"
fill="none"
stroke="currentColor"
strokeWidth="1.8"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect x="3" y="4" width="18" height="18" rx="2" />
<path d="M16 2v4M8 2v4M3 10h18M12 14v4M10 16h4" />
</svg>
新建预约
</button>
{/* 「新建预约」按钮已上移到详情页顶栏右上角(与 潜在 / 回访 同处动作区) */}
<button
disabled={!canSubmit}
onClick={handleSubmit}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment