From 6f0d8b0fb40607dbfb2f4394233103db3879d265 Mon Sep 17 00:00:00 2001 From: TradeMate Dev Date: Wed, 27 May 2026 11:24:03 +0800 Subject: [PATCH] Add contact extraction for discovery results: click to scrape email/phone/WhatsApp/WeChat from company website --- backend/app/services/discovery.py | 5 ++- user-frontend/src/views/Discovery.vue | 58 ++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/backend/app/services/discovery.py b/backend/app/services/discovery.py index 711044a..028b90c 100644 --- a/backend/app/services/discovery.py +++ b/backend/app/services/discovery.py @@ -19,7 +19,9 @@ ANALYZE_MATCH_PROMPT = """你是外贸客户分析专家。分析目标公司的 "contact_info": { "emails": ["找到的邮箱"], "phones": ["找到的电话"], - "social": ["LinkedIn等社媒链接"] + "social": ["LinkedIn等社媒链接"], + "wechat": "找到的微信号", + "whatsapp": "找到的 WhatsApp 号码" } } @@ -292,6 +294,7 @@ URL: {company_url} "match_reason": "无法获取网页内容进行分析,建议手动查看", "url": url, "provider": "template", + "contact_info": {"emails": [], "phones": [], "social": [], "wechat": "", "whatsapp": ""}, } def _template_outreach(self, company: Dict[str, Any], product: Dict[str, Any]) -> Dict[str, Any]: diff --git a/user-frontend/src/views/Discovery.vue b/user-frontend/src/views/Discovery.vue index 4615591..1cc332a 100644 --- a/user-frontend/src/views/Discovery.vue +++ b/user-frontend/src/views/Discovery.vue @@ -12,23 +12,46 @@
- +

{{ r.name }} {{ r.match_score }}%

{{ r.source }}

{{ r.description }}

+ +
+
+ 📧 +
+
+ 📞 +
+
+ 🔗 +
+
+ 💬 微信:{{ r._contactDetail.wechat }} +
+
+ 💬 WhatsApp:{{ r._contactDetail.whatsapp }} +
+
+ 未提取到联系方式 +
+
+

- 联系方式: + 网址:

-
+
添加为客户 访问网站 + {{ r._contactDetail ? '已提取' : '提取联系方式' }}
@@ -60,7 +83,7 @@