ionic APP二维码插件 地址

 二维码插件地址第一个   https://github.com/kyocn/BarcodeScanner git网址

下载网址  https://github.com/kyocn/BarcodeScanner.git

 

调用方法

com.jieweifu.plugins.barcode.startScan(function(success){
    alert(JSON.stringify(success));
}, function(error){
    alert(JSON.stringify(error));
});

适用
  • Android 4.0.0 or above
  • iOS 7.0.0 or above

  注意:这个插件节目听漂亮,但是会和极光推送插件起冲突造成闪退,后来换成下边的这个扫码插件

二维码插件地址第二个

https://github.com/tjwoon/csZBar
添加插件
cordova plugin add cordova-plugin-cszbar
 

cloudSky.zBar.scan({
text_title: "OPTIONAL Title Text - default = 'Scan QR Code'", // Android only
// text_instructions: "OPTIONAL Instruction Text - default = 'Please point your camera at the QR code.'", // Android only
// camera: "front" || "back" ,// defaults to "back"
// flash: "on" || "off" || "auto", // defaults to "auto". See Quirks
drawSight: true || false //defaults to true, create a red sight/line in the center of the scanner view.
}, function(barcodeData) {
成功的方法
} else {
Message.show('二维码不是平台专用,请核对后再扫!', 2000);
}

}, function(error) {
// console.log(error);
Messa.show(error);
Message.show('扫码失败,请尝试重新扫码!', 2000);
}




收集来自git网站
posted @ 2017-04-12 20:10  朝阳升  阅读(636)  评论(0编辑  收藏  举报