// 普通路由
export const defaultRoutes = [
  {
    path: '/redirect',
    component: 'Layout',
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: '/redirect/index'
      }
    ]
  },
  {
    path: '/login',
    component: '/login/index',
    hidden: true
  },
  {
    path: '/1',
    component: '/dataScreen/pc',
    hidden: true
  },
  {
    path: '/2',
    component: '/dataScreen/h5',
    hidden: true
  },
  {
    path: '/404',
    component: '/error-page/404',
    hidden: true
  },
  {
    path: '/401',
    component: '/error-page/401',
    hidden: true
  },
  {
    path: '/',
    component: 'Layout',
    redirect: '/home',
    children: [
      {
        path: 'home',
        component: '/home/home',
        name: '',
        meta: { title: '首页', icon: 'home', affix: true }
      }
    ]
  }
]

// 开发者路由
export const developerRoutes = [
  {
    path: '/developer',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'developer',
    meta: {
      title: '开发者管理',
      icon: 'backstage'
    },
    children: [
      {
        path: 'recovery',
        component: '/developer/recovery',
        name: 'developerRecovery',
        meta: {
          title: '数据恢复',
          noCache: true
        }
      }
    ]
  }
]

// 权限路由
export const asyncRoutes = [
  {
    path: '/team',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'teamSet',
    meta: {
      title: '代理管理',
      icon: 'team',
      noCache: true
    },
    children: [
      {
        path: 'member',
        component: '/team/member',
        name: 'team_member',
        meta: {
          title: '代理列表',
          noCache: false,
          authList: [{
            name: '修改密码',
            value: 0
          }, {
            name: '重置密码',
            value: 1
          }, {
            name: '删除代理',
            value: 2
          }, {
            name: '禁用/启用账号',
            value: 3
          }, {
            name: '代理升降级',
            value: 4
          }, {
            name: '选择站区',
            value: 5
          },
          {
            name: '团队升级人数',
            value: 6
          }],
          buttonAuthList: []
        }
      },
      {
        path: 'examine',
        component: '/team/examine',
        name: 'team_axamine',
        meta: {
          title: '审核管理',
          noCache: true,
          authList: [
            {
              name: '邀请人审核',
              value: 0
            },
            {
              name: '上级审核',
              value: 1
            },
            {
              name: '邀请人再次审核',
              value: 2
            },
            {
              name: '上级再次审核',
              value: 3
            }
          ],
          buttonAuthList: []
        }
      },
      {
        path: 'authorization',
        component: '/team/authorization',
        name: 'team_authorization',
        meta: {
          title: '代理授权',
          noCache: true
        }
      },
      {
        path: 'upgrade',
        component: '/team/upgrade',
        name: 'team_upgrade',
        meta: {
          title: '升级审核',
          noCache: true
        }
      },
      {
        path: 'demote',
        component: '/team/demote',
        name: 'teamDemote',
        meta: {
          title: '降级审核',
          noCache: true
        }
      },
      {
        path: 'zhengwei',
        component: '/team/zhengwei',
        name: 'teamZhengWei',
        meta: {
          title: '政委审核',
          noCache: true
        }
      },
      {
        path: 'question',
        component: '/team/question',
        name: 'team_question',
        meta: {
          title: '代理反馈',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/goods',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'goodsSet',
    meta: {
      title: '商品管理',
      icon: 'goods'
    },
    children: [
      {
        path: 'list',
        component: '/goods/list',
        name: 'goods_list',
        meta: {
          title: '商品列表',
          noCache: true
        }
      },
      {
        path: 'add',
        component: '/goods/add',
        name: 'goods_add',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '添加商品',
          noCache: true
        }
      },
      {
        path: 'edit/:id',
        component: '/goods/edit',
        name: 'goods_edit',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '修改商品',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/order',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'orderSet',
    meta: { title: '订单管理', icon: 'order' },
    children: [
      {
        path: 'list',
        component: '/order/list',
        name: 'order_list',
        meta: {
          title: '总订单列表',
          authList: [
            {
              name: '客服审核',
              value: 0
            },
            {
              name: '财务审核',
              value: 1
            },
            {
              name: '物流审核',
              value: 2
            },
            {
              name: '合并订单',
              value: 3
            }
          ],
          buttonAuthList: []
        }
      },
      // {
      //   path: 'change',
      //   component: '/order/change',
      //   name: 'order_change',
      //   meta: {
      //     title: '转单列表',
      //     noCache: true
      //   }
      // },
      // {
      //   path: 'next',
      //   component: '/order/next',
      //   name: 'order_next',
      //   meta: {
      //     title: '公司待发',
      //     noCache: true
      //   }
      // },
      {
        path: 'addOrder',
        component: '/order/addOrder',
        name: 'order_add',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '代下单',
          noCache: true
        }
      },
      {
        path: 'store',
        component: '/order/store',
        name: 'order_store',
        meta: {
          title: '体验店订单',
          noCache: true
        }
      },
      {
        path: 'merge',
        component: '/order/merge',
        name: 'MergeOrder',
        meta: {
          title: '合并订单',
          noCache: true
        }
      },
      {
        path: 'no_pay',
        component: '/order/noPay',
        name: 'orderNoPay',
        meta: {
          title: '未支付管理',
          noCache: true
        }
      },
      // {
      //   path: 'copyOrder',
      //   component: '/order/copyOrder',
      //   name: 'order_copy',
      //   hidden: true,
      //   hiddenButNeed: true,
      //   meta: {
      //     title: '复制订单',
      //     noCache: true
      //   }
      // },
      {
        path: 'examine/:order',
        component: '/order/examine',
        name: 'order_examine',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '订单审核',
          noCache: false,
          linkRouter: '/order/list'
        }
      }
    ]
  },
  // {
  //   path: '/product',
  //   component: 'Layout',
  //   redirect: 'noRedirect',
  //   name: 'product',
  //   meta: {
  //     title: '产品详情',
  //     icon: 'goods'
  //   },
  //   children: [
  //     {
  //       path: 'list',
  //       component: '/product/list',
  //       name: 'productList',
  //       meta: {
  //         title: '产品详情',
  //         noCache: true
  //       }
  //     }
  //   ]
  // },
  {
    path: '/returns',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'returns',
    meta: {
      title: '退换货管理',
      icon: 'data'
    },
    children: [
      {
        path: 'agent_change',
        component: '/returns/agent_change',
        name: 'ReturnsAgentChange',
        meta: {
          title: '代理换货',
          noCache: true
        }
      },
      {
        path: 'agent_return',
        component: '/returns/agent_return',
        name: 'ReturnsAgentReturn',
        meta: {
          title: '代理退货',
          noCache: true
        }
      },
      {
        path: 'user_change',
        component: '/returns/user_change',
        name: 'ReturnUserChange',
        meta: {
          title: '客户换货',
          noCache: true
        }
      },
      {
        path: 'user_return',
        component: '/returns/user_return',
        name: 'ReturnUserReturn',
        meta: {
          title: '客户退货',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/data',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'richSet',
    meta: {
      title: '数据统计',
      icon: 'data'
    },
    children: [
      {
        path: 'order',
        component: '/data/order',
        name: 'data_order',
        meta: {
          title: '订单排名',
          noCache: true
        }
      },
      {
        path: 'order_report',
        component: '/data/order_report',
        name: 'data_order_report',
        meta: {
          title: '订单报表',
          noCache: true
        }
      },
      {
        path: 'visual',
        component: '/data/visual',
        name: 'DataVisual',
        meta: {
          title: '实时数据',
          noCache: true
        }
      },
      {
        path: 'previous',
        component: '/data/previous',
        name: 'DataPrevious',
        meta: {
          title: '历届活动',
          noCache: true
        }
      }
      // {
      //   path: 'deal',
      //   component: '/data/deal',
      //   name: 'data_deal',
      //   meta: {
      //     title: '交易数据',
      //     noCache: true
      //   }
      // },
      // {
      //   path: 'next',
      //   component: '/data/next',
      //   name: 'data_next',
      //   meta: {
      //     title: '销售统计',
      //     noCache: true
      //   }
      // },
      // {
      //   path: 'rank',
      //   component: '/data/rank',
      //   name: 'data_rank',
      //   meta: {
      //     title: '排行榜',
      //     noCache: true
      //   }
      // },
      // {
      //   path: 'tshirt',
      //   component: '/data/tshirt',
      //   name: 'Tshirt',
      //   meta: {
      //     title: 'T恤',
      //     noCache: true
      //   }
      // }
    ]
  },
  // {
  //   path: '/tshirt',
  //   component: 'Layout',
  //   redirect: 'noRedirect',
  //   name: 'richSet',
  //   meta: {
  //     title: 'T恤',
  //     icon: 'data'
  //   },
  //   children: [
  //     {
  //       path: 'tshirt',
  //       component: '/data/tshirt',
  //       name: 'Tshirt',
  //       meta: {
  //         title: 'T恤',
  //         noCache: true
  //       }
  //     }
  //   ]
  // },
  {
    path: '/finance',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'finance',
    meta: {
      title: '财务管理',
      icon: 'finance'
    },
    children: [
      {
        path: 'recharge',
        component: '/finance/recharge',
        name: 'finance_recharge',
        meta: {
          title: '资金账户',
          noCache: true
        }
      },
      {
        path: 'refund',
        component: '/finance/refund',
        name: 'finance_refund',
        meta: {
          title: '退款确认',
          noCache: true
        }
      },
      {
        path: 'pay_detail',
        component: '/finance/payDetail',
        name: 'finance_payDeatil',
        meta: {
          title: '收支明细',
          noCache: true
        }
      },
      {
        path: 'flow',
        component: '/finance/flow',
        name: 'finance_flow',
        meta: {
          title: '流水账单',
          noCache: true
        }
      },
      {
        path: 'reward',
        component: '/finance/reward',
        name: 'finance_reward',
        meta: {
          title: '奖励支出',
          noCache: true
        }
      },
      {
        path: 'memberSaleAward',
        component: '/finance/memberSaleAward',
        name: 'finance_memberSaleAward',
        meta: {
          title: '代理业绩结算',
          noCache: true
        }
      },
      {
        path: 'shopSaleAward',
        component: '/finance/shopSaleAward',
        name: 'finance_shopSaleAward',
        meta: {
          title: '门店业绩结算',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/stock',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'stockSet',
    meta: {
      title: '库存管理',
      icon: 'goods'
    },
    children: [
      {
        path: 'goods',
        component: '/stock/goods',
        name: 'stock_goods',
        meta: {
          title: '公司库存',
          noCache: true
        }
      },
      {
        path: 'crown',
        component: '/stock/crown',
        name: 'stock_crown',
        meta: {
          title: '老大库存',
          noCache: true
        }
      },
      {
        path: 'statistics',
        component: '/stock/statistics',
        name: 'stock_statistics',
        meta: {
          title: '库存统计',
          noCache: true
        }
      },
      {
        path: 'remind',
        component: '/stock/remind',
        name: 'stock_remind',
        meta: {
          title: '库存提醒',
          noCache: true
        }
      }
    ]
  },
  // {
  //   path: '/giftB',
  //   component: 'Layout',
  //   redirect: 'noRedirect',
  //   name: 'giftB',
  //   meta: {
  //     title: 'B大礼包名单',
  //     icon: 'gift'
  //   },
  //   children: [
  //     {
  //       path: 'index',
  //       component: '/giftB/index',
  //       name: 'giftB_index',
  //       meta: {
  //         title: 'B大礼包名单',
  //         noCache: true
  //       }
  //     }
  //   ]
  // },
  // {
  //   path: '/honorWall',
  //   component: 'Layout',
  //   redirect: 'noRedirect',
  //   name: 'honorWall',
  //   meta: {
  //     title: '荣誉墙名单',
  //     icon: 'honor'
  //   },
  //   children: [
  //     {
  //       path: 'index',
  //       component: '/honorWall/index',
  //       name: 'honorWall_index',
  //       meta: {
  //         title: '荣誉墙名单',
  //         noCache: true
  //       }
  //     }
  //   ]
  // },
  // {
  //   path: '/exportExpress',
  //   component: 'Layout',
  //   redirect: 'noRedirect',
  //   name: 'ExportExpress',
  //   meta: {
  //     title: '快递单管理',
  //     icon: 'gift'
  //   },
  //   children: [
  //     {
  //       path: 'index',
  //       component: '/ExportExpress/index',
  //       name: 'ExportExpressIndex',
  //       meta: {
  //         title: '导出快递单',
  //         noCache: true
  //       }
  //     }
  //   ]
  // },
  {
    path: '/activity',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'activitySet',
    meta: {
      title: '活动管理',
      icon: 'activity'
    },
    children: [
      // {
      //   path: 'match',
      //   component: '/activity/match',
      //   name: 'activity_match',
      //   meta: {
      //     title: '争霸赛',
      //     noCache: true
      //   }
      // },
      // {
      //   path: 'train',
      //   component: '/activity/train',
      //   name: 'activity_train',
      //   meta: {
      //     title: '密训营',
      //     noCache: true
      //   }
      // },
      // {
      //   path: 'underline',
      //   component: '/activity/underline',
      //   name: 'activity_underline',
      //   meta: {
      //     title: '线下沙龙',
      //     noCache: true
      //   }
      // },
      {
        path: 'list',
        component: '/activity/list',
        name: 'activity_list',
        meta: {
          title: '活动列表',
          noCache: true
        }
      },
      {
        path: 'tutorial',
        component: '/activity/tutorial',
        name: 'activity_tutorial',
        meta: {
          title: '教程管理',
          noCache: true
        }
      },
      {
        path: 'giftB',
        component: '/giftB/index',
        name: 'giftBIndex',
        meta: {
          title: 'B大礼包名单',
          noCache: true
        }
      },
      {
        path: 'honorWall',
        component: '/honorWall/index',
        name: 'honorWallIndex',
        meta: {
          title: '荣誉墙名单',
          noCache: true
        }
      },
      {
        path: 'travel',
        component: '/travel/index',
        name: 'travelIndex',
        meta: {
          title: '旅游',
          noCache: true
        }
      },
      {
        path: 'tshirt',
        component: '/data/tshirt',
        name: 'dataTshirt',
        meta: {
          title: 'T恤',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/staff',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'staff',
    meta: {
      title: '政委管理',
      icon: 'activity'
    },
    children: [
      {
        path: 'list',
        component: '/staff/list',
        name: 'staffList',
        meta: {
          title: '政委列表',
          noCache: true
        }
      },
      {
        path: 'station',
        component: '/staff/station',
        name: 'staffStation',
        meta: {
          title: '战区管理',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/studio',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'studio',
    meta: {
      title: '工作室管理',
      icon: 'community'
    },
    children: [
      {
        path: 'list',
        component: '/studio/index',
        name: 'studioList',
        meta: {
          title: '工作室列表',
          noCache: true
        }
      },
      {
        path: 'order',
        component: '/studio/order',
        name: 'studioOrder',
        meta: {
          title: '工作室订单',
          noCache: true,
          authList: [
            {
              name: '客服审核',
              value: 0
            },
            {
              name: '财务审核',
              value: 1
            },
            {
              name: '物流审核',
              value: 2
            }
            // {
            //   name: '作废订单',
            //   value: -1
            // },
            // {
            //   name: '合并订单',
            //   value: 3
            // }
          ],
          buttonAuthList: []
        }
      },
      {
        path: 'good',
        component: '/studio/good',
        name: 'studioGood',
        meta: {
          title: '工作室商品',
          noCache: true
        }
      },
      {
        path: 'good_add',
        component: '/studio/good_add',
        name: 'studioGoodAdd',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '添加工作室商品',
          noCache: true
        }
      },
      {
        path: 'good_edit/:id',
        component: '/studio/good_edit',
        name: 'studioGoodEdit',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '修改工作室商品',
          noCache: true
        }
      },
      {
        path: 'order_detail/:id',
        component: '/studio/order_detail',
        name: 'studioOrderDetail',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '工作室订单详情',
          noCache: true
        }
      },
      {
        path: 'time',
        component: '/studio/time',
        name: 'studioTime',
        meta: {
          title: '工作室设置',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/shop',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'shop',
    meta: {
      title: '店铺管理',
      icon: 'community'
    },
    children: [
      {
        path: 'list',
        component: '/shop/index',
        name: 'shopIndex',
        meta: {
          title: '店铺列表',
          noCache: true
        }
      }
      // {
      //   path: 'reward',
      //   component: '/shop/reward',
      //   name: 'shopReward',
      //   meta: {
      //     title: '奖励设置',
      //     noCache: true
      //   }
      // },
      // {
      //   path: 'exchange',
      //   component: '/shop/exchange',
      //   name: 'shopExchange',
      //   meta: {
      //     title: '兑换管理',
      //     noCache: true
      //   }
      // }
    ]
  },
  {
    path: '/rtp',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'productRtp',
    meta: {
      title: '防伪追溯',
      icon: 'community'
    },
    children: [
      {
        path: 'index',
        component: '/rtp/index',
        name: 'productRtpIndex',
        meta: {
          title: '防伪追溯',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/login_time',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'LoginTime',
    meta: {
      title: '登录记录',
      icon: 'community'
    },
    children: [
      {
        path: 'index',
        component: '/loginTime/index',
        name: 'LoginTimeIndex',
        meta: {
          title: '登录记录',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/community',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'communitySet',
    meta: {
      title: '社区运营',
      icon: 'community'
    },
    children: [
      {
        path: 'list',
        component: '/community/list',
        name: 'community_list',
        meta: {
          title: '文章列表',
          noCache: true
        }
      },
      {
        path: 'add',
        component: '/community/add',
        name: 'community_add',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '添加文章',
          noCache: true
        }
      },
      {
        path: 'edit/:id',
        component: '/community/edit',
        name: 'community_edit',
        hidden: true,
        hiddenButNeed: true,
        meta: {
          title: '修改文章',
          noCache: true
        }
      },
      {
        path: 'live',
        component: '/community/live',
        name: 'community_live',
        meta: {
          title: '直播管理',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/message',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'message',
    meta: {
      title: '消息管理',
      icon: 'message'
    },
    children: [
      {
        path: 'index',
        component: '/message/index',
        name: 'message_index',
        meta: {
          title: '消息公告',
          noCache: true
        }
      },
      {
        path: 'push',
        component: '/message/push',
        name: 'message_push',
        meta: {
          title: '消息推送',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/picture',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'picture',
    meta: {
      title: '图库管理',
      icon: 'picture'
    },
    children: [
      {
        path: 'banner',
        component: '/picture/banner',
        name: 'picture_banner',
        meta: {
          title: '轮播图',
          noCache: true
        }
      },
      {
        path: 'goods',
        component: '/picture/goods',
        name: 'picture_goods',
        meta: {
          title: '商品图库',
          noCache: true
        }
      },
      {
        path: 'community',
        component: '/picture/community',
        name: 'picture_community',
        meta: {
          title: '社区图库',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/system',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'message',
    meta: {
      title: '系统设置',
      icon: 'message'
    },
    children: [
      {
        path: 'index',
        component: '/system/index',
        name: 'system_index',
        meta: {
          title: '设置首页',
          noCache: true
        }
      },
      {
        path: 'version',
        component: '/system/version',
        name: 'system_version',
        meta: {
          title: '版本管理',
          noCache: true
        }
      }
    ]
  },
  {
    path: '/backstage',
    component: 'Layout',
    redirect: 'noRedirect',
    name: 'backstageSet',
    meta: {
      title: '后台管理',
      icon: 'backstage'
    },
    children: [
      {
        path: 'account',
        component: '/backstage/account',
        name: 'backstage_account',
        meta: {
          title: '账号管理',
          noCache: true
        }
      },
      {
        path: 'role',
        component: '/backstage/role',
        name: 'backstage_role',
        meta: {
          title: '角色管理',
          noCache: true
        }
      },
      // {
      //   path: 'roleCopy',
      //   component: '/backstage/roleCopy',
      //   name: 'backstage_roleCopy',
      //   meta: {
      //     title: '测试角色',
      //     noCache: true
      //   }
      // },
      {
        path: 'log',
        component: '/backstage/log',
        name: 'backstage_log',
        meta: {
          title: '操作日志',
          noCache: true
        }
      },
      {
        path: 'dictionary',
        component: '/backstage/dictionary',
        name: 'backstage_dictionary',
        meta: {
          title: '字典设置',
          noCache: true
        }
      }
    ]
  },
  { path: '*', redirect: '/404', hidden: true }
]
