pp:function(){
//#ifdef APP-PLUS
var barcode=this.newsan();
barcode.setFlash(true)
barcode.start()//开始识别二维码
barcode.onmarked = function(type, code, file){//扫码成功后进行的事件
console.log(code);
barcode.close()
}
//#endif
},
newsan: function() {
//#ifdef APP-PLUS
var pages = getCurrentPages();
var page = pages[pages.length - 1];
const currentWebview = page.$getAppWebview();
var barcode = plus.barcode.create('barcode', [plus.barcode.QR], {
top: '0px',
left: '0px',
width: '100%',
height: '100%',
position: 'static'
});
currentWebview.append(barcode);
return barcode
//#endif
},
低价位小菜
- 发布:2019-06-14 14:06
- 更新:2019-07-01 14:07
- 阅读:2902
1 个回复
低价位小菜 (作者)
做了个延时500毫秒定时器解决了