-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimg_product_class_list.php
196 lines (127 loc) · 5.54 KB
/
img_product_class_list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php
include('php/identify.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>img_slider_list</title>
<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="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="./css/font.css">
<link rel="stylesheet" href="./css/xadmin.css">
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/xadmin.js"></script>
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="x-nav">
<span class="layui-breadcrumb">
<a target="_parent" href="index.php">首页</a>
<a href="">图片管理</a>
<a>
<cite>产品类别图片-------------------------pc版:218*218 wap版:171*171 裁剪好的圆形图片-------------------------</cite></a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
<i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
<div class="layui-inline" >
<table class="layui-hide" id="LAY_table_user" lay-filter="useruv"></table>
</div>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs " onclick="" lay-event="edit"><i class="layui-icon"></i>编辑</a>
<!--<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del"><i class="layui-icon"></i>删除</a>-->
</script>
<script src="./lib/layui/layui.js"></script>
<script>
layui.use('table', function(){
var table = layui.table,form = layui.form;
//方法级渲染
table.render({
elem: '#LAY_table_user'
,url: 'php/img/img_query.php'
,where: {img_page: 'product',img_class: 'class' }
,cols: [[
{field:'id', title: 'ID', sort: true, fixed: false,width:100}
,{field:'name', title: '名称', sort: false, fixed: false,width:180}
,{field:'en_name', title: '英文名称', sort: false, fixed: false,width:180}
,{field:'alt', title: '图片alt', sort: false, fixed: false}
,{field:'url', title: 'img地址', sort: false, fixed: false}
,{field:'wap_url', title: '移动端img地址', sort: false, fixed: false}
,{field:'right', title: '操作', width:178,align:'center',toolbar:"#barDemo", fixed: 'right',width:100}
]]
,id: 'testReload'
,page: true
//,height: 600
});
//监听工具条
table.on('tool(useruv)', function(obj){
var data = obj.data;
if(obj.event === 'edit'){
var c='php/img/img_edit.php?id='+data.id;
x_admin_show('图片编辑',c,600,650);
} else if(obj.event === 'del'){
layer.confirm('确定删除这个图片?', function(index){
console.log(data);
obj.del();
layer.close(index);
$.ajax({
url: "php/img/img_delete.php",
type: "post",
data:{"id":data.id},
dataType: "text",
});
});
} else if(obj.event === 'img'){
var c='php/img/img_edit.php?id='+data.id;
x_admin_show('暂时不用这个',c,850,500);
}
});
$('.demoTable .layui-btn').on('click', function(){
var type = $(this).data('type');
active[type] ? active[type].call(this) : '';
});
function EidtUv(data,value,index,obj) {
$.ajax({
url: "UVServlet",
type: "POST",
data:{"uvid":data.id,"memthodname":"edituv","aid":data.aid,"uv":value},
dataType: "json",
success: function(data){
if(data.state==1){
layer.close(index);
//同步更新表格和缓存对应的值
obj.update({
uv: value
});
layer.msg("修改成功", {icon: 6});
}else{
layer.msg("修改失败", {icon: 5});
}
}
});
}
});
layui.use('laydate', function(){
var laydate = layui.laydate;
//执行一个laydate实例
laydate.render({
elem: '#search_startdate' //指定元素
});
//执行一个laydate实例
laydate.render({
elem: '#search_enddate' //指定元素
});
});
</script>
</form>
</body>
</html>