<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <jsp:include page="../../common.jsp"></jsp:include>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <link href="${resourcePath}/css/jquery.mCustomScrollbar.css" rel="stylesheet">
    <meta name="keywords" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="renderer" content="webkit">
    <title>陕西超掌柜科技有限公司</title>

    <script type="text/javascript">
        require("js/jquery.min.js");
        require("js/main/main.js");
        require("js/jquery.mCustomScrollbar.concat.min.js");
        require("js/nicescroll.min.js");
    </script>
    <style type="text/css">
        .layui-badge-dot{
            width: 18px;
            height: 18px;
        }

        .layui-nav-child {
            padding: 1px 0;
        }
    </style>

</head>

<body style="overflow: hidden;">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">
            快银系统
        </div>
        <ul class="layui-nav layui-layout-right">
            <li style="float: left">
                <a href="javascript:void(0)"
                   id="notification" style="line-height: 60px" >
                    <i class="layui-icon layui-icon-notice" style="font-size: 30px;color: whitesmoke;"></i>
                </a>
                <div class="testc"></div>
            </li>
            <li class="layui-nav-item" style="float: right">
                <a href="javascript:void(0)"
                   id="manage-dropdown">
                    <img src="${resourcePath}/images/default_use_image.png" alt="管理员相片" id="picture"
                         class="w30 h30 vm dlblock">
                    <span class="user-info vm overFont textl">欢迎您,管理员</span>
                </a>
                <dl class="layui-nav-child">
                    <dd>
                        <a href="javascript:void(0);" id="logout" onclick="logout()">
                            <i class="ibps-icon fa fa-power-off"></i> 退出
                        </a>
                    </dd>
                </dl>
            </li>
        </ul>
    </div>
    <!-- 主体内容 -->
    <div class="main-container pt45" id="main-container">
        <!-- 左侧的树 -->
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll" id="leftMenu">
            </div>
        </div>
        <div class="layui-body">
            <div class="main-content">
                <div class="page-content">
                    <div class="page-content-area">
                        <!--Tab部分开始-->
                        <div class="content-tabs positionr bdbe h32 lgraybg mt2">
                            <button class="J_tabLeft positiona w30 h30 textc zIndex99 top0 left0 bdre whitebg">
                                <i class="fa fa-backward"></i>
                            </button>
                            <nav class="page-tabs J_menuTabs ml30 mr30">
                                <div class="page-tabs-content fl">
                                    <a href="javascript:void(0);"
                                       class="J_menuTab active dblock fl bdrc pt7 pb6 pl15 pr15"><span
                                            class="fa fa-home"></span>首页</a>
                                </div>
                            </nav>
                            <button class="J_tabRight positiona w30 h30 textc zIndex99 top0 right0 bdle whitebg">
                                <i class="fa fa-forward"></i>
                            </button>
                        </div>
                        <!--主体部分开始-->

                        <!-- 内容主体区域 -->
                        <div class="J_mainContent res-menu">
                            <iframe class="J_iframe" src="first" frameborder="0" scrolling="no" οnlοad="changeFrameHeight()"></iframe>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">

    $(document).ready(function(){
        $.ajax({
            url: ctx + "/notification/countStatus",
            method: 'get',
            dataType: 'JSON',
            contentType: "application/json",
            success: function (count) {
                if (count > 0){
                    $(".testc").html("<b><scan class=\"layui-badge-dot\" style=\"margin: -19px 18px 0;\"></scan></b>");
                }
            }
        })
    });

    function adjustWidthHeight() {
        var height = $(window).height();
        $(".page-content-area").height(height - 45);
    }

    $(window).resize(function () {
        adjustWidthHeight();
    });

    $(function () {
        adjustWidthHeight();
        //滚动条
        $(".res-menu").niceScroll({
            cursorcolor: "#ccc",
            cursoropacitymax: 1,
            touchbehavior: false,
            cursorwidth: "4px",
            cursorborder: "0",
            cursorborderradius: "4px"
        });

        //退出
        $("#manage-dropdown").click(function () {
            $(this).siblings("ul").toggle();
        })
        //测导航栏收缩
        // $("#sidebar-collapse").click(function() {
        // 	$(this).parents("#sidebar").toggleClass("menu-min");
        // 	$(this).find(".ibps-icon").toggleClass("fa-angle-double-right");
        // 	$(".main-content").toggleClass("ml105");
        // })
        //顶部导航栏
        $("#nav-menu li").click(
            function () {
                $(this).addClass("selected").siblings("li").removeClass(
                    "selected");
            });

        $(".nav-list>li").hover(function () {
            $(this).find(".submenu").show();
            $(this).addClass("hover-show");

        }, function () {
            $(this).find(".submenu").hide();
            $(this).removeClass("hover-show");
        })
        //面包屑导航栏
        $(".page-tabs-content a").click(
            function () {
                $(this).addClass("active").siblings("a").removeClass(
                    "active");
                var index = $(".page-tabs-content a").index(this);
                $(".J_mainContent iframe").eq(index).show().siblings(
                    "iframe").hide();
            })

    });

    function logout() {
        $.ajax({
            url: ctx + "/platform/logout",
            type: 'POST',
            dataType: 'json',
            async: false,
            success: function (data) {
                parent.location.href = data.url
            },
            error: function (jqXHR, textStatus, errorThrown) {
                console.log(jqXHR.status)
                window.location = $('#logout').val();
            }
        })
    }
</script>

</html>