Browse Source

修复保存推广海报异常的问题

master
Gaoxs 3 years ago
parent
commit
df492cbc63
  1. 55
      pages/user/promotion/Poster/index.vue

55
pages/user/promotion/Poster/index.vue

@ -79,47 +79,7 @@ export default {
this.isDown = true
var downloadUrl = imgsrc
// if (!wx.saveImageToPhotosAlbum) {
// uni.showModal({
// title: '',
// content: '使',
// })
// that.openDialogVisible = true
// return
// }
that.downloadFile(downloadUrl)
// uni.getSetting "scope.writePhotosAlbum" scope
// uni.getSetting({
// success(res) {
// if (!res.authSetting["scope.writePhotosAlbum"]) {
// that.openDialogVisible = true;
// //
// uni.authorize({
// scope: "scope.writePhotosAlbum",
// success() {
// that.downloadFile(downloadUrl);
// },
// fail() {
// //
// //
// uni.openSetting({
// success: function (data) {},
// fail: function (data) {}
// });
// }
// });
// } else {
// that.downloadFile(downloadUrl);
// }
// },
// fail(res) {
// that.openDialogVisible = true;
// }
// });
},
saveImg: function () {
this.downloadIamge(this.info[this.activeIndex].wap_poster, 'poster' + this.activeIndex)
@ -134,9 +94,18 @@ export default {
})
},
success: function (res) {
uni.showModal({
title: '提示',
content: '保存成功',
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
uni.showToast({
title: '保存成功!',
})
},
fail: () => {
uni.showToast({
title: '保存失败',
})
},
})
},
})

Loading…
Cancel
Save