<%@ Page Title="" Language="C#" MasterPageFile="~/Master/UserMaster.master" CodeBehind="BankList.aspx.cs" Inherits="WAP2P.Web.PC.User.Account.BankList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div class="m-userbox m-buserbox">
        <div class="m-prompt pl10 pr10 mt20">
            <div class="prompt-left g-left mt10">
                联系专属客服：
                <span class="qq"><% =CurrentUser.GetService() %></span>
            </div>
            <div class="prompt-small g-right">
                <p>银行卡作为提现的唯一渠道，添加并审核成功后才可用于提现，如果发生银行卡遗失的情况，请及时变更银行卡。</p>
                <p>详细情况具体请查看 <a href="../../Help/Default<%= PageBase.PageExt %>" target="_blank">帮助中心</a>。</p>
            </div>
        </div>
        <div class="pt15">
            <ul class="m-card">
                <ruson:Repater runat="server" ID="rptList" ItemType="WAP2P.Account.BankCard">
                    <ItemTemplate>
                        <li>
                            <div class="card-top">
                                <img src="<%# WAP2P.Web.Extensions.GetBankLogo(Item.BankName) %>" title="<%# Item.BankName %>" />
                                <%# GlobalSetting.Get<bool>(GlobalSetting.Keys.Risk.BankCardOnlyOneAndCannotChange) ? string.Empty : string.Format("<a href=\"javascript:void(0);\" data-id=\"{0}\" class=\"del\">删除</a>", Item.Id) %>
                                <%# Item.Status == WAP2P.Account.BankCard.AuditingStatus.Waiting ? string.Format("<a href=\"BankDetail{0}?id={1}\">修改</a>",PageBase.PageExt,Item.Id) : string.Empty %> 
                            </div>
                            <div class="card-middle">
                                <span class="<%# Item.Status == WAP2P.Account.BankCard.AuditingStatus.Success ? "fcred-3" : "fcgery-3"%>"><%# Item.Status.GetDescription() %></span>
                                <span class="fs18 g-fbold"><i class="fs12 ff-songti fcblueAsh-3">卡号后三位：</i><%# Item.CardNo.HidePart() %></span>
                            </div>
                            <div class="card-foot">
                                添加时间：<%# Item.CreateAt.ToDateTimeString() %>
                            </div>
                        </li>
                    </ItemTemplate>
                </ruson:Repater>
                <ruson:Space runat="server" ID="addBank" Visible="true">
                    <li class="card-add">
                        <a href="BankDetail<% =PageBase.PageExt %>">
                            <i class="iconfont fs30">&#xe628;</i>
                            <span class="g-block">添加新的银行卡</span>
                        </a>
                    </li>
                </ruson:Space>
            </ul>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">  
    <script>
        $(function () {
            $(".m-card li").hover(
                function () {
                    $(this).children(".card-top").children("a").show();
                },
                function () {
                    $(this).children(".card-top").children("a").hide();
                }
             );
        });

        $('.m-card li').on('click', 'a.del', function () {
            var me = $(this);
            $.jConfirm('确认删除该银行卡？', function () {
                $.ajax({
                    url: '?action=del',
                    type: 'get',
                    dataType: 'json',
                    data: { id: me.attr('data-id') },
                    success: function (res) {
                        if (res.Success)
                            me.closest('li').remove();
                        else
                            $.jError(res.Message);
                    }
                });
            });
        });
    </script>
</asp:Content>
