如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
案例:http://demo.90ckm.com/tiaozhuan/ali.php
1.获得二维码
2.识别二维码,获得链接
替换链接https://qr.alipay.com/c1x07319sfzruhl0t7fctfa
详细代码
<!DOCTYPE html>
<html>
<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, chrome=1">
<title>请复制到浏览器打开</title>
</head>
<body>
<h6 style=font-size:15px;><a id="gogo" href="alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=https://qr.alipay.com/c1x07319sfzruhl0t7fctfa" style="text-decoration:none;">
</a></h6>
<img src="https://ws3.sinaimg.cn/large/00676n0Tgy1fthuj5dnq0j30u01ao75n.jpg" alt="支付宝" width="340">
<center>
</div>
</center>
<script src="https://open.mobile.qq.com/sdk/qqapi.js?_bid=152"></script>
<script>
function is_weixin(){
if(/MicroMessenger/i.test(navigator.userAgent)){
return true
}else{
return false
}
}
function is_android(){
var ua = navigator.userAgent.toLowerCase()
if(ua.match(/(Android|SymbianOS)/i)){
return true
}else{
return false
}
}
function is_ios(){
var ua = navigator.userAgent.toLowerCase()
if(/ipod|iphone|ipad/.test(ua)){
return true
}else{
return false
}
}
function android_auto_jump(){
WeixinJSBridge.invoke("jumpToInstallUrl",{},function(e){})
window.close()
WeixinJSBridge.call("closeWindow")
}
window.onhashchange = function() {
document.getElementById("gogo").click();
};
function hh() {
document.getElementById("gogo").click();
mqq.ui.openUrl({
target: 2,
url: "alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=https://qr.alipay.com/c1x07319sfzruhl0t7fctfa"
});
};
setTimeout('hh();', 500);
</script>
</body>
</html>
注:必须手机里安有支付宝,否则会显示链接无效
王明昌博客
