From 1ee402b58186040d06cf8262a9ca2976588ef9fc Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Tue, 19 May 2026 15:53:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(ai-chat-message):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=BB=9A=E5=8A=A8=E5=AE=9A=E4=BD=8D=E5=92=8C?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E5=8A=A8=E7=94=BB=E7=9A=84=E6=97=B6=E5=BA=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 调整注释说明,补充scroll-into-view的微信小程序兼容场景 2. 移除冗余的定时器清除代码,新增延迟350ms触发搜索高亮动画,确保滚动先完成 3. 将原单次定时器改为嵌套定时器结构,正确管理动画状态和定时器资源 --- pages_tool/ai-chat/ai-chat-message.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pages_tool/ai-chat/ai-chat-message.vue b/pages_tool/ai-chat/ai-chat-message.vue index 4e8752b..5540d4f 100644 --- a/pages_tool/ai-chat/ai-chat-message.vue +++ b/pages_tool/ai-chat/ai-chat-message.vue @@ -11,7 +11,7 @@ @keyword-change="onSearchKeywordChange" /> - + { this.scrollIntoViewId = messageKey - // 触发 flash 脉冲动画 - 使用 setTimeout 让动画持续足够时间 - if (this.searchResultFilteredIndex >= 0) { - this.searchFlashAnimatingIndex = this.searchResultFilteredIndex - // 动画持续 1.2s 后自动移除 flash 状态 - this.searchFlashTimer = setTimeout(() => { - this.searchFlashAnimatingIndex = -1 - this.searchFlashTimer = null - }, 1200) - } + + // 延迟触发 flash 动画,让 scroll-into-view 滚动先完成 + this.searchFlashTimer = setTimeout(() => { + if (this.searchResultFilteredIndex >= 0) { + this.searchFlashAnimatingIndex = this.searchResultFilteredIndex + this.searchFlashTimer = setTimeout(() => { + this.searchFlashAnimatingIndex = -1 + this.searchFlashTimer = null + }, 1200) + } + }, 350) }) },