Commit 61e398de authored by Damon's avatar Damon

feat: 订单模块改造

parent bf128999
...@@ -184,22 +184,26 @@ export default { ...@@ -184,22 +184,26 @@ export default {
{ {
label: '待联系', label: '待联系',
value: 0, value: 0,
orderType: '' curNow: 0,
type: 'waitAppointment'
}, },
{ {
label: '待上门', label: '待上门',
value: 0, value: 0,
orderType: '' curNow: 0,
type: ''
}, },
{ {
label: '待完工', label: '待完工',
value: 0, value: 0,
orderType: '' curNow: 0,
type: ''
}, },
{ {
label: '异常单', label: '异常单',
value: 0, value: 0,
orderType: '' curNow: 1,
type: 'exception'
} }
] ]
} }
...@@ -287,8 +291,8 @@ export default { ...@@ -287,8 +291,8 @@ export default {
let date = new Date() let date = new Date()
let timestamp = date.getTime() let timestamp = date.getTime()
let today = this.$u.timeFormat(timestamp, 'yyyy-mm-dd') let today = this.$u.timeFormat(timestamp, 'yyyy-mm-dd')
uni.navigateTo({ uni.reLaunch({
url: `pages/mine/order/list?orderType=${item.orderType}&title=${item.label}&start=${today}&end=${today}` url: `pages/index/order?curNow=${item.curNow}&type=${item.type}`
}) })
}, },
async initSettleInfo() { async initSettleInfo() {
......
...@@ -131,46 +131,46 @@ export default { ...@@ -131,46 +131,46 @@ export default {
list: [ list: [
[ [
{ {
name: '待预约', name: '待联系',
total: 0, total: 0,
}, },
{ {
name: '待签到', name: '待上门',
total: 0, total: 0,
}, },
{ {
name: '待完工', name: '待完工',
total: 0, total: 0,
}, },
],
[
{ {
name: '审核中', name: '待预约',
total: 0, total: 0,
}, },
{ {
name: '异常单', name: '待签到',
total: 0, total: 0,
}, },
{ {
name: '已完工', name: '待完工',
total: 0, total: 0,
}, },
],
[
{ {
name: '待联系', name: '审核中',
total: 0, total: 0,
}, },
{ {
name: '待完工', name: '异常单',
total: 0, total: 0,
}, },
{ {
name: '异常单', name: '已完工',
total: 0, total: 0,
}, },
], ]
], ],
current: { 0: 0, 1: 0 }, current: { 1: 0, 0: 0 },
loadStatus: 'loading', loadStatus: 'loading',
dataValue: [], dataValue: [],
loaded: false, loaded: false,
...@@ -185,10 +185,10 @@ export default { ...@@ -185,10 +185,10 @@ export default {
}, },
computed: { computed: {
subList() { subList() {
return ['全部订单', '今日订单'] return ['今日待办', '全部订单']
}, },
// 0 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工' // 0 今日订单: 0:'今日待联系', 1:'今日待完工', 2:'今日异常单'
// 1 今日订单: 0:'今日待联系', 1:'今日待完工', 2:'今日异常单' // 1 全部订单: 0:'待预约', 1:'待签到', 2:'待完工', 3:'审核中', 4:'异常单', 5'已完工'
orderType() { orderType() {
return this.indexStatus[this.curNow][this.current[this.curNow]] return this.indexStatus[this.curNow][this.current[this.curNow]]
}, },
...@@ -203,14 +203,14 @@ export default { ...@@ -203,14 +203,14 @@ export default {
pageSizes() { pageSizes() {
// 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有 // 待预约, 待签到,待完工,因为需要排序,所以暂时去掉分页,一次要完所有
return [ return [
[10000, 10000, 10000, 15, 15, 15],
[10000, 10000, 15], [10000, 10000, 15],
[10000, 10000, 10000, 15, 15, 15]
] ]
}, },
offset() { offset() {
return [ return [
[0, 0],
[0, 44], [0, 44],
[0, 0],
] ]
}, },
sousuoImage() { sousuoImage() {
...@@ -219,6 +219,11 @@ export default { ...@@ -219,6 +219,11 @@ export default {
// 每一种状态对应的tab的index // 每一种状态对应的tab的index
types() { types() {
return [ return [
{
todayWaitContact: 0, // 今日待联系、
todayWaitFinish: 1, // 今日待完工、
todayException: 2, // 今日异常单、
},
{ {
waitAppointment: 0, // 待预约、 waitAppointment: 0, // 待预约、
waitCheckIn: 1, // 待签到、 waitCheckIn: 1, // 待签到、
...@@ -227,16 +232,12 @@ export default { ...@@ -227,16 +232,12 @@ export default {
exception: 4, // 异常单、 exception: 4, // 异常单、
finish: 5, //已完工 finish: 5, //已完工
}, },
{
todayWaitContact: 0, // 今日待联系、
todayWaitFinish: 1, // 今日待完工、
todayException: 2, // 今日异常单、
},
] ]
}, },
// 每一个tab对应的状态 // 每一个tab对应的状态
indexStatus() { indexStatus() {
return [ return [
['todayWaitContact', 'todayWaitFinish', 'todayException'],
[ [
'waitAppointment', 'waitAppointment',
'waitCheckIn', 'waitCheckIn',
...@@ -245,12 +246,12 @@ export default { ...@@ -245,12 +246,12 @@ export default {
'exception', 'exception',
'finish', 'finish',
], ],
['todayWaitContact', 'todayWaitFinish', 'todayException'],
] ]
}, },
// 订单数量接的返回数量的key // 订单数量接的返回数量的key
countKeys() { countKeys() {
return [ return [
['todayContactCount', 'todayFinishCount', 'todayExceptionCount'],
[ [
'toAppointmentCount', 'toAppointmentCount',
'toCheckinCount', 'toCheckinCount',
...@@ -259,7 +260,6 @@ export default { ...@@ -259,7 +260,6 @@ export default {
'exceptionCount', 'exceptionCount',
'', // 待完工没有数量 '', // 待完工没有数量
], ],
['todayContactCount', 'todayFinishCount', 'todayExceptionCount'],
] ]
}, },
isFinish() { isFinish() {
...@@ -273,6 +273,7 @@ export default { ...@@ -273,6 +273,7 @@ export default {
}, },
cellTypes() { cellTypes() {
return [ return [
['', 'waitFinish', 'exception'],
[ [
'waitAppointment', 'waitAppointment',
'waitCheckIn', 'waitCheckIn',
...@@ -281,7 +282,6 @@ export default { ...@@ -281,7 +282,6 @@ export default {
'exception', 'exception',
'finish', 'finish',
], ],
['', 'waitFinish', 'exception'],
] ]
}, },
// 仅用于传给OrderCell的type // 仅用于传给OrderCell的type
...@@ -299,11 +299,16 @@ export default { ...@@ -299,11 +299,16 @@ export default {
getApp().trackPage('订单首页') getApp().trackPage('订单首页')
this._freshing = false this._freshing = false
// 跳转到本页是否带了跳到那个tab的参数 // 跳转到本页是否带了跳到那个tab的参数
if (e && e.type) { if (e) {
this.current[this.curNow] = Math.max( if (e.curNow) {
0, this.sectionChange(parseInt(e.curNow))
this.indexStatus[this.curNow].indexOf(e.type) }
) if (e.type) {
this.current[this.curNow] = Math.max(
0,
this.indexStatus[this.curNow].indexOf(e.type)
)
}
} }
this.showMaskTip() this.showMaskTip()
}, },
......
...@@ -1053,7 +1053,7 @@ export default { ...@@ -1053,7 +1053,7 @@ export default {
}) })
} else { } else {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/order?type=audit', url: '/pages/index/order?type=audit&curNow=1',
}) })
} }
}, },
...@@ -1081,7 +1081,7 @@ export default { ...@@ -1081,7 +1081,7 @@ export default {
}) })
} else { } else {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/order?type=audit', url: '/pages/index/order?type=audit&curNow=1',
}) })
} }
}, },
......
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