<%@ Page Language="C#" MasterPageFile="~/Master/MainMaster.master" CodeBehind="Detail.aspx.cs" Inherits="WAP2P.Web.PC.Finance.Detail" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <div class="m-page">
        <div class="m-container g-ohide mt10">
            <div class="m-crumbs">
                <ul class="g-left">
                    <li><a href="/"><i class="iconfont">&#xe630;</i> 首页</a> &nbsp;>&nbsp;</li>
                    <li><a href="/Finance/">智能投资</a> &nbsp;>&nbsp;</li>
                    <li><% =model.Name %></li>
                </ul>                
            </div>
        </div>

        <div class="m-container m-globalbox g-ohide mt10  m-detailbid">
            <div class="g-left wg9 g-ohide m-rightborder">
                <h5 class="darailbid-title g-ohide m-boborder pt15 pb15 pl10"><span class="fs24 g-fbold"><% =model.Name %></span></h5>
                <ul class="darailbid-baselist">                    
                    <li class="wgm2 g-noneborder">
                        <span class="g-block mt30">投资期限</span>
                        <% =WAP2P.Web.PC.Finance.Default.GetMonthHtml(model) %>
                    </li>
                    <li class="wg2">
                        <span class="g-block mt30">预计年化收益</span>
                        <% =WAP2P.Web.PC.Finance.Default.GetInterestHtml(model) %>
                    </li>
                    <li class="wg2">
                        <span class="g-block mt30">起步金额</span>
                        <span class="fs24"><% =model.AmountMin.ToMoneyString() %></span>
                        <span>元</span>
                    </li>
                    <li class="wg3">
                        <span class="g-block mt30">收益方式</span>
                        <span class="fs20"><% =WAP2P.Web.Extensions.GetRepaymentName(model.Repayment) %></span>
                    </li>
                </ul>
                <div class="g-clear pa15 g-ohide fcblack-1 h60">
                    <% =model.Description.BrEncode() %>
                </div>
            </div>
            <div class="g-right wg3 g-ohide">
                <form class="js-auto js-vtip" method="post" action="../Borrow/ajax<% =PageExt %>?action=success" data-onsuccess="member.pay('<% =(int)WAP2P.Account.AccountActionType.认购理财方案 %>', '<% =string.Format("amount=' + $('#amount').val() + '&rid={0}", model.Id) %>', function () { common.pageTip('<% =PageBase.TipType.Success %>', '恭喜订购成功！', '/User/Loan/AutoBidList' + gconfig.pageExt, '我的智能理财方案'); });">
                    <ruson:Space runat="server" ID="nologin" Visible="false">
                        <%--未登录--%>
                        <div class="detailbid-usermoenytext">
                            <span class="g-left fs16">可用余额：</span>
                            <a class="g-right btn-bordsmall c-normal" href="/User/Account/OnlineRecharge<% =PageBase.PageExt %>">充 值</a>
                        </div>
                        <div class="detailbid-usermoeny">
                            <a href="javascript:void(0);" onclick="member.miniLogin(function(){location.href = '<% =string.Format("/Finance/Detail{0}?id={1}",PageBase.PageExt, model.Id) %>'});return false;">登录</a> 后即可见
                        </div>
                        <a class="g-block btn-nobord c-important w200 ml5 mt20 pt5 pb5" target="_blank" href="/User/Register<% =PageBase.PageExt %>">还没有账号？立刻注册</a>
                        <%--未登录 END--%>
                    </ruson:Space>
                    
                    <ruson:Space runat="server" ID="unValid" Visible="false">
                        <%--实名认证或手机号码认证--%>
                        <div class="detailbid-usermoenytext">
                            <span class="g-left fs16">可用余额：</span>
                            <a class="g-right btn-bordsmall c-normal" href="/User/Account/OnlineRecharge<% =PageBase.PageExt %>">充 值</a>
                        </div>
                        <div class="detailbid-usermoeny">
                             <span class="fs24"><% =avaliableSum.ToMoneyString() %></span> 元
                        </div>
                        <%= CurrentUser.RealNameValid != WAP2P.Member.User.BaseInfoValidStatus.ValidSuccess ? string.Format("<a class=\"g-block btn-nobord c-important w218 mt10\" href=\"/User/Info/RealName{0}\">立刻完成实名认证</a>", PageExt) : string.Empty %>
                        <%= CurrentUser.PhoneValid != WAP2P.Member.User.BaseInfoValidStatus.ValidSuccess ? string.Format("<a class=\"g-block btn-nobord c-important w218 mt5\" href=\"/User/Info/Phone{0}\"> 立刻绑定手机号码</a>", PageExt) : string.Empty %>
                        <%--实名认证或手机号码认证 end--%>
                    </ruson:Space>

                    <ruson:Space runat="server" ID="joined" Visible="false">
                        <%--进行中的理财--%>
                        <div class="detailbid-usermoenytext">
                            <span class="g-left fs16">可用余额：</span>
                            <a class="g-right btn-bordsmall c-normal" href="/User/Account/OnlineRecharge<% =PageBase.PageExt %>">充 值</a>
                        </div>
                        <div class="detailbid-usermoeny">
                             <span class="fs24"><% =avaliableSum.ToMoneyString() %></span> 元
                        </div>
                        <div class="detailbid-usermoeny fs18 fcgery-3 g-fbold">
                            您已经参加了该项目
                        </div>
                        <a class="g-block btn-nobord c-normal w218 mt20 pt5 pb5" href="/Finance/">看看别的项目</a>
                        <%--进行中的理财 end--%>
                    </ruson:Space>

                    <ruson:Space runat="server" ID="closed" Visible="false">
                        <%--进行中的理财--%>
                        <div class="detailbid-usermoenytext">
                            <span class="g-left fs16">可用余额：</span>
                            <a class="g-right btn-bordsmall c-normal" href="/User/Account/OnlineRecharge<% =PageBase.PageExt %>">充 值</a>
                        </div>
                        <div class="detailbid-usermoeny">
                             <span class="fs24"><% =avaliableSum.ToMoneyString() %></span> 元
                        </div>
                        <div class="detailbid-usermoeny fs18 fcgery-3 g-fbold">
                            该项目暂时已关闭
                        </div>
                        <a class="g-block btn-nobord c-normal w218 mt20 pt5 pb5" href="/Finance/">看看别的项目</a>
                        <%--进行中的理财 end--%>
                    </ruson:Space>

                    <ruson:Space runat="server" ID="ing" Visible="false">
                        <%--购买中的理财产品--%>
                        <div class="detailbid-usermoenytext">
                            <span class="g-left fs16">可用余额：</span>
                            <a class="g-right btn-bordsmall c-normal" href="/User/Account/OnlineRecharge<% =PageBase.PageExt %>">充 值</a>
                        </div>
                        <div class="detailbid-usermoeny">
                            <span class="fs24" id="js-avaliable"><% =avaliableSum.ToMoneyString() %></span> 元
                        </div>
                        <input type="text" class="detailbid-userbidinput ml5 w200 input-moneyicon" id="amount" autocomplete="off" maxlength="10" placeholder="请输入订购金额"
                            data-vtype="money|range|fun|ajax"
                            data-vmsg="请输入正确的投资金额|起步金额为 <% =(model.AmountMin ?? 1).ToMoneyString() %> 元|请输入 <% =model.StepAmount.ToMoneyString() %> 的整数倍|可用余额不足"
                            data-vmin="<% =(model.AmountMin ?? 1).ToJsString() %>"
                            data-vmax="9999999"
                            data-vfun="checkStep"
                            data-vurl="?action=amountCheck&id=<% =model.Id %>" />
                        <ul class="detailbid-userbidlist">
                            <li class="ui-vcheckbox js-tip">
                                <label><input type="checkbox" name="protocol1" checked="checked" value="1" data-vtype="group" data-vmin="1" data-vmsg="您需要同意用户协议。" />同意《<a target="_blank" href="/Agreement/?type=entrustbid"><% =SiteName %>智能投资协议</a>》</label>
                            </li>
                        </ul>
                        <div class="btn-submits mt5">
                            <input type="submit" class="btn-bbord fs16 c-normal w252" value="立刻订购" data-success-text="订购中" />
                            <div class="w252"><em class="m-sumtip js-vsum"></em></div>
                        </div>
                         <%--购买中的理财产品 end--%>
                    </ruson:Space>

                     <a class="detailbid-userhelpline" target="_blank" href="/Help/ServiceList<% =PageBase.PageExt %>">操作遇到了问题？联系客服</a>
                </form>
            </div>
        </div>
        <div class="finance-box" >
            <% =model.Detail %>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script>
        function checkStep(val) {
            if (<% =!model.StepAmount.HasValue ? "true" : "false" %>) return true;

            val = parseFloat(val.replace(/,/ig, ''));
            if (isNaN(val)) return false;

            return val % <% =model.StepAmount.ToJsString() %> == 0;
        }
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server"></asp:Content>
