-
Notifications
You must be signed in to change notification settings - Fork 0
/
scheme.html
42 lines (41 loc) · 1.2 KB
/
scheme.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="qrcode.js"></script>
<style>
.wx{
font-size: 30px;
color: red;
}
</style>
</head>
<body>
<div>
<button><a id="login" href="#"><h1>点击登录跳转学习强国app</h1></a></button>
</div>
<div id="wx" class="wx"></div>
<div id="qrcode" style="margin-top: 10px">
<img id="img" src="#" alt="#"/>
</div>
</body>
<script>
function load() {
if (isWechat()){
document.getElementById("wx").innerText = "当前为微信环境,请点击右上角浏览器中打开"
}
let search = window.location.search
search = search.substring(1,search.length)
document.getElementById("login").setAttribute("href","dtxuexi://appclient/page/study_feeds?url="+search)
console.log(unescape(search))
let imgBase64 = jrQrcode.getQrBase64(unescape(search), {});
document.getElementById("img").setAttribute("src",imgBase64)
document.getElementById("login").click()
}
function isWechat() {
return /MicroMessenger/i.test(window.navigator.userAgent);
}
load()
</script>
</html>