// eslint-disable-next-line no-unused-vars
import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login'
import loginbytel from '@/components/loginbytel'
import GetCode from '@/components/GetCode'
import saleindex from '@/components/saleindex'
// eslint-disable-next-line camelcase
import Getfdc_pm_unfare from '@/components/Getfdc_pm_unfare.vue'
// eslint-disable-next-line camelcase
import Getfdc_pm_revfare from '@/components/Getfdc_pm_revfare.vue'
// eslint-disable-next-line camelcase
import Insertfdc_pm_fare from '@/components/Insertfdc_pm_fare.vue'
import GetOwnerHouse from '@/components/GetOwnerHouse.vue'
import GetvehicleList from '@/components/GetvehicleList.vue'
// eslint-disable-next-line camelcase
import Insertfdc_pm_vehicle from '@/components/Insertfdc_pm_vehicle.vue'
import GetRepaireList from '@/components/GetRepaireList.vue'
import GetComplaintList from '@/components/GetComplaintList.vue'
// eslint-disable-next-line camelcase
import Insertfdc_pm_repair from '@/components/Insertfdc_pm_repair.vue'
import GetRepairDetail from '@/components/GetRepairDetail.vue'
// eslint-disable-next-line camelcase
import Insertfdc_pm_repairByTousu from '@/components/Insertfdc_pm_repairByTousu.vue'
import BindHouse from '@/components/BindHouse.vue'
import SelectPayType from '@/components/SelectPayType.vue'
import MakePayUrl from '@/components/MakePayUrl.vue'
import MakePayQrCode from '@/components/MakePayQrCode.vue'

Vue.use(Router)
// 获取原型对象上的push函数
const originalPush = Router.prototype.push
// 修改原型对象中的push方法
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

let baseUrl = '/' // base默认值是/ ,若要支持二级虚拟目录。需要设置为 /h5/这种形式。表示该vue项目放入h5虚拟目录下
// console.info("base", Router.base);
export default new Router({
  mode: 'history',
  base: baseUrl,
  routes: [
    { // 登录页
      path: '/',
      name: 'login',
      component: login
    },
    { // 登录页
      path: '/loginbytel',
      name: 'loginbytel',
      component: loginbytel
    },
    { // 手机号登录
      path: '/login',
      name: 'login',
      component: login
    },
    { // 获取WxCode
      path: '/GetCode',
      name: 'GetCode',
      component: GetCode
    },
    { // 首页
      path: '/saleindex',
      name: 'saleindex',
      component: saleindex
    },
    { // 我要缴费
      path: '/Getfdc_pm_unfare',
      name: 'Getfdc_pm_unfare',
      component: Getfdc_pm_unfare
    },
    { // 缴费记录
      path: '/Getfdc_pm_revfare',
      name: 'Getfdc_pm_revfare',
      component: Getfdc_pm_revfare
    },
    { // 房产信息
      path: '/GetOwnerHouse',
      name: 'GetOwnerHouse',
      component: GetOwnerHouse
    },
    { // 车辆信息
      path: '/GetvehicleList',
      name: 'GetvehicleList',
      component: GetvehicleList
    },
    { // 报修记录
      path: '/GetRepaireList',
      name: 'GetRepaireList',
      component: GetRepaireList
    },
    { // 插入车辆
      path: '/Insertfdc_pm_vehicle',
      name: 'Insertfdc_pm_vehicle',
      component: Insertfdc_pm_vehicle
    },
    { // 投诉记录
      path: '/GetComplaintList',
      name: 'GetComplaintList',
      component: GetComplaintList
    },
    { // 我要报修
      path: '/Insertfdc_pm_repair',
      name: 'Insertfdc_pm_repair',
      component: Insertfdc_pm_repair
    },
    { // 报修详情
      path: '/GetRepairDetail',
      name: 'GetRepairDetail',
      component: GetRepairDetail
    },
    { // 我要投诉
      path: '/Insertfdc_pm_repairByTousu',
      name: 'Insertfdc_pm_repairByTousu',
      component: Insertfdc_pm_repairByTousu
    },
    { // 绑定房屋信息
      path: '/BindHouse',
      name: 'BindHouse',
      component: BindHouse
    },
    { // 选择支付类型
      path: '/SelectPayType',
      name: 'SelectPayType',
      component: SelectPayType
    },
    { // 生成微信支付Url
      path: '/MakePayUrl',
      name: 'MakePayUrl',
      component: MakePayUrl
    },
    { // 生成微信支付二维码
      path: '/MakePayQrCode',
      name: 'MakePayQrCode',
      component: MakePayQrCode
    },
    { // 插入缴费信息
      path: '/Insertfdc_pm_fare',
      name: 'Insertfdc_pm_fare',
      component: Insertfdc_pm_fare
    }
  ]
})
