index.js 769 Bytes
import { getOrderStatus } from 'constants/order-constants';

const routers = [
  // 订单列表
  // owner: {sell, buy} 订单来源
  // status: 订单状态 sellerOrderStatus | buyerOrderStatus
  {
    name: 'OrderList',
    path: '/xianyu/:owner/order/list/:status?',
    component: () => import('./order-list'),
    props({ params }) {
      let { owner, status } = params;

      status = getOrderStatus(owner, status);
      return {
        owner,
        status,
      };
    },
    beforeEnter: (to, from, next) => {
      next();
    },
  },

  // 出售订单列表
  // owner 默认为sell
  {
    name: 'InSaleOrderList',
    path: '/xianyu/in/sale/order/list/:code?',
    component: () => import('./in-sell-order-list'),
  },
];

export default routers;