Browse Source

小程序内部调用微信扫一扫后 无法扫描微信小程序二维码没有反应

master
kuaileWu 3 months ago
parent
commit
47fbe47e72
  1. 20
      components/tabbar.vue

20
components/tabbar.vue

@ -84,15 +84,17 @@
async scanCode() { async scanCode() {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.scanCode({ uni.scanCode({
onlyFromCamera: false, success: (res) => {
success: (res) => { var url = `/${res.path}`;
console.log('扫码结果:', res.result); uni.navigateTo({ url });
}, },
fail: (err) => { fail: (err) => {
console.error('扫码失败:', err); uni.showToast({
// uni.showToast({ title: '', icon: 'none' }); title: '扫码失败'+JSON.stringify(err),
} icon: 'none'
}); })
}
})
// #endif // #endif
// #ifdef H5 // #ifdef H5

Loading…
Cancel
Save