cordova.plugins.barcodeScanner.scan(
function (result) {
if(result.cancelled != true) {
navigator.notification.confirm(
result.text,// message
onConfirm,// callback to invoke with index of button pressed
'扫描信息:',// title
['发送','取消']// buttonLabels
);
}
return;
//alert("We got a barcode\n" +
// "Result: " + result.text + "\n" +
// "Format: " + result.format + "\n" +
// "Cancelled: " + result.cancelled);
},
function (error) {
alert("Scanning failed: " + error);
}
);
转载于:https://my.oschina.net/u/555061/blog/471786