import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import benefit from '@/pages/benefit';
import benefitKd from '@/pages/benefitKd';
import qrcode from '@/pages/qrcode';
import qyb from '@/pages/login'
import bx from '@/pages/index'
import bjdc from '@/pages/bgResearch'
import research from '@/pages/addResearch'
import user from '@/pages/userCenter'
import protocol from '@/pages/protocol'
import userInput from '@/pages/userInput'
import axbProtocol from '@/pages/axbProtocol'
import pdfPreview from '@/pages/pdfPreview'
import guide from '@/pages/guide'
import contract from '@/pages/contract'
import previewContract from '@/pages/previewContract'

Vue.use(Router)
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
};
export default new Router({
  // mode: 'history',  //去掉url中的#
  routes: [
    {
      path: '/benefitKd',
      name: 'benefitKd',
      component: benefitKd,
      meta:{
        title:'宽带权益兑换'
      }
    },
    {
      path: '/benefit',
      name: 'benefit',
      component: benefit,
      meta:{
        title:'权益兑换'
      }
    },
    {
      path: '/qrcode',
      name: 'qrcode',
      component:qrcode,
      meta:{
        title:'权益兑换'
      }
    },
    {
      path: '/qyb',
      name: 'qyb',
      component: qyb
    },
    {
      path: '/bx',
      name: 'bx',
      component: bx,
      meta:{
        title:'保险'
      }
    },
    {
      path: '/bjdc',
      name: 'bjdc',
      component: bjdc,
      meta:{
        title:'合同签署'
      }
    },
    {
      path: '/user',
      name: 'user',
      component: user,
      meta:{
        title:'我的'
      }
    },
    {
      path: '/research',
      name: 'research',
      component: research
    },
    {
      path: '/protocol',
      name: 'protocol',
      component: protocol
    },
    {
      path: '/input',
      name: 'userInput',
      component: userInput,
      children:[
        {path:'f1',
        name:'userInput',
        component: userInput,}
      ],
      meta:{
        title:'投保信息页'
      }
    },
    {
      path: '/axbProtocol',
      name: 'axbProtocol',
      component: axbProtocol

    },
    {
      path: '/pdfPreview',
      name: 'pdfPreview',
      component: pdfPreview
    },
    {
      path: '/guide',
      name: 'guide',
      component: guide
    },
    {
      path: '/contract',
      name: 'contract',
      component: contract,
      meta:{
        title:'合同信息页'
      }
    },
    {
      path: '/previewContract',
      name: 'previewContract',
      component: previewContract
    },
    {path:'',redirect:"benefit"}
  ]
})
