From feca316c316c5180535dd66c2087768b33db3918 Mon Sep 17 00:00:00 2001 From: mike Date: Sat, 7 Nov 2026 15:18:39 +0800 Subject: [PATCH] Update App.jsx via upload script - 2026-11-07 15:17:57 --- App.jsx | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/App.jsx b/App.jsx index c80a45e..a848077 100644 --- a/App.jsx +++ b/App.jsx @@ -9831,6 +9831,7 @@ function ChatCenter({ onNotify, onSaveCustomer, initialSid }) { {c.lead && c.lead.needsHuman && c.mode !== 'human' && 需要人工}
{c.lead && c.lead.summary_zh ? c.lead.summary_zh : c.last ? c.last.text : ''}
+ {c.contact &&
{c.contact}
} ); })} @@ -9939,6 +9940,7 @@ function ChatConversation({ conv, onBack, onNotify, onSaveCustomer, onReload, on {l.summary_zh &&

{l.summary_zh}

} {[['姓名', 'name'], ['公司', 'company'], ['国家', 'country'], ['邮箱', 'email'], ['WhatsApp', 'whatsapp'], ['数量', 'quantity']].map(([lab, k]) => l[k] ?
{lab}{l[k]}
: null)} {l.products && l.products.length > 0 &&
产品{l.products.join('、')}
} +
IP 国家{conv.ipCountry || '-'}
语言{conv.custLang || conv.lang}
{conv.pages && conv.pages.length > 0 &&
看过的页面{conv.pages.slice(-6).map((p, i) => {p.page.replace(/^https?:\/\/[^/]+/, '')})}
} @@ -10081,6 +10083,7 @@ function ChatSettings({ onNotify }) {
窗口名称 set('agentName', e.target.value)} />
你的英文名 set('managerName', e.target.value)} />
你的职位 set('managerTitle', e.target.value)} />
+
"转到 WhatsApp"号码 set('waNumber', e.target.value.replace(/\D/g, ''))} placeholder="8615201273157" />
AI 最快多久回复(毫秒) set('minReplyMs', e.target.value)} />默认 5000 = 5 秒,看起来不像秒回
@@ -10097,6 +10100,35 @@ function ChatSettings({ onNotify }) { ); } +// 客户信息卡里的"联系方式核对"和"WhatsApp 验证" +const CH_NOTE = { 'invalid format': '格式不对', 'possible typo': '可能拼错', 'disposable email address': '临时邮箱', 'domain accepts email': '域名能收信', 'no country code': '缺国家区号', 'unknown country code': '区号不存在', 'wrong length for this country': '位数不对', 'not a valid number for this country': '不是有效号码' }; +const chNote = (n) => CH_NOTE[n] || (n || '').replace(/^domain (.+) does not exist$/, '域名 $1 不存在').replace(/^domain (.+) cannot receive email$/, '域名 $1 收不了邮件'); +function ChatContacts({ conv, act }) { + const C = conv.contacts || { emails: {}, phones: {} }, wa = conv.wa || {}; + const icon = { ok: '✅', warn: '⚠️', bad: '❌' }; + const rows = [...Object.values(C.phones).map((v) => ({ k: v.e164 || v.raw, t: '电话', ...v })), ...Object.entries(C.emails).map(([k, v]) => ({ k, t: '邮箱', ...v }))]; + return ( +
+ 联系方式核对 + {!rows.length && 客户还没留联系方式} + {rows.map((r) => ( +
+ {icon[r.status] || '·'} +
{r.k}{r.t}{r.note ? ' · ' + chNote(r.note) : ''}{r.suggest ? ` · 可能是 ${r.suggest}` : ''}{r.superseded ? ' · 客户已更正' : r.status !== 'ok' && r.asked ? ' · AI 已请客户核对' : ''}
+
+ ))} + WhatsApp 验证 对话编号 #{conv.code} +
+ {wa.verified ? '✔ 已验证:已收到客户的 WhatsApp 消息' : wa.clicked ? `客户点了按钮,留意 WhatsApp 里带 #${conv.code} 的消息` : wa.offered ? '已发"转到 WhatsApp"按钮,客户还没点' : '还没给客户发 WhatsApp 按钮(重要客户 AI 会自动发)'} +
+
+ {!wa.offered && } + {!wa.verified ? : } +
+
+ ); +} + // 手机推送链接打开的"只看这个对话"页面:全屏、不显示菜单和其他功能 function ChatFocus({ sid, k, authed }) { const [conv, setConv] = useState(null); @@ -10232,4 +10264,11 @@ const CHC_CSS = ` .chc-pane.focus .chc-lead { position: absolute; inset: 0; width: auto; background: var(--panel); z-index: 2; border: 0; } .chc-focus-msg { display: grid; place-items: center; gap: 12px; min-height: 100vh; color: var(--ink-soft); font-size: 14px; text-align: center; padding: 20px; } .chc-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(24,35,58,.92); color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; z-index: 50; } +.chc-contacts { display: grid; gap: 6px; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); } +.chc-sub { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-top: 4px; } .chc-sub em { font-style: normal; font-weight: 600; color: var(--blue); margin-left: 6px; } +.chc-muted { color: var(--ink-soft); font-size: 12.5px; } +.chc-ct { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px; font-size: 13px; } .chc-ct b { font-weight: 600; overflow-wrap: anywhere; } .chc-ct small { display: block; color: var(--ink-soft); font-size: 11.5px; } +.chc-ct.bad b { color: var(--led-red); } .chc-ct.old { opacity: .5; } .chc-ct.old b { text-decoration: line-through; } .chc-ct.warn b { color: var(--led-amber); } +.chc-wa { font-size: 12.5px; padding: 7px 9px; border-radius: 8px; background: #f5f8fb; color: var(--ink-soft); } .chc-wa.wait { background: var(--led-amber-bg); color: var(--led-amber); font-weight: 600; } .chc-wa.ok { background: var(--led-green-bg); color: var(--led-green); font-weight: 600; } +.chc-item-ct { font-size: 11.5px; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } `;