<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MobileValidate.aspx.cs"
    Inherits="YCHR.Web.person.MobileValidate" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>帐号安全认证＿个人求职中心_易辰人才招聘系统</title>
    <link rel="stylesheet" type="text/css" href="<%=config.templatetheme%>/css/member.css" />
    <script language="JavaScript" src="<%=config.templatetheme%>/js/jquery.js"></script>
    <script type="text/javascript" src="<%=config.templatetheme%>/js/jquery.validate.min.js"></script>
    <script type="text/javascript" src="<%=config.templatetheme%>/js/jquery.form.js"></script>
    <script type="text/javascript" src="<%=config.templatetheme%>/js/core.com.js"></script>
    <script type="text/javascript">        $(document).ready(function () {
            $("#form1").validate({
                success: function (label) {
                    label.text(" ").addClass("success")
                },
                rules: {

                    txtmobile: { required: true, isMobile: true }

                },
                messages: {

                    txtmobile: { required: "请填写手机号码" }


                },
                errorPlacement: function (error, element) {
                    if (element.is(":radio")) error.appendTo(element.parent().next().next());
                    else if (element.is(":checkbox")) error.appendTo(element.next());
                    else error.appendTo(element.parent())
                }
            })
        });

        // 手机号码验证 
        $.validator.addMethod("isMobile", function (value, element) {
            var length = $.trim(value).length;
            var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
            return this.optional(element) || (length == 11 && mobile.test($.trim(value)));
        }, "请正确填写您的手机号码");
       
    </script>
    <style>
        a.unClick:link, a.unClick:visited
        {
            color: #909393;
            cursor: text;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
                                            <input type="hidden" value="60" id="Hidden1">
    <!--head-->
    <!-- #include file="include/head.html" -->
    <!--nav-->
    <div class="navbox">
        <div class="navtab">
            <ul>
                <li><a href="index.aspx">求职中心</a></li>
                <li class="now"><a href="PersonInfoModify.aspx">个人资料</a></li>
                <li><a href="/news" target="_blank">职场资讯</a></li>
                <li><a href="/jinji" target="_blank">急招职位</a></li>
                <li class="search"><a href="/search/jobsearch.aspx">职位搜索</a></li>
                <li class="add"><a href="resumeList.aspx">发布简历</a></li>
            </ul>
        </div>
    </div>
    <div class="clear">
    </div>
    <!--content-->
    <div class="box">
        <!--menu-->
        <div class="mb_menu">
            <dl>
                <dt style="margin-top: 8px" class="m3"><a href="javascript:void(0);">账户管理</a></dt>
                <dd class="w98">
                    <a href="PersonInfoModify.aspx">我的资料修改</a></dd>
                <dd>
                    <a href="PasswordModify.aspx">登陆密码修改</a></dd>
                <dd>
                    <a href="photo.aspx">更新我的形象</a></dd>
                <dd>
                    <a href="Safety.aspx" class="now">帐号安全认证</a></dd>
            </dl>
        </div>
        <!--right-->
        <div class="navmbs">
            您的位置： <a href="/">首页</a> > <a href="Index.aspx">求职中心</a> > 帐户管理 > 帐号安全认证</div>
        <div class="mb_infoTip" id="infotip">
            <em><a href="javascript:;" onclick="document.getElementById ('infotip').className='none'">
                关闭</a></em>
            <p>
                为了您个人的帐号安全，请申请帐号安全认证.</p>
        </div>
        <div class="mbbox_r">
           <div id="sendvalid">
            <h3>
                手机认证</h3>
            <div class="pad20">
              
                    <table width="100%" cellspacing="1" cellpadding="4" border="0" class="padding3">
                        <tbody>
                            <tr>
                                <td class="ft_13" width="15%" align="right">
                                    <font color="#ff3300">*</font>手机号：
                                </td>
                                <td width="85%">
                                    <input name="txtmobile" value="" type="text" id="txtmobile" class="input250" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td class="ft_13" width="15%" align="right">
                                    <font color="#ff3300">*</font>验证码：
                                </td>
                                <td width="85%">
                                    <input name="txtcode" type="text" id="txtcode" class="input250" style="width: 80px"
                                        runat="server" />
                                    <span id="diviinfo1" style=""><a href="javascript:;" id="btngetcode" class="a_btn_hui">
                                        免费获取验证码</a> </span><span id="diviinfo2" style="display: none;" class="verTxt">
                                            <input type="hidden" value="60" id="hidSeconds">
                                            验证码已发送至手机，若未收到验证码，建议您(<i id="secnum">60</i>s)秒后重新发送 </span>
                                </td>
                            </tr>
                            <tr>
                                <td width="15%">
                                    &nbsp;
                                </td>
                                <td width="85%">
                                 <a href="javascript:void(0)" class="btn8" id="btnmobilevalid">立即认证</a>
                                 
                                </td>
                            </tr>
                        </tbody>
                    </table>
                   
            </div>
            </div>
            <br />
            <div id="success" style="display:none;" >
            <h3>
                手机号码认证成功</h3>
                <div class="pad20">
              
                    <table width="100%" cellspacing="1" cellpadding="4" border="0" class="padding3">
                        <tbody>
                            <tr>
                                <td class="ft_13" align="left">
                                您的手机号已修改为
<font color="#FF3300"><i id="photonum"></i></font></td>
                              
                            </tr>
                             <tr>
                                <td class="ft_13" align="left">
                                                      您的手机号
<font color="#FF3300"><i id="photonum2"></i></font>
已成功通过本站手机认证！ </td>
                              
                            </tr>
 
                        </tbody>
                    </table>
                   
            </div>
            </div>
        </div>
        <div class="clear">
        </div>
        <!--content-->
        <div class="clear">
        </div>
    </div>
    <script type="text/javascript">
        var interval;
        // 获取验证码
        function djs() {
            var seconds = $('#diviinfo2').find('i').html();
            seconds = parseInt(seconds);
            if (seconds > 0) {
                seconds--;
                $('#diviinfo2').find('i').html(seconds);
            }
            else {
                window.clearInterval(interval);
                $('#diviinfo1').show();
                $('#diviinfo2').hide();
                $('#secnum').html(60);
            }
        }
        $("#btngetcode").click(function () {
          
            var mobilePhone = $("#txtmobile").val();  
            var url = "/person/MobileValidate.aspx?action=sendvalidcode&phone=" + mobilePhone;  
            App.get(url, function (res) { 
                if (res.error == 1 || res.type != 100)
                    MessageBox.show(res.message, 2, 5000);
                else
                {
                    $('#txtcode').focus();
                    $('#diviinfo1').hide();
                    $('#diviinfo2').show();
                    interval = window.setInterval(djs, 1000);
                }
            });
        });
        $("#btnmobilevalid").click(function () {

            var mobilePhone = $("#txtmobile").val();
            var code = $("#txtcode").val();
            var url = "/person/MobileValidate.aspx?action=mobilevalid&phone=" + mobilePhone + "&code=" + code;
            App.get(url, function (res) {
                if (res.error == 1)
                    MessageBox.show(res.message, 2, 5000);
                else {
                    $('#success').show();
                    $('#sendvalid').hide();
                    $('#photonum').html(mobilePhone);
                    $('#photonum2').html(mobilePhone); 
                }
            });
        });
      
    </script>
    <!-- #include file="include/foot.html" -->
    </form>
</body>
</html>
