Commit f7cdfa91 authored by Facius's avatar Facius

feat: 订单列表接口调试

parent 7ec8ee1f
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
return ['全部订单', '今日订单'] return ['全部订单', '今日订单']
}, },
// 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工' // 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工'
// 1 今日订单: 0:'待联系', 1:'待完工', 2:'异常单' // 1 今日订单: 0:'今日待联系', 1:'今日待完工', 2:'今日异常单'
orderType() { orderType() {
return this.indexStatus[this.curNow][this.current[this.curNow]] return this.indexStatus[this.curNow][this.current[this.curNow]]
}, },
...@@ -202,6 +202,7 @@ export default { ...@@ -202,6 +202,7 @@ export default {
sousuoImage() { sousuoImage() {
return process.uniEnv.qn_base_url + 'sousuo.png' return process.uniEnv.qn_base_url + 'sousuo.png'
}, },
// 每一种状态对应的tab的index
types() { types() {
return [ return [
{ {
...@@ -213,13 +214,13 @@ export default { ...@@ -213,13 +214,13 @@ export default {
finish: 5, //已完工 finish: 5, //已完工
}, },
{ {
waitLianxi: 0, // 待联系、 todayWaitContact: 0, // 今日待联系、
waitFinish: 1, // 待完工、 todayWaitFinish: 1, // 今日待完工、
exception: 2, // 异常单、 todayException: 2, // 今日异常单、
}, },
] ]
}, },
//waitAccept、waitAppointment、waitCheckIn、waitFinish、exception、finish // 每一个tab对应的状态
indexStatus() { indexStatus() {
return [ return [
[ [
...@@ -230,19 +231,21 @@ export default { ...@@ -230,19 +231,21 @@ export default {
'exception', 'exception',
'finish', 'finish',
], ],
['waitLianxi', 'waitFinish', 'exception'], ['todayWaitContact', 'todayWaitFinish', 'todayException'],
] ]
}, },
// 订单数量接的返回数量的key
countKeys() { countKeys() {
return [ return [
'toAppointmentCount', [
'toCheckinCount', 'toAppointmentCount',
'toFinishCount', 'toCheckinCount',
'reviewingCount', 'toFinishCount',
'exceptionCount', 'reviewingCount',
'todayDlxCount', 'exceptionCount',
'todayDwgCount', '', // 待完工没有数量
'todayYcdCount', ],
['todayContactCount', 'todayFinishCount', 'todayExceptionCount'],
] ]
}, },
noMore() { noMore() {
...@@ -251,8 +254,22 @@ export default { ...@@ -251,8 +254,22 @@ export default {
this.loaded this.loaded
) )
}, },
cellTypes() {
return [
[
'waitAppointment',
'waitCheckIn',
'waitFinish',
'audit',
'exception',
'finish',
],
['', 'waitFinish', 'exception'],
]
},
// 仅用于传给OrderCell的type
cellType() { cellType() {
return this.orderType == 'waitLianxi' ? '' : this.orderType return this.cellTypes[this.curNow][this.current[this.curNow]]
}, },
noOrderCustomStyle() { noOrderCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7' return 'margin-top: 100rpx;background-color: #F4F5F7'
...@@ -262,7 +279,10 @@ export default { ...@@ -262,7 +279,10 @@ export default {
getApp().trackPage('订单首页') getApp().trackPage('订单首页')
this._freshing = false this._freshing = false
if (e && e.type) { if (e && e.type) {
this.current[this.curNow] = this.indexStatus[this.curNow].indexOf(e.type) this.current[this.curNow] = Math.max(
0,
this.indexStatus[this.curNow].indexOf(e.type)
)
} }
}, },
onShow() { onShow() {
...@@ -354,13 +374,13 @@ export default { ...@@ -354,13 +374,13 @@ export default {
if (res.data) { if (res.data) {
// 修改各个tab数量 // 修改各个tab数量
var j = 0 var j = 0
var i = 0
var count = 0 var count = 0
for (var items of this.list) { for (var items of this.list) {
var i = 0
for (var item of items) { for (var item of items) {
item.total = res.data[this.countKeys[i]] || 0 item.total = res.data[this.countKeys[j][i]] || 0
if (j == 0) { if (j == 0) {
// 待处理数量加起来 // 非今日订单数量加起来
count += item.total count += item.total
} }
i++ i++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment