我在PhoneGap Android中开发了条形码扫描应用程序。我能够扫描QR码和条形码。但是我无法扫描这个 2D条形码。这是我的问题还是代码的问题?
function scanCode(){
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan(
function(result){
alert("Scanned Code: " + result.text
+ ". Format: " + result.format
+ ". Cancelled: " + result.cancelled);
},
function(error){
alert("Scan failed: " + error);
}
);
}
function encodeData(){
var data = document.getElementById("data").value;
if (data != ''){
cordova.plugins.barcodeScanner.encode(
BarcodeScanner.Encode.TEXT_TYPE, data,
function(success){
alert("Encode success: " + success);
},
function(fail){
alert("Encoding failed: " + fail);
}
);
}
else{
alert("Please enter some data.");
return false;
}
}