import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login'
import home from '@/components/home/home'
import examine from '@/components/examine/examine'
import newmessage from '@/components/newmessage/newmessage'
import knowmore from '@/components/knowmore/knowmore'
import system from "@/components/system/system"
import Site from "@/components/Site/Site"
import crop from "@/components/crop/crop"
import discern from "@/components/discern/discern"
import person from "@/components/person/person"
import secondstep from "@/components/secondstep/secondstep"
import injuriousInsect from '@/components/injuriousInsect/injuriousInsect'
import knowledge from '@/components/knowledge/knowledge'
import disease from '@/components/disease/disease'
import pathology from '@/components/pathology/pathology'
import provinceList from '@/components/provinceList/provinceList'
import cityList from '@/components/cityList/cityList'
import particulars from '@/components/particulars/particulars'
import cropType from '@/components/cropType/cropType'
import cNumber from '@/components/cNumber/cNumber'
import county from '@/components/county/county'
import countryside from '@/components/countryside/countryside'
import entering from '@/components/entering/entering'
import insect from '@/components/insect/insect'
import caste from '@/components/caste/caste'
import kunName from '@/components/kunName/kunName'
import shengList from '@/components/shengList/shengList'
import shiList from '@/components/shiList/shiList'
import xianList from '@/components/xianList/xianList'
import insectType from '@/components/insectType/insectType'
import bottomNav from '@/components/bottomNav/bottomNav'
import amplification from '@/components/amplification/amplification'
import goTop from '@/components/goTop/goTop'
import help from '@/components/help/help'
import feedback from '@/components/feedback/feedback'
import feedback_list from '@/components/feedback_list/feedback_list'
import record from '@/components/record/record'
import details from '@/components/details/details'
import library from '@/components/library/library'
import inventory from '@/components/inventory/inventory'
import upload_pictures from '@/components/upload_pictures/upload_pictures'
import statistics from '@/components/statistics/statistics'
import addData from '@/components/addData/addData'
import updateHistory from '@/components/updateHistory/updateHistory'
import screen_plant from '@/components/screen_plant/screen_plant'
import plantset from '@/components/plantset/plantset'
import insectset from '@/components/insectset/insectset'
import plantinsectset from '@/components/plantinsectset/plantinsectset'
import acquiescent from '@/components/acquiescent/acquiescent'
import plantPlug from '@/components/plantPlug/plantPlug'
import insectPlug from '@/components/insectPlug/insectPlug'
import headStyle from '@/components/headStyle/headStyle'


import lianxi from '@/components/lianxi/lianxi'
import lianxiC from '@/components/lianxi/lianxiC'
import lianxiD from '@/components/lianxi/lianxiD'


Router.prototype.goBack = function () {
  this.isBack = true
  window.history.go(-1)
}


Vue.use(Router)

export default new Router({
  base: '/',
  routes: [
    // {
    //   path: '/lianxi',
    //   name: 'lianxiC',
    //   component: lianxiC,
    //   children: [{
    //     path: '',
    //     component: lianxi
    //   }, {
    //     path: '/lianxiA',
    //     component: lianxiA
    //   }, {
    //     path: '/lianxiB',
    //     component: lianxiB
    //   }]
    // },
    {
      path: '/newmessage',
      name: 'lianxiC',
      component: lianxiC,
      meta: {
        title: '新建信息',
        type: 'login'
      },
      children: [{
        path: '',
        component: newmessage
      }, {
        path: '/insect',
        component: insect,
        meta: {
              title: '虫害',
              type: 'login'
            },
      }, {
        path: '/secondstep',
        component: secondstep,
        meta: {
              title: '病害',
              type: 'login'
            },
      }]
    },


    //  {
    //   path: '/newmessage',
    //   name: 'newmessage',
    //   meta: {
    //     title: '新建信息',
    //     type: 'login'
    //   },
    //   component: newmessage
    // },
    // {
    //   path: '/insect',
    //   name: 'insect',
    //   meta: {
    //     title: '昆虫病害',
    //     type: 'login'
    //   },
    //   component: insect
    // },
    // {
    //   path: '/secondstep',
    //   name: 'secondstep',
    //   meta: {
    //     title: '第二步',
    //     type: 'login'
    //   },
    //   component: secondstep
    // },
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/lianxiD',
      name: 'lianxi',
      component: lianxiD,
    },
    {
      path: '/lianxi',
      name: 'lianxi',
      component: lianxi
    },



    {
      path: '/amplification',
      name: '放大组件',
      component: amplification
    },
    {
      path: '/bottomNav',
      name: 'bottomNav',
      component: bottomNav
    },
    {
      path: '/goTop',
      name: 'goTop',
      component: goTop
    },
    {
      path: '/home',
      name: 'home',
      meta: {
        title: '首页',
        type: 'login'  //是否需要判断是否登录，这里是需要判断
      },
      component: home
    },
    {
      path: '/examine',
      name: 'examine',
      meta: {
        title: '已录信息',
        type: 'login',
        keepAlive: true
      },
      component: examine
    },
    {
      path: '/knowmore',
      name: 'knowmore',
      meta: {
        title: '关于',
        type: 'login'
      },
      component: knowmore
    },
    {
      path: '/system',
      name: 'system',
      meta: {
        title: '系统设置',
        type: 'login'
      },
      component: system
    },
    {
      path: '/Site',
      name: 'Site',
      meta: {
        title: '地点设置',
        type: 'login'
      },
      component: Site
    },
    {
      path: '/crop',
      name: 'crop',
      meta: {
        title: '作物种类设置',
        type: 'login'
      },
      component: crop
    },
    {
      path: '/discern',
      name: 'discern',
      meta: {
        title: '识别',
        type: 'login'
      },
      component: discern
    },
    {
      path: '/person',
      name: 'person',
      meta: {
        title: '我的',
        type: 'login'
      },
      component: person
    },
   
    {
      path: '/injuriousInsect',
      name: 'injuriousInsect',
      meta: {
        title: '害虫识别',
        type: 'login'
      },
      component: injuriousInsect
    },
    {
      path: '/knowledge',
      name: 'knowledge',
      meta: {
        title: '识别记录',
        type: 'login'
      },
      component: knowledge
    },
    {
      path: '/disease',
      name: 'disease',
      meta: {
        title: '病害',
        type: 'login'
      },
      component: disease
    },
    {
      path: '/pathology',
      name: 'pathology',
      meta: {
        title: '病害名(病级)',
        type: 'login'
      },
      component: pathology
    },
    {
      path: '/provinceList',
      name: 'provinceList',
      meta: {
        title: '省地址',
        type: 'login'
      },
      component: provinceList
    },
    {
      path: '/cityList',
      name: 'cityList',
      meta: {
        title: '市地址',
        type: 'login'
      },
      component: cityList
    },
    {
      path: '/particulars',
      name: 'particulars',
      meta: {
        title: '调查详情',
        type: 'login'
      },
      component: particulars
    },
    {
      path: '/cropType',
      name: 'cropType',
      meta: {
        title: '作物种类设置',
        type: 'login'
      },
      component: cropType
    },
    {
      path: '/cNumber',
      name: 'cNumber',
      meta: {
        title: '作物数量',
        type: 'login'
      },
      component: cNumber
    },
    {
      path: '/county',
      name: 'county',
      meta: {
        title: '县地址',
        type: 'login'
      },
      component: county
    },
    {
      path: '/countryside',
      name: 'countryside',
      meta: {
        title: '乡地址',
        type: 'login'
      },
      component: countryside
    },
    {
      path: '/entering',
      name: 'entering',
      meta: {
        title: '采集人录入',
        type: 'login'
      },
      component: entering
    },
    
    {
      path: '/caste',
      name: 'caste',
      meta: {
        title: '昆虫种类设置',
        type: 'login'
      },
      component: caste
    },
    {
      path: '/kunName',
      name: 'kunName',
      meta: {
        title: '虫害名称',
        type: 'login'
      },
      component: kunName
    },
    {
      path: '/shengList',
      name: 'shengList',
      meta: {
        title: '系统设置省列表',
        type: 'login'
      },
      component: shengList
    },
    {
      path: '/shiList',
      name: 'shiList',
      meta: {
        title: '系统设置市列表',
        type: 'login'
      },
      component: shiList
    },
    {
      path: '/xianList',
      name: 'xianList',
      meta: {
        title: '系统设置县列表',
        type: 'login'
      },
      component: xianList
    },
    {
      path: '/insectType',
      name: 'insectType',
      meta: {
        title: '昆虫种类设置',
        type: 'login'
      },
      component: insectType
    },
    {
      path: '/help',
      name: 'help',
      meta: {
        title: '帮助',
        type: 'login'
      },
      component: help
    },
    {
      path: '/feedback',
      name: 'feedback',
      meta: {
        title: '用户反馈功能',
        type: 'login'
      },
      component: feedback
    },
    {
      path: '/feedback_list',
      name: 'feedback_list',
      meta: {
        title: '用户反馈列表',
        type: 'login'
      },
      component: feedback_list
    },
    {
      path: '/record',
      name: 'record',
      meta: {
        title: '识别记录',
        type: 'login',
        keepAlive: true
      },
      component: record
    },
    {
      path: '/details',
      name: 'details',
      meta: {
        title: '识别详情',
        type: 'login'
      },
      component: details
    },
    {
      path: '/library',
      name: 'library',
      meta: {
        title: '知识库',
        type: 'login',
        keepAlive: true
      },
      component: library
    },
    {
      path: '/inventory',
      name: 'inventory',
      meta: {
        title: '知识库详情',
        type: 'login'
      },
      component: inventory
    },
    {
      path: '/upload_pictures',
      name: 'upload_pictures',
      meta: {
        title: '上传图片',
        type: 'login'
      },
      component: upload_pictures
    },
    {
      path: '/statistics',
      name: 'statistics',
      meta: {
        title: '统计数据',
        type: 'login'
      },
      component: statistics
    },
    {
      path: '/addData',
      name: 'addData',
      meta: {
        title: '添加识别记录',
        type: 'login'
      },
      component: addData
    },
    {
      path: '/updateHistory',
      name: 'updateHistory',
      meta: {
        title: '版本更新历史记录',
        type: 'login'
      },
      component: updateHistory
    },
    {
      path: '/screen_plant',
      name: 'screen_plant',
      meta: {
        title: '作物筛选',
        type: 'login'
      },
      component: screen_plant
    },
    {
      path: '/plantset',
      name: 'plantset',
      meta: {
        title: '病害设置',
        type: 'login'
      },
      component: plantset
    },
    {
      path: '/insectset',
      name: 'insectset',
      meta: {
        title: '虫害设置',
        type: 'login'
      },
      component: insectset
    },
    {
      path: '/plantinsectset',
      name: 'plantinsectset',
      meta: {
        title: '病虫害设置详情',
        type: 'login'
      },
      component: plantinsectset
    },
    {
      path: '/acquiescent',
      name: 'acquiescent',
      meta: {
        title: '默认数据编辑',
        type: 'login'
      },
      component: acquiescent
    },
    {
      path: '/plantPlug',
      name: 'plantPlug',
      meta: {
        title: '第二步病害插件',
        type: 'login'
      },
      component: plantPlug
    },
    {
      path: '/insectPlug',
      name: 'insectPlug',
      meta: {
        title: '第二步虫害插件',
        type: 'login'
      },
      component: insectPlug
    },
    {
      path: '/headStyle',
      name: 'headStyle',
      meta: {
        title: '公共头部样式插件',
        type: 'login'
      },
      component: headStyle
    },
  ]
})
