123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <!DOCTYPE html>
- <html class="x-admin-sm">
-
- <head>
- <meta charset="UTF-8">
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
- <link rel="shortcut icon" href="https://osscold.baozhida.cn/favicon.ico">
- <link rel="bookmark" href="https://osscold.baozhida.cn/favicon.ico">
- <link rel="stylesheet" href="https://osscold.baozhida.cn/css/font.css">
- <link rel="stylesheet" href="https://osscold.baozhida.cn/css/xadmin.css">
- <script src="https://osscold.baozhida.cn/lib/layui/layui.js" charset="utf-8"></script>
- <script type="text/javascript" src="https://osscold.baozhida.cn/js/xadmin.js"></script>
- </head>
-
- <body>
- <div class="x-nav">
- <span class="layui-breadcrumb">
- <a href="">首页</a>
- <a><cite>宝智达</cite></a>
- </span>
- <a class="layui-btn layui-btn-normal" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
- <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
- </a>
- </div>
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-body ">
- <form class="layui-form layui-col-space5">
- <div class="layui-input-inline layui-show-xs-block">
- <select name="Class_1">
- <option value="">所有分类</option>
- {{range $index, $elem := .Class_List}}
- <option {{if eq $elem.Id $.Class_1 }}
- selected
- {{end}} value="{{$elem.Id}}">{{$elem.T_name}}</option>
- {{end}}
- </select>
- </div>
- <div class="layui-input-inline layui-show-xs-block">
- <input value="{{.Name}}" type="text" name="Name" placeholder="请输入 名称" autocomplete="off" class="layui-input"></div>
- <div class="layui-input-inline layui-show-xs-block">
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
- <i class="layui-icon"></i></button>
- </div>
- </form>
- </div>
- <div class="layui-card-header">
- <!-- <button class="layui-btn layui-btn-danger" onclick="delAll()">-->
- <!-- <i class="layui-icon"></i>批量删除</button>-->
- <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加','List_',800,600,true);">
- <i class="layui-icon"></i>添加</button></div>
- <div class="layui-card-body ">
- <table class="layui-table layui-form">
- <thead>
- <tr>
- <th>编号</th>
- <th>图片</th>
- <th>名称</th>
- <th>分类</th>
- <th>数量</th>
- <th>操作</th></tr>
- </thead>
- <tbody>
- {{range $index, $elem := .List}}
- <tr>
- <td>{{$elem.Id}}</td>
- <td><img src="{{$elem.T_img}}"></td>
- <td>{{$elem.T_name}}</td>
- <td>
- {{range $index, $elemx := $.Class_List}}
- {{if eq $elem.T_class $elemx.Id }}
- {{$elemx.T_name}}
- {{end}}
- {{end}}
- </td>
- <td>{{$elem.T_int}}</td>
- <td class="td-manage">
- <a title="编辑" onclick="xadmin.open('编辑','List_?id={{$elem.Id}}');" href="javascript:;">
- <i class="layui-icon"></i></a>
- <a title="删除" onclick="member_del(this,'{{$elem.Id}}')" href="javascript:;">
- <i class="layui-icon"></i></a>
- </td>
- </tr>
- {{end}}
- </tbody>
- </table>
- </div>
- <div class="layui-card-body ">
- <div class="page">
- <div>
- {{range $index, $elem := .Pages}}
- {{if eq $elem.A 1}}
- <a class="prev" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}"><<</a>
- {{end}}
- {{if eq $elem.A 2}}
- <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
- {{end}}
- {{if eq $elem.A 3}}
- <span class="current">{{$elem.V}}</span>
- {{end}}
- {{if eq $elem.A 4}}
- <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
- {{end}}
- {{if eq $elem.A 5}}
- <a class="next" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">>></a>
- {{end}}
- {{end}}
- </div>
- Page:{{.Page}}-
- Page_size:{{.Page_size}}-
- cnt:{{.cnt}}
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <script>
- layui.use(['laydate', 'form'],
- function() {
- var laydate = layui.laydate;
- //执行一个laydate实例
- laydate.render({
- elem: '#start' //指定元素
- });
- //执行一个laydate实例
- laydate.render({
- elem: '#end' //指定元素
- });
- });
- /*用户-删除*/
- function member_del(obj, id) {
- layer.confirm('确认要删除吗?',
- function(index) {
- //发异步删除数据
- $(obj).parents("tr").remove();
- $.ajax({
- type: 'POST',
- url: 'List_Del',//发送请求
- data: {Id:id},
- success: function(result) {
- console.log(result)
- if (result.Code == 200 ){
- layer.msg('已删除!', {
- icon: 1,
- time: 2000
- });
- window.location.reload();
- }else {
- layer.msg('删除失败!', {
- time: 2000
- });
- }
- }
- });
- });
- }
- </script>
- </html>
|