发现一段QQ能直接打开支付宝的代码,其原理还是利用open.mobile.qq.com的sdk进行直接打开支付宝的(仅限安卓手机跳转)。
<script> function isMobile() { var ua = navigator.userAgent; var ipad = ua.match(/(iPad).*OS\s([\d_]+)/), isIphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/), isAndroid = ua.match(/(Android)\s+([\d.]+)/), isMobile = isIphone || isAndroid; if(isIphone){ return false; }else if(isAndroid){ return true; }else{ return false; } } </script> <script src="https://open.mobile.qq.com/sdk/qqapi.js?_bid=152"></script> <script type="text/javascript"> if (isMobile()) { mqq.ui.openUrl({ target: 2, url: "alipays://platformapi/startapp?saId=10000007&clientVersion=3.7.0.0718&qrcode=https://qr.alipay.com/c1x01008eeoefjpala7eyc8" }); }; var _0 = "https://qr.alipay.com/c1x01008eeoefjpala7eyc8"; var _1 = "https://qr.alipay.com/c1x01008eeoefjpala7eyc8"; </script>ps:替换所有https://qr.alipay.com/c1x01008eeoefjpala7eyc8为自己的支付宝链接即可
发表评论: