| | |
| | | success: val => { |
| | | console.log(val) |
| | | const tempFilePath = val.tempFilePath; |
| | | uni.getSetting({ |
| | | success(res) { |
| | | if (!res.authSetting['scope.writePhotosAlbum']) { |
| | | uni.authorize({ |
| | | scope:'scope.writePhotosAlbum', |
| | | success() { |
| | | uni.saveImageToPhotosAlbum({ |
| | | filePath: tempFilePath, |
| | | success: () => { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | 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({ |
| | | title: '转换图片路径失败', |