根据二维码链接生成二维码

622 阅读1分钟

template:

<script src="lib/qrcode.min.js?v=0.5"></script>
<div class="zf-group-h">长按,识别此二维码可微信或支付宝缴费</div>
<div id="qrcode" class="zf-group" style="text-align:center;">

js:

$("#qrcode").html("");
var qrcode = new QRCode("qrcode", {   
   text: "http://………………………………",   
   width: 200,
   height: 200,
   colorDark: '#000000',
   colorLight: "#ffffff",
   correctLevel: QRCode.CorrectLevel.H
});

生成效果:


本文中未展示所写的CSS代码。使用的插件是qrcode。

参考地址:github.com/davidshimjs…