retrieve file
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user