<!--{include file="<!--{$mpath}-->block_header.tpl"}-->
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body>
<header class="mui-bar mui-bar-nav report-header box-s" id="header">
    <a href="javascript:history.go(-1)"><i class="iconfont icon-fanhui fl"></i></a>
    <p>充值</p>
</header>
<div id="main" class="mui-clearfix contaniner sorder">
    <div class="pay-method pay-methodtwo clearfloat">
        <ul>
            <li>请输入充值金额</li>
        </ul>
    </div>
    <div class="mpsw clearfloat box-s">
        <form action="" method="post">
            <input type="text" name="recharge_price" id="recharge_price" value="" placeholder="0" />
            <input type="hidden" id="user_id" value="<!--{$data.id}-->"/>
        </form>
    </div>
    <div class="pay-method pay-methodthree clearfloat">
        <ul>
            <li>请选择充值方式</li>
        </ul>
    </div>
    <div class="addlist clearfloat">
       <!-- <div class="bottom clearfloat box-s">
            <section class="shopcar clearfloat">
                <div class="shopcar-checkbox fr">
                    <label for="shopcar" onselectstart="return false" class="shopcar-checkd"></label>
                    <input type="checkbox" id="shopcar"/>
                </div>
                <div class="sorder-list clearfloat fl">
                    <i class="iconfont icon-weixinzhifu fl"></i>
                    <div class="zuo fl">
                        <p class="tit">微信</p>
                        <p class="fu-tit">亿万用户的选择，更快更安全</p>
                    </div>
                </div>
            </section>
        </div>-->
        <div class="bottom clearfloat box-s">
            <section class="shopcar clearfloat">
                <div class="shopcar-checkbox fr">
                    <label for="shopcar" onselectstart="return false" class="shopcar-checkd"></label>
                    <input type="checkbox" id="shopcar"/>
                </div>
                <div class="sorder-list clearfloat fl">
                    <i class="iconfont icon-zhifubao fl"></i>
                    <div class="zuo fl">
                        <p class="tit">支付宝</p>
                        <p class="fu-tit">客户端支持最便捷!</p>
                    </div>
                </div>
            </section>
        </div>

    </div>
    <a href="javascript:void(0);" class="tui-btn" onclick="pay();">
        充值
    </a>
</div>
</body>
<script type="text/javascript" src="<!--{$mpath}-->js/jquery-1.8.3.min.js" ></script>
<script src="<!--{$mpath}-->js/fastclick.js"></script>
<script src="<!--{$mpath}-->js/mui.min.js"></script>
<script type="text/javascript" src="<!--{$mpath}-->js/hmt.js" ></script>
<script type="text/javascript">
    // $(".shopcar-checkbox label").on('touchstart',function(){
    //     if($(this).hasClass('shopcar-checkd')){
    //         $(".shopcar-checkbox label").removeClass("shopcar-checkd")
    //     }else{
    //         $(".shopcar-checkbox label").addClass("shopcar-checkd")
    //     }
    // })
</script>
<script type="text/javascript">
    //修改密码


    function pay() {
        $price = $('#recharge_price').val();
        if($price==''){
            alert('充值金额不能为空');
            return false;
        }
        if(isNaN($price)){
            alert('充值金额类型错误');
            return false;
        }
        $id = $('#user_id').val();;
        $.ajax({
            type: "POST",
            url: "index.php?c=user&a=ajaxaddorder",
            cache: false,
            data: {price:$price,member_id:$id},
            dataType: "json",
            success: function (data) {
                var json = eval(data);
                var response = json.response;
                var order_number = json.order_number;
                var order_name = json.order_name;
                var oeder_price = json.oeder_price;
                var result =json.result;
                host = window.location.host;
                var url = 'source/plugin/alipay/alipayapi.php';
                if (response == "1") {
                    var parames = new Array();
                    parames.push({name: "WIDout_trade_no", value: order_number});
                    parames.push({name: "WIDsubject", value: order_name});
                    parames.push({name: "WIDtotal_fee", value: oeder_price});
                    parames.push({name: "WIDbody", value: '客户充值余额'});
                    Post(url, parames);
                    return false;

                } else {
                    alert(result);
                }
            },

        });
    }

    /*
 *功能： 模拟form表单的提交
 *参数： URL 跳转地址 PARAMTERS 参数
 */
    function Post(URL, PARAMTERS) {
        //创建form表单
        var temp_form = document.createElement("form");
        temp_form.action = URL;
        //如需打开新窗口，form的target属性要设置为'_blank'
        temp_form.target = "_self";
        temp_form.method = "post";
        temp_form.style.display = "none";
        //添加参数
        for (var item in PARAMTERS) {
            var opt = document.createElement("input");
            opt.name = PARAMTERS[item].name;
            opt.value = PARAMTERS[item].value;
            temp_form.appendChild(opt);
        }
        document.body.appendChild(temp_form);
        //提交数据
        temp_form.submit();
    }
</script>

</html>
