前端-胡立永 4 days ago
parent
commit
5a32ce25d0
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      pages/subcomponent/promo-qrcode.vue

+ 6
- 0
pages/subcomponent/promo-qrcode.vue View File

@ -176,6 +176,9 @@ export default {
}, },
// //
imgApi(image) { imgApi(image) {
uni.showLoading({
title: '保存中...'
})
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// //
@ -188,9 +191,11 @@ export default {
wx.saveImageToPhotosAlbum({ wx.saveImageToPhotosAlbum({
filePath: tempFilePath, filePath: tempFilePath,
success: () => { success: () => {
uni.hideLoading()
wx.showToast({ title: '保存成功', icon: 'success' }); wx.showToast({ title: '保存成功', icon: 'success' });
}, },
fail: (err) => { fail: (err) => {
uni.hideLoading()
console.error('保存失败:', err); console.error('保存失败:', err);
wx.showToast({ title: '保存失败', icon: 'none' }); wx.showToast({ title: '保存失败', icon: 'none' });
} }
@ -198,6 +203,7 @@ export default {
} }
}, },
fail: (err) => { fail: (err) => {
uni.hideLoading()
console.error('下载失败:', err); console.error('下载失败:', err);
wx.showToast({ title: '图片下载失败', icon: 'none' }); wx.showToast({ title: '图片下载失败', icon: 'none' });
} }


Loading…
Cancel
Save