From 3853b8faf8a55095c133730ce9b080ca3a68b3dd Mon Sep 17 00:00:00 2001 From: Gitea Actions Bot Date: Fri, 17 Oct 2025 17:05:02 +0800 Subject: [PATCH] =?UTF-8?q?[patch]=20=E6=96=B0=E5=A2=9E=E6=8B=BC=E5=A4=9A?= =?UTF-8?q?=E5=A4=9A=E5=A4=84=E7=90=86=E8=81=8A=E5=A4=A9=E9=A1=B5=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Utils/Pdd/PddUtils.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Utils/Pdd/PddUtils.py b/Utils/Pdd/PddUtils.py index 93a1a2e..6a2cda0 100644 --- a/Utils/Pdd/PddUtils.py +++ b/Utils/Pdd/PddUtils.py @@ -2798,7 +2798,21 @@ class ChatPdd: content = f"商品id:{goods_info.get('goodsID')} 订单号:{goods_info.get('orderSequenceNo')}" msg_type = "order_card" - # 商品卡片检测(基于内容关键词和goods_info) + # 🆕 聊天页面商品卡片处理(type=64,template_name='mall_goods_sku_pop_sku_card') + elif goods_info.get('key') == 'mall-goods-sku-card': + # 从info.data中提取goods_id + goods_data = goods_info.get('data', {}) + goods_id = goods_data.get('goods_id', '') + + if goods_id: + # 构造商品卡片content(格式:商品卡片ID:809389064177) + content = f"商品卡片ID:{goods_id}" + msg_type = "product_card" + self._log(f"🛒 检测到聊天页面商品卡片: goods_id={goods_id}", "DEBUG") + else: + self._log("⚠️ 聊天页面商品卡片缺少goods_id", "WARNING") + + # 商品卡片检测(基于内容关键词和goods_info - 店铺详情页格式) elif any(keyword in lc for keyword in ['goods.html', 'item.html', 'item.jd.com', '商品卡片id:']) or \ (goods_info and goods_info.get('goodsID') and not goods_info.get('orderSequenceNo')): msg_type = "product_card"