收藏
回答

scanCode返回fail?

windows系统,开发者工具版本:Stable 1.06.2307260,scanCode返回fail分支,真机调试可以返回success,会是什么原因?

scanCode: function () {
    var that = this
    setTimeout(()=>{
    wx.scanCode({
      successasync(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,
          isDisabledfalse
        });
        /*wx.showToast({
          icon: 'none',
          title: res.rawData,
          duration: 2000
        })*/
      },
      failfunction (e{
        console.info('3.' + e.errMsg)
        console.info(e)
        wx.showModal({
          title'警告',
          content'券码识别失败,请重试!',
          complete(res) => {
            that.setData({
              inputFocustrue
            });
          }
        })
      }
    })
  },500)
  },

最后一次编辑于  2023-08-29
回答关注问题邀请回答
收藏
登录 后发表内容