<%@ Page Language="C#" MasterPageFile="../BaseMaster.Master" CodeBehind="BorrowDetailBid.aspx.cs" Inherits="WAP2P.Web.PC.Admin.BorrowLoan.BorrowDetailBid" %>
<%@ Register Src="Controls/BorrowInfo.ascx" TagPrefix="uc1" TagName="BorrowInfo" %>
<%@ Register Src="Controls/BidLog.ascx" TagPrefix="uc1" TagName="BidLog" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <form class="auto" method="post" action="<% =Request.RawUrl %>" onsuccess="parent.$.jPopupEdit.close(true);">
        <div class="m-editbar">
            <input type="submit" class="btn-larger c-priority iconfont" value="&#xe684; 保存" />
            <input type="button" class="btn-larger c-normal iconfont" value="&#xe634; 关闭" onclick="parent.$.jPopupEdit.close();" />
        </div>
        <div class="m-content m-editcontent">
            <dl class="ui-tabs">
                <dt><a href="#edit" class="on">编辑</a></dt>
                <dt><a href="#bid">投标记录</a></dt>
                <dt><a href="#borrowDetail">借款详情</a></dt>
                <dd id="edit">
                    <div class="m-content">
                        <table class="m-info" cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <th>借款名称</th>
                                <td><input type="text" name="name" class="w250" maxlength="50" value="<%=Model.Name.HtmlEncode() %>" data-vtype="must" data-vmsg="请输入借款标题" /></td>
                            </tr>
                            <tr>
                                <th>投标开始时间</th>
                                <td><% =Model.BidAt.ToDateTimeString() %></td>
                            </tr>
                            <tr>
                                <th>投标结束时间</th>
                                <td><input type="text" name="bidEndAt" id="bidEndAt" data-mindate="#bidAt" value="<% =Model.BidEndAt.ToDateTimeString() %>" class="w150 ui-date ui-datetime" data-vtype="date" data-vmsg="请输入结束时间" /></td>
                            </tr>
                            <tr>
                                <th>投资限额</th>
                                <td>
                                    <div class="mt5 mb5">
                                        单次至少投资 <input type="text" name="bidMinAmount" value="<% =Model.BidMinAmount.ToMoneyString() %>" class="w100 ui-float" /> 元 
                                    </div>
                                    <div class="mt5 mb5">
                                        最多可以投资 <input type="text" name="bidMaxAmount" value="<% =Model.BidMaxAmount.ToMoneyString() %>" class="w100 ui-float" /> 元
                                    </div>
                                    <% =borrowType.ByStep ? string.Format("<em>请输入 {0} 元的整数倍</em>", borrowType.StepAmount.ToMoneyString()) :string.Format("<em>最小投资金额必须大于或等于 {0} 元，最大投资金额不填则不限制。</em>", borrowType.StepAmount.ToMoneyString()) %>
                                </td>
                            </tr>
                            <tr>
                                <th>智能投标</th>
                                <td>
                                    <span class="ui-checkbox g-block mb5"><% =HtmlHelper.CheckBox("canAutoBid", "启动智能投标", Model.CanAutoBid) %></span>
                                    <span>可自动投资金额：<input type="text" name="autoBidAmount" id="autoBidAmount" value="<% =Model.AutoBidAmount.ToMoneyString() %>" class="ui-float w100" data-vtype="money" data-vmust="false" data-vmsg="请输入正确的金额" /> 元</span>                
                                </td>
                            </tr>
                            <tr>
                                <th>推荐加色</th>
                                <td>
                                    <span><% =HtmlHelper.CheckBox("homeDisplay", "首页推荐", Model.HomeDisplay) %></span>
                                    <span class="ml50">标题加色 <ruson:Select runat="server" ID="color">
                                        <option value="" style="background-color:#fff; color:black;">默认</option>
                                        <option value="red" style="background-color:red; color:#fff;">红色</option>
                                        <option value="blue" style="background-color:blue; color:#fff;">蓝色</option>
                                        <option value="green" style="background-color:green; color:#fff;">绿色</option>
                                        <option value="purple" style="background-color:purple; color:#fff;">紫色</option>
                                    </ruson:Select>
                                    </span>
                                    <span class="ml50">排序值 <input type="text" name="orderBy" class="ui-int w50" value="<% =Model.OrderBy %>" data-vtype="number" data-vmsg="请输入正确的数值" /></span>
                                </td>
                            </tr>
                            <tr>
                                <th>补充说明</th>
                                <td><script id="detail" name="detail" class="ui-editor" type="text/plain"><%= Model.Detail %></script></td>
                            </tr>
                        </table>
                    </div>
                </dd>
                <dd id="bid" class="g-hide">
                    <div class="m-content">
                        <uc1:BidLog runat="server" ID="bidLog" />
                    </div>
                </dd>
                <dd id="borrowDetail" class="g-hide">
                    <div class="m-content">
                        <uc1:BorrowInfo runat="server" ID="borrowInfo" />
                    </div>
                </dd>
            </dl>            
        </div>
    </form>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script src="<% =this.ImportJsCss("../res/ueditor/ueditor.config.js") %>"></script>
    <script src="<% =this.ImportJsCss("../res/ueditor/ueditor.all.min.js") %>"></script>
    <script>
        $('.ui-tabs').tabs({ tabSelector: 'dt a' });

        //颜色
        var colorChange = function () {
            var option = $('#color :selected');
            $('#color').css({
                background: option.css('background-color'),
                color: option.css('color')
            });
        };
        colorChange();
        $('#color').change(colorChange);

        //智能投标
        var autoBidChange = function () {
            if ($('#canAutoBid')[0].checked)
                $('#autoBidAmount').removeAttr('disabled');
            else
                $('#autoBidAmount').attr('disabled', 'disabled');
        };
        autoBidChange();
        $('#canAutoBid').click(autoBidChange);
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="list" runat="server">
</asp:Content>