wx.scancode为什么偶尔会陷入死循环?
发布于 6 年前 作者 li50 9382 次浏览 来自 官方Issues

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

3 回复

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

  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

        })

麻烦提供一下代码片断

回到顶部