<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>webchat-控制台</title>

    <link rel="shortcut icon" href="/favicon.ico" />
    <link rel="bookmark" href="/favicon.ico" />
    <link href="/css/common/common.css" rel="stylesheet" type="text/css" />
    <link href="/css/admin/console.css" rel="stylesheet" type="text/css"/>
    <link href="/css/lottery/cms.css" rel="stylesheet" type="text/css"/>
    <link href="/ref/layui-v2.6.8/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <script src="/ref/layui-v2.6.8/layui/layui.js" type="text/javascript"></script>
    <script src="/ref/jquery/jquery-3.4.1.js" type="text/javascript"></script>
    <script src="/js/client/auth.js" type="text/javascript"></script>

    <script>
        var currentActivityId = '';

        function loadFrame(path) {
            $("#console-body").load(path);
        }
    </script>

</head>

<body style="background-color: whitesmoke">
<center>
    <!-- 控制台头部 -->
    <div id="console-header" style="box-shadow: none; background-color: whitesmoke; z-index: 999">
        <a href="/admin/console" class="console-logo"><img src="/image/icon/console-logo.png" style="height: 45px"></a>
        <img src="" id="login-user-avatar" style="position: absolute; right: 80px; top: 10px; height: 40px; width:
        40px; border-radius: 80px">
    </div>
    <!-- 控制台导航 -->
    <div id="console-left" style="background-color: whitesmoke">
        <ul class="layui-nav layui-nav-tree layui-inline" style="margin-top: 20px; width: 240px;border: 0px;
        text-align: left" lay-filter="demo" id="menu-ul">
            <li class="layui-nav-item">
                <a onclick="loadFrame('/admin/user-manage')" target="_body">用户管理</a>
            </li>
            <li class="layui-nav-item">
                <a onclick="loadFrame('/admin/user-wallet-manage')"  target="_body">钱包管理</a>
            </li>
            <li class="layui-nav-item">
                <a onclick="loadFrame('/admin/public-account-article')"  target="_body">公众号文章管理</a>
            </li>
            <li class="layui-nav-item">
                <a onclick="loadFrame('/admin/slide-manage')" target="_body">滑块验证</a>
            </li>
            <li class="layui-nav-item">
                <a onclick="loadFrame('/admin/mess-manage')" target="_body">消息审核</a>
            </li>
            <li class="console-menu-li-l1">
                <p class="menu1 menu" id="menu-activity"><i class="layui-icon">&#xe66f;</i>      抽奖活动 <i class="layui-icon menu-more-icon">&#xe61a;</i></p>
                <ul class="console-menu-ul-l2" style="padding-left: 40px; line-height:30px; margin-top: 15px;">
                    <a onclick="loadFrame('/admin/lottery-activity')"><li class="console-menu-li-l2" id="cms-activity">活动管理</li></a>
                    <a onclick="loadFrame('/admin/lottery-order')"><li class="console-menu-li-l2" id="cms-order">抽奖订单</li></a>
                </ul>
            </li>
        </ul>
    </div>
    <!-- 控制台主体 -->
    <div id="console-body" style="background-color: white; padding: 20px; border-radius: 10px 10px 0px 0px; overflow: hidden"></div>
</center>
</body>

<script>

    loadFrame("/admin/default");

    var userId;
    $.ajax({
        url:"/api/user/getCurrentAdminUserInfo",
        type:"get",
        success:function (data) {
            data = eval(data);
            if (data.success){
                data = data.data;
                userId = data.userId;
                $("#login-user-avatar").attr('src', data.photo);
            } else {
                layer.msg("未登录或者权限不足");
                location.href="/";
            }
        },error:function () {
            layer.msg("未登录或者权限不足");
            location.href="/";
        }
    })

    layui.use(['dropdown'], function() {
        var dropdown = layui.dropdown;
        //用户
        dropdown.render({
            elem: '#login-user-avatar'
            , data: [{
                title: '退出登录'
                , id: 1
            }]
            , click: function (obj) {
                if (obj.id == 1) {
                    loginOut();
                }
            }
        });
    })
</script>

<style>
    .layui-nav {
        background-color: whitesmoke;
        color: black;
    }
    .layui-nav-item {
        background-color: whitesmoke;
        color: black;
    }
    .layui-nav .layui-nav-item a {
        color: black;
        font-size: 15px;
    }
    .layui-nav .layui-nav-item a:hover {
        color: #1f40f6;
        font-size: 15px;
        font-weight: 500;
    }
    .layui-nav-item .layui-this {
        background-color: transparent;
        color: #1f40f6;
        font-weight: 500;
    }
    .layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover {
        background-color: transparent;
        color: #1f40f6;
        font-weight: 500;
    }
</style>
</html>