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