346149741
2024-09-04 58c9cd3b6e70e05952edb2e57f5215af77e1aa84
qiye/qiyeIndex/qiyeIndex.vue
@@ -171,22 +171,53 @@
                        success: val => {
                           console.log(val)
                           const tempFilePath = val.tempFilePath;
                           uni.saveImageToPhotosAlbum({
                              filePath: tempFilePath,
                              success: () => {
                                 uni.showToast({
                                    title: '图片保存成功',
                                    icon: 'success',
                                    duration: 2000
                                 });
                              },
                              fail: () => {
                                 uni.showToast({
                                    title: '图片保存失败',
                                    icon: 'none'
                                 });
                           uni.getSetting({
                              success(res) {
                                 if (!res.authSetting['scope.writePhotosAlbum']) {
                                    uni.authorize({
                                       scope:'scope.writePhotosAlbum',
                                       success() {
                                          uni.saveImageToPhotosAlbum({
                                             filePath: tempFilePath,
                                             success: () => {
                                                uni.showToast({
                                                   title: '图片保存成功',
                                                   icon: 'success',
                                                   duration: 2000
                                                });
                                             },
                                             fail: () => {
                                                uni.showToast({
                                                   title: '图片保存失败',
                                                   icon: 'none'
                                                });
                                             }
                                          });
                                       },
                                       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({