二维码

下载qrcode.js

window.BASEDIR = '/wechat';
getScript: (url) => {
        return new Promise(function (resolve, reject) {
            var script = document.createElement('script');
            script.type = "text/javascript";
            script.setAttribute('async', 'async');
            if (script.onreadystatechange !== undefined) {
                script.onreadystatechange = function () {
                    if (script.doneState[script.readyState]) resolve();
                }
            } else {
                script.onload = function () {
                    resolve();
                };
            }
            script.src = url;
            document.head.appendChild(script);
        });        
}
http.getScript(BASEDIR+'/static/qrcode.js', true).then(()=>{ new QRCode(document.querySelector("#qrcode"), {text:`http://smartpark.cniotlife.com/api/wechat/menu?belong=gh_70cf8924ea3c&url=/appointmentlist_${params}#/appointmentlist`,width:150,height:150}) })

你可能感兴趣的:(二维码)