|
@@ -17,7 +17,7 @@
|
17
|
17
|
<swiper-item v-for="(item, index) in list" :key="index">
|
18
|
18
|
<scroll-view class="page__scroll" :scroll-y="true" @scrolltolower="getMoreList">
|
19
|
19
|
<ul class="order">
|
20
|
|
- <li class="order__item">
|
|
20
|
+ <li class="order__item" v-for="item of list[self.tab].list" :key="item.id">
|
21
|
21
|
<div class="order__main">
|
22
|
22
|
<div class="order__top">
|
23
|
23
|
<div class="des">立即 (建议19:00前送达)</div>
|
|
@@ -31,21 +31,33 @@
|
31
|
31
|
<div class="order__title order__title2">周庄子家园(6号楼2单元1701)</div>
|
32
|
32
|
</div>
|
33
|
33
|
</div>
|
34
|
|
- <div class="yuji">
|
35
|
|
- 预计9.30出餐
|
36
|
|
- </div>
|
37
|
|
- <div class="remarks">
|
38
|
|
- 备注:多放辣
|
39
|
|
- </div>
|
|
34
|
+ <div class="yuji">预计9.30出餐</div>
|
|
35
|
+ <div class="remarks">备注:多放辣</div>
|
40
|
36
|
<div class="order__btns" v-if="tab!==4">
|
41
|
|
- <div class="btn tel">
|
|
37
|
+ <div class="btn tel" @click="makePhone(item)">
|
42
|
38
|
<my-image src="/static/icon/tal.png"></my-image>
|
43
|
|
- <span >联系</span>
|
|
39
|
+ <span>联系</span>
|
44
|
40
|
</div>
|
45
|
|
- <div class="btn active" v-if="tab===0">接单</div>
|
46
|
|
- <div class="btn active" v-if="tab===1">打包完</div>
|
47
|
|
- <div class="btn active" v-if="tab===2">配送中</div>
|
48
|
|
- <div class="btn active" v-if="tab===3">送达</div>
|
|
41
|
+ <div
|
|
42
|
+ class="btn active"
|
|
43
|
+ v-if="tab===0"
|
|
44
|
+ @click="receivingOrder(item)"
|
|
45
|
+ >接单</div>
|
|
46
|
+ <div
|
|
47
|
+ class="btn active"
|
|
48
|
+ v-if="tab===1"
|
|
49
|
+ @click="packagedOrder(item)"
|
|
50
|
+ >打包完</div>
|
|
51
|
+ <div
|
|
52
|
+ class="btn active"
|
|
53
|
+ v-if="tab===2"
|
|
54
|
+ @click="deliveryOrder(item)"
|
|
55
|
+ >配送中</div>
|
|
56
|
+ <div
|
|
57
|
+ class="btn active"
|
|
58
|
+ v-if="tab===3"
|
|
59
|
+ @click="completeOrder(item)"
|
|
60
|
+ >送达</div>
|
49
|
61
|
</div>
|
50
|
62
|
</li>
|
51
|
63
|
</ul>
|
|
@@ -74,35 +86,35 @@ export default {
|
74
|
86
|
list: [
|
75
|
87
|
{
|
76
|
88
|
title: "待接单",
|
77
|
|
- status: "0",
|
|
89
|
+ status: "20",
|
78
|
90
|
num: 0,
|
79
|
91
|
page: 1,
|
80
|
92
|
list: [],
|
81
|
93
|
},
|
82
|
94
|
{
|
83
|
95
|
title: "打包中",
|
84
|
|
- status: "2",
|
|
96
|
+ status: "21",
|
85
|
97
|
num: 0,
|
86
|
98
|
page: 1,
|
87
|
99
|
list: [],
|
88
|
100
|
},
|
89
|
101
|
{
|
90
|
102
|
title: "待配送",
|
91
|
|
- status: "3",
|
|
103
|
+ status: "23",
|
92
|
104
|
num: 0,
|
93
|
105
|
page: 1,
|
94
|
106
|
list: [],
|
95
|
107
|
},
|
96
|
108
|
{
|
97
|
109
|
title: "配送中",
|
98
|
|
- status: "4",
|
|
110
|
+ status: "24",
|
99
|
111
|
num: 0,
|
100
|
112
|
page: 1,
|
101
|
113
|
list: [],
|
102
|
114
|
},
|
103
|
115
|
{
|
104
|
116
|
title: "已送达",
|
105
|
|
- status: "9",
|
|
117
|
+ status: "25",
|
106
|
118
|
num: 0,
|
107
|
119
|
page: 1,
|
108
|
120
|
list: [],
|
|
@@ -114,20 +126,13 @@ export default {
|
114
|
126
|
|
115
|
127
|
onLoad() {
|
116
|
128
|
const self = this;
|
117
|
|
-
|
118
|
|
- // if (!self.loading) {
|
119
|
|
- // uni.showLoading({
|
120
|
|
- // title: '加载中...',
|
121
|
|
- // })
|
122
|
|
- // }
|
123
|
|
-
|
124
|
|
- self.tab = self.$mp.query.index ? Number(self.$mp.query.index) : 0;
|
125
|
129
|
},
|
126
|
130
|
|
127
|
|
- onShow() {
|
|
131
|
+ async onShow() {
|
128
|
132
|
const self = this;
|
129
|
|
-
|
130
|
|
- // self.getList()
|
|
133
|
+ await self.fn.init();
|
|
134
|
+ console.log(11)
|
|
135
|
+ this.getList();
|
131
|
136
|
},
|
132
|
137
|
|
133
|
138
|
// 函数
|
|
@@ -146,6 +151,11 @@ export default {
|
146
|
151
|
// self.getList()
|
147
|
152
|
},
|
148
|
153
|
|
|
154
|
+ onPullDownRefresh() {
|
|
155
|
+ const self = this;
|
|
156
|
+ self.getList();
|
|
157
|
+ },
|
|
158
|
+
|
149
|
159
|
// 获取订单列表
|
150
|
160
|
getList() {
|
151
|
161
|
const self = this;
|
|
@@ -159,16 +169,16 @@ export default {
|
159
|
169
|
pageSize: 20,
|
160
|
170
|
})
|
161
|
171
|
.then((res) => {
|
162
|
|
- let data = JSON.parse(res.data);
|
|
172
|
+ let data = res.data;
|
163
|
173
|
|
164
|
|
- if (data.orderList.length) {
|
|
174
|
+ if (data.length) {
|
165
|
175
|
self.list[self.tab].page++;
|
166
|
176
|
}
|
167
|
177
|
|
168
|
178
|
// self.list[1].num = data.countInfo.unpaidOrderCount
|
169
|
179
|
// self.list[2].num = data.countInfo.waitShippedOrderCount
|
170
|
180
|
// self.list[3].num = data.countInfo.waitReceivedOrderCount
|
171
|
|
- self.list[self.tab].list = data.orderList;
|
|
181
|
+ self.list[self.tab].list = data;
|
172
|
182
|
self.loading = true;
|
173
|
183
|
uni.hideLoading();
|
174
|
184
|
});
|
|
@@ -176,7 +186,6 @@ export default {
|
176
|
186
|
|
177
|
187
|
// 获取更多内容
|
178
|
188
|
getMoreList() {
|
179
|
|
- return console.log("获取更多");
|
180
|
189
|
const self = this;
|
181
|
190
|
|
182
|
191
|
self.api
|
|
@@ -186,144 +195,136 @@ export default {
|
186
|
195
|
pageSize: 20,
|
187
|
196
|
})
|
188
|
197
|
.then((res) => {
|
189
|
|
- let data = JSON.parse(res.data);
|
190
|
|
-
|
191
|
|
- if (data.orderList.length) {
|
|
198
|
+ let data = res.data;
|
|
199
|
+ if (data.length) {
|
192
|
200
|
self.list[self.tab].page++;
|
193
|
201
|
}
|
194
|
202
|
|
195
|
|
- self.list[1].num = data.countInfo.unpaidOrderCount;
|
196
|
|
- self.list[2].num = data.countInfo.waitShippedOrderCount;
|
197
|
|
- self.list[3].num = data.countInfo.waitReceivedOrderCount;
|
|
203
|
+ // self.list[1].num = data.countInfo.unpaidOrderCount;
|
|
204
|
+ // self.list[2].num = data.countInfo.waitShippedOrderCount;
|
|
205
|
+ // self.list[3].num = data.countInfo.waitReceivedOrderCount;
|
198
|
206
|
self.list[self.tab].list = self.list[self.tab].list.concat(
|
199
|
|
- data.orderList
|
|
207
|
+ data
|
200
|
208
|
);
|
201
|
209
|
});
|
202
|
210
|
},
|
203
|
|
-
|
204
|
|
- // 跳转到详情
|
205
|
|
- jumpDetail(val) {
|
206
|
|
- const self = this;
|
207
|
|
-
|
208
|
|
- self.router.push({
|
209
|
|
- path: "/pages/order/detail",
|
210
|
|
- query: {
|
211
|
|
- orderId: val.shopOrderId,
|
212
|
|
- },
|
|
211
|
+ // // 取消订单
|
|
212
|
+ // cancel(val, key) {
|
|
213
|
+ // const self = this;
|
|
214
|
+
|
|
215
|
+ // self.fn
|
|
216
|
+ // .showModal({
|
|
217
|
+ // title: "取消订单",
|
|
218
|
+ // content: "这么好的宝贝,确定不要了?",
|
|
219
|
+ // })
|
|
220
|
+ // .then((res) => {
|
|
221
|
+ // if (res.confirm) {
|
|
222
|
+ // self.api
|
|
223
|
+ // .post(
|
|
224
|
+ // "/Order/Cancel",
|
|
225
|
+ // {
|
|
226
|
+ // orderId: val.shopOrderId,
|
|
227
|
+ // reason: "",
|
|
228
|
+ // },
|
|
229
|
+ // {
|
|
230
|
+ // repeat: true,
|
|
231
|
+ // }
|
|
232
|
+ // )
|
|
233
|
+ // .then(() => {
|
|
234
|
+ // if (self.tab !== 0 && self.tab !== 4) {
|
|
235
|
+ // self.list[self.tab].num--;
|
|
236
|
+ // }
|
|
237
|
+ // self.list[self.tab].list.splice(key, 1);
|
|
238
|
+ // self.fn.showToast("订单取消成功");
|
|
239
|
+ // });
|
|
240
|
+ // }
|
|
241
|
+ // });
|
|
242
|
+ // },
|
|
243
|
+
|
|
244
|
+ // 打电话
|
|
245
|
+ makePhone(val) {
|
|
246
|
+ uni.makePhoneCall({
|
|
247
|
+ phoneNumber: "17343041879",
|
213
|
248
|
});
|
214
|
249
|
},
|
215
|
250
|
|
216
|
|
- // 跳转到物流信息
|
217
|
|
- jumpExpress(val) {
|
218
|
|
- const self = this;
|
219
|
|
-
|
220
|
|
- self.router.push({
|
221
|
|
- path: "/pages/order/express",
|
222
|
|
- query: {
|
223
|
|
- orderId: val.shopOrderId,
|
224
|
|
- },
|
225
|
|
- });
|
226
|
|
- },
|
227
|
|
-
|
228
|
|
- // 取消订单
|
229
|
|
- cancel(val, key) {
|
230
|
|
- const self = this;
|
231
|
|
-
|
232
|
|
- self.fn
|
233
|
|
- .showModal({
|
234
|
|
- title: "取消订单",
|
235
|
|
- content: "这么好的宝贝,确定不要了?",
|
236
|
|
- })
|
|
251
|
+ // 接单
|
|
252
|
+ receivingOrder(val) {
|
|
253
|
+ self.api
|
|
254
|
+ .post(
|
|
255
|
+ "/Order/ReceivingOrder",
|
|
256
|
+ {
|
|
257
|
+ id: val.id,
|
|
258
|
+ },
|
|
259
|
+ {
|
|
260
|
+ repeat: true,
|
|
261
|
+ }
|
|
262
|
+ )
|
237
|
263
|
.then((res) => {
|
238
|
|
- if (res.confirm) {
|
239
|
|
- self.api
|
240
|
|
- .post(
|
241
|
|
- "/Order/Cancel",
|
242
|
|
- {
|
243
|
|
- orderId: val.shopOrderId,
|
244
|
|
- reason: "",
|
245
|
|
- },
|
246
|
|
- {
|
247
|
|
- repeat: true,
|
248
|
|
- }
|
249
|
|
- )
|
250
|
|
- .then(() => {
|
251
|
|
- if (self.tab !== 0 && self.tab !== 4) {
|
252
|
|
- self.list[self.tab].num--;
|
253
|
|
- }
|
254
|
|
- self.list[self.tab].list.splice(key, 1);
|
255
|
|
- self.fn.showToast("订单取消成功");
|
256
|
|
- });
|
|
264
|
+ if (res.success) {
|
|
265
|
+ self.fn.showToast("接单成功");
|
|
266
|
+ } else {
|
|
267
|
+ self.fn.showToast("接单失败:" + res.message);
|
257
|
268
|
}
|
258
|
269
|
});
|
259
|
270
|
},
|
260
|
|
-
|
261
|
|
- // 支付
|
262
|
|
- pay(val) {
|
263
|
|
- const self = this;
|
264
|
|
-
|
265
|
|
- self.fn.pay(val.shopOrderId, val.buyerPayAmount);
|
|
271
|
+ // 打包完
|
|
272
|
+ packagedOrder(val) {
|
|
273
|
+ self.api
|
|
274
|
+ .post(
|
|
275
|
+ "/Order/PackagedOrder",
|
|
276
|
+ {
|
|
277
|
+ id: val.id,
|
|
278
|
+ },
|
|
279
|
+ {
|
|
280
|
+ repeat: true,
|
|
281
|
+ }
|
|
282
|
+ )
|
|
283
|
+ .then((res) => {
|
|
284
|
+ if (res.success) {
|
|
285
|
+ self.fn.showToast("打包完成功");
|
|
286
|
+ } else {
|
|
287
|
+ self.fn.showToast("打包完失败:" + res.message);
|
|
288
|
+ }
|
|
289
|
+ });
|
266
|
290
|
},
|
267
|
|
-
|
268
|
|
- // 确认收货处理
|
269
|
|
- receive(val, key) {
|
270
|
|
- const self = this;
|
271
|
|
-
|
272
|
|
- self.fn
|
273
|
|
- .showModal({
|
274
|
|
- title: "确认收货",
|
275
|
|
- content: "请你收到货物后再点击“确认”,否则可能钱货两空!",
|
276
|
|
- })
|
|
291
|
+ // 配送中
|
|
292
|
+ deliveryOrder(val) {
|
|
293
|
+ self.api
|
|
294
|
+ .post(
|
|
295
|
+ "/Order/DeliveryOrder",
|
|
296
|
+ {
|
|
297
|
+ id: val.id,
|
|
298
|
+ },
|
|
299
|
+ {
|
|
300
|
+ repeat: true,
|
|
301
|
+ }
|
|
302
|
+ )
|
277
|
303
|
.then((res) => {
|
278
|
|
- if (res.confirm) {
|
279
|
|
- self.api
|
280
|
|
- .post(
|
281
|
|
- "/Order/SignOff",
|
282
|
|
- {
|
283
|
|
- orderId: val.shopOrderId,
|
284
|
|
- },
|
285
|
|
- {
|
286
|
|
- repeat: true,
|
287
|
|
- }
|
288
|
|
- )
|
289
|
|
- .then(() => {
|
290
|
|
- if (self.tab !== 0 && self.tab !== 4) {
|
291
|
|
- self.list[self.tab].num--;
|
292
|
|
- }
|
293
|
|
- self.list[self.tab].list.splice(key, 1);
|
294
|
|
- });
|
|
304
|
+ if (res.success) {
|
|
305
|
+ self.fn.showToast("配送中成功");
|
|
306
|
+ } else {
|
|
307
|
+ self.fn.showToast("配送中失败:" + res.message);
|
295
|
308
|
}
|
296
|
309
|
});
|
297
|
310
|
},
|
298
|
|
-
|
299
|
|
- // 删除订单
|
300
|
|
- remove(val, key) {
|
301
|
|
- const self = this;
|
302
|
|
-
|
303
|
|
- self.fn
|
304
|
|
- .showModal({
|
305
|
|
- title: "删除订单",
|
306
|
|
- content: "确定删除订单?",
|
307
|
|
- })
|
|
311
|
+ // 送达
|
|
312
|
+ completeOrder(val) {
|
|
313
|
+ self.api
|
|
314
|
+ .post(
|
|
315
|
+ "/Order/CompleteOrder",
|
|
316
|
+ {
|
|
317
|
+ id: val.id,
|
|
318
|
+ },
|
|
319
|
+ {
|
|
320
|
+ repeat: true,
|
|
321
|
+ }
|
|
322
|
+ )
|
308
|
323
|
.then((res) => {
|
309
|
|
- if (res.confirm) {
|
310
|
|
- self.api
|
311
|
|
- .delete(
|
312
|
|
- "/Order/Delete",
|
313
|
|
- {
|
314
|
|
- orderId: val.shopOrderId,
|
315
|
|
- },
|
316
|
|
- {
|
317
|
|
- repeat: true,
|
318
|
|
- }
|
319
|
|
- )
|
320
|
|
- .then(() => {
|
321
|
|
- if (self.tab !== 0 && self.tab !== 4) {
|
322
|
|
- self.list[self.tab].num--;
|
323
|
|
- }
|
324
|
|
- self.list[self.tab].list.splice(key, 1);
|
325
|
|
- self.fn.showToast("删除成功");
|
326
|
|
- });
|
|
324
|
+ if (res.success) {
|
|
325
|
+ self.fn.showToast("送达成功");
|
|
326
|
+ } else {
|
|
327
|
+ self.fn.showToast("送达失败:" + res.message);
|
327
|
328
|
}
|
328
|
329
|
});
|
329
|
330
|
},
|
|
@@ -428,9 +429,10 @@ page {
|
428
|
429
|
margin-top: px(30);
|
429
|
430
|
background-color: #fff;
|
430
|
431
|
border-radius: px(10);
|
431
|
|
- box-shadow: 0px 2px 6px -3px rgba(0,0,0,0.5);
|
|
432
|
+ box-shadow: 0px 2px 6px -3px rgba(0, 0, 0, 0.5);
|
|
433
|
+ padding-bottom: 1px;
|
432
|
434
|
}
|
433
|
|
- &__main{
|
|
435
|
+ &__main {
|
434
|
436
|
padding: px(40);
|
435
|
437
|
}
|
436
|
438
|
&__top {
|
|
@@ -447,13 +449,12 @@ page {
|
447
|
449
|
font-size: px(36);
|
448
|
450
|
}
|
449
|
451
|
}
|
450
|
|
-
|
451
|
452
|
|
452
|
453
|
&__con {
|
453
|
454
|
margin-top: px(60);
|
454
|
455
|
padding-left: px(60);
|
455
|
456
|
position: relative;
|
456
|
|
- &::after{
|
|
457
|
+ &::after {
|
457
|
458
|
content: "";
|
458
|
459
|
position: absolute;
|
459
|
460
|
left: px(20);
|
|
@@ -464,52 +465,53 @@ page {
|
464
|
465
|
}
|
465
|
466
|
}
|
466
|
467
|
|
467
|
|
- &__title{
|
|
468
|
+ &__title {
|
468
|
469
|
font-size: px(60);
|
469
|
470
|
position: relative;
|
470
|
|
- &::after{
|
|
471
|
+ &::after {
|
471
|
472
|
content: "";
|
472
|
473
|
position: absolute;
|
473
|
474
|
left: px(-50);
|
474
|
475
|
top: 50%;
|
475
|
|
- transform: translate(0,-50%);
|
|
476
|
+ transform: translate(0, -50%);
|
476
|
477
|
z-index: 1;
|
477
|
478
|
width: px(20);
|
478
|
479
|
height: px(20);
|
479
|
480
|
border-radius: 50%;
|
480
|
481
|
background-color: #a8a8a8;
|
481
|
482
|
}
|
482
|
|
- &.on{
|
|
483
|
+ &.on {
|
483
|
484
|
color: #333;
|
484
|
|
- &::after{
|
|
485
|
+ &::after {
|
485
|
486
|
background-color: #f68a3f;
|
486
|
487
|
}
|
487
|
488
|
}
|
488
|
489
|
}
|
489
|
|
- &__title2{
|
|
490
|
+ &__title2 {
|
490
|
491
|
margin-top: px(60);
|
491
|
|
- color: #999;
|
|
492
|
+ color: #999;
|
492
|
493
|
}
|
493
|
|
- &__des{
|
|
494
|
+ &__des {
|
494
|
495
|
font-size: px(36);
|
495
|
496
|
margin-top: px(20);
|
496
|
497
|
}
|
497
|
|
- &__btns{
|
|
498
|
+ &__btns {
|
498
|
499
|
display: flex;
|
499
|
500
|
border-top: 1px solid #dedede;
|
500
|
501
|
justify-content: space-between;
|
501
|
|
- .btn{
|
|
502
|
+ margin-bottom: -1px;
|
|
503
|
+ .btn {
|
502
|
504
|
height: px(130);
|
503
|
505
|
line-height: px(130);
|
504
|
506
|
text-align: center;
|
505
|
507
|
}
|
506
|
|
- .active{
|
|
508
|
+ .active {
|
507
|
509
|
background-color: #f68a3f;
|
508
|
510
|
color: #fff;
|
509
|
511
|
font-size: px(50);
|
510
|
512
|
width: 100%;
|
511
|
513
|
}
|
512
|
|
- .tel{
|
|
514
|
+ .tel {
|
513
|
515
|
width: px(200);
|
514
|
516
|
flex-shrink: 0;
|
515
|
517
|
display: flex;
|
|
@@ -518,20 +520,19 @@ page {
|
518
|
520
|
align-items: center;
|
519
|
521
|
font-size: px(36);
|
520
|
522
|
line-height: 1;
|
521
|
|
- /deep/ img{
|
|
523
|
+ /deep/ img {
|
522
|
524
|
width: px(60);
|
523
|
525
|
height: px(60);
|
524
|
526
|
margin-bottom: px(10);
|
525
|
527
|
}
|
526
|
528
|
}
|
527
|
|
-
|
528
|
529
|
}
|
529
|
|
- .yuji{
|
530
|
|
- padding:px(20) px(40) px(20) px(60);
|
|
530
|
+ .yuji {
|
|
531
|
+ padding: px(20) px(40) px(20) px(60);
|
531
|
532
|
font-size: px(36);
|
532
|
533
|
color: #999;
|
533
|
534
|
}
|
534
|
|
- .remarks{
|
|
535
|
+ .remarks {
|
535
|
536
|
background-color: #fefaf1;
|
536
|
537
|
color: #6b5651;
|
537
|
538
|
font-size: px(36);
|