-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwechat_share.html
47 lines (46 loc) · 1.46 KB
/
wechat_share.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
<!DOCTYPE html>
<html>
<head>
<title>Share:title</title>
<script type="text/javascript">
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
}
document.title = "WeChat Share: " + decodeURI(getQueryVariable('title'))
</script>
<style>
.main {
/*text-align: center; !*让div内部文字居中*!*/
background-color: #fff;
border-radius: 20px;
width: 300px;
height: 350px;
margin: auto;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<script type="text/javascript" src="/assets/js/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="/assets/js/qrcode.min.js"></script>
</head>
<body>
<div id="qrcode" class="main">
</div>
<script type="text/javascript">
new QRCode(document.getElementById("qrcode"), getQueryVariable('url')); // 生成二维码
</script>
</body>
</html>