<%@ Page Title="" Language="C#" MasterPageFile="~/Master/UserMaster.master" CodeBehind="BorrowInfoList.aspx.cs" Inherits="WAP2P.Web.PC.User.Borrow.BorrowInfoList" %>
<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">
                联系专属客服：<div class="mt10 fs14 g-fcenter"><% =CurrentUser.GetService() %></div>
            </div>
            <div class="prompt-small g-right">
                <p>提供正确的借款相关资料将有助于您提升信用等级、获得更高的授信额度以及更快的获得投资人的青睐。</p>
                <p>详细情况具体请查看 <a href="/Help/" target="_blank">帮助中心</a>。</p>
            </div>
        </div>
        <div class="pt15 pb147">
            <ul class="m-card">
                <asp:Repeater runat="server" ID="borrowInfoRptList" ItemType="WAP2P.Member.BorrowInfo">
                    <ItemTemplate>
                        <li>
                            <div class="card-top">
                                <span class="g-left"><%# Item.Name %></span>
                                <%# Item.Status == WAP2P.Member.BorrowInfo.ValidStatus.ValidSuccess ? string.Empty : string.Format("<a href=\"javascript:void(0);\" class=\"delete\" data-id=\"{0}\">删除</a>",Item.Id) %>
                                <%# Item.Status == WAP2P.Member.BorrowInfo.ValidStatus.ValidFail ? string.Format(@"<a href=""BorrowInfoDetail{0}?id={1}"">修改</a>", PageExt, Item.Id) : string.Format(@"<a href=""BorrowInfoDetail{0}?id={1}&action=view"">详情</a>", PageExt, Item.Id) %>                                
                            </div>
                            <div class="card-middle">
                                <span class="<%# Item.Status == WAP2P.Member.BorrowInfo.ValidStatus.ValidSuccess ? "fcred-3":"fcgery-3" %>"><%# Item.Status.GetDescription() %></span>
                                <span class="fs16 g-fbold"><%# Item.Name.LeftX(12) %></span>
                                <span class="fs12 ff-songti fcblueAsh-3"><%# Item.Status == WAP2P.Member.BorrowInfo.ValidStatus.ValidSuccess ? "评估价值："+Item.Quota.ToMoneyString() + "元" : string.Empty %></span>
                            </div>
                            <div class="card-foot">
                                <%# Item.Status == WAP2P.Member.BorrowInfo.ValidStatus.ValidSuccess ? string.Format("到期时间：{0}", Item.Expires.ToDateTimeString("长期")) : string.Format("添加时间：{0}", Item.CreateAt.ToDateTimeString()) %>
                            </div>
                        </li>
                    </ItemTemplate>
                </asp:Repeater>
                <li class="card-add">
                    <a href="BorrowInfoDetail<% =PageExt %>">
                        <i class="iconfont fs30">&#xe628;</i>
                        <span class="g-block">添加新的借款资料</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script>
        $(function () {
            $(".m-card li").hover(
                function () {
                    $('a', this).show();
                },
                function () {
                    $('a', this).hide();
                }
             );

            $('.m-card li a.delete').click(function () {
                var a = $(this);
                $.jConfirm('确定删除借款资料吗？', function () {
                    $.ajax({
                        type: 'get',
                        url: '?',
                        cache: false,
                        dataType: 'json',
                        data: { action: 'delete', id: $(a).attr('data-id') },
                        success: function (res) {
                            if (res.Success) {
                                $(a).closest('li').remove();
                            } else {
                                $.jError('错误框', res.Message);
                            }
                        }
                    });
                });
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server">
</asp:Content>
