login.html 3.0 KB
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>登录</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="box">
    <h1 class="login_title">欢迎登录</h1>
    <div class="login_list">
        <b>手机号</b>
        <input type="tel" class="login_phone">
    </div>
    <div class="login_list">
        <b>验证码</b>
        <input type="number" class="login_code">
        <u class="get_code">获取验证码</u>
    </div>
    <div class="login_tab">
        <b></b>
        <i>抱歉,此手机号没有权限登录</i>
    </div>
    <div class="btn_login">
        <img src="image/btn_login.png" />
    </div>
</div>


<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script>
    $(function  () {
        //获取短信验证码
        var validCode=true;
        $(".get_code").click (function  () {
            var time=60;
            var code=$(this);
            if (validCode) {
                validCode=false;
                code.addClass("msgs1");
                var t=setInterval(function  () {
                    time--;
                    code.html(time+"秒");
                    if (time==0) {
                        clearInterval(t);
                        code.html("重新获取");
                        validCode=true;
                        code.removeClass("msgs1");
                    }
                },1000)
            }
        });
        var Mobile_Boolean = false;
        var code_Boolean = false;
        $('.login_phone').blur(function(){
            /*if ((/^1[34578]\d{9}$/).test($(".tel").val())){*/
            if ($(".tel").val("13800000000")){
                Mobile_Boolean = true;
            }else {
                Mobile_Boolean = false;
            }
        });
        // code
        $('.login_code').blur(function(){
            if ($(".reg_password").val("123456")){
                code_Boolean = true;
            }else {
                code_Boolean = false;
            }
        });
        // 验证码登录
        $('.btn_login').click(function(){
            if(  code_Boolean && Mobile_Boolean == true){
                $('.login_tab').hide();
                window.location.href="online_baoming.html";
            }else if(code_Boolean == true){
                $('.login_tab').hide();
                alert("验证码错误");
            }else {
                $('.login_tab').show();
            }
        });
    })
</script>
</body>
</html>