安卓真机拍照时报错,开发者工具模拟正常。
operateCamera:fail camera has not been initialized
手机:荣耀10,安卓9,EMUI版本 9.1.0
你好,问题未解决的话。麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
同样的问题,怎么都没人回答!
代码片段如下:
/**
* 生命周期函数–监听页面加载
*/
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);
}