import Vue from "vue";
import type { RouteConfig } from "vue-router";
import VueRouter from "vue-router";
import Home from "@h5/pages/home/home.vue";
import Recommend from "@h5/pages/recommend/recommend.vue";
import Hot from "@h5/pages/hot/hot.vue";
import RealtimeNews from "@h5/pages/realtime-news/realtime-news.vue";
import ArticleDetail from "@h5/pages/article-detail/article-detail.vue";
import ArticleComment from "@h5/pages/article-detail/comment.vue";
import BasicLayout from "@h5/components/layout-basic/layout-basic.vue";
import UserLayout from "@h5/components/layout-user/layout-user.vue";
import UserPersonalCenter from "@h5/pages/user/user-personal-center.vue";
import UserAccountSetting from "@h5/pages/user/user-account-setting.vue";
import UserOrder from "@h5/pages/user/user-order.vue";
import Like from "@h5/pages/user/user-like.vue";
import Comment from "@h5/pages/user/user-comment.vue";
import Collection from "@h5/pages/user/user-collection.vue";
import History from "@h5/pages/user/user-history.vue";
import Subscription from "@h5/pages/user/user-subscription.vue";
import Login from "@h5/pages/auth/login.vue";
import Register from "@h5/pages/auth/register.vue";
import ChangePass from "@h5/pages/auth/change-password.vue";
import ProfileComplete from "@h5/pages/auth/profile-complete.vue";
import ProductDetail from "@h5/pages/product/product-detail.vue";
import OrderDetail from "@h5/pages/product/order-detail.vue";
import OrderConfirm from "@h5/pages/product/order-confirm.vue";
import SpecificArticle from "@h5/pages/specific-article/specific-article.vue";
import Vip from "@h5/pages/vip/vip.vue";
import VipIndex from "@h5/pages/vip/vip-index.vue";
import Search from "@h5/pages/search/search.vue";
import Aboutus from "@h5/pages/aboutus/aboutus.vue";
import Publish from "@h5/pages/publish/publish.vue";
import OpenVip from "@h5/pages/open-vip/open-vip.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: "/home", component: Home },
      { path: "/open-vip", component: OpenVip },





      { path: "/specific-article", component: SpecificArticle },

      { path: "/search", component: Search },
      { path: "/aboutus", component: Aboutus },
      { path: "/publish", component: Publish },
      {
        path: "/user",
        name: "user",
        // NOTE: you can also apply meta information
        // meta: {authRequired: false }
        component: UserLayout,
        children: [
          { path: "personal-center", component: UserPersonalCenter },



        ],

      },

    ],

  },
  { path: "/user/collection", component: Collection },
  { path: "/user/subscription", component: Subscription },
  { path: "/user/like", component: Like },
  { path: "/user/comment", component: Comment },
  { path: "/user/history", component: History },
  { path: "/user/account-setting", component: UserAccountSetting },
  { path: "/user/order", component: UserOrder },
  { path: "/profile-complete", component: ProfileComplete },
  { path: "/vip", component: Vip },
  { path: "/vip-index", component: VipIndex },
  { path: "/recommend", component: Recommend },
  { path: "/hot", component: Hot },
  { path: "/realtime-news", component: RealtimeNews },
  { path: "/change-pass", component: ChangePass },
  { path: "/login", component: Login },
  { path: "/register", component: Register },
  { path: "/article-detail", component: ArticleDetail },
  { path: "/article-comment", component: ArticleComment },
  { path: "/product-detail", component: ProductDetail },
  { path: "/order-detail", component: OrderDetail },
  { path: "/order-confirm", component: OrderConfirm },

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

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

export default router;
