retrieve file

This commit is contained in:
2020-07-14 10:13:27 +08:00
parent d1e1934239
commit b83b375945
9 changed files with 81 additions and 25 deletions

View File

@@ -53,7 +53,8 @@ export default {
watch: {
current(value) {
this.page = 0;
this.getOrderList({ reload: 'again' });
// again 重新请求列表 不然往列表里添加
value == 6 ? this.getAfterSaleList({ reload: 'again' }): this.getOrderList({ reload: 'again' });
},
},
onLoad(option) {
@@ -82,9 +83,6 @@ export default {
case 5:
type = 'state_noeval'; // 待评价
break;
case 6:
type = 40; // 售后
break;
default:
type = -1;
break;
@@ -92,7 +90,17 @@ export default {
const res = await this.$u.api.getOrderList({
page: this.page,
type: type,
refund_state: this.current == 6 ? '1' : 0, // 判断是不是售后列表
})
this.timer = true;
if(res.errCode == 0) {
if(reload) this.orderList = res.data;
else this.orderList.push(...res.data);
}
return res;
},
async getAfterSaleList({ reload = '' } = {}) {
const res = await this.$u.api.getAfterSaleList({
page: this.page,
})
this.timer = true;
if(res.errCode == 0) {
@@ -108,7 +116,10 @@ export default {
this.timer = false;
this.loadStatus.splice(this.current, 1, "loading");
this.page++;
this.getOrderList().then(res => {
let promise;
if(this.current == 6) promise = this.getAfterSaleList();
else promise = this.getOrderList();
promise.then(res => {
this.loadStatus.splice(this.current, 1, "nomore");
if(res.data.length == 0) this.page--;
}).catch(() => {