...
|
...
|
@@ -5,10 +5,6 @@ const initailData = () => ({ |
|
|
orderList: [], // 订单列表
|
|
|
// scroll 组件参数,是否触发上拉事件
|
|
|
pullUpLoad: true,
|
|
|
|
|
|
// 当前查询订单状态
|
|
|
currentStatus: null,
|
|
|
routeParamStatus: null,
|
|
|
isShowEmpty: false,
|
|
|
});
|
|
|
|
...
|
...
|
@@ -37,12 +33,6 @@ export default function() { |
|
|
);
|
|
|
state.isShowEmpty = state.orderList.length === 0;
|
|
|
},
|
|
|
setOrderStatus(state, currentStatus) {
|
|
|
state.currentStatus = +currentStatus;
|
|
|
},
|
|
|
setRouteParamStatus(state, status = 1) {
|
|
|
state.routeParamStatus = +status;
|
|
|
},
|
|
|
resetPartialData(state) {
|
|
|
state.page = 1;
|
|
|
state.orderList = [];
|
...
|
...
|
@@ -51,14 +41,10 @@ export default function() { |
|
|
},
|
|
|
resetData(state) {
|
|
|
const s = initailData();
|
|
|
const keyList = Object.keys(s);
|
|
|
const keyBlackList = ['currentStatus', 'routeParamStatus'];
|
|
|
|
|
|
for (const key of keyList) {
|
|
|
if (!keyBlackList.includes(key)) {
|
|
|
state[key] = s[key];
|
|
|
}
|
|
|
}
|
|
|
Object.keys(s).forEach(key => {
|
|
|
state[key] = s[key];
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
actions: {
|
...
|
...
|
@@ -74,14 +60,14 @@ export default function() { |
|
|
async fetchOrderList(
|
|
|
{
|
|
|
commit,
|
|
|
state: { page, currentStatus, routeParamStatus },
|
|
|
state: { page },
|
|
|
},
|
|
|
param = {},
|
|
|
) {
|
|
|
const { owner } = param;
|
|
|
const { owner, status } = param;
|
|
|
const res = await this.$api.get('/api/order/list', {
|
|
|
tabType: owner,
|
|
|
type: currentStatus || routeParamStatus || 1, // 1表示我的订单全部
|
|
|
type: status || 1, // 1表示我的订单全部
|
|
|
page,
|
|
|
});
|
|
|
|
...
|
...
|
|