import Vue from "vue";
import type { RouteConfig } from "vue-router";
import VueRouter from "vue-router";
import Home from "@pc/pages/home/home.vue";
import Recommend from "@pc/pages/recommend/recommend.vue";
import RealtimeNews from "@pc/pages/realtime-news/realtime-news.vue";
import ArticleDetail from "@pc/pages/article-detail/article-detail.vue";
import BasicLayout from "@pc/components/layout-basic/layout-basic.vue";
import UserLayout from "@pc/components/layout-user/layout-user.vue";
import UserPersonalCenter from "@pc/pages/user/user-personal-center.vue";
import UserAccountSetting from "@pc/pages/user/user-account-setting.vue";
import UserOrder from "@pc/pages/user/user-order.vue";
import Like from "@pc/pages/user/user-like.vue";
import Comment from "@pc/pages/user/user-comment.vue";
import Collection from "@pc/pages/user/user-collection.vue";
import History from "@pc/pages/user/user-history.vue";
import Subscription from "@pc/pages/user/user-subscription.vue";
import Login from "@pc/pages/auth/login.vue";
import ChangePass from "@pc/pages/auth/change-password.vue";
import ProfileComplete from "@pc/pages/auth/profile-complete.vue";
import ProductDetail from "@pc/pages/product/product-detail.vue";
import OrderDetail from "@pc/pages/product/order-detail.vue";
import SpecificArticle from "@pc/pages/specific-article/specific-article.vue";
import VipList from "@pc/pages/vip-list/vip-list.vue";
import Vip from "@pc/pages/vip/vip.vue";
import Search from "@pc/pages/search/search.vue";
import Aboutus from "@pc/pages/aboutus/aboutus.vue";
import Yssn from "@pc/pages/yssm/yssn.vue";
import Zfsm from "@pc/pages/zfsm/zfsm.vue";
import Publish from "@pc/pages/publish/publish.vue";
import yssn from "@pc/pages/yssm/yssn.vue";
import zfsm from "@pc/pages/zfsm/zfsm.vue";
import UploadPayPic from "@pc/pages/upload-pay-pic/upload-pay-pic.vue";

Vue.use(VueRouter);

export const routes: RouteConfig[] = [
  {
    path: "/",
    name: "root",
    redirect:'/home',
    // NOTE: you can also apply meta information
    // meta: {authRequired: false }
    component: BasicLayout,
    children: [
      { path: "/login", component: Login },
      { path: "/home", component: Home },
      { path: "/recommend", component: Recommend },
      { path: "/realtime-news", component: RealtimeNews },
      { path: "/change-pass", component: ChangePass },
      { path: "/profile-complete", component: ProfileComplete },
      { path: "/article-detail", component: ArticleDetail },
      { path: "/product-detail", component: ProductDetail },
      { path: "/order-detail", component: OrderDetail },
      { path: "/specific-article", component: SpecificArticle },
      { path: "/vip-list", component: VipList },
      { path: "/vip", component: Vip },
      { path: "/search", component: Search },
      { path: "/aboutus", component: Aboutus },
      { path: "/yssm", component: yssn },
      { path: "/zfsm", component: zfsm },
      { path: "/publish", component: Publish },
      { path: "/upload-pay-pic", component: UploadPayPic },
      {
        path: "/user",
        name: "user",
        // NOTE: you can also apply meta information
        // meta: {authRequired: false }
        component: UserLayout,
        children: [
          { path: "personal-center", component: UserPersonalCenter },
          { path: "account-setting", component: UserAccountSetting },
          { path: "order", component: UserOrder },
          { path: "collection", component: Collection },
          { path: "subscription", component: Subscription },
          { path: "like", component: Like },
          { path: "comment", component: Comment },
          { path: "history", component: History },
        ],
        // NOTE: you can also lazy-load the component
        // component: () => import("@pc/views/About.vue")
      },
    ],
    // NOTE: you can also lazy-load the component
    // component: () => import("@pc/views/About.vue")
  },

  {
    path: "/:path(.*)",
    name: "NotFound",
    // component: NotFound,
  },
];

const router = new VueRouter({
  base: "/",
  mode: "hash",
  routes,
});

export default router;
