login.html 5.5 KB
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css/swiper-3.4.2.min.css" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css/index.css" />
    <link rel="stylesheet" href="__TMPL__/public/assets/css/mask.css">
    <title>登录</title>
</head>

<body class="index_tenth_bgimg">
    <include file="public@header"/>
    <!--彈出框-->
    <div class="mask">

    </div>
    <div class="index_tenth">
        <div class="index_theth_contant">
            <div class="index_tenth_bg">
                <div class="index_tenth_one">
                    <div class="index_tenth_left login">其他登录方式</div>
                    <div class="index_tenth_left index_tenth_right phone_login">
                        手机号登录
                    </div>
                </div>
                <div class="index_tenth_first">
                    <div class="index_tenth_two">
                        <input type="tel" placeholder="请输入手机号" id="mobile">
                        <input type="password" placeholder="请输入密码" id="password">
                    </div>
                    <div class="index_tenth_three" id="register">
                        没有账号?<span>
                            立即注册
                        </span>
                    </div>
                    <div class="index_tenth_four logging">
                        登录
                    </div>
                </div>
                <div class="index_tenth_seconds">
                    <div class="index_tenth_second">
                        <div class="index_tenth_second_one">
                            <a href="https://open.weixin.qq.com/connect/qrconnect?appid=wx9cfa880272f186bf&redirect_uri=http://www.starplanet.cn/portal/login/wx_login&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect">
                                <div class="index_tenth_second_img">
                                    <img src="__TMPL__/public/assets/images/cicon_71@2x.png" alt="" />
                                </div>
                            </a>
                            <div class="index_tenth_second_title">
                                微信登录
                            </div>
                        </div>

                        <form action="https://api.weibo.com/oauth2/authorize" method="POST" id="wb_form">
                            <div class="index_tenth_second_one">
                                <div class="index_tenth_second_img" id="wb_login">
                                    <img src="__TMPL__/public/assets/images/cicon_72@2x.png" alt="" />
                                </div>
                                <div class="index_tenth_second_title">
                                    微博登录
                                </div>
                                <input type="hidden" name="client_id" value="737607150">
                                <input type="hidden" name="redirect_uri" value="http://www.starplanet.cn/portal/login/wb_login">
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
        <div class="index_tenth_bottom">
            <p class="beian">
                Copyright © 2004-2019 独角星球 版权所有
            </p>
            <p class="beian">
                京ICP备17035112号-2
            </p>
        </div>
    </div>
</body>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
<script src="__TMPL__/public/assets/js/swiper.min.js"></script>
<script src="__TMPL__/public/assets/js/public.js"></script>
<script>
    $(".login").click(function() {
        $(this).addClass("index_tenth_right");
        $(".phone_login").removeClass("index_tenth_right");
        $(".index_tenth_seconds").css({
            display: "block"
        });
        $(".index_tenth_first").css({
            display: "none"
        });
    });
    $(".phone_login").click(function() {
        $(this).addClass("index_tenth_right");
        $(".login").removeClass("index_tenth_right");
        $(".index_tenth_seconds").css({
            display: "none"
        });
        $(".index_tenth_first").css({
            display: "block"
        });
    });
</script>

<script>
    $('.logging').click(function(){
        var phone_number = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
        var mobile = $("#mobile").val();
        var password = $.trim($('#password').val());
        if (!phone_number.test(mobile)){
            mask("手机号格式有误");
            return false;
        }
        if(password == '') {
            mask("密码不能为空");
            return false;
        }
        $.ajax({
            type: 'POST',
            url: "/portal/login/loginCommit",
            data: {
                'mobile': mobile,
                'user_pass': password
            },
            dataType: 'json',
            success: function (data) {
                if (data.code == 1) {
                    mask(data.msg);
                    window.location.href = '/';
                } else {
                    mask(data.msg);
                }
            }
        });
    });
</script>

</html>