import { createRouter, createWebHistory } from "vue-router";

const routes = [
  {
    path: "/",
    name: "home",
    component: () => import("@/views/home.vue"),
    meta: {
      title: "首页",
    },
  },
  {
    path: "/info",
    name: "info",
    component: () => import("@/views/info.vue"),
    meta: {
      title: "场馆资讯",
    },
  },

  {
    path: "/exhibition",
    name: "exhibition",
    component: () => import("@/views/exhibition.vue"),
    meta: {
      title: "展厅导览",
    },
  },

  {
    path: "/collect",
    name: "collect",
    component: () => import("@/views/collect.vue"),
    meta: {
      title: "馆藏精品",
    },
  },
  {
    path: "/survey",
    name: "survey",
    component: () => import("@/views/survey.vue"),
    meta: {
      title: "问卷调查",
    },
  },
  {
    path: "/feedback",
    name: "feedback",
    component: () => import("@/views/feedback.vue"),
    meta: {
      title: "留言反馈",
    },
  },
  {
    path: "/info-detail/:id",
    name: "infoDetail",
    component: () => import("@/views/info-detail.vue"),
    meta: {
      title: "",
    },
  },
  {
    path: "/exhibition-detail/:id",
    name: "exhibitionDetail",
    component: () => import("@/views/exhibition-detail.vue"),
    meta: {
      title: "",
    },
  },
  {
    path: "/collect-detail/:id",
    name: "collectDetail",
    component: () => import("@/views/collect-detail.vue"),
    meta: {
      title: "",
    },
  },
  {
    path: "/survey-detail/:id",
    name: "surveyDetail",
    component: () => import("@/views/survey-detail.vue"),
    meta: {
      title: "",
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404.vue"),
  },
  {
    path: "/:pathMatch(.*)",
    redirect: "/404",
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
