import Vue from 'vue'
import Router from 'vue-router'

const routerPush = Router.prototype.push  

Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}

Vue.use(Router)

export default new Router({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('./views/Home.vue'),
      meta: {
        title: '荆州市红十字会'
      }
    },
	{
		path: '/donation',
		name: 'donation',
		component: () => import('./views/Donation.vue'),
		redirect: '/donation/contribution',
		meta: {
			title: '捐赠平台'
		},
		children: [
			{
				path: 'contribution',
				name: 'contribution',
				component: () => import('./views/donation/Contribution.vue'),
				meta: {
					title: '捐款'
				}
			},
			{
				path: 'organDonation',
				name: 'organDonation',
				component: () => import('./views/donation/OrganDonation.vue'),
				meta: {
					title: '器官捐献'
				}
			},
			{
				path: 'HPC',
				name: 'HPC',
				component: () => import('./views/donation/Hpc.vue'),
				meta: {
					title: '捐献造血干细胞'
				}
			},
		]
	},
	{
		path: '/loveList',
		name: 'loveList',
		component: () => import('./views/LoveList.vue'),
		meta: {
			title: '爱心榜'
		}
	},
	{
		path: '/join',
		name: 'join',
		component: () => import('./views/Join.vue'),
		redirect: '/join/volunteer',
		meta: {
			title: '我要参与'
		},
		children: [
			{
				path: 'volunteer',
				name: 'volunteer',
				component: () => import('./views/join/Volunteer.vue'),
				meta: {
					title: '登记志愿者'
				}
			},
			{
				path: 'member',
				name: 'member',
				component: () => import('./views/join/Member.vue'),
				meta: {
					title: '登记个人会员'
				}
			},
			{
				path: 'train',
				name: 'train',
				component: () => import('./views/join/Train.vue'),
				meta: {
					title: '参与普及培训'
				}
			},
			{
				path: 'rescue',
				name: 'rescue',
				component: () => import('./views/join/Rescue.vue'),
				meta: {
					title: '登记救护员'
				}
			}
		]
	},
	{
		path: '/about',
		name: 'about',
		component: () => import('./views/About.vue'),
		meta: {
			title: '关于我们'
		},
	},
	{
		path: '/introduce',
		name: 'introduce',
		component: () => import('./views/Introduce.vue'),
		meta: {
			title: '组织介绍'
		},
	},
	{
		path: '/law',
		name: 'law',
		component: () => import('./views/Law.vue'),
		meta: {
			title: '政策法规'
		},
	},
	// {
	// 	path: '/cause',
	// 	name: 'cause',
	// 	component: () => import('./views/Cause.vue'),
	// 	meta: {
	// 		title: '政策法规'
	// 	},
	// },
	{
		path: '/concat',
		name: 'concat',
		component: () => import('./views/Concat.vue'),
		meta: {
			title: '联系我们'
		}
	},
	{
		path: '/knowledge',
		name: 'Knowledge',
		component: () => import('./views/Knowledge.vue'),
		meta: {
			title: '知识库'
		},
		redirect: '/knowledge/rescue',
		children: [
			{
				path: 'rescue',
				name: 'rescue',
				component: () => import('./views/knowledge/Rescue.vue'),
				meta: {
					title: '救护培训'
				},
				redirect: '/knowledge/rescue/list',
				children: [
					{
						path: 'list',
						name: 'rescueList',
						component: () => import('./views/knowledge/rescue/List.vue'),
						meta: {
							title: '救护培训'
						}
					},
					{
						path: 'detail',
						name: 'rescuedetail',
						component: () => import('./views/knowledge/rescue/Detail.vue'),
						meta: {
							title: '救护培训'
						}
					}
				]
			},
			{
				path: 'cells',
				name: 'cells',
				component: () => import('./views/knowledge/Cells.vue'),
				meta: {
					title: '造血干细胞'
				},
				redirect: '/knowledge/cells/list',
				children: [
					{
						path: 'list',
						name: 'cellsList',
						component: () => import('./views/knowledge/cells/List.vue'),
						meta: {
							title: '造血干细胞'
						}
					},
					{
						path: 'detail',
						name: 'cellsdetail',
						component: () => import('./views/knowledge/cells/Detail.vue'),
						meta: {
							title: '造血干细胞'
						}
					}
				]
			},
			{
				path: 'bloodDonation',
				name: 'bloodDonation',
				component: () => import('./views/knowledge/BloodDonation.vue'),
				meta: {
					title: '无偿献血'
				},
				redirect: '/knowledge/bloodDonation/list',
				children: [
					{
						path: 'list',
						name: 'bloodDonationList',
						component: () => import('./views/knowledge/bloodDonation/List.vue'),
						meta: {
							title: '无偿献血'
						}
					},
					{
						path: 'detail',
						name: 'bloodDonationdetail',
						component: () => import('./views/knowledge/bloodDonation/Detail.vue'),
						meta: {
							title: '无偿献血'
						}
					}
				]
			},
			{
				path: 'development',
				name: 'development',
				component: () => import('./views/knowledge/BloodDonation.vue'),
				meta: {
					title: '无偿献血'
				},
				redirect: '/knowledge/development/list',
				children: [
					{
						path: 'list',
						name: 'developmentlist',
						component: () => import('./views/knowledge/development/List.vue'),
						meta: {
							title: '无偿献血'
						}
					},
					{
						path: 'detail',
						name: 'developmentdetail',
						component: () => import('./views/knowledge/development/Detail.vue'),
						meta: {
							title: '无偿献血'
						}
					}
				]
			}
		]
	},
	{
		path: '/newContent',
		name: 'newContent',
		component: () => import('./views/NewContent.vue'),
		meta: {
			title: '县市区红会动态'
		},
		redirect: '/newContent/jlx',
		children: [
			{
				path: 'jlx',
				name: 'jlx',
				component: () => import('./views/newContent/Jlx.vue'),
				meta: {
					title: '江陵县红会动态'
				},
				redirect: '/newContent/jlx/list',
				children: [
					{
						path: 'list',
						name: 'jlxList',
						component: () => import('./views/newContent/jlx/List.vue'),
						meta: {
							title: '江陵县红会动态'
						}
					},
					{
						path: 'detail',
						name: 'jlxdetail',
						component: () => import('./views/newContent/jlx/Detail.vue'),
						meta: {
							title: '江陵县红会动态'
						}
					}
				]
			},
			{
				path: 'sss',
				name: 'sss',
				component: () => import('./views/newContent/Sss.vue'),
				meta: {
					title: '石首市红会动态'
				},
				redirect: '/newContent/sss/list',
				children: [
					{
						path: 'list',
						name: 'cellsList',
						component: () => import('./views/newContent/sss/List.vue'),
						meta: {
							title: '石首市红会动态'
						}
					},
					{
						path: 'detail',
						name: 'cellsdetail',
						component: () => import('./views/newContent/sss/Detail.vue'),
						meta: {
							title: '石首市红会动态'
						}
					}
				]
			},
			{
				path: 'hhs',
				name: 'hhs',
				component: () => import('./views/newContent/Hhs.vue'),
				meta: {
					title: '洪湖市红会动态'
				},
				redirect: '/newContent/hhs/list',
				children: [
					{
						path: 'list',
						name: 'hhsList',
						component: () => import('./views/newContent/hhs/List.vue'),
						meta: {
							title: '洪湖市红会动态'
						}
					},
					{
						path: 'detail',
						name: 'hhsdetail',
						component: () => import('./views/newContent/hhs/Detail.vue'),
						meta: {
							title: '洪湖市红会动态'
						}
					}
				]
			},
			{
				path: 'jzq',
				name: 'jzq',
				component: () => import('./views/newContent/Jzq.vue'),
				meta: {
					title: '荆州区红会动态'
				},
				redirect: '/newContent/jzq/list',
				children: [
					{
						path: 'list',
						name: 'jzqList',
						component: () => import('./views/newContent/jzq/List.vue'),
						meta: {
							title: '荆州区红会动态'
						}
					},
					{
						path: 'detail',
						name: 'jzqdetail',
						component: () => import('./views/newContent/jzq/Detail.vue'),
						meta: {
							title: '荆州区红会动态'
						}
					}
				]
			},
			{
				path: 'ssq',
				name: 'ssq',
				component: () => import('./views/newContent/Ssq.vue'),
				meta: {
					title: '沙市区红会动态'
				},
				redirect: '/newContent/ssq/list',
				children: [
					{
						path: 'list',
						name: 'ssqList',
						component: () => import('./views/newContent/ssq/List.vue'),
						meta: {
							title: '沙市区红会动态'
						}
					},
					{
						path: 'detail',
						name: 'ssqdetail',
						component: () => import('./views/newContent/ssq/Detail.vue'),
						meta: {
							title: '沙市区红会动态'
						}
					}
				]
			},
			{
				path: 'szs',
				name: 'szs',
				component: () => import('./views/newContent/Szs.vue'),
				meta: {
					title: '松滋市红会动态'
				},
				redirect: '/newContent/szs/list',
				children: [
					{
						path: 'list',
						name: 'szsList',
						component: () => import('./views/newContent/szs/List.vue'),
						meta: {
							title: '松滋市红会动态'
						}
					},
					{
						path: 'detail',
						name: 'szsdetail',
						component: () => import('./views/newContent/szs/Detail.vue'),
						meta: {
							title: '松滋市红会动态'
						}
					}
				]
			},
			{
				path: 'jls',
				name: 'jls',
				component: () => import('./views/newContent/Jls.vue'),
				meta: {
					title: '松滋市红会动态'
				},
				redirect: '/newContent/jls/list',
				children: [
					{
						path: 'list',
						name: 'jlsList',
						component: () => import('./views/newContent/jls/List.vue'),
						meta: {
							title: '松滋市红会动态'
						}
					},
					{
						path: 'detail',
						name: 'jlsdetail',
						component: () => import('./views/newContent/jls/Detail.vue'),
						meta: {
							title: '松滋市红会动态'
						}
					}
				]
			}
		]
	},
	{
		path: '/cause',
		name: 'cause',
		component: () => import('./views/Cause.vue'),
		meta: {
			title: '红十字事业'
		},
		redirect: '/cause/rescue',
		children: [
			{
				path: 'rescue',
				name: 'rescue',
				component: () => import('./views/cause/Rescue.vue'),
				meta: {
					title: '应急救援'
				},
				redirect: '/cause/rescue/list',
				children: [
					{
						path: 'list',
						name: 'jlxList',
						component: () => import('./views/cause/rescue/List.vue'),
						meta: {
							title: '应急救援'
						}
					},
					{
						path: 'detail',
						name: 'jlxdetail',
						component: () => import('./views/cause/rescue/Detail.vue'),
						meta: {
							title: '应急救援'
						}
					}
				]
			},
			{
				path: 'emergency',
				name: 'emergency',
				component: () => import('./views/cause/Emergency.vue'),
				meta: {
					title: '应急救护'
				},
				redirect: '/cause/emergency/list',
				children: [
					{
						path: 'list',
						name: 'cellsList',
						component: () => import('./views/cause/emergency/List.vue'),
						meta: {
							title: '应急救护'
						}
					},
					{
						path: 'detail',
						name: 'cellsdetail',
						component: () => import('./views/cause/emergency/Detail.vue'),
						meta: {
							title: '应急救护'
						}
					}
				]
			},
			{
				path: 'humanity',
				name: 'humanity',
				component: () => import('./views/cause/Humanity.vue'),
				meta: {
					title: '人道救助'
				},
				redirect: '/cause/humanity/list',
				children: [
					{
						path: 'list',
						name: 'humanityList',
						component: () => import('./views/cause/humanity/List.vue'),
						meta: {
							title: '人道救助'
						}
					},
					{
						path: 'detail',
						name: 'humanitydetail',
						component: () => import('./views/cause/humanity/Detail.vue'),
						meta: {
							title: '人道救助'
						}
					}
				]
			},
			{
				path: 'cells',
				name: 'cells',
				component: () => import('./views/cause/Cells.vue'),
				meta: {
					title: '造血干细胞捐献'
				},
				redirect: '/cause/cells/list',
				children: [
					{
						path: 'list',
						name: 'cellsList',
						component: () => import('./views/cause/cells/List.vue'),
						meta: {
							title: '造血干细胞捐献'
						}
					},
					{
						path: 'detail',
						name: 'cellsdetail',
						component: () => import('./views/cause/cells/Detail.vue'),
						meta: {
							title: '造血干细胞捐献'
						}
					}
				]
			},
			{
				path: 'free',
				name: 'free',
				component: () => import('./views/cause/Free.vue'),
				meta: {
					title: '无偿献血'
				},
				redirect: '/cause/free/list',
				children: [
					{
						path: 'list',
						name: 'freeList',
						component: () => import('./views/cause/free/List.vue'),
						meta: {
							title: '无偿献血'
						}
					},
					{
						path: 'detail',
						name: 'freedetail',
						component: () => import('./views/cause/free/Detail.vue'),
						meta: {
							title: '无偿献血'
						}
					}
				]
			},
			{
				path: 'remains',
				name: 'remains',
				component: () => import('./views/cause/Remains.vue'),
				meta: {
					title: '遗体和人体器官捐献'
				},
				redirect: '/cause/remains/list',
				children: [
					{
						path: 'list',
						name: 'remainsList',
						component: () => import('./views/cause/remains/List.vue'),
						meta: {
							title: '遗体和人体器官捐献'
						}
					},
					{
						path: 'detail',
						name: 'remainsdetail',
						component: () => import('./views/cause/remains/Detail.vue'),
						meta: {
							title: '遗体和人体器官捐献'
						}
					}
				]
			},
			{
				path: 'teenagers',
				name: 'teenagers',
				component: () => import('./views/cause/Teenagers.vue'),
				meta: {
					title: '红十字青少年'
				},
				redirect: '/cause/teenagers/list',
				children: [
					{
						path: 'list',
						name: 'teenagersList',
						component: () => import('./views/cause/teenagers/List.vue'),
						meta: {
							title: '红十字青少年'
						}
					},
					{
						path: 'detail',
						name: 'teenagersdetail',
						component: () => import('./views/cause/teenagers/Detail.vue'),
						meta: {
							title: '红十字青少年'
						}
					}
				]
			},
			{
				path: 'service',
				name: 'service',
				component: () => import('./views/cause/Service.vue'),
				meta: {
					title: '志愿服务'
				},
				redirect: '/cause/service/list',
				children: [
					{
						path: 'list',
						name: 'serviceList',
						component: () => import('./views/cause/service/List.vue'),
						meta: {
							title: '志愿服务'
						}
					},
					{
						path: 'detail',
						name: 'servicedetail',
						component: () => import('./views/cause/service/Detail.vue'),
						meta: {
							title: '志愿服务'
						}
					}
				]
			}
		]
	},
	{
		path: '/popularScience',
		name: 'popularScience',
		component: () => import('./views/PopularScience.vue'),
		meta: {
			title: '红会科普'
		},
		redirect: '/popularScience/list',
		children: [
			{
				path: 'list',
				name: 'list',
				component: () => import('./views/popularScience/List.vue'),
				meta: {
					title: '红会科普'
				}
			},
			{
				path: 'detail',
				name: 'detail',
				component: () => import('./views/popularScience/Detail.vue'),
				meta: {
					title: '红会科普'
				}
			}
		]
	},
	{
		path: '/news',
		name: 'news',
		component: () => import('./views/News.vue'),
		meta: {
			title: '红会新闻'
		},
		redirect: '/news/list',
		children: [
			{
				path: 'list',
				name: 'newslist',
				component: () => import('./views/news/List.vue'),
				meta: {
					title: '红会新闻'
				}
			},
			{
				path: 'detail',
				name: 'newsdetail',
				component: () => import('./views/news/Detail.vue'),
				meta: {
					title: '红会新闻'
				}
			}
		]
	},
	{
		path: '/publicity',
		name: 'publicity',
		component: () => import('./views/Publicity.vue'),
		meta: {
			title: '信息公示'
		},
		redirect: '/publicity/list',
		children: [
			{
				path: 'list',
				name: 'publicitylist',
				component: () => import('./views/publicity/List.vue'),
				meta: {
					title: '信息公示'
				}
			},
			{
				path: 'detail',
				name: 'publicitydetail',
				component: () => import('./views/publicity/Detail.vue'),
				meta: {
					title: '信息公示'
				}
			}
		]
	},
	{
		path: '/regulations',
		name: 'regulations',
		component: () => import('./views/Regulations.vue'),
		meta: {
			title: '政策法规'
		},
		redirect: '/regulations/list',
		children: [
			{
				path: 'list',
				name: 'regulationsList',
				component: () => import('./views/regulations/List.vue'),
				meta: {
					title: '政策法规'
				}
			},
			{
				path: 'detail',
				name: 'regulationsdetail',
				component: () => import('./views/regulations/Detail.vue'),
				meta: {
					title: '政策法规'
				}
			}
		]
	},
	{
		path: '/help',
		name: 'help',
		component: () => import('./views/Help.vue'),
		meta: {
			title: '我要求助'
		},
		redirect: '/help/list',
		children: [
			{
				path: 'list',
				name: 'helpList',
				component: () => import('./views/help/List.vue'),
				meta: {
					title: '我要求助'
				}
			},
			{
				path: 'detail',
				name: 'helpdetail',
				component: () => import('./views/help/Detail.vue'),
				meta: {
					title: '我要求助'
				}
			}
		]
	},
	{
		path: '/directories',
		name: 'directories',
		component: () => import('./views/Directories.vue'),
		meta: {
			title: '造血干细胞捐献名录'
		},
		redirect: '/directories/list',
		children: [
			{
				path: 'list',
				name: 'directoriesList',
				component: () => import('./views/directories/List.vue'),
				meta: {
					title: '造血干细胞捐献名录'
				}
			},
			{
				path: 'detail',
				name: 'directoriesdetail',
				component: () => import('./views/directories/Detail.vue'),
				meta: {
					title: '造血干细胞捐献名录'
				}
			}
		]
	},
	{
		path: '/organs',
		name: 'organs',
		component: () => import('./views/Organs.vue'),
		meta: {
			title: '器官/遗体捐献名录'
		},
		redirect: '/organs/list',
		children: [
			{
				path: 'list',
				name: 'organsList',
				component: () => import('./views/organs/List.vue'),
				meta: {
					title: '器官/遗体捐献名录'
				}
			},
			{
				path: 'detail',
				name: 'organsdetail',
				component: () => import('./views/organs/Detail.vue'),
				meta: {
					title: '器官/遗体捐献名录'
				}
			}
		]
	},
	{
		path: '*',
		redirect: '/home'
	}
  ]
})
