https://github.com/dillonlfy/weapp-qrcode
var QRCode = require('../../../utils/weapp-qrcode.js');
onLoad: function() {
        new QRCode('canvas', {
            // usingIn: this,
            text: "http://baidu.com/e/"+a.globalData.userInfo.uid,
            padding: 12,
            width: 256,
            height: 256,
            colorDark: "#1CA4FC",//前景色
            colorLight: "white",//背景色
            correctLevel: QRCode.CorrectLevel.H,
            callback: (res) => {
                // 生成二维码的临时文件
                console.log(res.path)
            }
        });
    },本文为看恩吧原创文章,转载无需和我联系,但请注明来自knsay.com
