windows系统,开发者工具版本:Stable 1.06.2307260,scanCode返回fail分支,真机调试可以返回success,会是什么原因?
scanCode: function () {
var that = this
setTimeout(()=>{
wx.scanCode({
success: async(res) => {
console.info(res.result);
console.log(res);
var res1 = res.result;
var obj_json = JSON.parse(res.result);
console.info(obj_json);
//var ress = this.base64_decode(res.rawData);
//console.log(ress);
that.setData({
result: obj_json.param2,
tel: obj_json.param1,
_id: obj_json.param2,
scanType: res.scanType,
isDisabled: false
});
/*wx.showToast({
icon: 'none',
title: res.rawData,
duration: 2000
})*/
},
fail: function (e) {
console.info('3.' + e.errMsg)
console.info(e)
wx.showModal({
title: '警告',
content: '券码识别失败,请重试!',
complete: (res) => {
that.setData({
inputFocus: true
});
}
})
}
})
},500)
},