wx.scancode为什么偶尔会陷入死循环?

发布于 8 年前作者 li509586 次浏览最后编辑 8 年前来自 issues

wx.scancode为什么偶尔会陷入死循环?关闭之后会被重复调用

3 回复
yangmao
yangmao1 楼6 年前

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

dye
dye2 楼6 年前

  getQrcode() {

    // clearInterval(timer);

    // timer = null;

    return new Promise((resolve, reject) => {

      wx.scanCode({

        success(res) {

          resolve(res.result)

        },

        fail(res) {

          wx.showToast({

            title: '扫码失败',

            icon: 'none',

            duration: 4000

          })

          reject(false)

        }

      })

    }).catch(err => { })

  },

let code = await that.getQrcode();

        that.setData({

          page: 1,

          customerId:res

        })

yanxia
yanxia3 楼6 年前

麻烦提供一下代码片断