import Vue from 'vue'
import Router from 'vue-router'
import home from '@/components/home/home'
import show from '@/components/show/show'
import lianxi from '@/components/lianxi/lianxi'
import record from '@/components/record/record'
import seek from '@/components/seek/seek'
import seek_data from '@/components/seek_data/seek_data'
import login from '@/components/login/login'
import enroll from '@/components/enroll/enroll'
import collect from '@/components/collect/collect'
import memory from '@/components/memory/memory'
import mine from '@/components/mine/mine'
import modification from '@/components/modification/modification'
import repository from '@/components/repository/repository'
import details from '@/components/details/details'
import message from '@/components/message/message'
import addMeg from '@/components/addMeg/addMeg'
import megXq from '@/components/megXq/megXq'
import forget from '@/components/forget/forget'
import lianxiA from '@/components/lianxi/lianxiA'
import lianxiB from '@/components/lianxi/lianxiB'
import bottomNav from '@/components/bottomNav/bottomNav'
import questions from '@/components/questions/questions'
import questions_details from '@/components/questions_details/questions_details'
import fieldsShow from '@/components/fieldsShow/fieldsShow'
import field_details from '@/components/field_details/field_details'
import message_list from '@/components/message_list/message_list'
import addData from '@/components/addData/addData'
import addData_details from '@/components/addData_details/addData_details'
import person from '@/components/person/person'
import versions_updateHistory from '@/components/versions_updateHistory/versions_updateHistory'
import mapShow from '@/components/mapShow/mapShow'
import share from '@/components/share/share'
import help from '@/components/help/help'
import tourist from '@/components/tourist/tourist'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/lianxiA',
      name: 'lianxiA',
      component: lianxiA
    },
    {
      path: '/lianxiB',
      name: 'lianxiB',
      component: lianxiB
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '首页',
        type: 'login',
        keepAlive: true,
      },
      component: home
    },
    {
      path: '/show',
      name: 'show',
      meta: {
        title: '识别',
        type: 'login',
        keepAlive: false, //不需要被缓存的组件
      },
      component: show
    },
    { name: 'lianxi',
      path: '/lianxi',
      component: lianxi
    },
    {
      path: '/record',
      name: 'record',
      meta: {
        title: '昆虫病害档案',
        type: 'login',
        keepAlive: true, //不需要被缓存的组件
      },
      component: record
    },
    {
      path: '/seek',
      name: 'seek',
      meta: {
        title: '搜索',
        type: 'login',
      },
      component: seek
    },
    {
      path: '/seek_data',
      name: 'seek_data',
      meta: {
        title: '搜索结果',
        type: 'login',
        keepAlive: true
      },
      component: seek_data
    },
    {
      path: '/enroll',
      name: 'enroll',
      component: enroll
    },
    {
      path: '/forget',
      name: 'forget',
      component: forget
    },
    {
      path: '/collect',
      name: 'collect',
      meta: {
        title: '我的收藏',
        type: 'login',
        keepAlive: true
      },
      component: collect
    },
    {
      path: '/memory',
      name: 'memory',
      meta: {
        title: '识别记录',
        type: 'login',
        keepAlive: true
      },
      component: memory
    },
    {
      path: '/mine',
      name: 'mine',
      meta: {
        title: '我的资料',
        type: 'login',
      },
      component: mine
    },
    {
      path: '/modification',
      name: 'modification',
      meta: {
        title: '修改密码',
        type: 'login',
      },
      component: modification
    },
    {
      path: '/repository',
      name: 'repository',
      meta: {
        title: '知识库',
        type: 'login',
        keepAlive: true
      },
      component: repository,
    },
    {
      path: '/details',
      name: 'details',
      meta: {
        title: '知识库详情',
        type: 'login',
      },
      component: details
    },
    {
      path: '/message',
      name: 'message',
      meta: {
        title: '留言反馈',
        type: 'login',
        keepAlive: true
      },
      component: message
    },
    {
      path: '/addMeg',
      name: 'addMeg',
      meta: {
        title: '新增留言',
        type: 'login',
      },
      component: addMeg
    },
    {
      path: '/megXq',
      name: 'megXq',
      meta: {
        title: '留言详情',
        type: 'login',
      },
      component: megXq
    },
    {
      path: '/bottomNav',
      name: 'bottomNav',
      component: bottomNav
    },
    {
      path: '/questions',
      name: 'questions',
      meta: {
        title: '交流新建',
        type: 'login',
      },
      component: questions
    },
    {
      path: '/questions_details',
      name: 'questions_details',
      meta: {
        title: '交流详情',
        type: 'login',
      },
      component: questions_details
    },
    {
      path: '/fieldsShow',
      name: 'fieldsShow',
      meta: {
        title: '新建个人秀',
        type: 'login',
      },
      component: fieldsShow
    },
    {
      path: '/field_details',
      name: 'field_details',
      meta: {
        title: '个人秀详情',
        type: 'login',
      },
      component: field_details
    },
    {
      path: '/message_list',
      name: 'message_list',
      meta: {
        title: '消息提醒列表',
        type: 'login',
      },
      component: message_list
    },
    {
      path: '/addData',
      name: 'addData',
      meta: {
        title: '手动添加病虫害数据',
        type: 'login',
      },
      component: addData
    },
    {
      path: '/addData_details',
      name: 'addData_details',
      meta: {
        title: '手动添加病虫害数据',
        type: 'login',
      },
      component: addData_details
    },
    {
      path: '/person',
      name: 'person',
      meta: {
        title: '我的',
        type: 'login',
      },
      component: person
    },
    {
      path: '/versions_updateHistory',
      name: 'versions_updateHistory',
      meta: {
        title: '版本更新历史',
        type: 'login',
      },
      component: versions_updateHistory
    },
    {
      path: '/mapShow',
      name: 'mapShow',
      meta: {
        title: '附近',
        type: 'login',
      },
      component: mapShow
    },
    {
      path: '/share',
      name: 'share',
      meta: {
        title: '分享app',
        type: 'login',
      },
      component: share
    },
    {
      path: '/help',
      name: 'help',
      meta: {
        title: '软件说明',
        type: 'login',
      },
      component: help
    },
    {
      path: '/tourist',
      name: 'tourist',
      meta: {
        title: '游客识别',
        type: 'login',
      },
      component: tourist
    },
  ],
})
