{extend name="base"}

{block name="content"}
<div class="row">
    <div class="col-sm-12">
        <div class="card-box">
            <div class="row">
                <form class="form-horizontal" role="form" action="" method="post" onsubmit="return beforeSubmit()">
                    {:token()}
                    <div class="form-group">
                        <label class="col-md-2 control-label">今日可提现次数</label>
                        <div class="col-md-4">
                            <input name="money" type="text" class="form-control" value="{$todayCanCashNum}" readonly>
                        </div>
                        <div class="col-md-6">
                            <p class="form-control-static"></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">可提现金额</label>
                        <div class="col-md-4">
                            <input name="money" type="text" class="form-control" value="{$_user.money}" readonly>
                        </div>
                        <div class="col-md-6">
                            <p class="form-control-static">不可提现金额：<span style="color:red">{$_user.freeze_money}</span>元
                            </p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">手续费</label>
                        <div class="col-md-4">
                            <input name="fee" type="text" class="form-control"
                                   value="{if sysconf('cash_fee_type')==100}{:sysconf('cash_fee')}%{else/}{:sysconf('cash_fee')}元{/if}"
                                   readonly>
                        </div>
                        <div class="col-md-6">
                            <p class="form-control-static"></p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label">提现金额</label>
                        <div class="col-md-4">
                            <input name="money" type="text" class="form-control" placeholder="提现金额" value="">
                        </div>
                        <div class="col-md-6">
                            <p class="form-control-static">注：最低提现金额{:sysconf('cash_min_money')}元</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-2 control-label"></label>
                        <div class="col-md-4">
                            <button type="submit" class="btn btn-purple waves-effect waves-light">申请提现</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="appendJS"}

<script>
    var canSubmit = true;

    function beforeSubmit() {
        if (canSubmit) {
            canSubmit = false;
            return true;
        } else {
            return false;
        }
    }
</script>

{/block}
