uni.downloadFile({
url: '图片地址',
success: (res) => {
console.log(res)
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: '图片地址',
success: function() {
uni.showToast({
title: "保存成功",
icon: "none"
});
},
fail: function(err) {
if (permision.judgeIosPermission("photoLibrary")) {
uni.showToast({
title: "保存失败,请稍后重试",
icon: "none"
});
} else {
uni.showModal({
title: '相册权限不足',
content: '点击确定打开相册权限设置'
})
}
}
})
}
}
});
uni保存图片到相册
最新推荐文章于 2024-06-02 22:34:52 发布