manual save(2026-01-22 16:29)

This commit is contained in:
SiteAgent Bot
2026-01-22 16:29:36 +08:00
parent 6a305f7242
commit 8b7de36cdc

View File

@@ -101,13 +101,13 @@ function buildFallbackAnswer(locale: Locale, question: string) {
'',
'如果你方便补充:行业 + 主要产品/服务 + 已有知识产权情况,我可以按你企业现状给出更具体的材料清单与推进路径。',
'',
'若需要人工进一步对接,请在右侧“留资”填写手机号(必填),我们会尽快联系。',
'如果你的情况比较复杂,建议点击“预约回电”,我们安排专员与您进一步确认。',
].join('\n')
}
return [
'我暂时无法在知识库中定位到完全匹配的答案。',
'你可以补充更多背景(行业/地区/需求细节),或者直接在“留资”里提交手机号,我们安排人工跟进。',
'你可以补充更多背景(行业/地区/需求细节),或点击“预约回电”,我们安排专员进一步沟通。',
].join('\n')
}
@@ -143,7 +143,7 @@ async function resolveLeadFormId() {
const forms = (res as unknown as { data?: { docs?: Array<{ id?: string; title?: string }> } })?.data?.docs ?? []
const target = forms.find((f) => {
const title = String(f?.title || '')
return /AI\s*智能助手|诚裕智能客服|AI Assistant|Assistant Lead|留资/i.test(title)
return /AI\s*智能助手|诚裕智能客服|AI Assistant|Assistant Callback|预约回电/i.test(title)
})
return (target?.id as string | undefined) ?? null
@@ -166,7 +166,7 @@ export const Assistant: React.FC = () => {
content:
locale === 'en'
? "Hi, I'm Chengyu AI Customer Service. Ask me anything, or leave your phone number for a callback."
: '你好,我是“诚裕智能客服”。你可以直接提问,我会基于知识库为你快速解答;如需人工进一步对接,也可以在“留资”提交手机号。',
: '你好,我是“诚裕智能客服”。你可以直接提问,我会基于知识库为你快速解答;如需更准确的答复,也可以点击“预约回电”,我们安排专员与你沟通。',
},
])
@@ -253,7 +253,7 @@ export const Assistant: React.FC = () => {
'',
excerpt ? excerpt.slice(0, 320) + (excerpt.length > 320 ? '…' : '') : '(该条目暂无摘要内容)',
'',
'若需要人工进一步沟通,建议在“留资”提交手机号(必填),我们会尽快联系。',
'如果需要更准确的判断与建议,建议点击“预约回电”,我们安排专员与您进一步确认。',
].join('\n')
pushMessage('assistant', answer)
@@ -268,7 +268,7 @@ export const Assistant: React.FC = () => {
'assistant',
locale === 'en'
? 'Sorry, I cannot access the knowledge base right now. Please leave your phone number and we will contact you.'
: '抱歉,我暂时无法访问知识库。请在“留资”提交手机号,我们会尽快联系。',
: '抱歉,我暂时无法访问知识库。你可以点击“预约回电”,我们会尽快与你联系。',
)
setActiveTab('lead')
} finally {
@@ -361,7 +361,7 @@ export const Assistant: React.FC = () => {
<p className="mt-4 text-lg text-white/85 max-w-2xl leading-relaxed">
{locale === 'en'
? 'Knowledge-base powered Q&A, plus a fast lead channel for consulting.'
: '基于知识库的自然语言问答,同时也是诚裕集团重要的留资渠道。'}
: '基于知识库的自然语言问答;如需更贴合你企业情况的判断,可预约专员进一步沟通。'}
</p>
</div>
@@ -372,7 +372,7 @@ export const Assistant: React.FC = () => {
</span>
<span className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-white/10 border border-white/20 text-sm">
<ClipboardList size={16} />
{locale === 'en' ? 'Lead capture' : '留资转化'}
{locale === 'en' ? 'Consultation' : '进一步了解'}
</span>
</div>
</div>
@@ -413,7 +413,7 @@ export const Assistant: React.FC = () => {
activeTab === 'lead' ? 'bg-primary/5 text-primary' : 'text-gray-600 hover:bg-gray-50'
}`}
>
{locale === 'en' ? 'Leave info' : '留资'}
{locale === 'en' ? 'Request a callback' : '预约回电'}
</button>
</div>
</div>
@@ -527,11 +527,11 @@ export const Assistant: React.FC = () => {
<div className="text-sm text-green-700 mt-1">
{leadFormId
? locale === 'en'
? 'Our team will contact you shortly.'
: '已收到你的信息,我们会尽快与你联系。'
? 'Our specialist will contact you shortly.'
: '已收到你的预约信息,我们会尽快与你联系。'
: locale === 'en'
? 'Backend form not configured yet; saved locally for now.'
: '暂未找到后台表单配置,本次留资已临时保存在浏览器本地(请尽快在运营平台创建表单以正式留存)。'}
? 'Backend form is not configured yet; saved locally for now.'
: '暂未找到后台表单配置,本次预约信息已临时保存在浏览器本地(请尽快在运营平台创建表单以正式记录)。'}
</div>
</div>
</div>
@@ -640,7 +640,7 @@ export const Assistant: React.FC = () => {
}`}
>
{leadSubmitting ? <Loader2 className="animate-spin" size={18} /> : <Send size={18} />}
{leadSubmitting ? (locale === 'en' ? 'Submitting…' : '提交中…') : locale === 'en' ? 'Submit' : '提交留资'}
{leadSubmitting ? (locale === 'en' ? 'Submitting…' : '提交中…') : locale === 'en' ? 'Request callback' : '预约回电'}
</button>
<div className="text-xs text-gray-500 leading-relaxed">
@@ -649,14 +649,14 @@ export const Assistant: React.FC = () => {
) : leadFormId ? (
<span>
{locale === 'en'
? 'This submission will be recorded in the operations platform.'
: '本次留资将记录到运营平台,便于运营人员及时查看处理。'}
? 'Your request has been submitted successfully.'
: '你的预约请求已提交,我们会尽快与你联系。'}
</span>
) : (
<span>
{locale === 'en'
? 'Backend form not found. Please create a form titled "AI Assistant Lead".'
: '未找到后台留资表单。建议在运营平台创建标题包含“AI智能助手/留资”的表单,并配置通知(邮件/Webhook以实现“及时提醒”。'}
? 'Backend form not found. Please create a form titled "AI Assistant Callback".'
: '当前未配置预约表单。在运营平台创建“AI智能助手-预约回电”表单,并按需开启邮件/Webhook 通知,确保咨询请求能及时处理。'}
</span>
)}
</div>
@@ -683,29 +683,29 @@ export const Assistant: React.FC = () => {
</li>
<li className="flex gap-2">
<span className="mt-0.5 w-6 h-6 rounded-lg bg-primary/10 text-primary flex items-center justify-center shrink-0">3</span>
<span>{locale === 'en' ? 'If manual follow-up is needed, guide users to leave contact info.' : '当无法确定答案或需进一步沟通时,引导客户留资(手机号必填并校验)。'}</span>
<span>{locale === 'en' ? 'If a question needs follow-up, users can request a callback.' : '当问题需要进一步确认时,可以预约回电,我们安排专员沟通。'}</span>
</li>
</ul>
</div>
<div className="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
<h2 className="text-lg font-semibold text-primary-dark">{locale === 'en' ? 'Lead channel focus' : '留资转化重点'}</h2>
<h2 className="text-lg font-semibold text-primary-dark">{locale === 'en' ? 'Get a more accurate answer' : '想要更准确的答复?'}</h2>
<p className="mt-3 text-sm text-gray-700 leading-relaxed">
{locale === 'en'
? 'For Chengyu Group, the assistant is also an important acquisition channel.'
: '对诚裕集团而言,该助手不仅用于快速响应,更是重要的获客与留资渠道。'}
? 'Some questions require more context (industry, current status, timeline). You can request a callback for a clearer plan.'
: '有些问题需要结合你的行业、现状与时间安排才能给出更准确的建议。你可以预约回电,我们会在沟通后给出更清晰的路径。'}
</p>
<div className="mt-4 grid gap-3">
<div className="rounded-xl border border-gray-100 bg-background p-4">
<div className="text-sm font-medium text-primary-dark">{locale === 'en' ? 'Required field' : '必填字段'}</div>
<div className="mt-1 text-xs text-gray-600">{locale === 'en' ? 'Phone number (11 digits) with basic validation.' : '手机号11 位)必填并进行基础校验。'}</div>
<div className="text-sm font-medium text-primary-dark">{locale === 'en' ? 'Contact method' : '联系方式'}</div>
<div className="mt-1 text-xs text-gray-600">{locale === 'en' ? 'We use your phone number only to return this inquiry.' : '手机号用于回访沟通,仅用于本次咨询。'}</div>
</div>
<div className="rounded-xl border border-gray-100 bg-background p-4">
<div className="text-sm font-medium text-primary-dark">{locale === 'en' ? 'Timely processing' : '及时提醒'}</div>
<div className="text-sm font-medium text-primary-dark">{locale === 'en' ? 'Response time' : '响应说明'}</div>
<div className="mt-1 text-xs text-gray-600">
{locale === 'en'
? 'Configure email/webhook notifications in the ops platform form settings.'
: '建议在运营平台表单里配置邮件/Webhook 通知,确保运营人员及时处理。'}
? 'We will contact you as soon as possible during business hours.'
: '我们会在工作时间尽快与你联系。'}
</div>
</div>
</div>