修复订单列表字段名兼容问题
This commit is contained in:
parent
6ce3b2da0e
commit
c68808cc0b
|
|
@ -57,13 +57,17 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
// 兼容驼峰和下划线命名
|
||||
const list = data.list || data.items || [];
|
||||
const totalPages = data.total_pages || data.totalPages || 1;
|
||||
|
||||
if (this.page === 1) {
|
||||
this.orderList = data.list;
|
||||
this.orderList = list;
|
||||
} else {
|
||||
this.orderList = [...this.orderList, ...data.list];
|
||||
this.orderList = [...this.orderList, ...list];
|
||||
}
|
||||
|
||||
this.totalPages = data.total_pages;
|
||||
this.totalPages = totalPages;
|
||||
this.hasMore = this.page < this.totalPages;
|
||||
} catch (error) {
|
||||
console.error('加载订单列表失败', error);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user