sflong
sflong
  • 发布:2018-06-01 13:42
  • 更新:2018-06-01 13:42
  • 阅读:1127

小米手机第二次打开扫码页面出错

分类:HTML5+

打开页面代码:
mui.openWindow({
url: 'scan.html',
id: "scanPage",
show: {
aniShow: 'pop-in'
},
createNew: true,
styles: {
popGesture: 'hide'
},
waiting: {
autoShow: false
},
extras: {
PWebviewId: "home/index.html"
}
});

扫码代码:
mui.init();
mui.plusReady(function() {
document.getElementById('cancel').addEventListener('tap', function() {
mui.back();
});

            var scan = new plus.barcode.Barcode('bcid', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]);  
            scan.onmarked = function(type, result, file) {  
                result = result.replace(/\n/g, '');  
                var w = mui.currentWebview;  
                var m = plus.webview.getWebviewById(w.PWebviewId);  
                mui.fire(m, 'onScanAfter', {  
                    Result: result  
                });  
                mui.back();  

                scan.cancel();   
                scan.close();  
            };  
            scan.start({  
                conserve: true,  
                filename: "_doc/barcode/"  
            });  

        });
2018-06-01 13:42 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复