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'
import helpTxt from '@/components/helpTxt/helpTxt'
import helpWangzhi from '@/components/helpWangzhi/helpWangzhi'
import popUp from '@/components/popUp/popUp'
import aboutUs from '@/components/aboutUs/aboutUs'
import conversion from '@/components/conversion/conversion'
import followUp from '@/components/followUp/followUp'
import setting from '@/components/setting/setting'
import helpWx from '@/components/helpWx/helpWx'
import home1 from '@/components/home/home1'
import conversionList from '@/components/conversionList/conversionList'
import conversionListDetails from '@/components/conversionListDetails/conversionListDetails'
import exchange from '@/components/exchange/exchange'
import authenticate from '@/components/authenticate/authenticate'
import scheme from '@/components/scheme/scheme'
import newScheme from '@/components/newScheme/newScheme'
import schemeDetails from '@/components/schemeDetails/schemeDetails'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/lianxiA',
      name: 'lianxiA',
      meta: {
        title: '测试2',
      },
      component: lianxiA
    },
    {
      path: '/lianxiB',
      name: 'lianxiB',
      meta: {
        title: '测试3',
      },
      component: lianxiB
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '首页',
        type: 'login',
        keepAlive: true,
        isBack: false, //动态使用keep-alive
      },
      component: home
    },
    {
      path: '/show',
      name: 'show',
      meta: {
        title: '识别',
        type: 'login',
        keepAlive: false, //不需要被缓存的组件
      },
      component: show
    },
    { name: 'lianxi',
      path: '/lianxi',
      meta: {
        title: '测试1',
        keepAlive: true, //缓存
        isBack: false, //判断是否为返回操作
      },
      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,
        isBack: false, //动态使用keep-alive
      },
      component: collect
    },
    {
      path: '/memory',
      name: 'memory',
      meta: {
        title: '识别记录',
        type: 'login',
        keepAlive: true,
        isBack: false, //动态使用keep-alive
      },
      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',
        keepAlive: true, //不需要被缓存的组件
      },
      component: help
    },
    {
      path: '/tourist',
      name: 'tourist',
      meta: {
        title: '游客识别',
        type: 'login',
      },
      component: tourist
    },
    {
      path: '/helpTxt',
      name: 'helpTxt',
      meta: {
        title: '关于我们',
        type: 'login',
      },
      component: helpTxt
    },
    {
      path: '/helpWangzhi',
      name: 'helpWangzhi',
      meta: {
        title: '关于我们',
        type: 'login',
      },
      component: helpWangzhi
    },
    {
      path: '/popUp',
      name: 'popUp',
      meta: {
        title: '病虫害弹框',
        type: 'login',
      },
      component: popUp
    },
    {
      path: '/aboutUs',
      name: 'aboutUs',
      meta: {
        title: '关于我们',
        type: 'login',
      },
      component: aboutUs
    },
    {
      path: '/conversion',
      name: 'conversion',
      meta: {
        title: '兑换奖品',
        type: 'login',
      },
      component: conversion
    },
    {
      path: '/followUp',
      name: 'followUp',
      meta: {
        title: '我的跟帖',
        type: 'login',
        keepAlive: true
      },
      component: followUp
    },
    {
      path: '/setting',
      name: 'setting',
      meta: {
        title: '设置',
        type: 'login',
      },
      component: setting
    },
    {
      path: '/helpWx',
      name: 'helpWx',
      meta: {
        title: '微信公众号',
        type: 'login',
      },
      component: helpWx
    },
    {
      path: '/home1',
      name: 'home1',
      meta: {
        title: '首页2',
        type: 'login',
      },
      component: home1
    },
    {
      path: '/conversionList',
      name: 'conversionList',
      meta: {
        title: '兑换列表',
        type: 'login',
        keepAlive: true,
        isBack: false, //动态使用keep-alive
      },
      component: conversionList
    },
    {
      path: '/conversionListDetails',
      name: 'conversionListDetails',
      meta: {
        title: '兑换详情',
        type: 'login',
      },
      component: conversionListDetails
    },
    {
      path: '/exchange',
      name: 'exchange',
      meta: {
        title: '交流',
        type: 'login',
        keepAlive: true, // 是否需要缓存
        isBack: false, //动态使用keep-alive
      },
      component: exchange
    },
    {
      path: '/authenticate',
      name: 'authenticate',
      meta: {
        title: '鉴定',
        type: 'login',
        keepAlive: true // 是否需要缓存
      },
      component: authenticate
    },
    {
      path: '/scheme',
      name: 'scheme',
      meta: {
        title: '方案',
        type: 'login',
        keepAlive: true, // 是否需要缓存
        isBack: false, //动态使用keep-alive
      },
      component: scheme
    },
    {
      path: '/newScheme',
      name: 'newScheme',
      meta: {
        title: '新建方案',
        type: 'login',
      },
      component: newScheme
    },
    {
      path: '/schemeDetails',
      name: 'schemeDetails',
      meta: {
        title: '方案详情',
        type: 'login',
      },
      component: schemeDetails
    },
  ],
})
