小程序相机点击第一次无反应,第二次才能实现拍照

发布于 7 年前作者 nqiu3534 次浏览最后编辑 7 年前来自 ask

onLoad() {

    this.cameraCTX = wepy.createCameraContext()

}

takePhoto() {

    this.cameraCTX.takePhoto({

        success: res => {

            this.photo = {

            show: true,

            info: res.tempImagePath

            }

        },

        error: error => {

            console.log(error)

        }

    })

}

1 回复
xiulantian
xiulantian1 楼5 年前

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html