...
|
...
|
@@ -37,7 +37,9 @@ export default function() { |
|
|
state.isShowEmpty = state.orderList.length === 0;
|
|
|
},
|
|
|
setOrderStatus(state, currentStatus) {
|
|
|
state.currentStatus = +currentStatus;
|
|
|
if (currentStatus) {
|
|
|
state.currentStatus = +currentStatus;
|
|
|
}
|
|
|
},
|
|
|
resetPartialData(state) {
|
|
|
state.page = 1;
|
...
|
...
|
@@ -46,10 +48,13 @@ export default function() { |
|
|
state.pullUpLoad = true;
|
|
|
},
|
|
|
resetData(state) {
|
|
|
console.log('------------------', state);
|
|
|
const s = initailData();
|
|
|
|
|
|
Object.keys(s).forEach(key => {
|
|
|
state[key] = s[key];
|
|
|
if (key !== 'currentStatus') {
|
|
|
state[key] = s[key];
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
},
|
...
|
...
|
@@ -66,20 +71,19 @@ export default function() { |
|
|
async fetchOrderList(
|
|
|
{
|
|
|
commit,
|
|
|
state: { page },
|
|
|
state: { page, currentStatus },
|
|
|
},
|
|
|
param = {},
|
|
|
) {
|
|
|
const { owner, status = 1 } = param;
|
|
|
const { owner, status } = param;
|
|
|
const res = await this.$api.get('/api/order/list', {
|
|
|
tabType: owner,
|
|
|
type: status,
|
|
|
type: status || currentStatus,
|
|
|
page,
|
|
|
});
|
|
|
|
|
|
if (res.code === 200) {
|
|
|
commit('setOrderList', res.data);
|
|
|
commit('setOrderStatus', status);
|
|
|
}
|
|
|
},
|
|
|
|
...
|
...
|
|