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
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
| <!DOCTYPE html>
| <html>
|
| <head>
| <meta charset="utf-8" />
| <meta http-equiv="X-UA-Compatible" content="chrome=1" />
| <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
| <title>订单总览</title>
| <link rel="stylesheet" type="text/css" href="../../css/doui.min.css" />
| <script src="../../js/doui.min.js" type="text/javascript" charset="utf-8"></script>
| <script src="../../js/requestHost.js" type="text/javascript" charset="utf-8"></script>
| <script type="text/javascript">
| doui.importLoad({
| importArray: [
| // 雷打不动
| getHostPath() + "js/jquery.min.js",
| getHostPath() + "js/vue.min.js",
| // 字体图标
| getHostPath() + "fontAdmin/iconfont.css",
| getHostPath() + "font/iconfont.css",
| // dom模板
| getHostPath() + "css/admin-all.css",
| getHostPath() + "js/admin-creat.js",
| ],
| });
| </script>
| </head>
|
| <body class="fontPC" style="display:none;">
| <div class="winSizeBox">
|
| <!-- =============================================================== 搜索筛选(顶部) -->
| <div id="thisHeader" style="width:7.5rem;"></div>
|
| <!-- =============================================================== 表格 -->
| <div id="thisTable" class="admin-main-overHeader"></div>
|
| <!-- =============================================================== 文件上传 弹框 -->
| <div v-show="fileWork.show" id="fileUpload" class="layer-dark fboxRow Xcenter Ycenter">
| <div class="admin-tan-box" style="height:auto;">
| <!-- 关闭按钮 -->
| <div class="admin-btn-arcS admin-tan-close" @click="fileWork.action_close()"><i class="fi fi-no"></i></div>
| <!-- 标题 -->
| <div class="fboxRow Xcenter Ycenter admin-margin">
| <div class="font18 font-blue">文件上传</div>
| </div>
| <!-- 文件选择 -->
| <div class="fboxRow Xcenter Ycenter admin-margin">
| <div class="font-cyan">订单表格:</div>
| <div class="inputShell border-1px border-round" style="width:1.2rem;">
| <input id="myimg" type="file" accept="application/vnd.ms-excel" @change="fileWork.action_change()" />
| </div>
| </div>
| <!-- 提交 按钮 -->
| <div class="fboxRow Xcenter Ycenter admin-margin">
| <div class="admin-btn-roundL bg-green click-scale" @click="fileWork.action_sub()">确定上传</div>
| </div>
| </div>
| </div>
|
| </div>
| </body>
|
| </html>
|
|
| <script type="text/javascript">
| // 文件上传vue
| var vm_file = null;
|
| // ==================================================================================== 页面数据
| doui.onReady({
| success: function() {
| // ----------------------------------------------------- 顶部
| // 创建顶部dom
| adminDom.header.creat({
| el: "#thisHeader",
| });
| // 输入类型
| adminDom.header.select({
| show: true,
| list: [{
| key: "1",
| value: "订单号"
| },
| {
| key: "2",
| value: "用户ID"
| },
| ],
| });
| // 输入搜索
| adminDom.header.input({
| placeholder: "根据选择填写",
| })
|
| var choiceList = [{
| title: "订单类型",
| muchCheck: true, // 是否可以多选
| child: [{
| key: [1],
| value: "自购订单",
| check: false
| },
| {
| key: [2],
| value: "分享订单",
| check: false
| },
| {
| key: [3],
| value: "团队订单",
| check: false
| },
| ],
| input: {
| type: "number",
| num: 0
| },
| },
| {
| title: "订单状态",
| muchCheck: false, // 是否可以多选
| child: [{
| key: [1],
| value: "有效",
| check: false
| },
| {
| key: [2],
| value: "售后",
| check: false
| },
| {
| key: [3],
| value: "失效",
| check: false
| },
| ],
| input: {
| type: "number",
| num: 0
| },
| },
| {
| title: "到账状态",
| muchCheck: false, // 是否可以多选
| child: [{
| key: [1],
| value: "未到账",
| check: false
| },
| {
| key: [2],
| value: "已到账",
| check: false
| },
| {
| key: [3],
| value: "已失效",
| check: false
| },
| ],
| input: {
| type: "number",
| num: 0
| },
| },
|
| {
| title: "支付时间",
| muchCheck: false, // 是否可以多选
| child: [],
| input: {
| type: "date",
| num: 2
| },
| },
| {
| title: "渠道来源",
| muchCheck: false, // 是否可以多选
| child: [{
| key: [1],
| value: "淘宝",
| check: false
| },
| {
| key: [2],
| value: "京东",
| check: false
| },
| {
| key: [3],
| value: "拼多多",
| check: false
| },
| {
| key: [4],
| value: "唯品会",
| check: false
| },
| {
| key: [5],
| value: "苏宁",
| check: false
| },
| ],
| input: {
| type: "number",
| num: 0
| },
| },
| {
| title: "订单风险",
| muchCheck: false, // 是否可以多选
| child: [{
| key: [1],
| value: "同商品",
| check: false
| },
| {
| key: [2],
| value: "同店铺",
| check: false
| },
| {
| key: [3],
| value: "高额返利",
| check: false
| },
| ],
| input: {
| type: "number",
| num: 0
| },
| },
| {
| title: "付款金额(最大值)",
| muchCheck: false, // 是否可以多选
| child: [],
| input: {
| type: "number",
| num: 1,
| value:''
| },
| }
| ];
| // 筛选项
| adminDom.header.screen({
| show: true,
| list: choiceList,
| btns:[{name:'刷单风险',actionClick:function(){
| choiceList[0].child[0].check=true;
| choiceList[0].child[1].check=true
| choiceList[1].child[0].check=true;
| choiceList[4].child[0].check=true;
| choiceList[6].input.value="9";
| }},{name:'清除所选',actionClick:function(){
| choiceList[0].child[0].check=false;
| choiceList[0].child[1].check=false
| choiceList[1].child[0].check=false;
| choiceList[4].child[0].check=false;
| choiceList[6].input.value="";
| }}]
| });
|
| // setTimeout(function(){
| // choiceList[0].child[0].check=true;
| // },10000);
|
|
|
| // ----------------------------------------------------- 表格
| // 创建表格dom
| adminDom.table.creat({
| el: "#thisTable",
| touchSearch: function(optC) {
| // 发起请求
| doui.showLoading({
| content: "加载列表"
| });
|
| var types=optC.screen[0].result;
| console.log("订单类型:"+optC.screen[0].result);
|
| doui.request({
| type: "jsonp",
| url: gethttp() + "/admin/new/api/v1/order/getUserOrderList",
| data: {
| pageIndex: optC.table.page, // 页码
| pageSize: optC.table.pageSize, // 每页数量
| keyType: optC.select.result, // 搜索类型
| key: optC.input[0].result, // 搜索关键字
| type: types, // 订单类型
| orderState: optC.screen[1].result[0], // 订单状态
| state: optC.screen[2].result[0], // 到账状态
| startTime: optC.screen[3].result[0], // 时间最小
| endTime: optC.screen[3].result[1] ? optC.screen[3].result[1] : '', // 时间最大
| sourceType: optC.screen[4].result[0],
| riskType: optC.screen[5].result[0],
| payment: optC.screen[6].result[0], // 付款金额
| },
| success: function(res) {
| doui.hideLoading();
| if (res.code != 0) {
| doui.showToast({
| content: res.msg
| });
| } else {
| // 申明 表格内容数据
| var mo_tr = []; // tr组
| for (var i = 0, mo = res.data.result_list; i < mo.length; i++) {
| // 当前行
| var thatTr = {
| check: false,
| td: [{
| title: "商品图片",
| key: mo[i].commonOrderGoods ? mo[i].commonOrderGoods.picture : "",
| value: mo[i].commonOrderGoods ? mo[i].commonOrderGoods.picture : "",
| dataType: "img"
| },
| {
| title: "商品标题",
| key: mo[i].commonOrderGoods.goodsId,
| value: mo[i].commonOrderGoods.title,
| dataType: 'link'
| },
| {
| title: "订单号",
| key: mo[i].orderNo,
| value: mo[i].orderNo
| },
| {
| title: "订单类型",
| key: mo[i].hongBaoType,
| value: mo[i].hongBaoType
| },
| {
| title: "支付金额",
| key: mo[i].payment,
| value: "¥" + mo[i].payment
| },
| {
| title: "支付时间",
| key: mo[i].downTime,
| value: mo[i].downTime,
| "class": "font13 font-gray"
| },
| {
| title: "订单状态",
| key: mo[i].state,
| value: mo[i].state
| },
| {
| title: "收货时间",
| key: mo[i].receiveTime,
| value: mo[i].receiveTime,
| "class": "font13 font-gray"
| },
| {
| title: "收益金额",
| key: mo[i].hongBao,
| value: "¥" + mo[i].hongBao
| },
| {
| title: "收益状态",
| key: mo[i].hongBaoState,
| value: mo[i].hongBaoState
| },
| {
| title: "收益时间",
| key: mo[i].hongBaoDate,
| value: mo[i].hongBaoDate,
| "class": "font13 font-gray"
| },
| {
| title: "用户头像",
| key: mo[i].userPortrait,
| value: mo[i].userPortrait,
| dataType: "img",
| "class": "admin-imgS"
| },
| {
| title: "用户昵称",
| key: mo[i].userName,
| value: mo[i].userName
| },
| {
| title: "用户ID",
| key: mo[i].userId,
| value: mo[i].userId
| },
| {
| title: "直接邀请人",
| key: mo[i].levelOneId,
| value: "ID:" + mo[i].levelOneId + " ¥" + mo[i].levelOneMoney
| },
| {
| title: "间接邀请人",
| key: mo[i].levelTwoId,
| value: "ID:" + mo[i].levelTwoId + " ¥" + mo[i].levelTwoMoney
| },
| {
| title: "一级分类",
| key: mo[i].commonOrderGoods.category1,
| value: mo[i].commonOrderGoods.category1
| },
| ],
| };
| // 订单类型
| if (thatTr.td[3].key == 1) {
| thatTr.td[3].value = "自购";
| thatTr.td[3]["class"] = "font-blue";
| } else if (thatTr.td[3].key == 2) {
| thatTr.td[3].value = "分享";
| thatTr.td[3]["class"] = "font-green";
| } else if (thatTr.td[3].key == 3) {
| thatTr.td[3].value = "团队";
| thatTr.td[3]["class"] = "font-green";
| }
| //渠道标识
|
|
| // 订单号分析
| if (i >= 1) {
| if (thatTr.td[2].key == mo[i - 1].orderNo) {
| thatTr.td[2].value = "(同上)";
| thatTr.td[2]["class"] = "font-gray";
| }
| }
| //商品链接
| if (mo[i].sourceType == 1) {
| thatTr.td[3].value = thatTr.td[3].value + " (淘宝)";
| thatTr.td[1].key = "https://detail.tmall.com/item.htm?id=" + thatTr.td[1].key;
| } else if (mo[i].sourceType == 2) {
| thatTr.td[3].value = thatTr.td[3].value + " (京东)";
| thatTr.td[1].key = "https://item.jd.com/" + thatTr.td[1].key + ".html";
| } else if (mo[i].sourceType == 3) {
| thatTr.td[3].value = thatTr.td[3].value + " (拼多多)";
| thatTr.td[1].key = "http://yangkeduo.com/goods.html?goods_id=" + thatTr.td[1].key;
| }
|
| // 订单状态
| if (thatTr.td[6].key == 1) {
| thatTr.td[6].value = "已付款";
| thatTr.td[6]["class"] = "font-orange";
| } else if (thatTr.td[6].key == 2) {
| thatTr.td[6].value = "已收货";
| thatTr.td[6]["class"] = "font-green";
| } else if (thatTr.td[6].key == 5) {
| thatTr.td[6].value = "已收货,待入账";
| thatTr.td[6]["class"] = "font-green";
| } else if (thatTr.td[6].key == 3) {
| var drawbackMoney = "";
| if (mo[i].weiQuanBackMoney != null && mo[i].weiQuanBackMoney != undefined) {
| if (mo[i].weiQuanBackMoney > 0) {
| drawbackMoney = "已扣除:" + mo[i].weiQuanBackMoney;
| } else {
| drawbackMoney = "未扣除:" + Math.abs(mo[i].weiQuanBackMoney);
| }
| }
|
| thatTr.td[6].value = "订单售后#" + mo[i].weiQuanState + "#" + drawbackMoney;
| thatTr.td[6]["class"] = "font-red";
| } else if (thatTr.td[6].key == 4) {
| thatTr.td[6].value = "已失效";
| thatTr.td[6]["class"] = "font-gray";
| }
|
| if (mo[i].otherState == 1) {
| thatTr.td[6].value = thatTr.td[6].value + "(免单中)";
| thatTr.td[6]["class"] = "font-orange";
| } else if (mo[i].otherState == 2) {
| thatTr.td[6].value = thatTr.td[6].value + "(免单成功)";
| thatTr.td[6]["class"] = "font-orange";
| }
|
| // 收益状态
| if (thatTr.td[9].key == 1) {
| thatTr.td[9].value = "未到账";
| thatTr.td[9]["class"] = "font-orange";
| } else if (thatTr.td[9].key == 2) {
| thatTr.td[9].value = "已到账";
| thatTr.td[9]["class"] = "font-green";
| } else if (thatTr.td[9].key == 3) {
| thatTr.td[9].value = "已失效";
| thatTr.td[9]["class"] = "font-gray";
| }
| // 受益人分析
| if (!thatTr.td[14].key) {
| thatTr.td[14].value = "(无)";
| thatTr.td[14]["class"] = "font-gray";
| }
| if (!thatTr.td[15].key) {
| thatTr.td[15].value = "(无)";
| thatTr.td[15]["class"] = "font-gray";
| }
|
| if (mo[i].commonOrderGoods.category3 != null && mo[i].commonOrderGoods.category3.length > 0) {
| thatTr.td[16].value = mo[i].commonOrderGoods.category3;
| } else if (mo[i].commonOrderGoods.category2 != null && mo[i].commonOrderGoods.category2.length > 0) {
| thatTr.td[16].value = mo[i].commonOrderGoods.category2;
| }
|
| // 将当前行放入tr组
| mo_tr.push(thatTr);
| }
| // 更新表格的数据
| adminDom.table.opt({
| pageMax: res.data.pe.totalPage
| }); // 最大页码
| adminDom.table.tbody({
| tr: mo_tr
| }); // 内容数据
| }
| }
| });
| }
| });
| // 表格设置
| adminDom.table.opt({
| showCheck: false,
| pageSize: 20,
| });
| // 表格头排
| adminDom.table.thead({
| th: [{
| title: "商品图片",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "商品标题",
| width: "1rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "订单号",
| width: "1rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "订单类型",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "支付金额",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "支付时间",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "订单状态",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "收货时间",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "收益金额",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "收益状态",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "收益时间",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "用户头像",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "用户昵称",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "用户ID",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "直接邀请人",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "间接邀请人",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| {
| title: "商品分类",
| width: "0.6rem",
| orderUp: "",
| orderDown: ""
| },
| ]
| });
| // 工具栏
| adminDom.table.tools({
| show: true,
| list: [{
| "title": "上传订单",
| "name": "add",
| "icon": "fi fi-cloud-upload"
| }, ],
| touch: function(back) {
| // 上传订单
| if (back.toolName == "add") {
| // 显示弹框
| vm_file.fileWork.show = true;
| }
| },
| });
|
|
| // ----------------------------------------------------- 文件上传弹框
| vm_file = new Vue({
| el: "#fileUpload",
| data: {
| // 文件工作
| fileWork: {
| show: false, // 是否显示
| "file": null,
| // 关闭按钮
| action_close: function() {
| vm_file.fileWork["file"] = null;
| $("#myimg").val();
| vm_file.fileWork.show = false;
| },
| // 文件改变
| action_change: function() {
| vm_file.fileWork["file"] = $("#myimg")[0].files[0];
| },
| // 确定上传按钮 点击
| action_sub: function() {
| if (vm_file.fileWork["file"]) {
| // 发情请求
| doui.showLoading("正在上传");
| doui.upload({
| url: gethttp() + "/admin/new/api/v1/upload/uploadOrderFile",
| data: {
| file: vm_file.fileWork["file"],
| },
| // 进度
| progress: function(res) {
| doui.showLoading("已上传" + res.percentage);
| },
| // 成功
| success: function(res) {
| doui.hideLoading();
| if (res.code != 0) {
| doui.showToast(res.msg);
| } else {
| vm_file.fileWork.action_close();
| doui.showToast("上传成功");
| vm_table.search();
| }
| },
| });
| } else {
| doui.showToast("请选择文件");
| }
| },
| },
| },
| });
|
|
| // ----------------------------------------------------- 初始行为
| // 模拟搜索点击
| vm_table.search();
|
|
| document.body.style.display = "block";
| }
| });
| </script>
|
|