feat(history): establish Telegram SaaS platform foundation

This commit is contained in:
wmq
2026-07-27 23:03:00 +08:00
parent cf0eed46c3
commit cd06d049fe
92 changed files with 5608 additions and 3749 deletions
+41 -2
View File
@@ -71,9 +71,12 @@ export function InsightPanel({
{/* 客户基本信息 */}
<div className="border-b border-border p-4">
<div className="mb-3 flex items-center gap-3">
<Avatar name={customer.name} size="lg" />
<Avatar name={customer.name} src={customer.avatarUrl} size="lg" />
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-semibold">{customer.name}</p>
{customer.telegramUsername && (
<p className="truncate text-xs text-primary">@{customer.telegramUsername}</p>
)}
{customer.company && (
<p className="mt-0.5 flex items-center gap-1 text-xs text-muted-foreground">
<Building2 className="h-3 w-3" />
@@ -164,18 +167,34 @@ export function InsightPanel({
<p className="mt-2 text-xs leading-relaxed text-muted-foreground">{analysis}</p>
)}
{/* AI 提取关键信息 */}
{customer.aiProfile.inquiryQuantity && (
{Object.values(customer.aiProfile || {}).some(Boolean) && (
<div className="mt-3 space-y-1 border-t border-border pt-3">
{Object.entries({
公司: customer.aiProfile.companyName,
行业: customer.aiProfile.industry,
商业模式: customer.aiProfile.businessModel,
采购角色: customer.aiProfile.purchasingRole,
决策权: customer.aiProfile.decisionPower,
询价数量: customer.aiProfile.inquiryQuantity,
目标价格: customer.aiProfile.targetPrice,
预算: customer.aiProfile.budget,
MOQ: customer.aiProfile.moqRequirement,
样品: customer.aiProfile.sampleNeed,
定制: customer.aiProfile.customRequirement,
交付: customer.aiProfile.deliveryTime,
紧迫程度: customer.aiProfile.urgency,
采购周期: customer.aiProfile.purchaseTimeline,
物流: customer.aiProfile.logistics,
付款: customer.aiProfile.payment,
核心需求: customer.aiProfile.keyNeeds?.join('、'),
痛点: customer.aiProfile.painPoints?.join('、'),
顾虑: customer.aiProfile.concerns?.join('、'),
异议: customer.aiProfile.objections?.join('、'),
购买信号: customer.aiProfile.buyingSignals?.join('、'),
竞品: customer.aiProfile.competitorMentions?.join('、'),
沟通风格: customer.aiProfile.communicationStyle,
建议语气: customer.aiProfile.recommendedTone,
跟进时机: customer.aiProfile.followUpTiming,
}).filter(([, v]) => v).map(([k, v]) => (
<div key={k} className="flex gap-2 text-xs">
<span className="shrink-0 text-muted-foreground">{k}</span>
@@ -184,6 +203,26 @@ export function InsightPanel({
))}
</div>
)}
<div className="mt-3 grid grid-cols-3 gap-2">
{[
['成交概率', customer.aiProfile.dealProbability],
['流失概率', customer.aiProfile.churnProbability],
['分析可信度', customer.aiProfile.confidenceScore],
].map(([label, value]) => (
<div key={String(label)} className="rounded-lg bg-muted/70 px-2 py-2 text-center">
<p className="text-[10px] text-muted-foreground">{label}</p>
<p className="text-sm font-semibold">{Number(value || 0)}%</p>
</div>
))}
</div>
{customer.aiProfile.evidence?.length ? (
<div className="mt-3 border-t border-border pt-3">
<p className="text-[11px] font-medium text-muted-foreground">判断依据</p>
<ul className="mt-1 space-y-1 text-xs text-muted-foreground">
{customer.aiProfile.evidence.map((item) => <li key={item}>• {item}</li>)}
</ul>
</div>
) : null}
</div>
{/* 推荐动作 */}