offline_order.html
12.8 KB
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>线下订单</title>
<include file="public/header"/>
<script type="text/javascript" src="__STATIC__/js/layer.js"></script>
<include file="public/menu"/>
<include file="public/navBall"/>
<style type="text/css">
.sub-btn {
margin: 20px 0 5px;
}
.offlion_head {
width: 100%;
margin: auto;
background-color: #FFF;
position: fixed;
left: 0;
top: 0px;
z-index: 999;
}
.offlion_head .inner {
margin: auto;
max-width: 720px;
text-align: center;
}
.offlion_head .titbox {
width: 50%;
float: left;
height: 40px;
line-height: 40px;
font-size: 14px;
border-bottom: 1px #ddd solid;
}
.offlion_head .titbox:hover,
.offlion_head .titbox:active {
color: #000;
}
.offlion_head .titbox.on {
color: #C4182E;
border-bottom: 2px #C4182E solid;
}
.offlion1 {
display: inline-block;
width: 20px;
height: 17px;
margin-top: -3px;
vertical-align: middle;
background-repeat: no-repeat;
background-position: center center;
background-image: url("__STATIC__/images/user/offlion1.png");
background-size: 100% 100%;
}
.offlion_head .titbox.on .offlion1 {
background-image: url("__STATIC__/images/user/offlion1on.png");
}
.offlion2 {
display: inline-block;
width: 20px;
height: 18px;
margin-top: -3px;
vertical-align: middle;
background-image: url("__STATIC__/images/user/offlion2.png");
background-repeat: no-repeat;
background-position: center center;
background-size: 100% 100%;
}
.offlion_head .titbox.on .offlion2 {
background-image: url("__STATIC__/images/user/offlion2on.png");
}
#offlinelist li {
padding: 0 10px;
border-bottom: 4px #ddd solid;
}
.ordernum {
font-size: 0;
padding: 5px 0;
border-bottom: 1px #ddd solid;
}
.ordernum .num {
display: inline-block;
vertical-align: middle;
width: 50%;
font-size: 14px;
color: #666;
}
.ordernum .pro {
display: inline-block;
vertical-align: middle;
text-align: right;
width: 50%;
line-height: 18px;
color: #999;
font-size: 14px;
}
.orderinfo .goodsname {
color: #666;
padding: 5px 0;
}
.goodspro {
font-size: 0;
}
.goodspro .threebox {
width: 33.3%;
display: inline-block;
font-size: 14px;
color: #999;
}
</style>
</head>
<body>
<div class="hasdata" style="display:block;">
<div class="offlion_head">
<div class="inner">
<a class="titbox" href="{:U('/Mobile/User/order_list',array('stoid'=>$Think.request.stoid))}"><span
class="offlion1"></span> 线上订单</a>
<a class="titbox on"><span class="offlion2"></span> 线下订单</a>
<div class="clear"></div>
</div>
</div>
<div class="funds" style="margin-top: 50px">
<div class="fundsQuery">
<span>日期:</span>
<input type="date" placeholder="请选择开始时间" id="stime" min="{$tyear}" max="{$hyear}" name="start"
value="{$Think.request.start}"/>
<span class="ml10 mr10">至</span>
<input type="date" placeholder="请选择结束时间" id="etime" min="{$tyear}" max="{$hyear}" name="end"
value="{$Think.request.end}"/>
<div class="sub-btn">查询明细</div>
<p>注:读取时段内近10笔记录</p>
</div>
<ul id="offlinelist">
<!--<li>-->
<!--<div class="ordernum">-->
<!--<span class="num cut">-->
<!--<img src="__STATIC__/images/user/offlionimg.png" style="margin-right: 5px;width: 20px" alt="">171212Z0100004171212Z0100004171212Z0100004-->
<!--</span>-->
<!--<span class="pro">-->
<!--<div>2017-12-13 16:54:12</div>-->
<!--<div>消费总额(元):100.00</div>-->
<!--</span>-->
<!--</div>-->
<!--<div class="orderinfo">-->
<!--<div class="goodsname cut">-->
<!--消费总额消费总额消费总额消费总额消费总额-->
<!--</div>-->
<!--<div class="goodspro">-->
<!--<div class="threebox">-->
<!--<div>数量</div>-->
<!--<div class="red">2</div>-->
<!--</div>-->
<!--<div class="threebox tac ">-->
<!--<div>零售价</div>-->
<!--<del class="red">2.00</del>-->
<!--</div>-->
<!--<div class="threebox tar">-->
<!--<div>实收价</div>-->
<!--<div class="red">2</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</li>-->
<!--<li>-->
<!--<div class="ordernum">-->
<!--<span class="num cut">-->
<!--<img src="__STATIC__/images/user/offlionimg.png" style="margin-right: 5px;width: 20px" alt="">171212Z0100004171212Z0100004171212Z0100004-->
<!--</span>-->
<!--<span class="pro">-->
<!--<div>2017-12-13 16:54:12</div>-->
<!--<div>消费总额(元):100.00</div>-->
<!--</span>-->
<!--</div>-->
<!--<div class="orderinfo">-->
<!--<div class="goodsname cut">-->
<!--消费总额消费总额消费总额消费总额消费总额-->
<!--</div>-->
<!--<div class="goodspro">-->
<!--<div class="threebox">-->
<!--<div>数量</div>-->
<!--<div class="red">2</div>-->
<!--</div>-->
<!--<div class="threebox tac ">-->
<!--<div>零售价</div>-->
<!--<del class="red">2.00</del>-->
<!--</div>-->
<!--<div class="threebox tar">-->
<!--<div>实收价</div>-->
<!--<div class="red">2</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div class="orderinfo">-->
<!--<div class="goodsname cut">-->
<!--消费总额消费总额消费总额消费总额消费总额-->
<!--</div>-->
<!--<div class="goodspro">-->
<!--<div class="threebox">-->
<!--<div>数量</div>-->
<!--<div class="red">2</div>-->
<!--</div>-->
<!--<div class="threebox tac ">-->
<!--<div>零售价</div>-->
<!--<del class="red">2.00</del>-->
<!--</div>-->
<!--<div class="threebox tar">-->
<!--<div>实收价</div>-->
<!--<div class="red">2</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</li>-->
</ul>
<!--<div class="datanone" style="display: none;margin-top: 80px;">没有更多订单</div>-->
<div class="loadBtn">加载更多</div>
</div>
</div>
</body>
<script type="text/javascript">
var getstoid = {$Think.request.stoid};
var page = 1;
//页面一开始执行ajax加载数据
$(function () {
window.scrollTo(0,0);
seach_offlion();
})
//查询按钮
$(".sub-btn").click(function () {
page = 1;
seach_offlion();
});
//滚动加载
$(document).unbind("scroll");
$(document).bind("scroll", function (event) {
var text = $(".loadBtn").text();
if ($(document).scrollTop() >= $(document).height() - $(window).height() && text == '加载更多') {
if(IsLoading==true) {
seach_offlion();
IsLoading = false;
}
}
});
function seach_offlion() {
var oo=layer.open({type: 2, shadeClose: false});
var stime = $("#stime").val();//起始时间
var etime = $("#etime").val();//结束时间
var isajax = 'isajax';//传值方式
var date=new Date;
var year=date.getFullYear();
if(stime!="") {
layer.close(oo);
var diff=year-stime.substr(0,4);
if (diff > 20 || diff < -20) {
layer.open({content: '开始时间不能超出前后20年', time: 2});
return false;
}
}
if(etime!="") {
layer.close(oo);
var diff2=year-etime.substr(0,4);
if (diff2 > 20 || diff2 < -20) {
layer.open({content: '结束时间不能超出前后20年', time: 2});
return false;
}
}
$.ajax({
type: "post",
url: '/index.php?m=Mobile&c=User&a=offline_order&stoid=' + getstoid + '',
data: {
stime: stime,
etime: etime,
isajax: isajax,
morepage: page,
},
dataType: 'json',
success: function (data) {
if (data.code == -1) {
$(".loadBtn").text("暂无更多订单");
IsLoading = false;
} else if (data.code == 1) {
$(".hasdata").css("display", "block");
var htm1 = '';
for (var i = 0; i < data.data.data.length; i++) {
var arry = data.data.data[i]['data_list'];
htm1 += "<li> <div class=\"ordernum\"> <span class=\"num cut\"> <img src=\"__STATIC__/images/user/offlionimg.png\" style=\"margin-right: 5px;margin-top: -3px;width: 20px\" alt=\"\">" + data.data.data[i]['No'] + " </span> <span class=\"pro\"> <div>" + data.data.data[i]['BillDate'].toString().substring(0, 19) + "</div> <div>消费总额:¥" + data.data.data[i]['Sum'] + "</div> </span> </div> ";
for (var t = 0; t < arry.length; t++) {
htm1 += "<div class=\"orderinfo\"> <div class=\"goodsname cut\">" + arry[t]['WareName'] + " </div> <div class=\"goodspro\"> <div class=\"threebox\"> <div>数量</div> <div class=\"red\">" + arry[t]['Qty'] + " </div> </div> <div class=\"threebox tac \"> <div>零售价</div> <del>¥" + arry[t]['PosPrice'] + " </del> </div> <div class=\"threebox tar\"> <div>实收价</div> <div class=\"red\">¥ " + arry[t]['Price'] + " </div> </div> </div> </div>";
}
htm1 += " </li>";
};
$("#offlinelist").html(htm1);
IsLoading = false;
$(".loadBtn").text("暂无更多订单");
} else if (data.code == 2) {
var htm1 = '';
for (var i = 0; i < data.data.data.length; i++) {
var arry = data.data.data[i]['data_list'];
htm1 += "<li> <div class=\"ordernum\"> <span class=\"num cut\"> <img src=\"__STATIC__/images/user/offlionimg.png\" style=\"margin-right: 5px;margin-top: -3px;width: 20px\" alt=\"\">" + data.data.data[i]['No'] + " </span> <span class=\"pro\"> <div>" + data.data.data[i]['BillDate'].toString().substring(0, 19) + "</div> <div>消费总额:¥" + data.data.data[i]['Sum'] + "</div> </span> </div> ";
for (var t = 0; t < arry.length; t++) {
htm1 += "<div class=\"orderinfo\"> <div class=\"goodsname cut\">" + arry[t]['WareName'] + " </div> <div class=\"goodspro\"> <div class=\"threebox\"> <div>数量</div> <div class=\"red\">" + arry[t]['Qty'] + " </div> </div> <div class=\"threebox tac \"> <div>零售价</div> <del>¥ " + arry[t]['PosPrice'] + " </del> </div> <div class=\"threebox tar\"> <div>实收价</div> <div class=\"red\">¥ " + arry[t]['Price'] + " </div> </div> </div> </div>";
}
htm1 += " </li>";
};
$("#offlinelist").append(htm1);
if (data.ordnum == page){
IsLoading = false;
$(".loadBtn").text("暂无更多订单");
}else{
IsLoading = true;
$(".loadBtn").text("加载更多");
page++;
}
}
layer.closeAll();
}
});
}
</script>
</html>