代码片段如下: /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { this.ctx = wx.createCameraContext(); }, //拍照 takePhoto() { this.ctx.takePhoto({ quality: 'high', success: (res) => { console.log(res); this.setData({ src: res.tempImagePath }) }, fail: (e) => { console.log(e); } }) }, [图片][图片]
真机拍照报错,提示相机未初始化安卓真机拍照时报错,开发者工具模拟正常。 operateCamera:fail camera has not been initialized 手机:荣耀10,安卓9,EMUI版本 9.1.0
2019-08-04