1***@qq.com
1***@qq.com
  • 发布:2021-06-07 18:49
  • 更新:2021-06-09 14:42
  • 阅读:506

【报Bug】android调用uni.chooseImage拍照没有任何反应 相册是可以的

分类:uni小程序sdk

产品分类: uni小程序SDK

手机系统: Android

手机系统版本号: Android 10

手机厂商: 华为

手机机型: mate20 pro

页面类型: vue

SDK版本号: 3.1.8

示例代码:
uni.chooseImage({  
                    count: 1, //默认9  
                    sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有  
                    sourceType: [type], //'camera','album'  
                    success: function(res) {  
                        console.log(res.tempFilePaths);  
                        for (let i = 0; i < res.tempFilePaths.length; i++) {  
                            const tempFilePaths = res.tempFilePaths;  
                            uni.uploadFile({  
                                url: `${getUrl()}/basis-member/file/upload`, //服务器地址  
                                filePath: tempFilePaths[i],  
                                name: 'file',  
                                fileType: 'image',  
                                header: {  
                                    Authorization: 'Bearer ' + getProperties('accessToken')  
                                },  
                                formData: {  
                                    user: 'test'  
                                },  
                                success: uploadFileRes => {  
                                    const url = JSON.parse(uploadFileRes.data).data.url;  
                                    that.sceneImage = url;  
                                    that.dismiss();  
                                }  
                            });  
                        }  
                    },  
                    fail: function(res) {  
                        console.log(res, "res");  
                        that.dismiss();  
                        uni.showToast({  
                            icon: 'none',  
                            title: '上传失败,请重试'  
                        });  
                    }  
                });

操作步骤:

代码操作

预期结果:

可以进行拍照

实际结果:

没有反应

bug描述:

点击拍照无效

2021-06-07 18:49 负责人:无 分享
已邀请:
DCloud_UNI_LXH

DCloud_UNI_LXH

在哪一步没有反应?可以说明清楚吗?最好有视频或者动图演示

该问题目前已经被锁定, 无法添加新回复