实现底部导航栏中的扫一扫功能
This commit is contained in:
parent
814c59cba4
commit
d2f6efbd3f
@ -161,6 +161,25 @@ export default {
|
||||
|
||||
jump(e) {
|
||||
const url = e.currentTarget.dataset.url;
|
||||
const index = e.currentTarget.dataset.idx;
|
||||
const item = this.navList[index];
|
||||
|
||||
// 检查是否为扫码功能
|
||||
if (item.isScan) {
|
||||
// 调用uni-app的扫码API
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
// 扫码成功后的处理逻辑
|
||||
console.log('扫码结果:', res.result);
|
||||
// 可以根据实际需求对扫码结果进行处理
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('扫码失败:', err);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查url是否存在且不为空
|
||||
if (!url || url.trim() === '') {
|
||||
this.NotOpen();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user