|
cordova.plugins.barcodeScanner.scan(function(result) {
barcodetext = result.text;
alert("barcodetext"+barcodetext);
alert("We got a barcode\n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled);
if (barcodetext != "") {
justep.Baas.sendRequest({
"url" : "/oa/checkin",
"action" : "signIn",
"async" : false,
"params" : {
"barcodetext" : barcodetext,
"userid" : userid
},
"success" : function(date) {
alert(date.state);
this.comp("messageDialog1").show();
// 获取返回值,存放到output1组件中
// me.comp("output1").set({
// "value" : data.code
// });
}
});
}
else {alert("请重新扫描!")}
}, function(error) {
alert("二维码扫描错误 :" + error);
}); |
|