Commit 61e398de authored by Damon's avatar Damon

feat: 订单模块改造

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