uniapp【修复】: 修复app中保存图片不成功

This commit is contained in:
15093570141
2024-11-11 16:51:16 +08:00
parent 6113df717d
commit 8852b73576

View File

@@ -53,9 +53,11 @@
</lpainterView> </lpainterView>
</lpainterView> </lpainterView>
</LPainter> </LPainter>
<!-- #ifdef MP -->
<view class="tip-box" v-if="state.imgSrc"> <view class="tip-box" v-if="state.imgSrc">
如果您下载失败或者以前拒绝过弹出的授权相册提醒请点击右上角三个点进入设置页面开启添加到相册功能 如果您下载失败或者以前拒绝过弹出的授权相册提醒请点击右上角三个点进入设置页面开启添加到相册功能
</view> </view>
<!-- #endif -->
<view class="btn-box"> <view class="btn-box">
<view class="btn"> <view class="btn">
<view class="back" @click="handlenNavigateBack">返回上一页</view> <view class="back" @click="handlenNavigateBack">返回上一页</view>
@@ -328,11 +330,11 @@
/** 保存到本地 */ /** 保存到本地 */
const handlesavePoster = async () => { const handlesavePoster = async () => {
// #ifdef APP-PLUS || APP-PLUS-NVUE // #ifdef APP-PLUS || APP-PLUS-NVUE
uni.downloadFile({ uni.getImageInfo({
url: state.imgSrc, src: state.imgSrc,
success(res : any) { success(res : any) {
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, filePath: res.path,
success() { success() {
handleShowToast('保存成功', 'success'); handleShowToast('保存成功', 'success');
}, },