<%@ page title="添加提现" language="C#" masterpagefile="~/Member/MyShopMasterPage.master" autoeventwireup="true" inherits="Member_Application, WebApp_deploy" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        $(function () {
            var p = '<%=actType %>';
            if (p != "") {
                $(".tab li").removeClass("active");
                switch (p) {
                    case "1":
                        $(".tab li").eq(0).addClass("active");
                        $(".tab li").eq(0).removeClass("normal");
                        $(".tab li").eq(1).addClass("normal");
                        $(".tab li").eq(2).addClass("normal");
                        $("#Mention").hide();
                        $("#Recharge").hide();
                        $("#RechargeList").show();
                        break;
                    case "2":
                        $(".tab li").eq(0).addClass("normal");
                        $(".tab li").eq(1).addClass("active");
                        $(".tab li").eq(1).removeClass("normal");
                        $(".tab li").eq(2).addClass("normal");
                        $("#Mention").hide();
                        $("#Recharge").show();
                        $("#RechargeList").hide();
                        break;
                    case "3":
                        $(".tab li").eq(0).addClass("normal");
                        $(".tab li").eq(1).addClass("normal");
                        $(".tab li").eq(2).addClass("active");
                        $(".tab li").eq(2).removeClass("normal");
                        $("#Mention").show();
                        $("#Recharge").hide();
                        $("#RechargeList").hide();
                        break;

                }
            }
        })
    </script>
    <ul class="tab">
         
        <%--<li class="active"><a href="Application.aspx?actype=list">充值列表</a></li>
        <li class="normal"><a href="Application.aspx?actype=Rechar">充&nbsp;值</a></li>--%>
        <li class="normal"><a href="Application.aspx?actype=now">提现添加</a></li>
        <li class="normal"><a href="RecordChash.aspx">提现列表</a></li>
    </ul>
    <%--提现添加 begin--%>
    <div class="wrap" id="Mention" style="display:none">
        <div class="public">
            <div class="information">
                <div class="info individual">
                    <table>
                        <tr>
                            <th class="width4">
                                支付方式:
                            </th>
                            <td>
                                <asp:DropDownList ID="payment_sel" runat="server">
                                   <asp:ListItem Value="0">请选择</asp:ListItem>
                                    <asp:ListItem Value="线下支付">线下支付</asp:ListItem>
                                    <asp:ListItem Value="线上支付">线上支付</asp:ListItem>
                                </asp:DropDownList>
                                <span id="payment_selSpan" style="color: Red; width: 150px; display: none;">请选择支付方式!
                                </span>
                            </td>
                        </tr>
                        <tr class="offlinetr">
                            <th>
                                收款人姓名:
                            </th>
                            <td>
                                <input type="text" class="text width_normal" name="shoukuan_name" id="shoukuan_name"
                                    runat="server" /><span id="nameSpan" style="color: Red; width: 150px; display: none;">收款人姓名不能为空!
                                    </span>
                            </td>
                        </tr>
                        <tr class="offlinetr">
                            <th>
                                收款银行:
                            </th>
                            <td>
                                <input type="text" class="text width_normal" name="shoukuan_bank" id="shoukuan_bank"
                                    runat="server" /><span id="bankSpan" style="color: Red; width: 150px; display: none;">收款银行不能为空!
                                    </span>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                收款账号:
                            </th>
                            <td>
                                <input type="text" class="text width_normal" name="account" id="account" runat="server" /><span
                                    id="accountSpan" style="color: Red; width: 150px; display: none;">收款账号不能为空!
                                </span><font class="field_notice">线上方式为例如支付宝的帐号，线下方式为银行帐号</font>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                提现金额:
                            </th>
                            <td>
                                <input type="text" class="text width_normal" name="price" id="price" runat="server" /><span
                                    id="priceSpan" style="color: Red; width: 150px; display: none;">提现金额不能为空! </span>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                会员备注:
                            </th>
                            <td>
                                <textarea class="text" name="memberremark" style="height: 100px; overflow-y: auto;
                                    width: 250px; vertical-align: top;" id="memberremark" runat="server"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                当前可用金额:
                            </th>
                            <td>
                                <asp:Label ID="lblPrice" runat="server" Text=""></asp:Label>&nbsp;&nbsp;元
                            </td>
                        </tr>
                        <tr>
                            <th>
                                &nbsp;<br>
                                <br>
                            </th>
                            <td>
                                <asp:Button ID="submit" runat="server" Text="提交" CssClass="btn" OnClientClick="return SubmitPayMent();"
                                    OnClick="submit_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>
    <%--提现添加 end--%>
    <%--充值 begin--%>
    <div class="wrap" id="Recharge" style="display:none">
        <div class="public table">
            <div class="information_index individual">
                <div class="info">
                    <h3 class="margin2">
                        <span>您好！
                            <asp:Literal ID="ltrUserName" runat="server" />
                        </span>
                    </h3>
                    <span class="epay_txt">你的账户现金:<span style="font-size: 16px; font-weight: bold; color: #FE5400;">
                        <asp:Literal ID="Balance" runat="server" Text="0.0" />
                    </span>&nbsp;元&nbsp;&nbsp;&nbsp;&nbsp;冻结金额：<span style="color: blue;">
                        <asp:Literal ID="ltrFrozenMoney" runat="server" Text="0.0" />
                    </span>&nbsp;元</span>
                </div>
            </div>
        </div>
        <div style="padding-top: 0;" class="public table">
            <div style="color: #646665; float: left; font-size: 12px; font-weight: normal; line-height: 30px;"
                class="individual">
                <span style="background: #FFFFFF; font-size: 14px; color: #3E3E3E; font-weight: bold;">
                    充值金额:</span> &nbsp;<input type="text" size="8" value="0.01" id="TxtMoney" runat="server" />&nbsp;元
                <label id="lblError" style="color: Red;">
                </label>
                <table style="font-size: 12px; cellspacing=1; cellpadding=3; width=762; align=center;
                    bgcolor=#d8d9db; border=0">
                    <tbody>
                        <tr>
                            <td style="background: #FFFFFF; font-size: 14px; color: #3E3E3E; font-weight: bold;">
                                充值方式
                            </td>
                        </tr>
                        <tr>
                            <td height="36" style="background: #FFFFFF; padding-left: 15px;">
                                <asp:RadioButton ID="rdoAlipay" runat="server" Checked="true" />
                                &nbsp;<img src="../Images/Member/Alipay.gif" height="21" />
                            </td>
                        </tr>
                    </tbody>
                </table>
                <asp:Button ID="btnSubmitChage" runat="server" Text="立即充值" CssClass="money_btn" OnClientClick="return CheckMoney()"
                    OnClick="btnSubmitChage_Click" />
            </div>
        </div>
    </div>
    <%--充值 end--%>
    <%--充值列表 begin--%>
    <div class="wrap" id="RechargeList">
            <div class="public_select table" style="padding: 0px;">
                <table>
                    <tr class="line_bold">
                        <th colspan="5">
                            <div class="select_div">
                               <span>添加时间：</span>
                               <input type="text" class="text1 width2" runat="server" id="BeginTime" />-
                                <input type="text" value="" class="text1 width2" id="EndTime" runat="server" />
                                <%--<input type="text" class="text1 width2" runat="server" id="BeginTime" onclick="WdatePicker()" />-
                                <input type="text" value="" onfocus="WdatePicker({ minDate: '#F{$dp.$D(\'ctl00_ContentPlaceHolder1_BeginTime\')||\'2020-10-01\'}' })" class="text1 width2" id="EndTime" runat="server" />
                                --%>编号:&nbsp;<input type="text" id="txtPayNum" class="text1 width8" value="" runat="server" />
                                <asp:Button ID="Button1" runat="server" Text="搜索" CssClass="btn" 
                                    onclick="Button1_Click" />
                            </div>
                        </th>
                    </tr>
                    <asp:Repeater ID="Repeater1" runat="server" >
                        <HeaderTemplate>
                            <tr class="gray" ectype="table_header">
                                <th width="20%">
                                    编号
                                </th>
                                <th width="10%">
                                    充值来源
                                </th>
                                <th width="10%">
                                    金额
                                </th>
                                <th width="15%">
                                  操作时间
                                </th>
                                <th width="15%">
                                  状态
                                </th>
                            </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr class="linetr">
                                <td class="align2">
                                    <%#Eval("PayNum")%>
                                </td>
                                <td class="align2">
                                    <%#Eval("eBankName")%>
                                </td>
                                <td class="align2">
                                    <%#Eval("PayMoney")%>
                                </td>
                                <td class="align2">
                                    <%#Eval("PayTime")%>
                                </td>
                                <td>
                                  <asp:Literal ID="PayStatus" runat="server" Text='<%# (Eval("PayStatus").ToString()=="1")?"完成":"未支付" %>' />
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr>
                      <td colspan="5">
                      <div class="pagination">
                      <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" LastPageText="最后页"
                                            NextPageText="下一页" PrevPageText="上一页" UrlPaging="false" AlwaysShow="True" PageSize="1"
                                            PagingButtonClass="paginationPage" OnPageChanged="AspNetPager1_PageChanged" >
                                        </webdiyer:AspNetPager>
                               </div>    </td>
                    </tr>
                </table>
                <table id="noread" runat="server" visible="false">
                    <tr>
                        <td class="align2 member_no_records padding6" colspan="10">
                            没有符合条件的记录
                        </td>
                    </tr>
                </table>
            </div>
            <div class="wrap_bottom">
            </div>
        </div>
    <%--充值列表 end--%>
    <script type="text/javascript">
        //线下内容显示与隐藏
        $(function () {
            $(".offlinetr").hide();
            showofflinetr();
            //下来框的改变事件
            document.getElementById('<%=payment_sel.ClientID %>').onchange = function () { showofflinetr(); };
        });

        //表单验证
        function SubmitPayMent() {
            var payment_sel = document.getElementById("<%=payment_sel.ClientID %>").value;
            if (payment_sel == "0") {
                $('#payment_selSpan').css("display", "inline");
                $('#<%=shoukuan_name.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                return false;
            } else {
                $('#payment_selSpan').css("display", "none");
                $('#<%=shoukuan_name.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
            }
            if (payment_sel == "线下支付") {
                var shouKuanName = document.getElementById('<%=shoukuan_name.ClientID %>').value;
                if (shouKuanName == "") {
                    $('#nameSpan').css("display", "inline");
                    $('#<%=shoukuan_name.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                    return false;
                }
                else {
                    $('#nameSpan').css("display", "none");
                    $('#<%=shoukuan_name.ClientID %>').css("border-style", "").css("border-color", "");
                }
                var shouKuanBank = document.getElementById('<%=shoukuan_bank.ClientID %>').value;
                if (shouKuanBank == "") {
                    $('#bankSpan').css("display", "inline");
                    $('#<%=shoukuan_bank.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                    return false;
                } else {
                    $('#bankSpan').css("display", "none");
                    $('#<%=shoukuan_bank.ClientID %>').css("border-style", "").css("border-color", "");
                }
            }
            var account = document.getElementById('<%=account.ClientID %>').value;
            if (account == "") {
                $('#accountSpan').css("display", "inline");
                $('#<%=account.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                return false;
            } else {
                $('#accountSpan').css("display", "none");
                $('#<%=account.ClientID %>').css("border-style", "").css("border-color", "");
            }
            var price = document.getElementById('<%=price.ClientID %>').value;
            if (price == "") {
                $('#priceSpan').css("display", "inline");
                $('#<%=price.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                return false;
            } else {
                $('#priceSpan').css("display", "none");
                $('#<%=price.ClientID %>').css("border-style", "").css("border-color", "");
            }

            var re = /^[0-9]+.?[0-9]*$/;   //判断字符串是否为数字     //判断正整数 /^[1-9]+[0-9]*]*$/
            if (!re.test(price)) {
                $('#priceSpan').html("请添加提现金额为大于或者等于0.01的数字");
                $('#priceSpan').css("display", "inline");
                $('#<%=price.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                return false;
            } else {
                $('#priceSpan').css("display", "none");
                $('#<%=price.ClientID %>').css("border-style", "").css("border-color", "");
            }
            //判断提现金额的最小、最大值
            var cash_price_min_var = "<%=cash_price_min %>";
            var cash_price_max_var = "<%=cash_price_max %>";
            var cash_price_min_parse = parseFloat(cash_price_min_var).toFixed(2);
            var cash_price_max_parse = parseFloat(cash_price_max_var).toFixed(2);
            //判断提现金额的最小值
            if (cash_price_min_parse > parseFloat(price).toFixed(2)) {
                $('#priceSpan').html("提现的金额不能小于最小提现金额" + cash_price_min_parse+"!");
                $('#priceSpan').css("display", "inline");
                $('#<%=price.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                return false;
            } else {
                $('#priceSpan').css("display", "none");
                $('#<%=price.ClientID %>').css("border-style", "").css("border-color", "");
            }
            //判断提现金额的最大值
            if (cash_price_max_parse < parseFloat(price).toFixed(2)) {
                $('#priceSpan').html("提现的金额不能大于最大提现金额" + cash_price_max_parse + "!");
                $('#priceSpan').css("display", "inline");
                $('#<%=price.ClientID %>').css("border-style", "dashed").css("border-color", "Red");
                return false;
            } else {
                $('#priceSpan').css("display", "none");
                $('#<%=price.ClientID %>').css("border-style", "").css("border-color", "");
            }
            return true;
        }

        function showofflinetr() {
            var payment_sel = document.getElementById('<%=payment_sel.ClientID %>').value;
            if (payment_sel == '0' || payment_sel == '线上支付') {
                $(".offlinetr").hide();
            } else {
                $(".offlinetr").show();
            }
        }
        function CheckMoney() {
            var Money = $("#<%=TxtMoney.ClientID %>").val().trim();
            if (Money == "") {
                $("#lblError").text("支付金额不能为空");
                return false;
            } else
                return true;
        }
  
    </script>
</asp:Content>
