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

const isProduction = import.meta.env.MODE === "production";

const router = createRouter({
  history: isProduction
    ? createWebHistory(import.meta.env.BASE_URL)
    : createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "首页",
      component: () => import("@/pages/Home/index.vue"),
    },
    {
      path: "/showroomCase",
      name: "展厅案例",
      component: () => import("@/pages/Gallery/showroomCase.vue"),
    },
    {
      path: "/showroomCaseDetail",
      name: "展厅案例明细",
      component: () => import("@/pages/Gallery/showroomCaseDetail.vue"),
    },
    {
      path: "/templateCase",
      name: "模板案例",
      component: () => import("@/pages/Template/templateCase.vue"),
    },
    {
      path: "/ArticleColumn",
      name: "文章栏目",
      component: () => import("@/pages/Article/ArticleColumn.vue"),
    },
    {
      path: "/personalCenter",
      name: "个人中心",
      component: () => import("@/pages/User/personalCenter.vue"),
    },
    {
      path: "/login",
      name: "登录",
      component: () => import("@/pages/User/login.vue"),
    },
    {
      path: "/register",
      name: "注册",
      component: () => import("@/pages/User/register.vue"),
    },
    {
      path: "/forget",
      name: "忘记密码",
      component: () => import("@/pages/User/forget.vue"),
    },
    {
      path: "/ArticleDetails",
      name: "新闻详情",
      component: () =>
        import("@/pages/Article/ArtideContent/ArticleDetails.vue"),
    },
    {
      path: "/ConfirmOrder",
      name: "ConfirmOrder",
      component: () => import("@/pages/Order/ConfirmOrder.vue"),
    },
    {
      path: "/PayOrder",
      name: "PayOrder",
      component: () => import("@/pages/Order/PayOrder.vue"),
    },
    {
      path: "/OrderSuccess",
      name: "OrderSuccess",
      component: () => import("@/pages/Order/OrderSuccess.vue"),
    },
  ],
});

export default router;
