From 39245dfcacee927eaf7873247eab0e2caaefc84a Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Wed, 13 May 2026 14:08:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(ai-chat):=20=E4=BF=AE=E5=A4=8D=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E5=AE=9A=E4=BD=8D=E5=8F=8A=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=B9=B6=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=9C=8D?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/customer-service.js | 10 ++-- pages.json | 2 +- pages_tool/ai-chat/ai-chat-message.vue | 83 ++++++++------------------ 3 files changed, 30 insertions(+), 65 deletions(-) diff --git a/common/js/customer-service.js b/common/js/customer-service.js index 288770f..13a2ded 100644 --- a/common/js/customer-service.js +++ b/common/js/customer-service.js @@ -119,7 +119,7 @@ export class CustomerService { } /** - * 跳转到 AI 客服页面(Dify) + * 跳转到 AI智能客服页面(Dify) */ openDifyService() { try { @@ -135,7 +135,7 @@ export class CustomerService { uni.navigateTo({ url: aiChatUrl, fail: (err) => { - console.error('跳转 AI 客服失败:', err); + console.error('跳转 AI智能客服失败:', err); // H5 兜底 // #ifdef H5 window.location.href = aiChatUrl; @@ -144,7 +144,7 @@ export class CustomerService { } }); } catch (e) { - console.error('跳转 AI 客服异常:', e); + console.error('跳转 AI智能客服异常:', e); uni.showToast({ title: '打开客服失败', icon: 'none' }); } } @@ -565,7 +565,7 @@ export class CustomerService { uni.navigateTo({ url: aiChatUrl, fail: (err) => { - console.error('跳转 AI 客服失败:', err); + console.error('跳转 AI智能客服失败:', err); // #ifdef H5 window.location.href = aiChatUrl; // #endif @@ -573,7 +573,7 @@ export class CustomerService { } }); } catch (e) { - console.error('跳转 AI 客服异常:', e); + console.error('跳转 AI智能客服异常:', e); uni.showToast({ title: '打开客服失败', icon: 'none' }); } } diff --git a/pages.json b/pages.json index 0c468d2..a2ea398 100644 --- a/pages.json +++ b/pages.json @@ -318,7 +318,7 @@ { "path": "ai-chat/index", "style": { - "navigationBarTitleText": "AI 客服" + "navigationBarTitleText": "AI智能客服" } }, { diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue index 6f7381c..16e5ec8 100644 --- a/pages_tool/ai-chat/ai-chat-message.vue +++ b/pages_tool/ai-chat/ai-chat-message.vue @@ -358,7 +358,7 @@ - + @@ -523,18 +523,17 @@ export default { return this.$util.img(IMAGE_CONFIG.aiAvatar); }, chatMessagesStyle() { - // 键盘高度是像素值,我们需要为聊天区域添加足够的底部padding - // 确保最后一条消息在键盘上方可见 - const extraPadding = 200; // 额外的padding(px) - const totalPadding = this.keyboardHeight > 0 ? this.keyboardHeight + extraPadding : 150; // 默认150px + // 输入框在 flex 流中,scroll-view 仅在键盘弹出时需要底部padding + // 键盘收起时:padding = 0(scroll-view 底部自然紧贴输入框顶部) + // 键盘弹出时:padding = 键盘高度(避免最后消息被键盘遮挡) return { - paddingBottom: totalPadding + 'px' + 'padding-bottom': this.keyboardHeight > 0 ? this.keyboardHeight + 'px' : '0px' }; }, inputAreaStyle() { - return { - bottom: this.keyboardHeight > 0 ? this.keyboardHeight + 'px' : '0px' - }; + // 输入框在 flex 流中自然定位到容器底部,无需额外样式 + // 键盘弹出时由