abstract:admin.html<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <link rel="stylesheet" type="text/
admin.html
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css"> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script> <style type="text/css"> .header span{background: #009688;color: #fff;padding: 10px;margin-left: 30px;line-height:32px;} .header button{float: right;} .header{border-bottom: 2px #009688 solid;} </style> </head> <body style="padding: 10px;"> <div class="header"> <span>管理员列表</span> <button class="layui-btn layui-btn-sm" onclick="add()" >添加</button> </div> <table class="layui-table" > <thead> <tr> <th>ID</th> <th>用户名</th> <th >性别</th> <th>城市</th> <th>签名</th> <th>积分</th> <th>操作</th> </tr> </thead> <tbody> <tr> <td>贤心</td> <td>汉族</td> <td>1989-10-14</td> <td>人生似修行</td> <td>汉族</td> <td>1989-10-14</td> <td> <button class="layui-btn layui-btn-xs" onclick="add()" >编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </td> </tr> <tr> <td>张爱玲</td> <td>汉族</td> <td>1920-09-30</td> <td>于千万人之中</td> <td>汉族</td> <td>1989-10-14</td> <td> <button class="layui-btn layui-btn-xs"onclick="add()">编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </td> </tr> <tr> <td>Helen Keller</td> <td>拉丁美裔</td> <td>1880-06-27</td> <td> Life </td> <td>汉族</td> <td>1989-10-14</td> <td> <button class="layui-btn layui-btn-xs" >编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </td> </tr> <tr> <td>岳飞</td> <td>汉族</td> <td>1103</td> <td>教科书</td> <td>汉族</td> <td>1989-10-14</td> <td> <button class="layui-btn layui-btn-xs" >编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs"onclick="del()" >删除</button> </td> </tr> <tr> <td>孟子</td> <td>华夏族(汉族)</td> <td>公元前-372年</td> <td>猿强</td> <td>汉族</td> <td>1989-10-14</td> <td> <button class="layui-btn layui-btn-xs" >编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </td> </tr> </tbody> </table> <script type="text/javascript"> layui.use(['layer'],function(){ layer = layui.layer; $ = layui.jquery; }); // 删除 function del(){ layer.confirm('确定要删除么?', { icon:2, btn: ['确定', '取消'] //可以无限个按钮 }, function(index, layero){ //按钮【按钮一】的回调 }, function(index){ //按钮【按钮二】的回调 }); } // 添加/编辑 function add(){ layer.open({ type: 2, title:'添加管理员', area:['480px','420px'], content: 'Admin/add.html' //这里content是一个普通的String }); } </script> </body> </html>
cates.html
<!DOCTYPE html> <html> <head> <title>手机分类</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css"> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script> <style type="text/css"> .header span{background: #009688;margin-left: 30px;padding: 10px;color:#ffffff;} .header div{border-bottom: solid 2px #009688;margin-top: 8px;} </style> </head> <body style="padding: 10px;"> <div class="header"> <span>分类管理</span> <div></div> </div> <form class="layui-form"> <input type="hidden" name="flag" value="channel"> <table class="layui-table"> <thead> <tr> <th>ID</th> <th>排序</th> <th>标签名称</th> <th>是否禁用</th> </tr> </thead> <tbody> <tr> <td>1</td> <td><input type="text" class="layui-input" name="ords[1]" value="0"></td> <td><input type="text" class="layui-input" name="titles[1]" value="iphone"></td> <td><input type="checkbox" lay-skin="primary" name="status[1]" title="禁用" value=1></td> </tr> <tr> <td>2</td> <td><input type="text" class="layui-input" name="ords[2]" value="0"></td> <td><input type="text" class="layui-input" name="titles[2]" value="荣耀"></td> <td><input type="checkbox" lay-skin="primary" name="status[2]" title="禁用" value=1></td> </tr> <tr> <td>3</td> <td><input type="text" class="layui-input" name="ords[3]" value="0"></td> <td><input type="text" class="layui-input" name="titles[3]" value="小米"></td> <td><input type="checkbox" lay-skin="primary" name="status[3]" title="禁用" value=1></td> </tr> <tr> <td>4</td> <td><input type="text" class="layui-input" name="ords[4]" value="0"></td> <td><input type="text" class="layui-input" name="titles[4]" value="华为"></td> <td><input type="checkbox" lay-skin="primary" name="status[4]" title="禁用" value=1></td> </tr> <tr> <td>5</td> <td><input type="text" class="layui-input" name="ords[5]" value="0"></td> <td><input type="text" class="layui-input" name="titles[5]" value="vivo"></td> <td><input type="checkbox" lay-skin="primary" name="status[5]" title="禁用" value=1></td> </tr> <tr> <td>6</td> <td><input type="text" class="layui-input" name="ords[6]" value="0"></td> <td><input type="text" class="layui-input" name="titles[6]" value="OPPO"></td> <td><input type="checkbox" lay-skin="primary" name="status[6]" title="禁用" value=1></td> </tr> <tr> <td>21</td> <td><input type="text" class="layui-input" name="ords[21]" value="0"></td> <td><input type="text" class="layui-input" name="titles[21]" value="三星"></td> <td><input type="checkbox" lay-skin="primary" name="status[21]" title="禁用" value=1></td> </tr> <tr> <td></td> <td><input type="text" class="layui-input" name="ords[0]"></td> <td><input type="text" class="layui-input" name="titles[0]"></td> <td><input type="checkbox" lay-skin="primary" name="status[0]" title="禁用" value=1></td> </tr> </tbody> </table> </form> <button class="layui-btn" onclick="save()">保存</button> <script type="text/javascript"> layui.use(['layer','form'],function(){ $ = layui.jquery; layer = layui.layer; form = layui.form; }); // 保存 function save(){ $.post('/index.php/admins/Cates/save',$('form').serialize(),function(res){ if(res.code>0){ layer.alert(res.msg,{'icon':2}); }else{ layer.msg(res.msg,{'icon':1}); setTimeout(function(){window.location.reload();},1000); } },'json'); } </script> </body> </html>
home.html
<!DOCTYPE html> <html> <head> <title>JD商城后台管理系统</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css"> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script> <style type="text/css"> /*documentElement.clientHeight*/ .header{width:100%;height: 50px;line-height: 50px;background: #2e6da4;color:#ffffff;} .title{margin-left: 20px;font-size: 20px;} .userinfo{float: right;margin-right: 10px;} .userinfo a{color:#ffffff;} .menu{width: 200px;background: #333744;position: absolute;} .main{position: absolute;left: 200px;right: 0px;} .layui-collapse{border: none;} .layui-colla-item{border-top: none;} .layui-colla-title{background: #42485b;color:#ffffff;} .layui-colla-content{border-top: none;padding: 0px;} </style> </head> <body> <!--header--> <div class="header"> <span class="title"><span style="font-size: 20px;">JD商城</span>--后台管理系统</span> <span class="userinfo">admin【系统管理员】<span><a href="javascript:;" onclick="logout()" >退出</a></span></span> </div> <!--菜单--> <div class="menu" id="menu"> <div class="layui-collapse" lay-accordion> <div class="layui-colla-item"> <h2 class="layui-colla-title">管理员管理</h2> <div class="layui-colla-content layui-show"> <ul class="layui-nav layui-nav-tree" lay-filter="test"> <li class="layui-nav-item"><a href="javascript:;"onclick="menuFire(this)" src="admin.html" >管理员列表</a></li> </ul> </div> </div> <div class="layui-colla-item"> <h2 class="layui-colla-title">权限管理</h2> <div class="layui-colla-content"> <ul class="layui-nav layui-nav-tree" lay-filter="test"> <li class="layui-nav-item"><a href="javascript:;"onclick="menuFire(this)" src="menu.html">菜单管理</a></li> <li class="layui-nav-item"><a href="javascript:;" onclick="menuFire(this)"src="Roles.html">角色管理</a></li> </ul> </div> </div> <div class="layui-colla-item"> <h2 class="layui-colla-title">系统设置</h2> <div class="layui-colla-content "> <ul class="layui-nav layui-nav-tree" lay-filter="test"> <li class="layui-nav-item"><a href="javascript:;"onclick="menuFire(this)"src="site.html">网站设置</a></li> </ul> </div> </div> <div class="layui-colla-item"> <h2 class="layui-colla-title">商品分类</h2> <div class="layui-colla-content"> <ul class="layui-nav layui-nav-tree" lay-filter="test"> <li class="layui-nav-item"><a href="javascript:;"onclick="menuFire(this)"src="cates.html">分类列表</a></li> </ul> </div> </div> <div class="layui-colla-item"> <h2 class="layui-colla-title">产品管理</h2> <div class="layui-colla-content"> <ul class="layui-nav layui-nav-tree" lay-filter="test"> <li class="layui-nav-item"><a href="javascript:;"onclick="menuFire(this)"src="product.html">产品列表</a></li> </ul> </div> </div> <div class="layui-colla-item"> <h2 class="layui-colla-title">幻灯片管理</h2> <div class="layui-colla-content"> <ul class="layui-nav layui-nav-tree" lay-filter="test"> <li class="layui-nav-item"><a href="javascript:;"onclick="menuFire(this)"src="slide.html">首页首屏</a></li> </ul> </div> </div> </div> </div> <!--主操作页面--> <div class="main"> <iframe src="welcome.html" onload="resetMainHeight(this)" style="width: 100%;height: 100%;"frameborder="0" scrolling="0" ></iframe> </div> <script> layui.use(['element', 'layer'], function(){ var element = layui.element; layer = layui.layer; $= layui.jquery resetMenuHeight() }); function logout(){ layer.confirm('确定要退出么?', { icon:3, btn: ['确定', '取消'] //可以无限个按钮 }, function(index, layero){ //按钮【按钮一】的回调 }, function(index){ //按钮【按钮二】的回调 }); } // 重新设置菜单容器高度 function resetMenuHeight(){ var height=document.documentElement.clientHeight-50; $('#menu').height(height) } //菜单点击 function menuFire(obj){ //获取url var src=$(obj).attr('src') //改变框架内的页面地址 $('iframe').attr('src',src) } // 设置主操作页面高度 function resetMainHeight(obj){ var height = parent.document.documentElement.clientHeight-53; $(obj).parent('div').height(height) } </script> </body> </html>
login.html
<!DOCTYPE html> <html> <head> <title>登录</title> <!-- 引入核心样式文件 --> <link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css"> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script><!-- 引入基础核心库 --> </head> <body style="background:#1E9FFF"> <div style="width: 500px;margin:270px auto 0px; "> <div style="background: #fff; border-radius: 4px;box-shadow: 5px 5px 20px #4444;padding: 20px;"> <form class="layui-form"> <div class="layui-form-item" style="color: gray" > <h2>后台管理系统</h2> </div> <hr> <div class="layui-form-item"> <label class="layui-form-label">用户名</label> <div class="layui-input-block"> <input type="text" placeholder="请输入用户名" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">密码</label> <div class="layui-input-block"> <input type="text" placeholder="请输入密码" class="layui-input"> </div> </div> <div class="layui-form-item"> <label class="layui-form-label">验证码</label> <div class="layui-input-inline"> <input type="text" class="layui-input"> </div> <img src="../yz.png"> </div> <div class="layui-form-item"> <div class="layui-input-block"> <button class="layui-btn" lay-submit lay-filter="formDemo">登录</button> </div> </div> </form> </div> </div> </body> </html>
menu.html
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css"> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script> <style type="text/css"> .header span{background: #009688;color: #fff;padding: 10px;margin-left: 30px;line-height:32px;} .header{border-bottom: 2px #009688 solid;} </style> </head> <body style="padding: 10px;"> <div class="header"> <span>管理员列表</span> </div> <form class="layui-form"> <table class="layui-table" > <thead> <tr> <th>ID</th> <th>用户名</th> <th >性别</th> <th>城市</th> <th>操作</th> <th>是否隐藏</th> <th>是否禁用</th> <th>操作</th> </tr> </thead> <tbody> <tr> <td>1</td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="checkbox" name="" title="隐藏" lay-skin="primary" ></td> <td><input type="checkbox" name="" title="禁用" lay-skin="primary" ></td> <td> <button class="layui-btn layui-btn-xs" onclick="child(1);return false;">子菜单</button></td> </tr> <tr> <td>2</td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="checkbox" name="" title="隐藏" lay-skin="primary" checked></td> <td><input type="checkbox" name="" title="禁用" lay-skin="primary" checked></td> <td> <button class="layui-btn layui-btn-xs">子菜单</button></td> </tr> <tr> <td>3</td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="checkbox" name="" title="隐藏" lay-skin="primary" checked></td> <td><input type="checkbox" name="" title="禁用" lay-skin="primary" checked></td> <td> <button class="layui-btn layui-btn-xs">子菜单</button></td> </tr> <tr> <td>4</td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="text" name="" class="layui-input"></td> <td><input type="checkbox" name="" title="隐藏" lay-skin="primary" checked></td> <td><input type="checkbox" name="" title="禁用" lay-skin="primary" checked></td> <td> <button class="layui-btn layui-btn-xs">子菜单</button></td> </tr> </tbody> </table> <button class="layui-btn " >保存</button> </form> <script type="text/javascript"> layui.use(['layer','form'],function(){ layer = layui.layer; form = layui.form; $ = layui.jquery; }); //子菜单跳转 function child(pid){ window.location.href="Menu/index.html?pid="+pid } </script> </body> </html>
product.html
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css"> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script> <style type="text/css"> .header span{background: #009688;margin-left: 30px;padding: 10px;color:#ffffff;} .header button{float: right;margin-top: -5px;} .thumb{height: 28px;float: right;border: 1px solid #f0f0f0;padding: 1px;} </style> </head> <body style="padding: 10px;"> <div class="header"> <span>商品列表</span> <button class="layui-btn layui-btn-sm" onclick="add()">添加</button> </div> <div class="layui-form-item"> <div class="layui-input-inline"> <input type="text" name="title" required lay-verify="required" placeholder="请输入商品名称"class="layui-input"> </div> <button class="layui-btn layui-btn-primary"><i class="layui-icon"></i> 搜索</button> </div> <table class="layui-table"> <thead> <tr> <th>ID</th> <th>分类</th> <th>名称</th> <th>最低价格</th> <th>成本</th> <th>PV</th> <th>状态</th> <th>添加时间</th> <th>操作</th> </tr> </thead> <tbody> <tr> <td>14</td> <td>iphone</td> <td>Apple iPhone 8 Plus 64GB 红色特别版 移动联通电信4G手机<img class="thumb" src="../uploads/20180524\13b7cee33f10bcdaeeb273f31e2600f5.jpg" onmouseover="show_img(this)" onmouseleave="hide_img()"> </td><!-- --> <td>5000.00</td> <td>3000.00</td> <td>3</td> <td>正常</td> <td>2018-05-24 14:31:04</td> <td> <button class="layui-btn layui-btn-xs" onclick="add()">编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </td> </tr> <tr> <td>14</td> <td>iphone</td> <td>Apple iPhone 8 Plus 64GB 红色特别版 移动联通电信4G手机<img src="../uploads/20180524\13b7cee33f10bcdaeeb273f31e2600f5.jpg " class="thumb" onmouseover="show_img(this)" onmouseleave="hide_img()"> </td><!-- --> <td>5000.00</td> <td>3000.00</td> <td>3</td> <td>正常</td> <td>2018-05-24 14:31:04</td> <td> <button class="layui-btn layui-btn-xs" onclick="add()">编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </td> </tr> <tr> <td>14</td> <td>iphone</td> <td>Apple iPhone 8 Plus 64GB 红色特别版 移动联通电信4G手机<img src="../uploads/20180524\13b7cee33f10bcdaeeb273f31e2600f5.jpg " class="thumb" onmouseover="show_img(this)" onmouseleave="hide_img()"> </td><!-- --> <td>5000.00</td> <td>3000.00</td> <td>3</td> <td>正常</td> <td>2018-05-24 14:31:04</td> <td> <button class="layui-btn layui-btn-xs" onclick="add()">编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </td> </tr> </tbody> </table> <div id="test1"></div> <script type="text/javascript"> layui.use(['layer','laypage'],function(){ layer = layui.layer; laypage= layui.laypage; $ = layui.jquery; //执行一个laypage实例 laypage.render({ elem: 'test1' //注意,这里的 test1 是 ID,不用加 # 号 ,count: 50 //数据总数,从服务端得到 }); }); function del(){ layer.confirm('确定要删除么?', { icon:2, btn: ['确定', '取消'] //可以无限个按钮 }, function(index, layero){ //按钮【按钮一】的回调 }, function(index){ //按钮【按钮二】的回调 }); } // 添加 //预览图片 //1、首先获取到浏览器窗口的位置(相对于文档) function getMousePos(event) { var e = event || window.event; var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; var scrollY = document.documentElement.scrollTop || document.body.scrollTop; var x = e.pageX || e.clientX + scrollX; var y = e.pageY || e.clientY + scrollY; return { 'x': x, 'y': y }; } //显示隐藏预览图片 function show_img(obj){ var imgurl = $(obj).attr('src') var res=getMousePos() var html ='<div style="background:#fff;width: 200px;border:solid 1px #ccc;border-radius: 6px;padding: 2px;position: absolute;left:'+res.x+'px;top:'+res.y+'px;z-index:4" id="preview">\ <img style="width: 100%;border-radius: 6px;" src="'+imgurl+'">\ </div> ' $('body').append(html) } function hide_img(){ $('#preview').remove() } </script> </body> </html>
roles.html
<!DOCTYPE html> <html> <head> <title>角色管理</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../static/plugins/layui/css/layui.css"> <script type="text/javascript" src="../static/plugins/layui/layui.js"></script> <style type="text/css"> .header span{background: #009688;margin-left: 30px;padding: 10px;color:#ffffff;} .header div{border-bottom: solid 2px #009688;margin-top: 8px;} </style> </head> <body style="padding: 10px;"> <div class="header"> <span>角色列表</span> <button class="layui-btn layui-btn-xs" style="float: right;" onclick="add()">添加</button> <div></div> </div> <table class="layui-table"> <thead> <tr> <th>ID</th> <td>角色名称</td> <td>操作</td> </tr> </thead> <tbody> <tr> <td>1</td> <td>系统管理员</td> <td> <button class="layui-btn layui-btn-warm layui-btn-xs" onclick="add()">编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </tdv> </tr> <tr> <td>2</td> <td>开发人员</td> <td> <button class="layui-btn layui-btn-warm layui-btn-xs" onclick="add()">编辑</button> <button class="layui-btn layui-btn-danger layui-btn-xs" onclick="del()">删除</button> </tdv> </tr> </tbody> </table> </body> </html> <script type="text/javascript"> layui.use(['layer'],function(){ $ = layui.jquery; layer = layui.layer; }); // 添加 function add(){ layer.open({ type: 2, title:'添加角色', shade: 0.3, area: ['580px', '520px'], content: 'Rose/add.html' }); } // 删除 function del(gid){ layer.confirm('确定要删除吗?', { icon:3, btn: ['确定','取消'] }, function(){ $.post('/index.php/admins/roles/deletes',{'gid':gid},function(res){ if(res.code>0){ layer.alert(res.msg,{icon:2}); }else{ layer.msg(res.msg);  
Correcting teacher:天蓬老师Correction time:2019-08-15 10:54:26
Teacher's summary:你的小结呢, 只看到代码了, 文字呢