order_list.html
19.3 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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://at.alicdn.com/t/font_834805_0ml90wdq5hzm.css">
<link rel="stylesheet" href="__INDEX__/css/base.css">
<link rel="stylesheet" href="__INDEX__/css/myorder.css">
<link rel="stylesheet" href="__INDEX__/css/swiper.min.css">
<script type="text/javascript" src="__INDEX__/js/base.js"></script>
<script src="http://res2.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<title>全部订单</title>
</head>
<body>
<div class="deletewrap" style="display:none">
<div class="deletepop">
<p class="suredelete">取消订单</p>
<p class="certainornot">确定取消该订单吗?</p>
<div class="certain">
<p class="cancel">取消</p>
<p class="sure">确认</p>
</div>
</div>
</div>
<div class="container">
<div class="head">
<ul class="order_list">
<li class="active" ordertype="0">
<em></em>
全部
</li>
<li ordertype="1">
<em></em>
待支付
</li>
<li ordertype="2">
<em></em>
待发货
</li>
<li ordertype="3">
<em></em>
待收货
</li>
<li ordertype="4">
<em></em>
已完成
</li>
</ul>
</div>
<!--全部订单-->
<div class="orderlist allorder">
<volist name="data.all" id="vo">
<div class="item_order_list">
<div class="order_head">
<div class="order_num">
<p class="order_list_num">订单号:</p>
<p class="item_num">{$vo.order_num}</p>
</div>
<p class="order_type">
<if condition="$vo['step'] eq '1'">
待付款
</if>
<if condition="$vo['step'] eq '2'">
待发货
</if>
<if condition="$vo['step'] eq '3'">
待发货
</if>
<if condition="$vo['step'] eq '5'">
已完成
</if>
</p>
</div>
<div class="order_content">
<volist name="vo.detail" id="v">
<div class="order_content_item">
<p class="content_item_img">
<img src="{$v.thumb}" alt="">
</p>
<div class="content_text">
<p class="good_name">{$v.name}</p>
<div class="good_test">
<p class="item_tast">{$v.intro}</p>
<p class="tast_num">x{$v.num}</p>
</div>
<p class="item_price">
¥
<span class="item_money">{$v.price}</span>
</p>
</div>
</div>
</volist>
</div>
<if condition="$vo['step'] eq '1'">
<div class="unpay">
<p class="pay" data-id="{$vo.id}">付款</p>
<p class="cancelorder cancellist" data-id="{$vo.id}">取消订单</p>
</div>
</if>
<if condition="$vo['step'] eq '3'">
<div class="unpay">
<a href="{:url('user/Center/tracking',['oid'=>$vo['id']])}"><p class="tracking">物流跟踪</p></a>
<p class="confirm" data-id="{$vo.id}">确认收货</p>
</div>
</if>
<!--<if condition="$vo['step'] eq '5'">-->
<!--<div class="unpay">-->
<!--<p class="pay eval" data-url="{:url('user/Center/evaluate',['oid'=>$vo['id']])}">评价</p>-->
<!--<p class="cancelorder refund" data-url="{:url('user/Center/refund',['oid'=>$vo['id']])}">申请退款</p>-->
<!--</div>-->
<!--</if>-->
<in name="vo.step" value="5,6,7,8,9">
<div class="unpay">
<if condition="$vo['is_evaluate'] eq '0'">
<p class="pay eval" data-url="{:url('user/Center/evaluate',['oid'=>$vo['id']])}">评价</p>
</if>
<if condition="$vo['step'] eq '5'">
<p class="cancelorder refund" data-url="{:url('user/Center/refund',['oid'=>$vo['id']])}">申请退货</p>
</if>
<if condition="$vo['step'] eq '6'">
<p class="cancelorder">等待审核</p>
</if>
<if condition="$vo['step'] eq '7'">
<p class="cancelorder refund_pay" data-url="{:url('user/Center/refundPay',['oid'=>$vo['id']])}">申请退款</p>
</if>
<if condition="$vo['step'] eq '8'">
<p class="cancelorder">等待审核</p>
</if>
<if condition="$vo['step'] eq '9'">
<p class="cancelorder">已退款</p>
</if>
</div>
</in>
</div>
</volist>
</div>
<!--待支付-->
<div class="orderlist waitpay" style="display:none">
<volist name="data.unpaid" id="vo">
<div class="item_order_list">
<div class="order_head">
<div class="order_num">
<p class="order_list_num">订单号:</p>
<p class="item_num">{$vo.order_num}</p>
</div>
<p class="order_type">待付款</p>
</div>
<div class="order_content">
<volist name="vo.detail" id="v">
<div class="order_content_item">
<p class="content_item_img">
<img src="{$v.thumb}" alt="">
</p>
<div class="content_text">
<p class="good_name">{$v.name}</p>
<div class="good_test">
<p class="item_tast">{$v.intro}</p>
<p class="tast_num">x{$v.num}</p>
</div>
<p class="item_price">
¥
<span class="item_money">{$v.price}</span>
</p>
</div>
</div>
</volist>
</div>
<div class="unpay">
<p class="pay" data-id="{$vo.id}">付款</p>
<p class="cancelorder cancellist" data-id="{$vo.id}">取消订单</p>
</div>
</div>
</volist>
</div>
<!--待发货-->
<div class="orderlist waitsend" style="display:none">
<volist name="data.undelivered" id="vo">
<div class="item_order_list">
<div class="order_head">
<div class="order_num">
<p class="order_list_num">订单号:</p>
<p class="item_num">{$vo.order_num}</p>
</div>
<p class="order_type">待发货</p>
</div>
<div class="order_content">
<volist name="vo.detail" id="v">
<div class="order_content_item">
<p class="content_item_img">
<img src="{$v.thumb}" alt="">
</p>
<div class="content_text">
<p class="good_name">{$v.name}</p>
<div class="good_test">
<p class="item_tast">{$v.intro}</p>
<p class="tast_num">x{$v.num}</p>
</div>
<p class="item_price">
¥
<span class="item_money">{$v.price}</span>
</p>
</div>
</div>
</volist>
</div>
</div>
</volist>
</div>
<!--待收货-->
<div class="orderlist waittake" style="display:none">
<volist name="data.unreceived" id="vo">
<div class="item_order_list">
<div class="order_head">
<div class="order_num">
<p class="order_list_num">订单号:</p>
<p class="item_num">{$vo.order_num}</p>
</div>
<p class="order_type">待收货</p>
</div>
<div class="order_content">
<volist name="vo.detail" id="v">
<div class="order_content_item">
<p class="content_item_img">
<img src="{$v.thumb}" alt="">
</p>
<div class="content_text">
<p class="good_name">{$v.name}</p>
<div class="good_test">
<p class="item_tast">{$v.intro}</p>
<p class="tast_num">x{$v.num}</p>
</div>
<p class="item_price">
¥
<span class="item_money">{$v.price}</span>
</p>
</div>
</div>
</volist>
</div>
<div class="unpay">
<a href="{:url('user/Center/tracking',['oid'=>$vo['id']])}"><p class="tracking">物流跟踪</p></a>
<p class="confirm" data-id="{$vo.id}">确认收货</p>
</div>
</div>
</volist>
</div>
<!--已完成-->
<div class="orderlist finish drawback" style="display:none">
<volist name="data.completed" id="vo">
<div class="item_order_list">
<div class="order_head">
<div class="order_num">
<p class="order_list_num">订单号:</p>
<p class="item_num">{$vo.order_num}</p>
</div>
<p class="order_type">已完成</p>
</div>
<div class="order_content">
<volist name="vo.detail" id="v">
<div class="order_content_item">
<p class="content_item_img">
<img src="{$v.thumb}" alt="">
</p>
<div class="content_text">
<p class="good_name">{$v.name}</p>
<div class="good_test">
<p class="item_tast">{$v.intro}</p>
<p class="tast_num">x{$v.num}</p>
</div>
<p class="item_price">
¥
<span class="item_money">{$v.price}</span>
</p>
</div>
</div>
</volist>
</div>
<div class="unpay">
<if condition="$vo['is_evaluate'] eq '0'">
<p class="pay eval" data-url="{:url('user/Center/evaluate',['oid'=>$vo['id']])}">评价</p>
</if>
<if condition="$vo['step'] eq '5'">
<p class="cancelorder refund" data-url="{:url('user/Center/refund',['oid'=>$vo['id']])}">申请退货</p>
</if>
<if condition="$vo['step'] eq '6'">
<p class="cancelorder">等待审核</p>
</if>
<if condition="$vo['step'] eq '7'">
<p class="cancelorder refund_pay" data-url="{:url('user/Center/refundPay',['oid'=>$vo['id']])}">申请退款</p>
</if>
<if condition="$vo['step'] eq '8'">
<p class="cancelorder">等待审核</p>
</if>
<if condition="$vo['step'] eq '9'">
<p class="cancelorder">已退款</p>
</if>
</div>
</div>
</volist>
</div>
</div>
</body>
<script type="text/javascript" src="__INDEX__/js/jquery.min.js"></script>
<script type="text/javascript" src="__INDEX__/js/cookie.js"></script>
<script>
//跳转订单的页面
var orderid = localStorage.getItem("orderid");
console.log(orderid);
var len=$("li");
console.log(len)
if(orderid==1){
for(var i=0;i<len.length;i++){
if($(len[i]).attr("ordertype")==1){
$(len[i]).addClass("active");
$(len[i]).siblings("li").removeClass("active");
$(".waitpay").css("display","block");
$(".allorder").css("display","none");
$(".waitsend").css("display","none");
$(".waittake").css("display","none");
$(".finish").css("display","none");
}
}
}else if(orderid==2){
for(var i=0;i<len.length;i++){
if($(len[i]).attr("ordertype")==2){
$(len[i]).addClass("active");
$(len[i]).siblings("li").removeClass("active");
$(".waitpay").css("display","none");
$(".allorder").css("display","none");
$(".waitsend").css("display","block");
$(".waittake").css("display","none");
$(".finish").css("display","none");
}
}
}else if(orderid==3){
for(var i=0;i<len.length;i++){
if($(len[i]).attr("ordertype")==3){
$(len[i]).addClass("active");
$(len[i]).siblings("li").removeClass("active");
$(".waitpay").css("display","none");
$(".allorder").css("display","none");
$(".waitsend").css("display","none");
$(".waittake").css("display","block");
$(".finish").css("display","none");
}
}
}else if(orderid==4){
for(var i=0;i<len.length;i++){
if($(len[i]).attr("ordertype")==4){
$(len[i]).addClass("active");
$(len[i]).siblings("li").removeClass("active");
$(".waitpay").css("display","none");
$(".allorder").css("display","none");
$(".waitsend").css("display","none");
$(".waittake").css("display","none");
$(".finish").css("display","block");
}
}
}else{
$(".waitpay").css("display","none");
$(".allorder").css("display","block");
$(".waitsend").css("display","none");
$(".waittake").css("display","none");
$(".finish").css("display","none");
}
$(".order_list li").click(function(){
$(this).addClass("active");
$(this).siblings("li").removeClass("active");
if($(this).attr("ordertype")==0){
$(".allorder").css("display","block");
$(".allorder").siblings(".orderlist").css("display","none")
}else if($(this).attr("ordertype")==1){
$(".waitpay").css("display","block");
$(".waitpay").siblings(".orderlist").css("display","none")
}else if($(this).attr("ordertype")==2){
$(".waitsend").css("display","block");
$(".waitsend").siblings(".orderlist").css("display","none")
}else if($(this).attr("ordertype")==3){
$(".waittake").css("display","block");
$(".waittake").siblings(".orderlist").css("display","none")
}else if($(this).attr("ordertype")==4){
$(".finish").css("display","block");
$(".finish").siblings(".orderlist").css("display","none")
}
})
//取消订单弹出层
var oid ='';
$(".cancellist").click(function(){
oid = $(this).attr('data-id');
$(".deletewrap").show();
})
//确认取消订单
$(".sure").click(function(){
$(".deletewrap").hide();
$.ajax({
url:"{:url('user/Center/cancelOrder')}",
data:{
oid:oid
},
type:"POST",
dataType:"JSON",
success: function (data) {
if(data.data === true) {
window.location.reload();
}
}
})
})
$(".cancel").click(function(){
$(".deletewrap").hide();
})
//申请退货
$(".refund").click(function(){
window.event.stopPropagation()
window.location.href=$(this).attr('data-url');
})
//申请退款
$(".refund_pay").click(function(){
window.event.stopPropagation()
window.location.href=$(this).attr('data-url');
})
//评价
$(".eval").click(function(){
window.event.stopPropagation()
window.location.href=$(this).attr('data-url');
})
$(".pay").click(function () {
$.ajax({
url:"{:url('pay/Pay/payFromCenter')}",
data:{
oid:$(this).attr('data-id')
},
type:"POST",
dataType:"JSON",
success: function (data) {
if(data.msg == 'ok') {
wx.chooseWXPay({
timestamp: data.data.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: data.data.nonceStr, // 支付签名随机串,不长于 32 位
package: data.data.package, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType: data.data.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: data.data.paySign, // 支付签名
success: function (res) {
window.location.href=data.url;
},
});
}
}
})
})
$(".confirm").click(function () {
if(!window.confirm('是否确认收货?')) {
return false;
}else {
$.ajax({
url:"{:url('user/Center/confirm')}",
data:{
oid:$(this).attr('data-id')
},
type:"POST",
dataType:"JSON",
success: function (data) {
if(data.data === true) {
window.location.reload();
}
}
})
}
})
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '{$js_sdk.appId}', // 必填,公众号的唯一标识
timestamp: '{$js_sdk.timestamp}', // 必填,生成签名的时间戳
nonceStr: '{$js_sdk.nonceStr}', // 必填,生成签名的随机串
signature: '{$js_sdk.signature}',// 必填,签名
jsApiList: [
'chooseWXPay'
] // 必填,需要使用的JS接口列表
});
</script>
</html>