{include file="Application/Home/View/Public/header.blade.php"}
{include file="Application/Home/View/Public/userLeft.blade.php"}
<div class="member-content">
    <h3 class="memberTitle">我要提现</h3>
    {literal}
    <p class="memberMinTitle">
        <span class="pad-left-20"></span>
						<span class="balance">余额：
							<span class="t-red">{{ cash }}元</span>
						</span>
        <span class="t-gary">可提现金额：{{ cash }}元</span>
    </p>
    {/literal}
	
    <form action="" method="post" class="changepw">
        <p class="memberMinTitle t-left">
            <span class="pad-left-20">申请提现</span>
        </p>
		
        <input id="merId" type="hidden" name="merId" value="777290058110097"/><!-- 商户号 -->
        <input id="txnTime" type="hidden" name="txnTime" value=""/><!-- 提现时间 -->
        <input id="orderId" type="hidden" name="orderId" value=""/><!-- 商户订单号 -->

        <table border="0" cellspacing="0" cellpadding="0">
        {literal}
            <tr>
                <td class="label_ou">选择提现银行卡:</td>
                <td class="inputWo">
                    <select name="bank_no" id="accNo"  style="width: 300px!important;">
                    <option  v-bind:value="bank_number.bank_number" v-text="bank_shows"></option>
                    </select>
                </td>

            </tr>
        {/literal}
            <tr>
                <td class="label_ou">户名:</td>
                <td>
                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="realName" v-text='usrName'></span>
                    <!--<input type="text" name="realName" id="realName" readonly="readonly" placeholder="请输入开户人姓名" v-bind:value="usrName" /><span class="checkName_res"></span>-->

                </td>
            </tr>
            <tr>
                <td class="label_ou">提现金额:</td>
                <td>
                    <input type="number" class="regMoney" name="money" id="money"  placeholder="请输入提现金额" title="单位为分，正数"/>
                </td>
            </tr>
            <tr>
                <td class="label_ou">交易密码:</td>
                <td>
                    <input type="password" name="pwd" id="pay_pwd" placeholder="请输入交易密码" />
                </td>
            </tr>
            <tr style="display:none;">
                <td class="label_ou">验证码:</td>
                <td class="yzmInput">
                    <input type="text" name="" id="" placeholder="验证码" />
                    <a href="" style="cursor:default">发送验证码</a>
                </td>
            </tr>
        </table>
        <input type="button" value="提交" class="btnInputCe not btnInputCeTX" id="tijiao"/>
    </form>
</div>
</div>
</div>
<script src="/Public/Home/js/checkToken.js"></script>
{literal}
<script type="text/javascript" >

    //导航高亮
    $(".leftList>li").removeClass('active');
    $(".leftList>li li").removeClass('active');
    $(".leftList>li").eq(3).addClass('active');
    $(".leftList>li.active").find('li').eq(1).addClass('active');


var take=new Vue({
    el:'.member-content',
    data:{
        bank_number:[],
        cash:'0',
        bank_shows:'',
        usrName:''
    }
});
$(function() {
    apiAjax('/api-selfCenter/ReMoney',{},function(data) {
        // console.log(data);
         take.cash=data.data.cash;
     })
     apiAjax('/api-other/GetBank',{},function (data) {
            console.log(data.account_name);
            take.bank_number=data.data;
            take.usrName=data.data.account_name;
            var str=data.data.bank_number;
            var str1=str.substr(0,4);
            var str2=str.substr(str.length-4);
            take.bank_shows=str1+'****'+str2;
        },'json');
});



$('#tijiao').on('click',function () {
    var money = $("#money").val();

        if(! /^\d+\.?\d{0,2}$/.test(money)){
            $("#money").val('');
            layer.msg('只能填写到两位小数');
            return false;
        }

    var bank_no = $("#accNo").val();
    //console.log(bank_no);
    var pwd = $("#pay_pwd").val();
    apiAjax('/api-selfCenter/TakeMoney',{
        money:money,
        bank_no:bank_no,
        pwd:pwd
    },function (data) {
        if(data.status==1){
           // alert('提现申请成功');
            lalert('提现申请成功','/Home-Account/AccountGetCash');

            $("#money").val('');
            $("#pay_pwd").val('');
        }else{
            alert(data.msg);
            $("#money").val('');
            $("#pay_pwd").val('');
        }
    });
})
    $(function() {
        apiAjax('/Api-Account/getAccount',{},function(data) {
            console.log(data);
            var datax = data.data.name;
            console.log(datax);
//            if(datax==null){
//                $('#realName').removeAttr('readonly');
//                return false;
//            }
//            $('#realName').val(datax['name']);
        });
    })




</script>
{/literal}
{include file="Application/Home/View/Public/footer.php"}
