<%@ Page Title="" Language="C#" MasterPageFile="~/Master/MainMaster.master" CodeBehind="TransferList.aspx.cs" Inherits="WAP2P.Web.PC.Borrow.TransferList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div class="m-page">
        <form action="?action=search" class="js-filter search" method="get" id="form1" data-ajax-scroll="#form1" data-ajax-auto="false" data-ajax-fill="#js-ajaxlist" data-ajax-error="<div>加载中错误</div>">
            <div class="m-container mt20 mb20"">
                <dl class="ui-tab m-select">
                    <dt><a href="/Borrow/Default<% =PageBase.PageExt %>">借款列表</a></dt>
                    <dt><a href="/Borrow/TransferList<% =PageBase.PageExt %>" class="on">债权列表</a></dt>
                    <%--<dt><a href="/Borrow/Default<% =PageBase.PageExt %>">理财列表</a></dt>--%>
                    <dd>
                        <ul class="select-list mt25 ml30 g-left">
                            <li>
                                <strong>债权类型</strong>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("type", string.Empty) %>" data-filter-to="#type" data-filter-value=""<% =string.IsNullOrWhiteSpace(Request.QueryString["type"]) ? "class=\"on\"" : string.Empty %>>全部</a>
                                <asp:Repeater runat="server" ID="rptBorrowType" ItemType="WAP2P.Sys.BorrowType">
                                    <ItemTemplate>
                                        <a href="<%# Request.RawUrl.UrlEncodeParam().SetUrlParam("type", Item.Id.ToString()) %>" data-filter-to="#type" data-filter-value="<%# Item.Id %>"<%# Request.QueryString["type"] == Item.Id.ToString() ? "class=\"on\"" : string.Empty %>><%# Item.Name %></a>
                                    </ItemTemplate>
                                </asp:Repeater>                                
                                <input type="hidden" name="type" id="type" value="<% =Request.QueryString["type"].UrlEncode() %>" />
                            </li>
                            <li>
                                <strong>转让金额</strong>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("money", string.Empty) %>" data-filter-to="#money" data-filter-value=""<% =string.IsNullOrWhiteSpace(Request.QueryString["money"]) ? "class=\"on\"" : string.Empty %>>全部</a>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("money", "-5") %>" data-filter-to="#money" data-filter-value="-5"<% =Request.QueryString["money"] == "-5" ? "class=\"on\"" : string.Empty %>>5万以下</a>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("money", "5-10") %>" data-filter-to="#money" data-filter-value="5-10"<% =Request.QueryString["money"] == "5-10" ? "class=\"on\"" : string.Empty %>>5-10万</a>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("money", "10-15") %>" data-filter-to="#money" data-filter-value="10-15"<% =Request.QueryString["money"] == "10-15" ? "class=\"on\"" : string.Empty %>>10-15万</a>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("money", "15-") %>" data-filter-to="#money" data-filter-value="15-"<% =Request.QueryString["money"] == "15-" ? "class=\"on\"" : string.Empty %>>15万以上</a>                                
                                <input type="hidden" name="money" id="money" value="<% =Request.QueryString["money"].UrlEncode() %>" />
                            </li>
                            <li>
                                <strong>债权期数</strong>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("period", string.Empty) %>" data-filter-to="#period" data-filter-value=""<% =string.IsNullOrWhiteSpace(Request.QueryString["period"]) ? "class=\"on\"" : string.Empty %>>全部</a>                                
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("period", "1-3") %>" data-filter-to="#period" data-filter-value="1-3"<% =Request.QueryString["period"] == "1-3" ? "class=\"on\"" : string.Empty %>>1-3期</a>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("period", "3-6") %>" data-filter-to="#period" data-filter-value="3-6"<% =Request.QueryString["period"] == "3-6" ? "class=\"on\"" : string.Empty %>>3-6期</a>
                                <a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("period", "6-") %>" data-filter-to="#period" data-filter-value="6-"<% =Request.QueryString["period"] == "6-" ? "class=\"on\"" : string.Empty %>>6期以上</a>                                
                                <input type="hidden" name="period" id="period" value="<% =Request.QueryString["period"].UrlEncode() %>" />
                            </li>
                        </ul>
                    </dd>
                </dl>
                <input type="hidden" name="order" id="order" value="<% =Request.QueryString["order"].UrlEncode() %>" />
                <dl class="m-bidlist mt10">
                    <dt><a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("order", string.IsNullOrEmpty(Request.QueryString["order"]) ? "_asc" : string.Empty) %>" data-filter-to="#order|#order" data-filter-value="|_desc"<% =string.IsNullOrWhiteSpace(Request.QueryString["order"]) || Request.QueryString["order"] == "_asc" ? "class=\"on\"" : string.Empty %>>按时间排序</a></dt>
                    <dt><a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("order", Request.QueryString["order"] == "money" ? "money_desc" : "money") %>" data-filter-to="#order|#order" data-filter-value="money|money_desc"<% =Request.QueryString["order"] != null && Request.QueryString["order"].StartsWith("money") ? "class=\"on\"" : string.Empty %>>按金额排序</a></dt>
                    <dt><a href="<% =Request.RawUrl.UrlEncodeParam().SetUrlParam("order", Request.QueryString["order"] == "period" ? "period_desc" : "period") %>" data-filter-to="#order|#order" data-filter-value="period|period_desc"<% =Request.QueryString["order"] != null && Request.QueryString["order"].StartsWith("period") ? "class=\"on\"" : string.Empty %>>按期数排序</a></dt>
                    <dd id="js-ajaxlist" class="js-ajaxlist">
                        <ruson:Space runat="server" ID="list" Visible="false">
                            <ruson:Repater runat="server" ID="rptList" ItemType="WAP2P.BorrowLoan.Transfer">
                                <ItemTemplate>
                                    <div class="m-bidbox" id="tr<%# Item.Id %>">
                                        <div class="bidbox-title">
                                            <h5 class="g-left">
                                                <a href="<%# WAP2P.Web.Extensions.GetBorrowUrl(Item.Id) %>">
                                                    <img src="../Res/core/Images/default/tico.jpg" style="width:60px; height:18px; margin-top:2px;" class="g-left"/>
                                                </a>
                                                <a class="g-left fs16 ml10 g-valign" style="color:#1b1b1b" href="<%# WAP2P.Web.Extensions.GetTransferUrl(Item.Id) %>"><%# Item.Name %></a>
                                            </h5>
                                        </div>
                                        <ul>
                                            <li class="wg3">
                                               <span>转让价格</span>
                                                <label class="fcblue-3 g-fbold fs26"><%# Item.UpDownAmount.ToMoneyString() %></label> 元 
                                            </li>
                                            <li class="border"></li>
                                            <li class="wg3">
                                                <span>债权价值</span>
                                                <label><%# Item.Amount.ToMoneyString() %></label>元 / <%# (Item.Amount-Item.BidAmountCount).ToMoneyString() %> 元
                                            </li>
                                            <li class="border"></li>
                                            <li class="wg2">
                                              <span>预计收益</span><label><%# Item.Interest.ToMoneyString() %></label>元
                                            </li>
                                            <li class="border"></li>
                                            <li class="wg2">
                                                <span>剩余期数</span>
                                                <label><%# Item.PeriodCount %></label> 期
                                            </li>
                                            <li>                                                
                                                <a href="<%# WAP2P.Web.Extensions.GetTransferUrl(Item.Id) %>" class="w100 btn-nobord g-block js-btn bidbtn">投&nbsp;&nbsp;标</a>
                                            </li>
                                        </ul>
                                    </div>

                                </ItemTemplate>
                                <EmptyTemplate>
                                    <span class="bidlist-empty">没有找到更多的数据。</span>
                                </EmptyTemplate>
                            </ruson:Repater>
                            <div class="ui-pages g-fright">
                                <ruson:Pager runat="server" ID="pages" CssClass="pages" ShowPageSizeSelect="false" />
                                <a href="<% =Request.RawUrl.UrlEncodeParam() %>" class="g-hide"></a>
                            </div>
                            <script type="text/html" class="js-run">
                                $.ajax({
                                    dataType: 'json',
                                    cache: false,
                                    url: 'ajax<% =PageExt %>',
                                    data: { action: 'transfersInfo', ids: '<% =ids %>'},
                                    success: function(res) {                                
                                        if (res.length) {
                                            $.each(res, function(i, n) {
                                                var tr = $('#tr' + n.id);                                
                                                tr.find('.js-stepw').css('width', n.data.step);
                                                tr.find('.js-stepl').css('left', n.data.step).html(n.data.step);
                                            });
                                        }
                                    }
                                });
                            </script>
                        </ruson:Space>
                    </dd>
                </dl>
            </div>
        </form>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script>
        eval($('script.js-run')[0].innerHTML);
    </script>
</asp:Content>
