JakeWarthon
JakeWarthon
  • 发布:2019-11-16 15:05
  • 更新:2019-11-16 16:13
  • 阅读:920

wap2app 扫一扫能使用Barcode实现吗

分类:wap2app

wap2app 扫一扫能使用Barcode实现吗

2019-11-16 15:05 负责人:无 分享
已邀请:
DCloud_heavensoft

DCloud_heavensoft

看plus.barcode的文档

JakeWarthon

JakeWarthon (作者)

我这边测试toast没出现

created() {  
            var statusBarHeight = uni.getSystemInfoSync().statusBarHeight;//状态栏  
            var height = statusBarHeight + 44 +104+'px';  
            var pages = getCurrentPages();  
            var page = pages[pages.length - 1];  
            // #ifdef APP-PLUS  
            uni.showToast({  
                title: 'APP-PLUS',  
                duration: 2000,  
                icon:'none'  
            });  
            var currentWebview = page.$getAppWebview();  
            this.barcode = plus.barcode.create('barcode', this.barcode, {  
                top: '0',  
                left: '0px',  
                width: '100%',  
                height: height,//这里可以设置扫码框的高度  
                position: 'static'  
            });  
            this.barcode.onmarked = this.onmarked;  
            currentWebview.append(this.barcode);  
            const res = uni.getSystemInfoSync();  
            if(res.platform == 'android'){//安卓机  
                this.barcode.start();  
            }  
            // #endif  
            // if(!barcode){  
            //      barcode = plus.barcode.create('barcode', [plus.barcode.QR], {  
            //          top:'100px',  
            //          left:'0px',  
            //          width: '100%',  
            //          height: '500px',  
            //          position: 'static'  
            //      });  
            //      barcode.onmarked = onmarked;  
            //      plus.webview.currentWebview().append(barcode);  
            // }  
            // barcode.start();  

        },

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