uni
.scanCode()
.then(res => {
if (res.errMsg !== 'scanCode:ok' || !res.result) {
throw Error
}
console.log(res.result) // 有值
})
.catch(() => {
uni.showToast({ title: '扫描失败,请重试', icon: 'none' })
})

4***@qq.com
- 发布:2024-04-17 16:01
- 更新:2024-04-18 08:36
- 阅读:186



套马杆的套子 - 没有解决不了的问题,只有解决不完的问题
是不是每次返回的都是之前你扫过的二维码的值?
也可以试试支付宝扫码
https://ext.dcloud.net.cn/plugin?id=2636