超快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
});
}
}