index.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. import Vue from 'vue'
  2. import VueRouter from 'vue-router'
  3. import Home from '../views/Index.vue'
  4. Vue.use(VueRouter)
  5. const routes = [
  6. // {
  7. // path: '/',
  8. // redirect: 'ExamineDetail',
  9. // },
  10. {
  11. path: '/',
  12. name: 'Home',
  13. mate: {
  14. showTabBar: true
  15. },
  16. component: Home
  17. },
  18. // ====== 申请页面
  19. {
  20. path: '/applyfor',
  21. name: 'Applyfor',
  22. meta: {
  23. keepAlive: true
  24. },
  25. component: () => import(/* webpackChunkName: "index" */ '../views/applyfor/index.vue')
  26. },
  27. {
  28. // NOTE: 自己书写外部出差人员
  29. path: '/applyfor/peers-out-form',
  30. name: 'PeersOutForm',
  31. component: () => import(/* webpackChunkName: "index" */ '../views/applyfor/peersOutForm.vue')
  32. },
  33. {
  34. path: '/applyfor/type6-before',
  35. name: 'AskForLeave',
  36. component: () => import(/* webpackChunkName: "type6" */ '../views/applyfor/askForLeaveType.vue')
  37. },
  38. {
  39. path: '/applyfor/product-store',
  40. name: 'ProductStore',
  41. component: () => import(/* webpackChunkName: "applyfor" */ '../views/applyfor/ProductStore.vue')
  42. },
  43. {
  44. path: '/applyfor/goods',
  45. name: 'Goods',
  46. component: () => import(/* webpackChunkName: "applyfor" */ '../views/applyfor/goods.vue')
  47. },
  48. {
  49. path: '/applyfor/goods-specifications',
  50. name: 'GoodsSpeci',
  51. component: () => import(/* webpackChunkName: "applyfor" */ '../views/applyfor/goods-specifications.vue')
  52. },
  53. {
  54. path: '/applyfor/goods-unit',
  55. name: 'GoodsUnit',
  56. component: () => import(/* webpackChunkName: "applyfor" */ '../views/applyfor/goods-unit-price.vue')
  57. },
  58. // NOTE:我的审核状态
  59. {
  60. path: '/apply-state',
  61. name: 'ApplyState',
  62. component: () => import(/* webpackChunkName: "index" */ '../views/apply-state/index.vue')
  63. },
  64. // ====== 审核页面
  65. {
  66. path: '/approve',
  67. name: 'Approve',
  68. mate: {
  69. showTabBar: true
  70. },
  71. // route level code-splitting
  72. // this generates a separate chunk (about.[hash].js) for this route
  73. // which is lazy-loaded when the route is visited.
  74. component: () => import(/* webpackChunkName: "approve" */ '../views/Approve.vue')
  75. },
  76. {
  77. path: '/approve/search',
  78. name: 'Search',
  79. component: () => import(/* webpackChunkName: "approve" */ '../views/approve/search.vue')
  80. },
  81. {
  82. path: '/approve/examine',
  83. name: 'Examine',
  84. component: () => import(/* webpackChunkName: "approve" */ '../views/approve/examine.vue')
  85. },
  86. {
  87. path: '/approve/detail',
  88. name: 'ExamineDetail',
  89. component: () => import(/* webpackChunkName: "approve" */ '../views/approve/detail.vue')
  90. },
  91. // ====== 我的页面
  92. {
  93. path: '/my',
  94. name: 'My',
  95. meta: { title: '我的', showTabBar: true },
  96. component: () => import(/* webpackChunkName: "personnel" */ '../views/My.vue'),
  97. },
  98. {
  99. path: '/user-info',
  100. name: 'Userinfo',
  101. component: () => import(/* webpackChunkName: "personnel" */ '../views/personal/Userinfo.vue')
  102. },
  103. {
  104. path: '/user-info/single-info',
  105. name: 'Singleinfo',
  106. component: () => import(/* webpackChunkName: "personnel" */ '../views/personal/single-info.vue')
  107. },
  108. {
  109. path: '/update/nickname',
  110. name: 'Nickname',
  111. component: () => import(/* webpackChunkName: "personnel" */ '../views/personal/nickname.vue')
  112. },
  113. {
  114. path: '/update/mobile',
  115. name: 'Mobile',
  116. component: () => import(/* webpackChunkName: "personnel" */ '../views/personal/phone-number.vue')
  117. },
  118. {
  119. path: '/update/signature',
  120. name: 'Signature',
  121. component: () => import(/* webpackChunkName: "personnel" */ '../views/personal/signature.vue')
  122. },
  123. ]
  124. const router = new VueRouter({
  125. routes,
  126. mode: 'hash'
  127. })
  128. router.beforeEach((to, from, next) => {
  129. // console.log('>>>>> beforeEach >>>>>');
  130. // console.log('to', to);
  131. // console.log('form', from);
  132. // console.log('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<');
  133. // TODO: 该位置设置navigation title
  134. next()
  135. })
  136. export default router