From 7eb0d12edc77add3829bf1e4d11a292da4d469b0 Mon Sep 17 00:00:00 2001 From: Double-_-Z <2492419643@qq.com> Date: Fri, 30 May 2025 20:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 14 +++++++------- common/http.interceptor.js | 3 ++- pages/mobile_web/wall/detail.vue | 1 + utils/utils.js | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/App.vue b/App.vue index dc1f8fd..52d8b3f 100644 --- a/App.vue +++ b/App.vue @@ -124,13 +124,13 @@ // }); // // #endif - // #ifdef APP-PLUS - let osname = plus.os.name - if (osname == "Android") { - var activity = plus.android.runtimeMainActivity() - plus.android.invoke(plus.android.invoke(activity, "getWindow"), "addFlags", 0x00002000) - } - // #endif + // // #ifdef APP-PLUS + // let osname = plus.os.name + // if (osname == "Android") { + // var activity = plus.android.runtimeMainActivity() + // plus.android.invoke(plus.android.invoke(activity, "getWindow"), "addFlags", 0x00002000) + // } + // // #endif // #ifdef H5 // 禁止长按或右键保存 document.oncontextmenu = new Function("event.returnValue=false"); diff --git a/common/http.interceptor.js b/common/http.interceptor.js index f4640c0..0324979 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -21,7 +21,8 @@ const install = (Vue, vm) => { header: { 'content-type': 'application/json; charset=utf-8' }, - originalData: true + originalData: true, + showLoading: false }); // 请求拦截,配置Token等参数 Vue.prototype.$u.http.interceptor.request = (config) => { diff --git a/pages/mobile_web/wall/detail.vue b/pages/mobile_web/wall/detail.vue index 4f19cf9..b95d873 100644 --- a/pages/mobile_web/wall/detail.vue +++ b/pages/mobile_web/wall/detail.vue @@ -519,6 +519,7 @@ export default { width: 100%; position: fixed; z-index: 81; + top: 0; } // #endif .wd-top{ diff --git a/utils/utils.js b/utils/utils.js index 3305e29..c632286 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -66,6 +66,24 @@ export const tools = { longPressActions: { itemList: itemList, success: function(data) { + if(data.tapIndex === 1){ + //先下载到本地获取临时路径 + uni.downloadFile({ + url: imagesList[data.index], + success: (res) => { + //将临时路径保存到相册,即可在相册中查看图片 + uni.saveImageToPhotosAlbum({ + filePath: res.tempFilePath, //不支持网络地址 + success: function () { + uni.showToast({icon:"none",title: '保存图片到相册成功',position: 'bottom'}); + } + }); + }, + fail: (err) => { + uni.showToast({icon:"none",title: '保存图片失败',position: 'bottom'}); + } + }) + } console.log(data) }, fail: function(err) {