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] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E5=9B=BE?= =?UTF-8?q?=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 || '';