alipayResult.html 3.17 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="theme-color" content="#000000">
    <meta name="google" value="notranslate">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="email=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <script src="../js/common.js"></script>
    <!--
      Notice the use of %PUBLIC_URL% in the tags above.
      It will be replaced with the URL of the `public` folder during the build.
      Only files inside the `public` folder can be referenced from the HTML.

      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
      work correctly both with client-side routing and a non-root public URL.
      Learn how to configure a non-root public URL by running `npm run build`.
    -->
    <title>支付状态</title>
</head>
<body style="background-color: #f0f4f5;">
    <!--<noscript>-->
    <!--You need to enable JavaScript to run this app.-->
    <!--</noscript>-->
    <header id="header" style="margin-top:25%; display: flex; justify-content: center; align-items: center; flex-direction: column; ">
        <img id="stateImg" src="../img/default.png" style="width: 64px; height: 64px; " />
        <div id="stateLable" style="font-size: 18px; color: #777; margin-top: 20px;">状态</div>
    </header>

    <!--
      This HTML file is a template.
      If you open it directly in the browser, you will see an empty page.

      You can add webfonts, meta tags, or analytics to this file.
      The build step will place the bundled scripts into the <body> tag.

      To begin the development, run `npm start` or `yarn start`.
      To create a production bundle, use `npm run build` or `yarn build`.
    -->
    <script type="text/javascript">
        window.onload = function () {
            var tmpParams = getQueryString(window.location);
            if (tmpParams != null) {
                console.log(JSON.stringify(tmpParams));
                if (tmpParams.trade_no != "") {
                    getResponse("success");
                } else {
                    getResponse("fail");
                }
                //alertMsg("支付返回参数:" + JSON.stringify(tmpParams));
            } else {
                console.log("支付返回参数" + tmpParams);
            }
        }
        //type[fail、sucesss]
        function getResponse(type) {
            var img = document.getElementById("stateImg");
            var label = document.getElementById("stateLable");
            if (type == "fail") {
                img.src = "../img/no.png";
                label.innerHTML = "支付失败,尝试重新扫码";
            } else {
                img.src = "../img/ok.png";
                label.innerHTML = "订单支付成功";
            }
        }
    </script>
</body>


</html>