...
|
...
|
@@ -11,19 +11,19 @@ export default function() { |
|
|
currentStatus: 1,
|
|
|
},
|
|
|
mutations: {
|
|
|
setOrderList(state, res = {}) {
|
|
|
let { page, pagetotal, data = [] } = res;
|
|
|
setOrderList(state, { fetchData, isStatusChange }) {
|
|
|
let { page, pagetotal, data = [] } = fetchData;
|
|
|
|
|
|
state.page = ++page;
|
|
|
state.pagetotal = pagetotal;
|
|
|
state.orderList = state.orderList.concat(data);
|
|
|
state.orderList = isStatusChange ? data : state.orderList.concat(data);
|
|
|
|
|
|
// 分页结束
|
|
|
if (page > pagetotal) {
|
|
|
state.pullUpLoad = false;
|
|
|
}
|
|
|
},
|
|
|
setOrderState(state, currentStatus) {
|
|
|
setOrderStatus(state, currentStatus) {
|
|
|
state.currentStatus = +currentStatus;
|
|
|
},
|
|
|
},
|
...
|
...
|
@@ -40,14 +40,15 @@ export default function() { |
|
|
async fetchOrderList(
|
|
|
{
|
|
|
commit,
|
|
|
state: { page },
|
|
|
state: { page, currentStatus },
|
|
|
},
|
|
|
{ owner, status = 1 } = {},
|
|
|
) {
|
|
|
const isStatusChange = currentStatus !== +status;
|
|
|
const res = await this.$api.get('/api/order/list', {
|
|
|
tabType: owner,
|
|
|
type: status,
|
|
|
page,
|
|
|
page: isStatusChange ? 1 : page,
|
|
|
limit: 5,
|
|
|
|
|
|
// Todo 删除
|
...
|
...
|
@@ -55,8 +56,8 @@ export default function() { |
|
|
});
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
commit('setOrderList', res.data);
|
|
|
commit('setOrderState', status);
|
|
|
commit('setOrderList', { fetchData: res.data, isStatusChange });
|
|
|
commit('setOrderStatus', status);
|
|
|
}
|
|
|
},
|
|
|
},
|
...
|
...
|
|