<?php
/**
 * Author：晴天 QQ：1186258278
 * Creation：2020/3/29 12:36
 */
include "../includes/fun.global.php";

use sms\sms_operation;
if (!empty($_COOKIE['THEKEY'])) header("Location:index.php");
if ($_QET['act'] == 'login') {
    echo login_data::login('/user/login.php?act=login_reception');
}
if ($_QET['act'] == 'login_reception') {
    login_data::login_reception($_QET);
}
if ($_QET['act'] == 'Send_verification_code_login') {
    sms_operation::user_login((int)$_QET['mobile'], $conf['usersmslogin']);
}
if ($_QET['act'] == 'Send_verification_login') {
    sms_operation::user_login_verify((int)$_QET['code']);
}
$image = background::image();
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登入 - 店长后台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" type="text/css"
          href="<?= $cdnserver == null ? '../' : $cdnserver ?>assets/layui/css/layui.css"/>
    <link rel="stylesheet" href="/assets/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/assets/layuiadmin/style/login.css" media="all">
    <link rel="stylesheet" href="/assets/admin/css/login.css" media="all">
</head>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<body style="<?= ($image == false ? 'background-image: linear-gradient(130deg, #fc5c7d, #6a82fb);' : $image) ?>">
<style>
    @media screen and (max-width: 788px) {
        .nbi {
            width: 94% !important;
        }
    }
</style>
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main nbi" style="background-color: white;border-radius: 0.3em;opacity: 0.9;">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2 class="FontColor"><?= $conf['sitename'] ?></h2>
            <p>店长登陆，<?= $conf['sitename'] ?>用户管理后台</p>
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div id="form" style="display: block">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-cellphone"></label>
                    <input type="text" name="phone" lay-verify="required|phone" placeholder="请输入已绑定的手机号"
                           class="layui-input">
                </div>
                <div class="layui-form-item">
                    <div class="layui-row">
                        <div class="layui-col-xs8">
                            <label class="layadmin-user-login-icon layui-icon layui-icon-vercode"></label>
                            <input type="text" name="vercode" lay-verify="required" placeholder="请输入短信验证码"
                                   class="layui-input">
                        </div>
                        <div class="layui-col-xs4">
                            <a class="layui-btn layui-btn-fluid LgoinBtn" id="PhoneCode"
                               href="javascript:AdminLogin.do_admin_get_mobile_code()">
                                获取验证码
                            </a>
                        </div>
                    </div>
                </div>

                <button class="layui-btn layui-btn-fluid" lay-submit
                        style="background-color: #ff7235" onclick="AdminLogin.do_admin_login_phone_verify()">登 入
                </button>
            </div>

            <div class="layui-trans layui-form-item layadmin-user-login-other">
                <label>其他登陆方式</label>
                <i class="layui-icon layui-icon-login-qq LoginIcon" onclick="AdminLogin.do_login_wx()"
                   title="登陆站长后台"></i>
            </div>
        </div>
    </div>

    <div class="layui-trans layadmin-user-login-footer">
        <p style="color: white">© 2020 - 2025 <a href="/" style="color: white"
                                                 target="_blank"><?= $conf['sitename'] ?></a></p>
    </div>
</div>

<script src="<?= $cdnserver == null ? '../' : $cdnserver ?>assets/layui/layui.all.js"></script>
<script src="<?= $cdnpublic ?>/jquery/3.4.1/jquery.min.js"></script>
<script src="/assets/admin/js/login_user.js"></script>
</body>
</html>
