🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
左边文件 \Application\Admin\View\Public\left.html ~~~ <!-- menu_list --> <script> $(function() { $(".menu_list dd"); $(".menu_list dt").click(function() { $(this).toggleClass("open").next().slideToggle("fast"); }); }); </script> <div class="menu_list"> <dl> <foreach name="data" item="vo" key="v"> <dt <if condition="$au eq $vo['id']">class="open"</if>> <span>{$vo.title}</span> </dt> <dd <if condition="$au eq $vo['id']">style="display: block;"</if>> <foreach name="vo['sub']" item="sub" key="k"> <a href="{:U($sub['name'])}" title="{$sub['title']}" <if condition="$su eq $sub['id']">style='background-color: #0a67a3;'</if> >{$sub['title']}</a> </foreach> </dd> </foreach> </dl> </div> <!-- /menu_list --> ~~~ 公共文件 \Application\Admin\View\Public\header.html ~~~ <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title> 后台管理系统 </title> <meta name="keywords" content="" /> <meta name="description" content="后台管理系统" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> <link href="__PUBLIC__/Admin/css/haiersoft.css" rel="stylesheet" type="text/css" media="screen,print" /> <link href="__PUBLIC__/Admin/css/print.css" rel="stylesheet" type="text/css" media="print" /> <script src="__PUBLIC__/Admin/js/jquery-1.10.1.min.js"></script> <script src="__PUBLIC__/Admin/js/side.js" type="text/javascript"></script> <script src="__PUBLIC__/Admin/js/index.js"></script> <script src="__PUBLIC__/Common/Layer/layer.js"></script> <script src="__PUBLIC__/layui/layui.js"></script> </head> <body> <!-- wrap_left --> <div class="wrap_left" id="frmTitle" name="fmTitle"> <!-- Logo --> <!-- <div id="Logo"> <a href="{:U('Index/index')}"> <img src="__PUBLIC__/Admin/images/common/logo.png" /> </a> </div> --> <!-- /Logo --> <include file="Public:left" /> </div> <!-- /wrap_left --> <!-- picBox --> <div class="picBox" onclick="switchSysBar()" id="switchPoint"> </div> <!-- /picBox --> <!-- wrap_right --> <div class="wrap_right"> ~~~ \Application\Admin\View\Public\top.html ~~~ <header> <!-- Header --> <div id="Header"> <!-- Head --> <div id="Head"> <h1> 后台管理系统 </h1> <script language="javascript"> function showmenu(id) { id.style.visibility = "visible"; } </script> <div class="user"> <a href="javascript:showmenu(UserList)"> {$Think.session.account} </a> <div id="UserList"> <a href="{:U('Index/edit_pwd')}"> 修改密码 </a> <a href="javascript:;" class="logout" link="{:U('Index/logout')}"> 退出 </a> </div> </div> </div> </div> </header> ~~~ 底部文件 \Application\Admin\View\Public\footer.html ~~~ </div> <script type="text/javascript"> $(function(){ $('.del').click(function(){ var url = $(this).attr('link'); layer.confirm('你确定要此操作吗?', { icon: 5, btn: ['确定','取消'] //按钮 }, function(){ $.get(url,function(data){ if (data.code == 1) { layer.alert(data.msg, {icon: 6},function (index) { layer.close(index); window.location.reload(); }); }else{ layer.alert(data.msg); } }); }); }); $('.logout').click(function(){ var url = $(this).attr('link'); layer.confirm('你确定要此操作吗?', { icon: 5, btn: ['确定','取消'] //按钮 }, function(){ $.get(url,function(data){ if (data.code == 1) { layer.alert(data.msg, {icon: 6},function (index) { layer.close(index); window.location.reload(); }); }else{ layer.alert(data.msg); } }); }); }); }); </script> </body> </html> ~~~