forked from aralejs/qrcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (61 loc) · 1.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>QRcode</title>
</head>
<body>
<div id="qrcodeDefault"></div>
<div id="qrcodeTable"></div>
<div id="qrcodeCanvas"></div>
<div id="qrcodeSVG"></div>
<script src='dist/arale-qrcode/3.0.5/index.js'></script>
<script>
var icon = 'https://t.alipayobjects.com/images/rmsweb/T1ZsxhXdxbXXXXXXXX.png';
var url = 'https://qr.alipay.com/tsx06052sckeitijl08oyd7?_s=web-other';
// var url = 'https://ds.alipay.com/?from=mobilecodec&scheme=alipays%3A%2F%2Fplatformapi%2Fstartapp%3FsaId%3D10000007%26clientVersion%3D3.7.0.0718%26qrcode%3Dhttps%253A%252F%252Fqr.alipay.com%252Ftsx06052sckeitijl08oyd7%253F_s%253Dweb-other';
// var url = 'alipays://platformapi/startapp?saId=10000007&qrcode=https%3A%2F%2Fqr.alipay.com%2Ftsx06052sckeitijl08oyd7';
var qrcode = AraleQRCode;
var qrDefault = new qrcode({
text: url,
});
document.getElementById('qrcodeDefault').appendChild(qrDefault);
// 调用table画二维码
var qrTable = new qrcode({
render: 'table',
correctLevel: 0,
pdground: '#00aaee',
text: url,
size: 200,
image : icon,
});
document.getElementById('qrcodeTable').appendChild(qrTable);
// 调用canvas画二维码
var qrCanvas = new qrcode({
render: 'canvas',
correctLevel: 0,
text: url,
size: 200,
// background: '#eeeeee',
// foreground: '#667766',
pdground: '#00aaee',
image : icon,
imageSize : 100
});
document.getElementById('qrcodeCanvas').appendChild(qrCanvas);
// 调用svg画二维码
var qrSvg = new qrcode({
correctLevel: 0,
render: 'svg',
text: url,
size: 200,
pdground: '#00aaee',
image : icon,
imageSize: 30
});
document.getElementById('qrcodeSVG').appendChild(qrSvg);
</script>
</body>
</html>