346149741
2024-09-04 58c9cd3b6e70e05952edb2e57f5215af77e1aa84
qiye/qiyeIndex/qiyeIndex.vue
@@ -171,6 +171,12 @@
                        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: () => {
@@ -188,6 +194,31 @@
                              }
                           });
                        },
                                       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: '转换图片路径失败',