【发布时间】:2015-08-21 23:57:27
【问题描述】:
我将 MeteorJs 和 Cordova 与 Barcodescanner 插件一起使用。
我需要对不同的二维码进行多次读取,并将每次读取发送到远程服务器。
使用此代码,我可以读取一次,然后 Cordova 关闭相机(要制作一个新的,我需要调用代码)。
cordova.plugins.barcodeScanner.scan(
function(result) {
Meteor.call('newQR', result.text);
},
function(error) {
alert("Scanning failed: " + error);
}
);
如何进行多次连续读数(不退出相机阅读器)?
谢谢。
【问题讨论】:
-
这个功能好像还没有实现(community.phonegap.com/nitobi/topics/…)。 Phonegap/Cordova 插件:github.com/phonegap/phonegap-plugin-barcodescanner 只是github.com/wildabeast/BarcodeScanner 的一个分支。实现这一目标的最简单方法是在每次成功和/或失败后重新启动 cordova.plugins.barcodeScanner.scan。如果你想要更多,你需要自己硬编码。
标签: javascript android cordova meteor qr-code