| | |
| | | // scan特殊处理 |
| | | if (index === 2) { |
| | | tabbarStore.setCurIdx(tabbarStore.lastIdx) |
| | | |
| | | // 模拟成功 |
| | | // uni.navigateTo({ |
| | | // url: `/pages/scan/index?result=GPA2024NL025`, |
| | | // }) |
| | | // return false |
| | | // 模拟成功 |
| | | |
| | | // 只允许通过相机扫码 |
| | | uni.scanCode({ |
| | | onlyFromCamera: true, |
| | | success: function (res) { |
| | | console.log('条码类型:' + res.scanType) |
| | | console.log('条码内容:' + res.result) |
| | | if (res?.scanType !== 'QR_CODE') { |
| | | uni.showToast({ |
| | | title: '请使用二维码进行扫码', |
| | | icon: 'none', |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | // 使用split方法截取资产编号 |
| | | // const assetCode = res.result.split('资产编号:')[1].split(' ')[0] |
| | | uni.navigateTo({ |
| | | url: `/pages/scan/index?result=${res.result}`, |
| | | }) |
| | | }, |
| | | fail: function (res) {}, |
| | | }) |
| | | } else { |
| | | tabbarStore.setCurIdx(index) |