From 36b09a2179dcc6b3639c32dfad01284284c99f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 10:40:14 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/upload/upload.vue | 19 ++++- pages/plugins/video/detail/detail.vue | 90 +++++--------------- pages/plugins/video/search/search-record.vue | 8 ++ 3 files changed, 44 insertions(+), 73 deletions(-) diff --git a/components/upload/upload.vue b/components/upload/upload.vue index cf7d94be..b966d20c 100644 --- a/components/upload/upload.vue +++ b/components/upload/upload.vue @@ -54,6 +54,11 @@ type: Boolean, default: false, }, + // 是否返回全部信息 + propIsAllInfo: { + type: Boolean, + default: false, + }, // 路径类型 默认common propPathType: { type: String, @@ -98,10 +103,20 @@ var data = typeof res.data == 'object' ? res.data : JSON.parse(res.data); if (data.code == 0 && (data.data.url || null) != null) { if(self.propSingleCall) { - self.$emit('call-back', data.data.url, self.propCallData); + // 是否返回全部信息 + if(self.propIsAllInfo) { + self.$emit('call-back', data.data, self.propCallData); + } else { + self.$emit('call-back', data.data.url, self.propCallData); + } } else { var list = self.form_images_list; - list.push(data.data.url); + // 返回全部信息 + if(self.propIsAllInfo) { + list.push(data.data); + } else { + list.push(data.data.url); + } self.setData({ form_images_list: list, }); diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index b3a95f6d..91c2d4d9 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -147,9 +147,9 @@ - + - + @@ -212,9 +212,9 @@ - - - + + + @@ -240,6 +240,7 @@ import componentNoData from '@/components/no-data/no-data'; import componentBottomLine from '@/components/bottom-line/bottom-line'; import componentPopup from '@/components/popup/popup'; + import componentUpload from '@/components/upload/upload'; // 状态栏高度 var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0)); // #ifdef MP-TOUTIAO || H5 @@ -254,7 +255,8 @@ componentNoData, componentBottomLine, componentPopup, - loadingComponent + loadingComponent, + componentUpload }, data() { return { @@ -316,7 +318,8 @@ is_add_comment: false, // 监听键盘高度变化事件 listener_height: 0, - comments_data: {} + comments_data: {}, + editor_path_type: 'video', }; }, computed: { @@ -443,6 +446,7 @@ video_data_list: [new_data.data], report_type_list: new_data.report_type_list, base_config_data: new_data.base_config_data, + editor_path_type: new_data.editor_path_type, }); this.get_last_or_next_data_list(this.params.id, 1, 1); } else { @@ -797,70 +801,14 @@ comment_input_event(e) { this.comment_input_value = e.detail.value; }, - comment_input_change(e) { - const { type } = e.currentTarget.dataset; - if (type == 'image') { - var self = this; - uni.chooseImage({ - count: self.propMaxNum, - success(res) { - var success = 0; - var fail = 0; - var length = res.tempFilePaths.length; - var count = 0; - self.upload_one_by_one(res.tempFilePaths, success, fail, count, length, 'uploadimage'); - }, - }); - } - }, - // 采用递归的方式上传多张 - upload_one_by_one(img_paths, success, fail, count, length, action) { - var self = this; - if (self.form_images_list.length <= this.propMaxNum) { - uni.uploadFile({ - url: app.globalData.get_request_url('index', 'ueditor'), - filePath: img_paths[count], - name: 'upfile', - formData: { - action: action, - path_type: self.propPathType, - }, - success: function (res) { - success++; - if (res.statusCode == 200) { - var data = typeof res.data == 'object' ? res.data : JSON.parse(res.data); - if (data.code == 0 && (data.data.url || null) != null) { - var list = self.form_images_list; - list.push({ - url: data.data.url, - name: data.data.original, - size: data.data.size, - }); - self.setData({ - form_images_list: list, - }); - self.$emit('call-back', self.form_images_list, self.propCallData); - } else { - app.globalData.showToast(data.msg); - } - } - }, - fail: function (e) { - console.log(e); - fail++; - }, - complete: function (e) { - count++; - - // 下一张 - if (count >= length) { - // 上传完毕,作一下提示 - //app.showToast('上传成功' + success +'张', 'success'); - } else { - // 递归调用,上传下一张 - self.upload_one_by_one(img_paths, success, fail, count, length, action); - } - }, + + chat_upload_images_event(res) { + if((res || null) != null) { + // 存储上传图片内容 + this.form_images_list.push({ + url: res.url, + name: res.name, + size: res.size, }); } }, diff --git a/pages/plugins/video/search/search-record.vue b/pages/plugins/video/search/search-record.vue index 8b691200..52bb7afc 100644 --- a/pages/plugins/video/search/search-record.vue +++ b/pages/plugins/video/search/search-record.vue @@ -139,11 +139,16 @@ export default { header_padding_left: padding_left, menu_button_info: menu_button_info }); + // 搜索历史记录 + this.search_history = uni.getStorageSync('search_history_key') || []; if (this.search_history.length > 0) { this.show_search_history = this.search_history.filter((item, index) => index < 5); } else { this.show_search_history = []; } + // 初始化数据 + this.search_query = ''; + this.init_data(); }, init_data() { @@ -181,8 +186,10 @@ export default { // 保存搜索历史记录 if (!isEmpty(e) && !this.search_history.includes(e)) { this.search_history.push(e); + uni.setStorageSync('search_history_key', this.search_history); } this.search_query = e; + // 跳转到搜索页 app.globalData.url_open(`/pages/plugins/video/search/search?search_query=${this.search_query}`, false); }, perform_search(e) { @@ -198,6 +205,7 @@ export default { this.search_history.splice(newIndex, 1); } this.show_search_history.splice(index, 1); + uni.setStorageSync('search_history_key', this.search_history); }, perform_url(e) { const url = e?.currentTarget?.dataset?.url || ''; From e31af20dbcf49e71f9b8c1742d1e466ac36cce6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 10:57:08 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E4=B8=8B=E6=B2=89=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/form-input/components/form-input/modules/uploads.vue | 1 + pages/plugins/video/detail/detail.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pages/form-input/components/form-input/modules/uploads.vue b/pages/form-input/components/form-input/modules/uploads.vue index 644cdf84..b1dcdf0e 100644 --- a/pages/form-input/components/form-input/modules/uploads.vue +++ b/pages/form-input/components/form-input/modules/uploads.vue @@ -40,6 +40,7 @@ 请选择文件,最多可以上传{{ propMaxNum }}个 + diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index 91c2d4d9..0fbd69ef 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -327,7 +327,7 @@ return this.show_comment_modal ? (this.move_distance > 0 ? `height: calc(30% + ${this.move_distance}px);` : 'height: 30%;') : 'height: 100%;'; }, commentContentStyle() { - return this.show_comment_modal && this.move_distance > 0 ? `transform: translateY(3px); height: calc(70% - ${this.move_distance}px);` : `transform: translateY(0); height: 70%;`; + return this.show_comment_modal && this.move_distance > 0 ? `transform: translateY(3px); height: calc(70% + 20rpx - ${this.move_distance}px);` : `transform: translateY(0); height: calc(70% + 20rpx);`; }, current_video_index() { return this.video_data_list.findIndex(item => item.id == this.current_video_id); From 88d76c75ff42cea7d3043cdfa9ccbb82ea91ca35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 13:59:54 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 34 +++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index 0fbd69ef..bf937383 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -115,9 +115,9 @@ - + @@ -1034,6 +1034,11 @@ if (item.id == new_video_comments_id) { item.sub_comments.unshift(new_data); item.comments_count++; + if (!item.show_sub_comment) { + item.show_sub_comment = true; + item.page = 0; + item.page_total = 1; + } } }) } @@ -1390,7 +1395,6 @@ // 遍历所有评论 for (let i = 0; i < this.active_comments.length; i++) { const comment = this.active_comments[i]; - // 如果是父级评论且id匹配,跳过整个评论(包括子评论) if (comment.id == comment_id) { continue; @@ -1398,19 +1402,19 @@ // 检查是否有子评论需要删除 if (comment.sub_comments && Array.isArray(comment.sub_comments)) { - // 过滤掉匹配的子评论 - const filteredSubComments = comment.sub_comments.filter( - subComment => subComment.id != comment_id - ); - - // 如果还有子评论或者本身就是有效的父级评论,则保留 - if (filteredSubComments.length > 0 || comment.content) { - // 更新子评论数组 + const index = comment.sub_comments.findIndex(subComment => subComment.id == comment_id); + if (index != -1) { + // 过滤掉匹配的子评论 + const filteredSubComments = comment.sub_comments.filter(subComment => subComment.id != comment_id); + // 如果还有子评论或者本身就是有效的父级评论,则保留 + if (filteredSubComments.length <= 0) { + comment.show_sub_comment = false; + } comment.sub_comments = filteredSubComments; - filteredComments.push(comment); - } - // 更新显示的评论数 - comment.comments_count = filteredSubComments.length; + // 更新显示的评论数 + comment.comments_count = comment.comments_count - 1; + } + filteredComments.push(comment); } else { // 没有子评论的情况,直接保留父级评论 filteredComments.push(comment); From 1899482bb287069142b0a206be51e03d0bc0b653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 14:25:46 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index bf937383..9b3e7622 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -39,7 +39,7 @@ {{ video_item.give_thumbs_count }} - + {{ video_item.comments_count }} @@ -873,7 +873,8 @@ }, // 打开评论区 handle_comment(e) { - const old_data = e?.currentTarget?.dataset?.value || ''; + const id = e?.currentTarget?.dataset?.id || ''; + const old_data = this.video_data_list.find(item => item.id == id); // 初始化评论数据 const new_data = old_data.comments_list.map(item1 => ({ ...item1, @@ -1126,18 +1127,27 @@ const data = res.data; if (data.code == 0) { const new_data = data.data; + // 合并评论列表 + let video_data = JSON.parse(JSON.stringify(this.video_data_list)); // 更新视频数据 - this.video_data_list.forEach(item => { + const new_video_data = video_data.map(item => { if (item.id == id) { + console.log(new_data.data.comments_list, '1'); const new_item = { ...item, - ...new_data, + ...new_data.data, + comments_list: new_data.data.comments_list, }; + console.log(new_item, '2'); + item = new_item; } }); + console.log(new_video_data, '3'); + + // 更新数据 this.setData({ - video_data_list: this.video_data_list + video_data_list: new_video_data }) } } From e54964f191489ee3422a92690fc5d216a2afab03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 14:30:00 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index 9b3e7622..fd6022e2 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -1128,9 +1128,9 @@ if (data.code == 0) { const new_data = data.data; // 合并评论列表 - let video_data = JSON.parse(JSON.stringify(this.video_data_list)); + // let video_data = JSON.parse(JSON.stringify(this.video_data_list)); // 更新视频数据 - const new_video_data = video_data.map(item => { + this.video_data_list.forEach(item => { if (item.id == id) { console.log(new_data.data.comments_list, '1'); const new_item = { @@ -1143,12 +1143,12 @@ item = new_item; } }); - console.log(new_video_data, '3'); + console.log(this.video_data_list, '3'); // 更新数据 - this.setData({ - video_data_list: new_video_data - }) + // this.setData({ + // video_data_list: video_data + // }) } } }); From bf771658b4d96a7088612d17fb4bbbe175ab5954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 15:03:02 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 39 +++++++++++---------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index fd6022e2..0e41211e 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -606,6 +606,13 @@ is_seeking: false, current_video_id: id, // 更新当前播放视频的ID }); + //#ifdef H5 + // 使用URLSearchParams处理当前查询参数 + const url = new URL(location.href); + url.searchParams.set('id', id); + + history.replaceState(null, '', url.pathname + url.search); + //#endif const index = this.video_data_list.findIndex(item => item.id == id); @@ -715,7 +722,7 @@ title: data.title || '', desc: data.desc || '', path: '/pages/plugins/video/detail/detail', - query: app.globalData.json_to_url_params(this.params), + query: 'id=' + this.current_video_id, img: data.poster_url || '' } this.setData({ @@ -1127,28 +1134,15 @@ const data = res.data; if (data.code == 0) { const new_data = data.data; - // 合并评论列表 - // let video_data = JSON.parse(JSON.stringify(this.video_data_list)); // 更新视频数据 - this.video_data_list.forEach(item => { - if (item.id == id) { - console.log(new_data.data.comments_list, '1'); - const new_item = { - ...item, - ...new_data.data, - comments_list: new_data.data.comments_list, - }; - console.log(new_item, '2'); - - item = new_item; - } - }); - console.log(this.video_data_list, '3'); - - // 更新数据 - // this.setData({ - // video_data_list: video_data - // }) + const index = this.video_data_list.findIndex(item => item.id == id); + if (index !== -1) { + // 使用Object.assign更新原对象,保持引用不变 + Object.assign(this.video_data_list[index], { + ...this.video_data_list[index], + ...new_data.data + }); + } } } }); @@ -1560,7 +1554,6 @@ * @param {Object} res - 键盘高度变化事件对象 */ listener(res) { - console.log(res); // 减1是为了兼容,避免跟键盘之间会不连贯 if (res.height > 0) { this.listener_height = res.height - 1; From 924c2e03bfe5c7830d86fda5474fa18b4fcbd2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 15:19:09 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index 0e41211e..de319ce0 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -610,10 +610,10 @@ // 使用URLSearchParams处理当前查询参数 const url = new URL(location.href); url.searchParams.set('id', id); - - history.replaceState(null, '', url.pathname + url.search); + // 替换URL路径,保持查询参数不变 + const pathname = location.href.split('?')[0]; + history.replaceState(null, '', pathname + url.search); //#endif - const index = this.video_data_list.findIndex(item => item.id == id); // 数据预加载逻辑 From e4c9a6077caabe8f8a5916663d2e3d3ed54ba8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 26 Feb 2026 15:22:31 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=80=BB=E8=BE=91=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/plugins/video/detail/detail.vue | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue index de319ce0..ee9d17dd 100644 --- a/pages/plugins/video/detail/detail.vue +++ b/pages/plugins/video/detail/detail.vue @@ -549,16 +549,18 @@ }); setTimeout(() => { - //#ifdef H5 - if (this.video_contexts[this.current_index]) { // 当前播放的视频索引为0 - this.video_play_event(this.video_contexts[this.current_index], true); + if (!this.paused) { + //#ifdef H5 + if (this.video_contexts[this.current_index]) { // 当前播放的视频索引为0 + this.video_play_event(this.video_contexts[this.current_index], true); + } + //#endif + //#ifndef H5 + if (this.create_video_contexts[this.current_index]) { // 当前播放的视频索引为0 + this.video_play_event(this.create_video_contexts[this.current_index], true); + } + //#endif } - //#endif - //#ifndef H5 - if (this.create_video_contexts[this.current_index]) { // 当前播放的视频索引为0 - this.video_play_event(this.create_video_contexts[this.current_index], true); - } - //#endif }, 200); }, 0); }