forked from visonforcoding/zuidemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorderlist.html
270 lines (264 loc) · 12.3 KB
/
orderlist.html
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zui_demo</title>
<!-- zui -->
<link href="/static/zui/css/zui.min.css" rel="stylesheet">
<link href="/static/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet">
<link href="/static/css/base.css" rel="stylesheet">
<!--jqgrid-->
<link rel="stylesheet" type="text/css" href="/static/lib/jqgrid/css/ui.jqgrid.css">
<link rel="stylesheet" type="text/css" href="/static/lib/jqgrid/css/ui.ace.css">
</head>
<body>
<!-- header -->
<header>
<nav class="navbar navbar-inverse " role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">zui管理系统</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-collapse-example">
<ul class="nav navbar-nav navbar-avatar navbar-right">
<li>
<a href="/shop/order/orderList" class="header-tooltip" style="margin-top:8px;" data-toggle="tooltip"
data-placement="bottom" data-container="body" title="" data-original-title= "4条未处理订单">
<i style="font-size: 25px;" class="icon-shopping-cart icon-xlarge text-default"></i>
<b style="display: block;" class="badge badge-notes bg-default count-n">4</b>
</a>
</li>
<li>
<a href="/shop/user/message" class="header-tooltip" style="margin-top:8px;" data-toggle="tooltip"
data-placement="bottom" data-container="body" title="" data-original-title= "2条未读信息">
<i style="font-size: 25px;" class="icon-comment-alt icon-xlarge text-default"></i>
<b style="display: block;" class="badge badge-notes bg-danger count-n">2</b>
</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">曹麦穗
<span class="thumb-small avatar inline">
<img src="/static/Images/avatar/avatar.jpg" alt="Mika Sokeil" class="img-circle">
</span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="/shop/index/loginOut.html"><i class="icon icon-off"></i> 注销</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
</header>
<!-- / header -->
<div id="left-bar" style="width: 200px">
<nav class="menu" id="left-menu" data-toggle="menu" >
<ul class="nav nav-primary">
<li><a href="/index.php?/shop/index/index"><i class="icon-home"></i> 主面板</a></li>
<li><a href="#"><i class="icon-user"></i>我的店铺</a>
<ul class="nav">
<li >
<a href=""><i class="icon-shopping-cart"></i>menu_1</a>
</li>
<li >
<a href=""><i class="icon-shopping-cart"></i>menu_2</a>
</li>
</ul>
</li>
<li><a href="#"><i class="icon-yen"></i>资金管理</a>
<ul class="nav">
</ul>
</li>
<li><a href="#"><i class="icon-dashboard"></i>工作中心</a>
<ul class="nav">
<li class="active" >
<a href="orderlist.html"><i class="icon-shopping-cart"></i>订单管理</a>
</li>
<li >
<a href=""><i class="icon-shopping-cart"></i>收银开单</a>
</li>
<li >
<a href=""><i class="icon-line-chart"></i>交易统计</a>
</li>
</ul>
</li>
<li>
<a href="#"><i class="icon-comments-alt"></i>评论管理</a>
<ul class="nav">
</ul>
</li>
<li>
<a href=""><i class="icon-tasks"></i> 消息中心
<span class="label label-badge label-danger pull-right">2</span>
</a>
</li>
</ul>
</nav>
</div>
<div id="main-content">
<div id="breadcrumb">
<ul class="breadcrumb">
<li>
<a href=""><i class="icon icon-home"></i> 主页</a>
</li>
<li>
<a id="parent-bread" href="#">工作中心</a>
</li>
<li id="children-bread" class="active">店铺管理</li>
</ul>
</div>
<div id="page-content">
<div class="page-header" >
<h1>
店铺管理
</h1>
</div>
<div class="col-xs-12">
<table id="list"><tr><td></td></tr></table>
<div id="pager"></div>
</div>
</div>
</div>
<!-- 在此处挥洒你的创意 -->
<!-- jQuery (ZUI中的Javascript组件依赖于jQuery) -->
<script src="/static/js/jquery.js"></script>
<!-- ZUI Javascript组件 -->
<script src="/static/zui/js/zui.min.plus.js"></script>
<script src="/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
<script src="/static/lib/layer/layer.js"></script>
<script src="/static/shop/js/global.js"></script>
<script>
$(function () {
$('#left-bar').add('#main-content').height($(window).height() - $('header').height());
$('.header-tooltip').tooltip();
$('#left-menu ul.nav-primary ul.nav li.active').parents('li').addClass('active show');
});
</script>
<script src="/static/lib/jqgrid/js/jquery.jqGrid.min.js"></script>
<script src="/static/lib/jqgrid/js/i18n/grid.locale-cn.js"></script>
<script>
$(function () {
$("#list").jqGrid({
url: "getOrderList.php",
datatype: "json",
mtype: "POST",
colNames: ["编号", "日期", "用户名", "真实姓名", "手机", "", "操作"],
colModel: [
{name: "employee_no", editable: true},
{name: "ctime", editable: true},
{name: "username", editable: true, align: "center"},
{name: "truename", editable: true, align: "center"},
{name: "tel", editable: true, align: "center"},
{name: "actionLoc", viewable: false, formatter: "actions"},
{name: "actionBtn", viewable: false, sortable: false, formatter: actionFormatrer},
],
pager: "#pager",
rowNum: 10,
rowList: [10, 20, 30],
sortname: "ctime",
sortorder: "desc",
viewrecords: true,
gridview: true,
autoencode: true,
caption: '订单列表',
autowidth: true,
shrinkToFit: false,
height: 'auto',
rownumbers: true,
jsonReader: {
root: "rows",
page: "page",
total: "total",
records: "records",
repeatitems: false,
id: "0"
},
}).navGrid('#pager', {edit: true, add: true, del: true, view: true}, searchFn, editFn, addFn, delFn, viewFn);
});
var searchFn = {
};
var editFn = {
jqModal: true,
reloadAfterSubmit: true,
closeOnEscape: true,
savekey: [true, 13],
closeAfterEdit: true,
url: '',
beforeShowForm: function (form) {
$('#tr_password', form).hide();
},
afterSubmit: function (response) {
var responseText = $.parseJSON(response.responseText);
var success = responseText.success;
var message = responseText.message;
return [success, message];
}
};
function edit() {
}
;
function addFn() {
console.log('add');
}
function delFn() {
console.log('add');
}
function viewFn() {
console.log('view');
}
function actionFormatrer(cellvalue, options, rowObject) {
var response = '';
if (rowObject.statusText === '申请退款') {
response = '<a onClick="rebackPay(' + rowObject.id + ')" class="label grid-btn label-badge label-danger">确认退款</a>';
response += '<a onClick="refuseFn(' + rowObject.id + ')" class="label grid-btn label-badge label-danger">拒绝退款</a>';
}
if (rowObject.statusText === '已评价') {
response = '<a class="label grid-btn label-badge label-danger">查看评价</a>';
}
return response;
}
function refuseFn(id) {
//拒绝退款
$('#refuse-order-id').val(id);
$('#refundModal').modal({show: true});
}
function rebackPay(id) {
//确认退款
layer.confirm('确定确认退款?', {
btn: ['确认', '取消'] //按钮
}, function () {
//确认退款
$.ajax({
url: '/shop/order/rebackPay',
type: 'post',
dataType: 'json',
data: {id: id},
success: function (res) {
layer.msg(res.msg, {icon: 1});
}
});
}, function () {
// layer.msg('奇葩么么哒', {shift: 6});
});
}
</script>
<script>
$(function () {
$('table.datatable').datatable({checkable: true, sortable: true});
});
</script>
</body>
</html>