-
Notifications
You must be signed in to change notification settings - Fork 1
/
pay.html
35 lines (35 loc) · 1.03 KB
/
pay.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
<html>
<head>
<title id="title">转账跳转中......</title>
</head>
<body>
<script>
function getUA(){
return navigator.userAgent;
}
alipayURL="HTTPS://QR.ALIPAY.COM/FKX05303SHMKUP7SQD375B";
wechat = "MicroMessenger";
alipay = "AlipayClient";
userAgent = getUA();
if(userAgent .includes(wechat)){
//微信window.location.href="./images/wechat.png"
window.location.href="https://i.loli.net/2019/08/14/MAsf1rUNvin2VjF.png"
}else if(userAgent.includes(alipay)){
//支付宝
window.location.href=alipayURL;
}else{
//不是支付宝或微信中的一个
//alert("无法识别的客户端!请在微信或支付宝内打开!");
window.location.href=alipayURL;
}
</script>
<div id="container">
<h1>详细信息:</h1>
<div id="ua"><p>UA:</p></div>
<script>
document.getElementById("ua").innerHTML=("UA:"+navigator.userAgent);
document.getElementById("title").innerHTML="错误!";
</script>
</div>
</body>
</html>