<%@ Page Title="" Language="C#" MasterPageFile="~/Master/UserMaster.master" CodeBehind="Default.aspx.cs" Inherits="WAP2P.Web.PC.User.Default" %>
<%@ MasterType VirtualPath="~/Master/UserMaster.master"%> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div class="m-userbox mb10">
        <div class="m-wartip" id="js-promotip">
            <asp:Repeater runat="server" ID="rptPromotion" ItemType="WAP2P.BorrowLoan.Promotion">
                <ItemTemplate>
                    <a href="/Promotion/Detail<%# PageExt %>?id=<%# Item.Id %>" target="_blank"><%# Item.Name %></a>
                </ItemTemplate>
            </asp:Repeater>
        </div>
    </div>
    <div class="m-userbox m-buserbox">
        <!--个人中心首页第一块用户信息 开始-->
        <div class="usercenter-infor">
            <div class="usercenter-left">
                <div class="usercenter-container">
                    <div class="usercenter-photo">
                        <img src="<% =CurrentUser.GetFace() %>" alt="" />
                        <a class="usercenter-imglink" href="Info/BaseInfo<% =PageExt %>">更换头像</a>
                        <span>推荐号：<a href="Reward/Recommend<% =PageExt %>"><% =CurrentUser.GetRecommendNo() %></a></span>
                    </div>
                    <div class="usercenter-info">
                        <h4><% =CurrentUser.GetNickname() %><span>(<% =CurrentUser.Name %>) 的账户中心</span></h4>
                        <p class="fcblack-1">所在会员组：<span class="mr30"><a href="/User/Info/UserGroupUp<% =PageExt %>" class="fcred-3"><% =CurrentUser.GetGroup().Name %></a></span>我的积分：<span class="fcred-3"><% =CurrentUser.Score %></span></p>
                        <p class="icons-p">
                            <% =CurrentUser.PhoneValid == WAP2P.Member.User.BaseInfoValidStatus.ValidSuccess ? "<i class=\"iconfont fs30 fcblue-2\" title=\"手机认证已通过\">&#xe604;</i>" : string.Format("<a href=\"Info/Phone{0}\" class=\"iconfont fs30 fcgery-3\" title=\"手机认证未通过\">&#xe604;</a>", PageExt) %>
                            <% =CurrentUser.EmailValid == WAP2P.Member.User.BaseInfoValidStatus.ValidSuccess ? "<i class=\"iconfont fs30 fcblue-2\" title=\"邮箱认证已通过\">&#xe603;</i>" : string.Format("<a href=\"Info/Email{0}\" class=\"iconfont fs30 fcgery-3\" title=\"邮箱认证未通过\">&#xe603;</a>", PageExt) %>
                            <% =CurrentUser.RealNameValid == WAP2P.Member.User.BaseInfoValidStatus.ValidSuccess ? "<i class=\"iconfont fs30 fcblue-2\" title=\"实名认证已通过\">&#xe602;</i>" : string.Format("<a href=\"Info/SafeCenter{0}\" class=\"iconfont fs30 fcgery-3\" title=\"实名认证未通过\">&#xe602;</a>", PageExt) %>
                            <% =CurrentUser.OnsiteValid == WAP2P.Member.User.BaseInfoValidStatus.ValidSuccess ? "<i class=\"iconfont fs30 fcblue-2\" title=\"现场认证已通过\">&#xe601;</i>" : string.Format("<a href=\"Info/SafeCenter{0}\" class=\"iconfont fs30 fcgery-3\" title=\"现场认证未通过\">&#xe601;</a>", PageExt) %>                            
                        </p>
                        <p class="fcblueAsh-2 mt5">上次登录地址：<span class="fcblue-2"><% =Area.GetLocationString(CurrentUser.PreLoginIP) %></span> 。如果非本人登录，请及时<a href="Info/ModifyPassword<% =PageExt %>">修改密码</a></p>
                    </div>
                </div>
                <div class="usercenter-money">
                    <ul>
                        <li>可用总额</li>
                        <li><strong class="fcred-3"><% =account.AvaliableSum.ToMoneyString() %></strong> 元</li>
                    </ul>
                    <ul class="usercenter-border">
                        <li>冻结总额</li>
                        <li><strong><% =account.HoldSum.ToMoneyString() %></strong> 元</li>
                    </ul>
                    <ul>
                        <li>可用红包</li>
                        <li><strong><a href="Reward/RewardLogList<% =PageExt %>"><% =promotionLog.Count %></a></strong>个，共计<strong><a href="Reward/RewardLogList<% =PageExt %>"><% =promotionLog.Sum(item => item.RewardMoney - item.RewardMoneyUsed).ToMoneyString() %></a></strong>元</li>
                    </ul>
                </div>
            </div>
            <div class="usercenter-right">
                <div class="custom-service">
                    <i class="iconfont fs80">&#xe620;</i>
                    <span class="ff-yahei mb5"><% =CurrentUser.GetService() %></span>
                    <span><a href="SNS/FriendList<% =PageExt %>">站内信（<% =WAP2P.Member.Message.FindByUser(CurrentUser.Id).Where(item => item.HaveNew).Count() %>）</a>| <a href="Loan/ReservationList<% =PageExt %>">标的预约</a></span>
                </div>              
                 <div class="money-service">
                    <a href="/User/Account/OnlineRecharge<%= PageBase.PageExt %>" class="c-normal btn-bordsmall ml10">充 值</a>
                    <a href="/User/Account/Cash<%= PageBase.PageExt %>" class="c-priority btn-bordsmall">提 现</a>
                </div>
            </div>
        </div>
        <!--个人中心首页第一块用户信息 结束-->

        <!--个人中心首页第二块内容账户资金 开始-->
        <table class="usercenter-table" width="100%">
            <tr>
                <th class="pl20">账户资产</th>
                <th></th>
                <th>待收总额</th>
                <th></th>
                <th>待付总额</th>
                <th></th>
                <th>账户总额</th>
            </tr>
            <tr>
                <td class="pl20"><span class="fcred-3"><% =account.Sum.ToMoneyString() %></span> 元</td>
                <td><strong>=</strong></td>
                <td><span><% =account.WaitReceive.ToMoneyString() %></span> 元</td>
                <td><strong>-</strong></td>
                <td><span><% =account.WaitRepayment.ToMoneyString() %></span> 元</td>
                <td><strong>+</strong></td>
                <td><span><% =(account.AvaliableSum + account.HoldSum + account.LockSum).ToMoneyString() %></span> 元</td>
            </tr>
        </table>
        <!--个人中心首页第二块内容账户资金 结束-->

        <!--个人中心首页第三块内容理财情况 开始-->
        <div class="usercenter-mdetail">
            <div class="g-ohide">
                <h4 class="g-left">理财状况 已获理财收益<span class="fs18 ml5 mr5"><% =WAP2P.Account.UserAccountLog.FindByUser(CurrentUser.Id, null, null, WAP2P.Account.AccountActionType.收到还款利息).Sum(item => (decimal?)item.Money).ToMoneyString("0.00") %></span>元</h4>
                <a href="Loan/AutoBidList<% =PageExt %>" class="g-right fs12 ff-songti" >设置智能投标方案</a>
            </div>
            <div id="js-incomeChart" style="width:99%; height:320px;">                
            </div>            
        </div>
        <!--个人中心首页第三块内容理财情况 结束-->
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">    
    <script src="<% =this.ImportJsCss("~/res/echarts/build/echarts-plain.js") %>"></script>
    <script src="<% =this.ImportJsCss("~/res/echarts/build/macarons.js") %>"></script>
    <script>
        var promoTip = $('#js-promotip');
        if (promoTip.children().length > 0) {
            promoTip.scrollview('a');
        } else
            promoTip.parent().remove();

        var incomeNames = ['<% =now.AddMonths(-5).Month %>月', '<% =now.AddMonths(-4).Month %>月', '<% =now.AddMonths(-3).Month %>月', '<% =now.AddMonths(-2).Month %>月', '<% =now.AddMonths(-1).Month %>月', '<% =now.Month %>月']
        var incomeData = [
            {value: <% =chartList.Where(item => item.CreateAt.Month == now.AddMonths(-5).Month).Sum(item => item.Money).ToMoneyString().Replace(",", string.Empty) %>, name: incomeNames[0]},
            {value: <% =chartList.Where(item => item.CreateAt.Month == now.AddMonths(-4).Month).Sum(item => item.Money).ToMoneyString().Replace(",", string.Empty) %>, name: incomeNames[1]},
            {value: <% =chartList.Where(item => item.CreateAt.Month == now.AddMonths(-3).Month).Sum(item => item.Money).ToMoneyString().Replace(",", string.Empty) %>, name: incomeNames[2]},
            {value: <% =chartList.Where(item => item.CreateAt.Month == now.AddMonths(-2).Month).Sum(item => item.Money).ToMoneyString().Replace(",", string.Empty) %>, name: incomeNames[3]},
            {value: <% =chartList.Where(item => item.CreateAt.Month == now.AddMonths(-1).Month).Sum(item => item.Money).ToMoneyString().Replace(",", string.Empty) %>, name: incomeNames[4]},
            {value: <% =chartList.Where(item => item.CreateAt.Month == now.Month).Sum(item => item.Money).ToMoneyString().Replace(",", string.Empty) %>, name: incomeNames[5]}
        ];
        charts.bar('js-incomeChart', '近6个月收益(元)', incomeNames, incomeData);
    </script>
</asp:Content>
