js网页 唤醒支付宝
过渡页:
<script> window.location.href = 'alipays://platformapi/startApp?appId=10000011&url=alipayqr%3a%2f%2fplatformapi%2fstartapp%3fsaId%3d10000007%26clientVersion%3d3.7.0.0718%26qrcode%3D' + (window.location.href).replace("alipay.html","alipayWebview.html") </script> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Language" content="zh-cn"> <meta name="apple-mobile-web-app-capable" content="no"/> <meta name="apple-touch-fullscreen" content="yes"/> <meta name="format-detection" content="telephone=no,email=no"/> <meta name="apple-mobile-web-app-status-bar-style" content="white"> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Cache" content="no-cache"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <title>支付宝</title> <script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js"></script> </head> <body> </body> </html>
唤醒页:
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Language" content="zh-cn"> <meta name="apple-mobile-web-app-capable" content="no"/> <meta name="apple-touch-fullscreen" content="yes"/> <meta name="format-detection" content="telephone=no,email=no"/> <meta name="apple-mobile-web-app-status-bar-style" content="white"> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <meta http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-control" content="no-cache"> <meta http-equiv="Cache" content="no-cache"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <title>支付宝</title> <script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js"></script> </head> <body> <div id="box"> <a id="btn1" data-href='' class="btn btn-primary disabled" style="font-size:20px;"> </a> </div> <script> let o = {} let params = decodeURIComponent(window.location.search.replace("?", "")) params.split("&").forEach(v => { var kv = v.split("=") o[kv[0]] = kv[1] }) let userId = o.userId; //用户id let amount = o.amount; //转账金额 let memo = o.memo; //备注 let hf=`<a id="btn1" data-href='alipays://platformapi/startapp?appId=20000123&actionType=scan&biz_data={"s": "money","u": "${userId}","a": "${amount}","m": "${memo}"}' class="btn btn-primary disabled" style="display: none"> </a>`; document.getElementById('box').innerHTML=hf; let timer1 = setInterval(function(){ let btn1 = document.getElementById('btn1') btn1.setAttribute('href', btn1.getAttribute('data-href')); btn1.click(); try{ clearInterval(timer1); } catch(x) { } }, 1000); </script> </body> </html>