<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>YUNYECMS <?php echo YUNYECMS_VERSION; ?></title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Font Awesome -->
    <link href="<?php echo YUNYECMS_PUBLIC; ?>plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" />
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<?php echo YUNYECMS_UI; ?>plugins/fontawesome-free/css/all.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?php echo YUNYECMS_UI; ?>dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<?php echo YUNYECMS_UI; ?>dist/css/member.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="<?php echo YUNYECMS_UI; ?>plugins/iCheck/square/blue.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<style>
    .tc-msg {
        font-size: 12px;
        line-height: 22px;
        margin: 0 auto 15px;
        vertical-align: middle;
        border-radius: 2px;
        position: relative;
        color: #e1504a;
        background: #fee;
        width: 100%;
        text-align: left;
        -webkit-transition: max-height .5s ease-in-out;
        transition: max-height .5s ease-in-out;
        max-height: 140px;
        margin-top: 40px;
    }

    .tc-msg .msg-icon {
        display: inline-block;
        width: 16px;
        height: 16px;
        background: url(/skin/reg/images/icon-warn-s.png) no-repeat;
        position: absolute;
        top: 8px;
        left: 10px;
    }

    .tip-info {
        padding: 5px 10px 5px 35px;
    }
</style>

<body class="hold-transition register-page" style="background: #ffffff;">
    <div class="register-box" style="background: #ffffff; padding-top: 30px; padding-bottom: 0px;">
        <div class="register-box-body">
            <div class="tc-msg" style="display: none;">
                <span class="msg-icon"></span>
                <div class="tip-info">
                    &nbsp;
                </div>
            </div>
            <form name=userinfoform class="form-horizontal" method="post" action="">
                <div class="form-group row">
                    <div class="input-group  input-group-lg btn-flat">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><i class="icon-user"></i></span>
                        </div>
                        <input type="text" name="reg_phone" class="form-control btn-flat" id="reg_phone" onfocus="ThisOnfocus('reg_phone')" maxlength="11" onblur="ThisOnblur('reg_phone')" onkeyup="ThisOnkeyup('reg_phone')" vdata="0" placeholder="手机号码">
                    </div>
                    <div class="col-sm-12">
                        <span class="text-red" id="reg_phone_mes"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="input-group  input-group-lg">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><i class="fa fa-lock"></i></span>
                        </div>
                        <input name="reg_password" class="form-control" type="password" id="reg_password" onfocus="ThisOnfocus('reg_password')" maxlength="20" onblur="ThisOnblur('reg_password')" onkeyup="ThisOnkeyup('reg_password')" vdata="0" maxlength="20" placeholder="登录密码">
                    </div>
                    <div class="col-sm-12">
                        <span class="text-red" id="reg_password_mes"></span>
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col-md-12">
                        <div class="row">
                            <input type="hidden" name="safecode" id="safecode" value="<?php echo $token; ?>">
                            <button type="button" class="btn btn-primary btn-block btn-flat  btn-lg  " style="font-size: 18px; width: 100%;" id="btnRegister" onclick="return DoLogin()">
                                登录YUNYECMS帐户 </button>
                        </div>
                    </div>
                    <div class="col-sm-2">
                    </div>
                </div>
                <script type="text/javascript">
                    $(function() {
                        $(".agreement label").toggle(function() {
                            $("#tongyispan").show();
                            $(this).removeClass("checked1");
                            $("#tongyispan_mes").attr("vdata", "0");
                        }, function() {
                            $("#tongyispan_mes").attr("vdata", "1");
                            $(this).addClass("checked1");
                            $("#tongyispan").hide();
                            $(".agreement label").show();
                        });
                    });
                </script>
            </form>
            <br />
            <a href="http://www.yunyecms.com/register.html" class="text-center" target="_blank">还没有帐号？去注册</a>
        </div>
        <!-- /.form-box -->
    </div>
    <!-- /.register-box -->

    <!-- jQuery 2.2.3 -->
    <script src="<?php echo YUNYECMS_UI; ?>/plugins/jQuery/jquery-3.6.1.min.js"></script>
    <!-- Bootstrap 3.3.6 -->
    <script src="<?php echo YUNYECMS_UI; ?>bootstrap/js/bootstrap.min.js"></script>
    <!-- iCheck -->
    <script src="<?php echo YUNYECMS_UI; ?>dist/js/yunyecms_login.js"></script>
    <script language="javascript">
        function DoLogin() {
            if ($("#reg_phone").attr("vdata") != "1") {
                $("#reg_phone").attr("vdata", "2");
                $("#reg_phone").focus();
                return false;
            } else if ($("#reg_password").attr("vdata") != "1") {
                $("#reg_password").attr("vdata", "2");
                $("#reg_password").focus();
                return false;
            } else {
                $("#btnRegister").html("登录中...").attr("disabled", "disabled");
                //开始登录
                $.ajax({
                    data: {
                        mobile: $("#reg_phone").val(),
                        pwd: $("#reg_password").val(),
                        <?php echo $this->PostHash['ehashvar'] . ":'" . $this->PostHash['ehash'] . "'"; ?>,
                        <?php echo $this->PostHash['rhashvar'] . ":'" . $this->PostHash['rhash'] . "'"; ?>,
                        token: $("#safecode").val()
                    },
                    type: "post",
                    dataType: "json",
                    url: "<?php echo url_admin('yunyecms_logincheck', 'addons'); ?>",
                    success: function(data) {
                        if (data.code == "100") {
                            window.location.href = "<?php echo url_admin('init', 'addons'); ?>";
                            return false;
                        } else {
                            $("#btnRegister").html("登录YUNYECMS帐户").removeAttr("disabled").css({
                                "cursor": "pointer",
                                "background": "#3598dc"
                            });
                            $(".tip-info").html("登录失败：" + data.msg);
                            $(".tc-msg").show();
                            return false;
                        }
                    }
                })
            }
        }
    </script>

</body>

</html>