From 4168c24fd65eff3f5f28d2710e3bdfcb429bb1d5 Mon Sep 17 00:00:00 2001
From: ZF sun <34314687@qq.com>
Date: Mon, 28 Sep 2026 13:48:56 +0800
Subject: [PATCH] =?UTF-8?q?feat(ai-chat):=20=E5=A2=9E=E5=BC=BA=E4=BD=8D?=
=?UTF-8?q?=E7=BD=AE=E6=B6=88=E6=81=AF=E5=A4=84=E7=90=86=EF=BC=8C=E6=94=AF?=
=?UTF-8?q?=E6=8C=81=E9=80=8F=E4=BC=A0=E4=BD=8D=E7=BD=AE=E3=80=81=E6=97=B6?=
=?UTF-8?q?=E9=97=B4=E3=80=81=E9=A1=B5=E9=9D=A2=E4=B8=8A=E4=B8=8B=E6=96=87?=
=?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/js/ai-service.js | 13 +-
pages_tool/ai-chat/ai-chat-message.vue | 329 +++++++++++++++++++++++--
2 files changed, 318 insertions(+), 24 deletions(-)
diff --git a/common/js/ai-service.js b/common/js/ai-service.js
index 50a97ea..dc8da67 100644
--- a/common/js/ai-service.js
+++ b/common/js/ai-service.js
@@ -523,6 +523,9 @@ export default {
user: getUserId(),
conversation_id: this.getConversationId() || '',
attachments: (options && options.attachments) || [],
+ // PR-BASIC-CONTEXT-TO-WB (2026-09-28): 透传位置/时间/页面上下文
+ // 给 WbAgentOsClient 提供 timestamp/timezone/location/page/metadata 等基础元素
+ context: (options && options.context) || null,
...getDomainParams()
},
header: {
@@ -588,6 +591,8 @@ export default {
user_id: getUserId(),
conversation_id: this.getConversationId() || '',
attachments: opts.attachments || [],
+ // PR-BASIC-CONTEXT-TO-WB (2026-09-28): 透传位置/时间/页面上下文
+ context: (opts && opts.context) || null,
...getDomainParams()
})
});
@@ -608,7 +613,11 @@ export default {
*/
async _fallbackToHttp(message, onEvent, onComplete, opts = {}) {
try {
- const result = await this.sendMessage(message, { attachments: (opts && opts.attachments) || [] });
+ const result = await this.sendMessage(message, {
+ attachments: (opts && opts.attachments) || [],
+ // PR-BASIC-CONTEXT-TO-WB (2026-09-28): MP HTTP 降级路径同步传递 context
+ context: (opts && opts.context) || null
+ });
const content = result && result.content ? result.content : '';
// 阻塞式降级也尝试把后端返回的思考过程/用量透出来, 让小程序在 WS 不可用时仍能显示"思考过程 (N 步)"
const fallbackPayload = {
@@ -666,6 +675,8 @@ export default {
user_id: getUserId(),
conversation_id: this.getConversationId() || '',
attachments: (opts && opts.attachments) || [],
+ // PR-BASIC-CONTEXT-TO-WB (2026-09-28): 透传位置/时间/页面上下文
+ context: (opts && opts.context) || null,
...getDomainParams()
})
});
diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue
index a47a268..b251d2a 100644
--- a/pages_tool/ai-chat/ai-chat-message.vue
+++ b/pages_tool/ai-chat/ai-chat-message.vue
@@ -42,7 +42,9 @@
+ 修复: 显式判断 voiceList / videoList 非空 + attachments 非空
+ PR-LOCATION-FILTER (2026-09-28): 位置消息顶层无上述字段, 但有 latitude/longitude,
+ 单独判断以确保位置气泡不被过滤掉 -->
{{ message.content }}
+
+
+
+ 📍
+
+ {{ message.name || $lang('ai-chat.index.location') || '位置' }}
+ {{ message.address }}
+ {{ message.latitude }}, {{ message.longitude }}
+
+
+
+ {{ message.content }}
+
+