From 5c1e4728de73fd458188feb8578d622ec0da82e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Tue, 10 Mar 2026 14:28:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E8=AE=BA=E5=BC=B9?= =?UTF-8?q?=E5=87=BA=E6=A1=86=E8=8A=82=E6=B5=81=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.nvue | 36 +++++++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/pages/plugins/video/detail/detail.nvue b/pages/plugins/video/detail/detail.nvue index a383a28a..a309d837 100644 --- a/pages/plugins/video/detail/detail.nvue +++ b/pages/plugins/video/detail/detail.nvue @@ -298,9 +298,7 @@ video_switch_debounce_timer: null, // 视频切换防抖定时器 video_cleanup_timer: null, // 视频清理定时器 comment_scroll_debounce_timer: null, // 评论滚动防抖定时器 - // 添加下拉菜单状态管理 - active_dropdown_id: null, // 当前显示下拉菜单的评论ID - params: {}, + comment_move_throttle_timer: null, // 评论拖拽节流定时器 header_padding_left: '', report_type_list: [], // 举报类型列表 current_main_index: 0, // 默认选中第一个举报原因 @@ -338,7 +336,7 @@ commentContentStyle() { const baseHeight = Math.round(this.windowHeight * 0.7); return this.show_comment_modal && this.move_distance > 0 - ? `transform: translateY(6px); width:${this.windowWidth}px; height: ${baseHeight - 10 - this.move_distance}px;` + ? `transform: translateY(3px); width:${this.windowWidth}px; height: ${baseHeight - 10 - this.move_distance}px;` : `transform: translateY(0); width:${this.windowWidth}px; height: ${baseHeight + 10}px;`; }, // 当前播放视频的索引 @@ -441,6 +439,9 @@ if (this.comment_scroll_debounce_timer) { clearTimeout(this.comment_scroll_debounce_timer); } + if (this.comment_move_throttle_timer) { + clearTimeout(this.comment_move_throttle_timer); + } // 清理所有视频资源 this.cleanup_all_videos(); @@ -1098,6 +1099,12 @@ this.is_dragging = false; // 重置拖拽状态 this.comment_start_y = 0; // 重置起始位置 this.comment_current_y = 0; // 重置当前位置 + + // 清理节流定时器 + if (this.comment_move_throttle_timer) { + clearTimeout(this.comment_move_throttle_timer); + this.comment_move_throttle_timer = null; + } } catch (error) { console.error('close_comment_modal error:', error); } @@ -1200,14 +1207,24 @@ if (distance > 10) { this.is_dragging = true; this.comment_current_y = current_y; + + // 使用节流控制 move_distance 的更新频率,避免计算属性频繁触发导致抖动 + if (this.comment_move_throttle_timer) { + return; + } + this.move_distance = distance; + + // 设置节流定时器,16ms 约等于 60fps,保证流畅度同时避免过度更新 + this.comment_move_throttle_timer = setTimeout(() => { + this.comment_move_throttle_timer = null; + }, 80); } } } catch(error) { console.error('handle_comment_touch_move error:', error); } }, - // 评论拖拽结束 handle_comment_touch_end(e) { try { @@ -1222,12 +1239,17 @@ this.move_distance = 0; } this.is_dragging = false; // 拖拽结束,重置状态 + + // 清理节流定时器 + if (this.comment_move_throttle_timer) { + clearTimeout(this.comment_move_throttle_timer); + this.comment_move_throttle_timer= null; + } } } catch (error) { console.error('handle_comment_touch_end error:', error); } }, - // 评论 send_comment() { try { @@ -2106,7 +2128,7 @@ border-top-right-radius: 30rpx; display: flex; flex-direction: column; - transition: transform 0.3s ease-in; + } .comment-header {