From c62f4961f9d86460a5d483d7b31c05f98b113290 Mon Sep 17 00:00:00 2001 From: 王恒 <318726284@qq.com> Date: 星期三, 06 八月 2025 17:12:37 +0800 Subject: [PATCH] '更换域名小程序发布' --- qiye/qiyeIndex/qiyeIndex.vue | 61 +++++++++++++++++++++++------- 1 files changed, 46 insertions(+), 15 deletions(-) diff --git a/qiye/qiyeIndex/qiyeIndex.vue b/qiye/qiyeIndex/qiyeIndex.vue index 8c89017..91a48b8 100644 --- a/qiye/qiyeIndex/qiyeIndex.vue +++ b/qiye/qiyeIndex/qiyeIndex.vue @@ -171,22 +171,53 @@ success: val => { console.log(val) const tempFilePath = val.tempFilePath; - uni.saveImageToPhotosAlbum({ - filePath: tempFilePath, - success: () => { - uni.showToast({ - title: '鍥剧墖淇濆瓨鎴愬姛', - icon: 'success', - duration: 2000 - }); - }, - fail: () => { - uni.showToast({ - title: '鍥剧墖淇濆瓨澶辫触', - icon: 'none' - }); + uni.getSetting({ + success(res) { + if (!res.authSetting['scope.writePhotosAlbum']) { + uni.authorize({ + scope:'scope.writePhotosAlbum', + success() { + uni.saveImageToPhotosAlbum({ + filePath: tempFilePath, + success: () => { + uni.showToast({ + title: '鍥剧墖淇濆瓨鎴愬姛', + icon: 'success', + duration: 2000 + }); + }, + fail: () => { + uni.showToast({ + title: '鍥剧墖淇濆瓨澶辫触', + icon: 'none' + }); + } + }); + }, + fail(err){ + console.log(err) + } + }) + }else{ + uni.saveImageToPhotosAlbum({ + filePath: tempFilePath, + success: () => { + uni.showToast({ + title: '鍥剧墖淇濆瓨鎴愬姛', + icon: 'success', + duration: 2000 + }); + }, + fail: () => { + uni.showToast({ + title: '鍥剧墖淇濆瓨澶辫触', + icon: 'none' + }); + } + }); + } } - }); + }) }, fail: err => { uni.showToast({ -- Gitblit v1.9.1