Commit fcc2723b authored by Facius's avatar Facius

chore: 标注

parent 33ce2535
...@@ -276,7 +276,6 @@ export default { ...@@ -276,7 +276,6 @@ export default {
// tab栏切换 // tab栏切换
change(index) { change(index) {
this.current[this.curNow] = index this.current[this.curNow] = index
// this.orderList = []
this.reloadOrderList() this.reloadOrderList()
}, },
...@@ -301,15 +300,17 @@ export default { ...@@ -301,15 +300,17 @@ export default {
var self = this var self = this
self.$u.api.listOrder(param).then((res) => { self.$u.api.listOrder(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data.type != self.orderType) return if (res.data.type != self.orderType) return // 已切换到其他tab,则不处理后台返回的数据
if (self.pageNumber == 1) { if (self.pageNumber == 1) {
// 下拉刷新或切换到新tab,清空对应数组
self.orderList[this.curNow][this.current[this.curNow]] = [] self.orderList[this.curNow][this.current[this.curNow]] = []
} }
if (res.data.list) { if (res.data.list) {
self.orderList[this.curNow][this.current[this.curNow]].push( self.orderList[this.curNow][this.current[this.curNow]].push(
...res.data.list ...res.data.list
) )
// 更新tab数字
if ( if (
self.list[this.curNow][self.types[this.curNow][res.data.type]] self.list[this.curNow][self.types[this.curNow][res.data.type]]
) { ) {
...@@ -317,15 +318,15 @@ export default { ...@@ -317,15 +318,15 @@ export default {
self.types[this.curNow][res.data.type] self.types[this.curNow][res.data.type]
].total = res.data.total ].total = res.data.total
} }
if (this.needSort) {
// 待预约, 待签到,待完工需要排序 // 待预约, 待签到,待完工需要排序
if (this.needSort) {
self.orderList[this.curNow][this.current[this.curNow]].sort( self.orderList[this.curNow][this.current[this.curNow]].sort(
(x, y) => { (x, y) => {
return x.currentOverTime <= y.currentOverTime ? 1 : -1 return x.currentOverTime <= y.currentOverTime ? 1 : -1
} }
) )
} }
// 更新底部加载状态
self.loadStatus = self.loadStatus =
res.data.total > res.data.total >
self.orderList[this.curNow][this.current[this.curNow]].length && self.orderList[this.curNow][this.current[this.curNow]].length &&
......
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