Commit a6d8bb47 authored by Facius's avatar Facius

improve: 订单页面切换时显示优化

parent 16c5f708
......@@ -22,22 +22,26 @@
</view>
</view>
<view class="u-tabs-box">
<u-tabs
height="66"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="offset[curNow]"
:list="list[curNow]"
count="total"
:current="current"
@change="change"
:is-scroll="false"
font-size="28"
bold
></u-tabs>
<!-- 写两个是避免切换subsection时候,current不是0的时候底部蓝条有初始动画 -->
<view v-for="index of [0, 1]" :key="index">
<u-tabs
v-show="curNow == index"
height="66"
activeColor="#2272FF"
bg-color="none"
inactive-color="#999"
bar-height="4"
bar-width="44"
:offset="offset[index]"
:list="list[index]"
count="total"
:current="current[index]"
@change="change"
:is-scroll="false"
font-size="28"
bold
></u-tabs>
</view>
</view>
<view class="tab-view">
......@@ -62,7 +66,10 @@
:customStyle="noOrderCustomStyle"
/>
<template v-else>
<view v-for="item in orderList" :key="item.orderId">
<view
v-for="item in orderList[curNow][current[curNow]]"
:key="item.orderId"
>
<OrderCell
:orderData="item"
:type="cellType"
......@@ -104,7 +111,10 @@ export default {
curNow: 0,
pageNumber: 0,
pageSize: 1000, // 因为需要排序,所以暂时去掉分页
orderList: [],
orderList: [
[[], [], [], [], [], []],
[[], [], []],
],
list: [
[
{
......@@ -147,7 +157,7 @@ export default {
},
],
],
current: 0,
current: { 0: 0, 1: 0 },
loadStatus: 'loading',
dataValue: [],
loaded: false,
......@@ -157,7 +167,6 @@ export default {
old: {
scrollTop: 0,
},
cellType: 'waitAppointment',
}
},
computed: {
......@@ -166,7 +175,7 @@ export default {
},
// 0:'去预约', 1:'去签到', 2:'去完工', 3:'审核中', 4:'去处理', 5'已完工'
orderType() {
return this.indexStatus[this.curNow][this.current]
return this.indexStatus[this.curNow][this.current[this.curNow]]
},
offset() {
return [
......@@ -221,7 +230,13 @@ export default {
]
},
noMore() {
return this.orderList.length == 0 && this.loaded
return (
this.orderList[this.curNow][this.current[this.curNow]].length == 0 &&
this.loaded
)
},
cellType() {
return this.orderType == 'waitLianxi' ? '' : this.orderType
},
noOrderCustomStyle() {
return 'margin-top: 100rpx;background-color: #F4F5F7'
......@@ -231,7 +246,7 @@ export default {
getApp().trackPage('订单首页')
this._freshing = false
if (e && e.type) {
this.current = e.type
this.current[this.curNow] = this.indexStatus[this.curNow].indexOf(e.type)
}
},
onShow() {
......@@ -244,7 +259,7 @@ export default {
},
// tab栏切换
change(index) {
this.current = index
this.current[this.curNow] = index
// this.orderList = []
this.reloadOrderList()
},
......@@ -273,11 +288,12 @@ export default {
if (res.data.type != self.orderType) return
if (self.pageNumber == 1) {
self.orderList = []
self.orderList[this.curNow][this.current[this.curNow]] = []
}
this.cellType = this.orderType == 'waitLianxi' ? '' : this.orderType
if (res.data.list) {
self.orderList.push(...res.data.list)
self.orderList[this.curNow][this.current[this.curNow]].push(
...res.data.list
)
if (
self.list[this.curNow][self.types[this.curNow][res.data.type]]
) {
......@@ -286,12 +302,15 @@ export default {
].total = res.data.total
}
self.orderList.sort((x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1
})
self.orderList[this.curNow][this.current[this.curNow]].sort(
(x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1
}
)
self.loadStatus =
res.data.total > self.orderList.length &&
res.data.total >
self.orderList[this.curNow][this.current[this.curNow]].length &&
res.data.list.length == self.pageSize
? 'loadmore'
: 'nomore'
......
......@@ -63,7 +63,9 @@
:prop="item.fieldsName"
:border-bottom="false"
v-show="
((item.fieldsName != 'actualPaid' && item.fieldsName != 'eSerialNum') || show200) &&
((item.fieldsName != 'actualPaid' &&
item.fieldsName != 'eSerialNum') ||
show200) &&
((readOnly &&
!$u.test.isEmpty(form[item.fieldsName])) ||
!readOnly)
......@@ -865,7 +867,7 @@ export default {
const save = await this.nextStepSaveData()
if (save) {
uni.reLaunch({
url: '/pages/index/order?type=0',
url: '/pages/index/order?type=waitAppointment',
})
}
},
......@@ -1001,7 +1003,7 @@ export default {
type: 'success',
callback: () => {
uni.reLaunch({
url: '/pages/index/order?type=3',
url: '/pages/index/order?type=audit',
})
},
})
......@@ -1022,7 +1024,7 @@ export default {
type: 'success',
callback: () => {
uni.reLaunch({
url: '/pages/index/order?type=3',
url: '/pages/index/order?type=audit',
})
},
})
......@@ -1090,10 +1092,14 @@ export default {
if (innerItem.fieldsName === 'paymentMethodsType') {
// 选不需要收款的时候,收款金额修改为非必选
const actualPaid = groupItem.items.find((v) => v.fieldsName === 'actualPaid')
const actualPaid = groupItem.items.find(
(v) => v.fieldsName === 'actualPaid'
)
actualPaid.required = data.value != '03'
const eSerialNum = groupItem.items.find((v) => v.fieldsName === 'eSerialNum')
const eSerialNum = groupItem.items.find(
(v) => v.fieldsName === 'eSerialNum'
)
eSerialNum.required = data.value != '03'
}
......
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