|
|
@ -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 |
|
|
|