sureyinZero
sureyinZero
  • 发布:2019-02-23 20:11
  • 更新:2019-03-11 12:22
  • 阅读:1277

【报Bug】小米 NOTE3 拍照后点击“√”回调进入取消/拍照错误函数

分类:HTML5+

详细问题描述(DCloud产品不会有明显的bug,所以你遇到的问题大都是在特定环境下才能重现的问题,请仔细描述你的环境和重现方式,否则DCloud很难排查解决你的问题)
[内容]
小米 NOTE3 拍照后点击 “√” 进入取消/拍照错误的回调函数,错误信息:{"code":11,"message":"resultCode is wrong"}

重现步骤
[步骤] 调起拍照界面,完成拍照,点击确定
[结果] 进入了取消拍照/拍照错误的回调函数CameraErrorCallback,并返回错误{"code":11,"message":"resultCode is wrong"}
[期望] 进入CameraSuccessCallback回调函数,并返回path
[如果语言难以表述清晰,可以拍一个视频或截图,有图有真相]

IDE运行环境说明
[HBuilder 或 HBuilderX] HBuilderX
[IDE版本号]
[windows版本号]
[mac版本号]

App运行环境说明
[Android版本号] MUI 10
[iOS版本号]
[手机型号] 小米 NOTE3
[模拟器型号]

附件
[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]
[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]
[安装包]

联系方式
[QQ]

2019-02-23 20:11 负责人:无 分享
已邀请:
sureyinZero

sureyinZero (作者)

//5+拍照  
        function photographWork(arr) {  
            var imgPathArr = arr;  
            var cmr = plus.camera.getCamera();  
            cmr.captureImage(function(path) {  
                plus.io.resolveLocalFileSystemURL(path, function(entry) {  
                    var localurl = entry.toLocalURL();  
                    imgPathArr.push(localurl);  
                    plus.nativeUI.confirm('当前已拍摄:'+imgPathArr.length+'张\n是否继续拍摄',function(res){  
                        if(res.index == 0){  
                            photographWork(imgPathArr);  
                        }else{  
                            //开始上传作业  
                            uploadWorks(imgPathArr);  
                        }  
                    },{  
                        title: '提示',  
                        buttons: [  
                            '继续拍摄',  
                            '开始上传'  
                        ]  
                    });  
                }, function(e) {  
                    toast('读取拍照文件错误:' + e.message);  
                });  
            }, function(e) {  
                alert(JSON.stringify(e));  
                plus.nativeUI.confirm('当前已拍摄:'+imgPathArr.length+'张\n是否放弃作业上传',function(res){  
                    if(res.index == 0){  
                        photographWork(imgPathArr);  
                    }else if(res.index == 2){  
                        //开始上传作业  
                        uploadWorks(imgPathArr);  
                    }  
                },{  
                    title: '提示',  
                    buttons: [  
                        '继续拍摄',  
                        '放弃上传',  
                        '开始上传'  
                    ]  
                });  
            }, {  
                filename: '_doc/head.jpg',  

            });  
        }  
        //5+相机选择  
        function albumWork() {  
            plus.gallery.pick(function(path) {  
                var path = path.files;  
                plus.nativeUI.confirm('已选择:'+path.length+'张照片\n是否开始上传',function(res){  
                    if(res.index == 0){  
                        uploadWorks(path);  
                    }else{  
                        albumWork();  
                    }  
                },{  
                    title: '提示',  
                    buttons: [  
                        '开始上传',  
                        '重新选择'  
                    ]  
                })  
            }, function(e) {  
                toast('取消选择图片');  
            }, {  
                filter: 'image',  
                multiple: true  
            });  
        }  

        //上传作业图集  
        function uploadWorks(pathArr){  
            // TODO 上传作业  
            showWating('作业上传中...');  
            $ajax({  
                url: '/uploadSubject.jspx',  
                data: {  
                    userId: userItem.userId,  
                    SubjectType: workType,  
                    photoCount: pathArr.length  
                },  
                success: function(data){  
                    if(+data['code'] == 1000){  
                        uploadImgFun(pathArr, 0, data['result']);  
                    }else{  
                        closeWating();  
                        showToast(data['message']);  
                    }  
                },  
                error: function(e){  
                    closeWating();  
                    showToast('上传作业失败,请重试');  
                }  
            })  
        }  
        function uploadImgFun(paths, i, items){  
            imgUrlToBlob(paths[i], function(img, imgWidth, imgHeight){  
                var config = {  
                  useCdnDomain: true,  
                  disableStatisticsReport: false,  
                  retryCount: 6,  
                };  
                var putExtra = {  
                  fname: "",  
                  params: {},  
                  mimeType: null  
                };  
                var observable = qiniu.upload(img, items[i]['key'], items[i]['token'],putExtra ,config);  
                var subscription = observable.subscribe({  
                    next: function(res){  
                    },  
                    error: function(err){  
                        closeWating();  
                        showToast("上传作业失败");  
                    },  
                    complete: function(res){  

                        res['userId'] = userItem.userId;  
                        res['photoId'] = items[i]['photoId'];  
                        res['photoSort'] = items[i]['photoSort'];  
                        res['groupId'] = items[i]['groupId'];  
                        res['qiniuKey'] = items[i]['qiniuKey'];  
                        res['subjectType'] = workType;  
                        res['width'] = imgWidth;  
                        res['height'] = imgHeight;  

                        $ajax({  
                            url: '/uploadOKSubject.jspx',  
                            data: res,  
                            success: function(data){  
                                closeWating();  
                                if(+data['code']==1000){  

                                }else{  

                                }  
                            },  
                            error: function(e){  

                            }  
                        })  

                        i = i+1;  
                        if(i < paths.length){  
                            uploadImgFun(paths, i, items);  
                        }else{  
                            closeWating();  
                            showToast('作业上传完成');  
                        }  

                    }  
                }) // 上传开始  
            })  
        }  
plus.nativeUI.confirm("请选择您需要上传的作业科目", function(res){  
                        if(res.index == 0){  
                            workType = '02';  
                        }else{  
                            workType = '01';  
                        }  
                        var bts = [{  
                            title: "拍照"  
                        }, {  
                            title: "从相册选取"  
                        }];  
                        //5+actionSheet  
                        if(res.index == 0 || res.index == 1){  
                            plus.nativeUI.actionSheet({  
                                    title: "上传作业",  
                                    cancel: "取消",  
                                    buttons: bts  
                                },  
                                function(e) {  
                                    var idx = e.index;  
                                    switch(idx) {  
                                        case 0:  
                                            break;  
                                        case 1:  
                                            photographWork([]);  
                                            break;  
                                        case 2:  
                                            albumWork();  
                                            break;  
                                        default:  
                                            break;  
                                    }  
                                }  
                            );  
                        }  
                    },{  
                        title: '选择科目',  
                        buttons: [  
                            '数学',  
                            '语文'  
                        ]  
                    })
sureyinZero

sureyinZero (作者)

自己顶起

sureyinZero

sureyinZero (作者)

这是。。没有人来回应一下的吗?

sureyinZero

sureyinZero (作者)

再顶最后一次了

l***@163.com

l***@163.com

顶一次,这是android 7.1.1版本的问题,有没有人解决

sureyinZero

sureyinZero (作者)

这个问题没有人来解决的吗?

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