收藏
回答

vivo、部分iphone11调起前置摄像camera黑屏是怎么回事?

最近刚开发好一个企业内部使用的小程序,用了camera做人脸截取,但是部分手机调起camera时出现黑屏现象,两台iphone11,一台ios13.4.1正常,一台ios13.5.2一开始正常,后来出现黑屏且一直无法调起前置,手机相机没问题,还有vivo iqoo偶尔会出现黑屏现象;

<zan-pop type="bottomshow="{{camera_show}}bindclose="togglePopup">

    <view class="camera content">

        <camera device-position="frontflash="offbinderror="errorstyle="width: 100vw; height: {{camera_h}};z-index:0wx:if="{{camera_show}}">camera>

        <cover-view class="mc_wrap">

            <cover-image class="w-p100 h-p100src="../../common/images/camera_bg.png">cover-image>

            <cover-view class="tips c-white txt-c h5">请调整人脸角度后点击下方按钮cover-view>

        cover-view>

        <cover-view class="camera_wrap">

            <cover-view class="camera_btn_wrap flex flex-c"  bindtap="takePhoto">

                <cover-view class="camera_btn h4 c-5 flex flex-chover-class="take">cover-view>

            cover-view>

        cover-view>

        <cover-view class="closebindtap="togglePopup">

            <cover-image src="../../common/images/close.png">cover-image>

        cover-view>

    view>

zan-pop>


let camera_show = this.data.camera_show,
            that = this;
        wx.getSetting({
            success(res) {
                console.log(res)
                if (res.authSetting['scope.camera'] != undefined && !res.authSetting['scope.camera']) { //非初始化进入该页面,且未授权
                    wx.showModal({
                        title'是否授权摄像头功能功能',
                        content'需要授权使用摄像头功能,请确认授权,否则无法使用',
                        successfunction (res{
                            if (res.cancel) {
                                wx.showToast({
                                    title'授权失败',
                                    icon'none',
                                    duration1000
                                })
                            } else if (res.confirm) {
                                wx.openSetting({
                                    successfunction (dataAu{
                                        if (dataAu.authSetting["scope.camera"]) {
                                            wx.showToast({
                                                title'授权成功',
                                                icon'success',
                                                duration1000
                                            })
                                            that.setData({
                                                camera_showtrue
                                            })
                                        } else {
                                            wx.showToast({
                                                title'授权失败',
                                                icon'none',
                                                duration1000
                                            })
                                        }
                                    }
                                })
                            }
                        }
                    })
                } else {
                    that.setData({
                        camera_show: !camera_show
                    })
                }
            }
        })
回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容
问题标签