saveImage(url) {
uni.downloadFile({
url: url,
success: res => {
if (this.record.type === 'video' || this.type === 'teamOpus') {
uni.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success: res => {
uni.showToast({
title: '保存成功'
})
},
fail: res => {
console.log(res)
if(res.errMsg =="saveVideoToPhotosAlbum:fail cancel"){
uni.showModal({
title:'您已取消保存'
})
}else{
uni.showModal({
title:'如要使用保存功能,需要确认授权',
content: '请确认授权,否则无法保存到相册',
success:res =>{
if (res.confirm) {
uni.openSetting()
}
}
})
}
// uni.showToast({
// title: '保存失败'
// })
}
});
} else {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: res => {
uni.showToast({
title: '保存成功'
})
},
fail: res => {
uni.showToast({
title: '保存失败'
})
}
})
}
},
})
}
uniapp得视频保存授权取消后再次调用授权
最新推荐文章于 2023-04-12 14:39:35 发布