• 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&amp;actionType=scan&amp;biz_data={&quot;s&quot;: &quot;money&quot;,&quot;u&quot;: &quot;${userId}&quot;,&quot;a&quot;: &quot;${amount}&quot;,&quot;m&quot;: &quot;${memo}&quot;}'
                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>
  • 相关阅读:
    【HANA系列】SAP HANA跟我学HANA系列之创建计算视图一
    【HANA系列】SAP HANA计算视图中的RANK使用方法
    【ABAP系列】SAP ABAP7.40新语法简介第一篇
    【ABAP系列】SAP ABAP7.40新语法简介第二篇
    【MM系列】SAP 根据PO查找对应的打印FORM
    【ABAP系列】SAP BOM反查
    【FICO系列】SAP FICO折旧记账时出现错误:没有找到与所做选择一致的数据
    【PI系列】SAP IDOC发送状态03,PI没有收到消息的解决办法
    Struts2_属性驱动
    struts2_struts.xml配置文件讲解
  • 原文地址:https://www.cnblogs.com/web-fusheng/p/10101369.html
Copyright © 2020-2023  润新知