<!DOCTYPE html>
<html>
<head>
    <title>支付测试</title>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $codepay_config['chart'] ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0"/>
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <link rel="stylesheet" type="text/css" href="css/userPay.css">
    <script  src="jquery.min.js"></script>
    <!-- 引入 layui.css -->
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">

</head>
<body>
<div id="loadingPicBlock" style="max-width: 720px;margin:10px auto;" class="pay">
    <header class="g-header">
        <h2>支付测试</h2>
    </header>
    <section class="clearfix g-member">
    <div class="layui-form" action="" method="post">
        <div class="g-Total gray9 layui-form-item">请选择需要支付的金额</div>
            <div class="g-Recharge layui-form-item">
                <ul id="ulOption">
                    <!--注意修改金额 需要同时修改前面的值 money="10" -->
                    <li money="0.1"><a href="javascript:;">0.1元<s></s></a></li>
                    <li money="0.2"><a href="javascript:;">0.2元<s></s></a></li>
                    <li money="0.3"><a href="javascript:;" class="z-sel">0.3元<s></s></a></li> <!--class="z-sel" 表示默认选中50元-->
                    <li money="0.4"><a href="javascript:;">0.4元<s></s></a></li>
                    <li money="1"><a href="javascript:;">1元<s></s></a></li>
                    <li money="3"><a href="javascript:;">3元<s></s></a></li>
                </ul>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">商户单号</label>
                <div class="layui-input-inline">
                    <input type="text"  id="payId" name="payId" disabled required  lay-verify="required" placeholder="订单号" autocomplete="off" class="layui-input">
                </div>
            </div>
            <input type="hidden" id="param" name="param" value="1012" disabled/>
            <div class="layui-form-item">
                <label class="layui-form-label">充值金额</label>
                <div class="layui-input-inline">
                    <input type="text" id="price" name="price" required  lay-verify="required" placeholder="金额" autocomplete="off" class="layui-input" value="<?php echo $_GET['price']?>">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">支付方式</label>
                <div class="layui-input-block">
                    <input type="radio" name="type" value="1" title="微信支付" checked="checked">
                    <input type="radio" name="type" value="2" title="支付宝支付">
                    <input type="radio" name="type" value="4" title="QQ钱包">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="" onclick="zf()" name="do">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </div>
    </section>
</div>
<input id="hidIsHttps" type="hidden" value="0"/>

<!-- 引入 layui.js -->
<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
<script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
});
</script>
<script>
    $("#payId").val(new Date().getTime());
    function zf() {
        var p = "payId=QTCS"+$("#payId").val() + "&price="+$("#price").val()+"&param="+$("#param").val()+"&type="+$("input[name='type']:checked").val();
        window.location.href = "main.php?" + p;

    }
</script>
  
    <script language="javascript" type="text/javascript">

        $(function () {
            var c;
            var g = false;
            var a = null;
            var e = function () {
                $("#ulOption > li").each(function () {
                    var n = $(this);
                    n.click(function () {
                        g = false;
                        c = n.attr("money");
                        n.children("a").addClass("z-sel");
                        n.siblings().children().removeClass("z-sel").removeClass("z-initsel");
                        var needMoney = parseFloat(n.attr("money")).toFixed(2);
                        if (needMoney <= 0)needMoney = 0.01;
                        $("#price").val(needMoney);
                    })
                });
                $("#ulBankList > li").each(function (m) {
                    var n = $(this);
                    n.click(function () {
                        if (m < 2)return;
                        $("#pay_type").val(n.attr("payType"));
                        n.children("a").addClass("z-initsel");
                        n.siblings().children().removeClass("z-initsel");
                    })
                });

            };
            e()
        });

    </script>


</div>
</body>
</html>
