346149741
2024-09-04 58c9cd3b6e70e05952edb2e57f5215af77e1aa84
长按保存二维码
1个文件已修改
61 ■■■■ 已修改文件
qiye/qiyeIndex/qiyeIndex.vue 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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({