From afa7fe19370aa3cd5763c30baad6c7d44b7ececf 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 17:03:39 +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=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 7 +-- .../plugins/video/components/comment-info.vue | 24 +++++++--- .../plugins/video/components/comment-more.vue | 4 +- pages/plugins/video/components/loading.vue | 2 +- pages/plugins/video/detail/detail.nvue | 44 ++++++++++++------- pages/plugins/video/detail/detail.vue | 2 +- 6 files changed, 55 insertions(+), 28 deletions(-) diff --git a/pages.json b/pages.json index f4ea6f05..7e187862 100644 --- a/pages.json +++ b/pages.json @@ -2070,6 +2070,7 @@ // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-KUAISHOU || H5 || APP "navigationStyle": "custom", // #endif + // #ifdef MP-ALIPAY "transparentTitle": "auto", "titlePenetrate": "YES", @@ -2241,9 +2242,9 @@ "current": 0, //当前激活的模式(list 的索引项) "list": [ { - "name": "", //模式名称 - "path": "", //启动页面,必选 - "query": "" //启动参数,在页面的onLoad函数里面得到 + "name": "test", //模式名称 + "path": "pages/plugins/video/detail/detail", //启动页面,必选 + "query": "id=1" //启动参数,在页面的onLoad函数里面得到。 } ] } diff --git a/pages/plugins/video/components/comment-info.vue b/pages/plugins/video/components/comment-info.vue index 9b43c30e..7d3236eb 100644 --- a/pages/plugins/video/components/comment-info.vue +++ b/pages/plugins/video/components/comment-info.vue @@ -73,12 +73,12 @@ data() { return { // 下拉菜单选项数据 - dropdownOptions: [ - { label: this.$t('common.del'), type: 'delete' }, - { label: this.$t('common.complaint'), type: 'report' } - ] + dropdownOptions: [] }; }, + mounted() { + this.init(); + }, computed: { // 使用computed属性映射props状态 drop_down_visible() { @@ -87,8 +87,15 @@ }, methods: { isEmpty, + init() { + this.dropdownOptions = [ + { label: '删除', type: 'delete' }, + { label: '举报', type: 'report' } + ] + }, // 回复 comment_reply(e) { + console.log('124545'); this.$emit('comment_reply', this.propComment, e); }, // 点赞 @@ -110,9 +117,11 @@ }); }, // 切换下拉菜单 - toggle_dropdown() { + toggle_dropdown(e) { // 通知父组件切换当前组件的下拉菜单状态 this.$emit('toggle_dropdown', this.propId); + + e.stopPropagation(); }, // 处理下拉菜单项点击 handle_dropdown_item_click(e) { @@ -174,7 +183,12 @@ /* 下拉菜单样式 */ .dropdown-menu { + /* #ifndef APP-NVUE */ position: absolute; + /* #endif */ + /* #ifdef APP-NVUE */ + position: fixed; + /* #endif */ background: #ffffff; border-radius: 8rpx; box-shadow: 0 6rpx 16rpx 0 rgba(0, 0, 0, 0.15); diff --git a/pages/plugins/video/components/comment-more.vue b/pages/plugins/video/components/comment-more.vue index 31380f9d..fd0f5dea 100644 --- a/pages/plugins/video/components/comment-more.vue +++ b/pages/plugins/video/components/comment-more.vue @@ -2,7 +2,7 @@ {{ propText || $t('common.expand') }} - + @@ -30,7 +30,7 @@ export default { }, propIconName: { type: String, - default: 'icon-arrow-down' + default: 'arrow-down' }, }, methods: { diff --git a/pages/plugins/video/components/loading.vue b/pages/plugins/video/components/loading.vue index 914f742b..75d4853d 100644 --- a/pages/plugins/video/components/loading.vue +++ b/pages/plugins/video/components/loading.vue @@ -4,7 +4,7 @@ - {{ propContent || $t('common.loading_in_text') }} + {{ propContent || $t('common.loading_in_text') }} diff --git a/pages/plugins/video/detail/detail.nvue b/pages/plugins/video/detail/detail.nvue index 3afbac60..265354e3 100644 --- a/pages/plugins/video/detail/detail.nvue +++ b/pages/plugins/video/detail/detail.nvue @@ -86,7 +86,7 @@ - + {{$t('common.comment')}} @@ -94,16 +94,16 @@ - + @@ -299,21 +299,27 @@ video_cleanup_timer: null, // 视频清理定时器 comment_scroll_debounce_timer: null, // 评论滚动防抖定时器 comment_move_throttle_timer: null, // 评论拖拽节流定时器 + // 添加下拉菜单状态管理 + active_dropdown_id: null, // 当前显示下拉菜单的评论ID + params: {}, header_padding_left: '', report_type_list: [], // 举报类型列表 + popup_report_status: false, // 举报弹窗状态 current_main_index: 0, // 默认选中第一个举报原因 current_sub_index: 0, // 默认选中第一个具体类型 report_comment_id: '', // 举报的评论id comment_value: '', is_add_comment: false, + // 监听键盘高度变化事件 listener_height: 0, comments_reply_data: {}, editor_path_type: 'video', is_manual_pause: false, // 是否手动暂停 windowWidth: 0, - windowHeight: 0, + windowHeight: 0, padding_width: 0, + sub_comment_padding_left: 0, }; }, components: { @@ -360,9 +366,12 @@ }, width_height_style() { return `width: ${ this.windowWidth }px;height: ${ this.windowHeight }px;`; - }, - window_more_style() { - return `width: ${ this.windowWidth - this.padding_width }px;` + }, + window_more_style() { + return `width: ${ this.windowWidth - this.padding_width }px;` + }, + window_sub_more_style() { + return `width: ${ this.windowWidth - this.sub_comment_padding_left }px;` } }, onLoad(params) { @@ -481,9 +490,10 @@ let padding_left = ''; // #ifdef MP-ALIPAY padding_left = video_get_top_left_padding(); - // #endif - this.padding_width = app.globalData.rpx_to_px(30); - + // #endif + this.padding_width = app.globalData.rpx_to_px(30); + this.sub_comment_padding_left = app.globalData.rpx_to_px(80); + this.header_padding_left = padding_left; this.menu_button_info = menu_button_info; this.current_video_id = isEmpty(this.current_video_id) ? this.params.id : this.current_video_id; @@ -1092,8 +1102,9 @@ } }, // 关闭评论区 - close_comment_modal() { + close_comment_modal(e) { try { + console.log('close_comment_modal', e.currentTarget.dataset.type); this.active_dropdown_id = null; this.show_comment_modal = false; this.comment_scroll_top = 0 + Math.random(); // 关闭评论时滚动到最顶部 @@ -1337,7 +1348,7 @@ // 展开子评论 open_sub_comment(id, is_level) { - try { + try { console.log(id); const comment = this.active_comments.find(item => item.id == id); if (comment) { @@ -1679,6 +1690,7 @@ } else { this.active_dropdown_id = comment_id; } + console.log(this.active_dropdown_id); } catch (error) { console.error('handle_toggle_dropdown error:', error); } diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index 8030ad4f..a6811af1 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -118,7 +118,7 @@ - +