feat: 完善物流信息展示功能

- 修复物流信息中 order_id 字段缺失的问题,确保按钮正常生成
- 添加 tracking_url 支持,新增"官网追踪"按钮
- "官网追踪"按钮在新标签页打开 (target: "_blank")
- 改进日志记录,添加完整的 payload 预览

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
wangliang
2026-01-26 13:15:47 +08:00
parent 0b5d0a8086
commit 9fe29ff3fe
2 changed files with 168 additions and 16 deletions

View File

@@ -815,8 +815,10 @@ def _parse_logistics_data(data: dict[str, Any]) -> dict[str, Any]:
)
return {
"order_id": mcp_result.get("order_id", ""), # 添加订单号
"carrier": mcp_result.get("courier", mcp_result.get("carrier", mcp_result.get("express_name", "未知"))),
"tracking_number": mcp_result.get("tracking_number") or "",
"tracking_url": mcp_result.get("tracking_url", mcp_result.get("trackingUrl", "")), # 添加追踪链接
"status": mcp_result.get("status"),
"estimated_delivery": mcp_result.get("estimatedDelivery"),
"timeline": mcp_result.get("timeline", [])