import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "*",
      redirect: "/",
    },
    {
      path: "/",
      name: "PageView",
      component: (resolve) => require(["@/view/PageView"], resolve),
      children: [
        {
          path: "/",
          redirect: "/home",
        },
        {
          path: "/home",
          name: "home",
          component: (resolve) => require(["@/view/HomePage"], resolve),
          meta: {
            title: "德木自动化｜首页",
          },
        },
        {
          path: "/software",
          name: "software",
          component: (resolve) => require(["@/view/Software"], resolve),
          meta: {
            title: "软件产品",
          },
          children: [
            {
              path: "/software",
              redirect: "/software/smartTown",
            },
            {
              path: "/software/smartTown",
              name: "software",
              component: (resolve) =>
                require(["@/view/Software_smartTown"], resolve),
              meta: {
                title: "德木自动化丨产品概览",
              },
            },
            {
              path: "/software/bigData",
              name: "software",
              component: (resolve) =>
                require(["@/view/Software_bigData"], resolve),
              meta: {
                title: "德木自动化丨大数据管理系统",
              },
            },
          ],
        },
        {
          path: "/service",
          name: "service",
          component: (resolve) => require(["@/view/Service"], resolve),
          meta: {
            title: "德木自动化｜生产数据",
          },
        },
        {
          path: "/newsinformation",
          name: "newsinformation",
          component: (resolve) => require(["@/view/NewsInformation"], resolve),
          meta: {
            title: "新闻动态",
          },
        },
        {
          path: "/companyintroduction",
          name: "companyintroduction",
          component: (resolve) =>
            require(["@/view/CompanyIntroduction"], resolve),
          meta: {
            title: "德木自动化｜关于德木",
          },
        },
        {
          path: "/jobchance",
          name: "jobchance",
          component: (resolve) => require(["@/view/JobChance"], resolve),
          meta: {
            title: "德木自动化丨产品概览",
          },
        },
        {
          path: "/contactus",
          name: "contactus",
          component: (resolve) => require(["@/view/ContactUs"], resolve),
          meta: {
            title: "联系我们",
          },
        },
        {
          path: "/servicedetail",
          name: "servicedetail",
          component: (resolve) => require(["@/view/ServiceDetail"], resolve),
          meta: {
            title: "相关服务",
          },
        },
      ],
    },
  ],
});
