欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

超快uniapp扫码原生组件 (毫秒级别响应,适用多种码制)

最编程 2024-02-22 08:18:30
...
methods: { // Ba-Scanner-G onScanG() { scannerG.onScan({ 'isShowVibrate': true, 'isShowBeep': true, 'isShowPhotoAlbum': true, 'isShowLightController': true, 'zoom': true, 'scanColor': '#ff0000', 'hintText': '扫二维码/条形码', 'hintTextColor': '#ffffff', 'hintTextSize': '14' }, (res) => { if (res.code == "success") ... //扫码结果 res.result }); }, //Ba-Scanner-Zxing onScanZ() { scanner.onScan({}, (res) => { if (res.code == "success") ... //扫码结果 res.result }); } }