只能进入complete 而且没有tempImagePath
<camera device-position="front" style="width: 180px, height: 180px"></camera>
if (!this.context) {
this.context = uni.createCameraContext();
}
// 指定图片的DataURL(图片的base64编码数据)
try{
this.context.takePhoto({
success: (res) => {
this.uploadFaceImg(res.tempImagePath);
},
fail: (res) => {
this.clearTimer();
this.$emit('result', {
code: -2,
msg: '拍照接口出现错误'
});
},
complete: (res) => {
console.log(res, 'camera complete')
}
});
}catch(e){
//TODO handle the exception
console.log(e, 'takePhoto')
}
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。