Authored by baoss

修复订单列表跳转后点击其他tab后跳转错乱问题

... ... @@ -48,6 +48,11 @@ export default {
return this.currentStatus || this.routeParamStatus;
}
},
activated() {
let {status} = this.$route.params || this.statusList[0].value
this.setOrderStatus(status)
},
methods: {
...mapMutations(["setOrderStatus", "resetPartialData"]),
...mapActions(["fetchOrderList"]),
... ...
... ... @@ -95,8 +95,10 @@ export default {
// 获取订单数据
asyncData({ store, router }) {
const { status } = router.params;
const { owner, status } = router.params;
store.commit(`${STORE_PATH}/resetData`);
store.commit(`${STORE_PATH}/setOrderStatus`, status);
store.commit(`${STORE_PATH}/setRouteParamStatus`, status);
return store.dispatch(`${STORE_PATH}/fetchOrderList`, router.params);
},
... ...
... ... @@ -85,7 +85,7 @@ export default function() {
const { owner } = param;
const res = await this.$api.get('/api/order/list', {
tabType: owner,
type: currentStatus || routeParamStatus,
type: currentStatus || routeParamStatus || 1, // 1表示我的订单全部
page,
});
... ...