import Vue from "vue";
import Router from "vue-router";
import Layout from "../layout/index";

Vue.use(Router);

export const constantRouterMap = [
  {
    path: "/largeScreen/index",
    component: () => import("@/views/largeScreen/index"),
    hidden: true
  },
  {
    path: "/login",
    meta: { title: "登录", noCache: true },
    component: resolve => require(["@/views/login"], resolve),
    hidden: true
  },
  {
    path: "/404",
    component: resolve => require(["@/views/features/404"], resolve),
    hidden: true
  },
  {
    path: "/401",
    component: resolve => require(["@/views/features/401"], resolve),
    hidden: true
  },
  {
    path: "/redirect",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "/redirect/:path*",
        component: resolve => require(["@/views/features/redirect"], resolve)
      }
    ]
  },
  {
    path: "/",
    component: Layout,
    children: [
      {
        path: "",
        component: resolve => require(["@/views/home"], resolve),
        name: "首页",
        meta: { title: "首页", icon: "index", affix: true, noCache: true }
      }
    ]
  },
  // 直播视频管理
  {
    path: "/liveBroadcast",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "liveBroadcastCreate",
        component: () => import("@/views/liveBroadcast/list/components/create"),
        name: "直播管理运营管理详情",
        meta: { title: "直播管理运营管理详情" }
      },
      {
        path: "liveBroadcastBatchCreate",
        component: () =>
          import("@/views/liveBroadcast/list/components/batchCreate"),
        name: "批量创建直播",
        meta: { title: "批量创建直播" }
      },
      {
        path: "liveDetail",
        component: () => import("@/views/liveBroadcast/liveDetail/index"),
        name: "直播详情",
        meta: { title: "直播详情" }
      },
      {
        path: "data",
        component: () => import("@/views/liveBroadcast/marketing/data"),
        name: "直播数据",
        meta: { title: "直播数据" }
      },
      {
        path: "liveBroadcastDetail",
        component: () =>
          import("@/views/liveBroadcast/manage/components/detail"),
        name: "直播单场分析",
        meta: { title: "直播单场分析" }
      },
      {
        path: "marketing",
        component: () =>
          import("@/views/liveBroadcast/manage/components/marketing"),
        name: "营销单场分析",
        meta: { title: "营销单场分析" }
      }
    ]
  },
  // 合集
  {
    path: "/serial",
    component: Layout,
    hidden: true,
    redirect: "noredirect",
    children: [
      {
        path: "detail/:id",
        component: () => import("@/views/serial/detail/index.vue"),
        name: "合集详情",
        meta: { title: "合集详情" }
      }
    ]
  },
  {
    path: "/course",
    component: Layout,
    hidden: true,
    redirect: "noredirect",
    children: [
      {
        path: "detail/:id",
        component: () => import("@/views/course/detail/index"),
        name: "课程详情",
        meta: { title: "课程详情" }
      }
    ]
  },
  {
    path: "/user",
    component: Layout,
    hidden: true,
    children: [
      {
        path: "center",
        component: resolve => require(["@/views/system/user/center"], resolve),
        name: "个人中心",
        meta: { title: "个人中心" }
      }
    ]
  },
  {
    path: "/circle",
    component: Layout,
    hidden: true,
    name: "圈子管理",
    children: [
      // {
      //   path: "indexYy",
      //   component: () => import("@/views/circle/list/indexYy"),
      //   name: "圈子列表(运营)",
      //   meta: { title: "圈子列表(运营)" }
      // },
      // {
      //   path: "indexTg",
      //   component: () => import("@/views/circle/list/indexTg"),
      //   name: "圈子列表(投顾)",
      //   meta: { title: "圈子列表(投顾)" }
      // },
      // {
      //   path: "indexYx",
      //   component: () => import("@/views/circle/list/indexYx"),
      //   name: "圈子列表(营销)",
      //   meta: { title: "圈子列表(营销)" }
      // },
      // {
      //   path: "indexZj",
      //   component: () => import("@/views/circle/list/indexZj"),
      //   name: "圈子列表(助教)",
      //   meta: { title: "圈子列表(助教)" }
      // },
      {
        path: "detail",
        component: () => import("@/views/circle/detail/index"),
        name: "圈子详情",
        meta: { title: "圈子详情" }
      },
      {
        path: "data",
        component: () => import("@/views/circle/data/index"),
        name: "圈子数据",
        meta: { title: "圈子数据" }
      }
    ]
  }
];

export default new Router({
  // mode: 'hash',
  // mode: "history",
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
});
