Commit f7cdfa91 authored by Facius's avatar Facius

feat: 订单列表接口调试

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