微信

router.js 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import mainPage from './mainPage/index' // 主页
  4. import indexPage from './mainPage/indexPage/index' // 首页
  5. import fiveA from './fiveA/index' // 5A
  6. import majorProjects from './majorProjects/index' // 项目专题
  7. import majorProjectsDetail from './majorProjectsDetail/index' // 项目专题详情
  8. import placeOrderForCourse from './placeOrderForCourse/index' // 购买课程下单
  9. import coffeeIndex from './mainPage/coffeeIndex/index' // 城咖啡
  10. import placeOrder from './placeOrder/index' // 城咖啡-点单
  11. import placeOrderDetail from './placeOrderDetail/index' // 城咖啡-点单详情
  12. import orderList from './orderList/index' // 城咖啡-点单列表
  13. import userCenter from './mainPage/userCenter/index' // 个人中心
  14. import bindMobile from './bindMobile/bindMobile' // 绑定手机号
  15. import lessonOrder from './lessonOrder/index' // 我的订单
  16. import vip from './vip/index' // vip卡说明
  17. import card from './card/index' // 卡
  18. import coupons from './coupons/index' // 优惠券
  19. import lessonDetail from './lessonDetail/index' // 课程详情
  20. import cardDetail from './cardDetail/index' // 体验卡详情
  21. import gymCardDetail from './gymCardDetail/index' // 健身卡详情
  22. import couponsDetail from './couponsDetail/index' // 体验券详情
  23. import receive from './receive/index' // 领取页面
  24. import receiveResults from './receiveResults/index' // 领取结果页面
  25. import receiveChannel from './receiveChannel/index' // 渠道领取页面
  26. Vue.use(Router)
  27. const router = new Router({
  28. routes: [{
  29. path: '/mainPage',
  30. name: 'mainPage',
  31. component: mainPage,
  32. children: [{ // 首页
  33. path: 'indexPage',
  34. name: 'indexPage',
  35. component: indexPage,
  36. children: []
  37. }, { // 城咖啡
  38. path: 'coffeeIndex',
  39. name: 'coffeeIndex',
  40. component: coffeeIndex,
  41. children: []
  42. }, { // 个人中心
  43. path: 'userCenter',
  44. name: 'userCenter',
  45. component: userCenter,
  46. children: []
  47. }]
  48. }, { // 城咖啡-点单
  49. path: '/placeOrder',
  50. name: 'placeOrder',
  51. component: placeOrder,
  52. children: []
  53. }, { // 城咖啡-点单详情
  54. path: '/placeOrderDetail',
  55. name: 'placeOrderDetail',
  56. component: placeOrderDetail,
  57. children: []
  58. }, { // 城咖啡-点单列表
  59. path: '/orderList',
  60. name: 'orderList',
  61. component: orderList,
  62. children: []
  63. }, { // 项目专题
  64. path: '/majorProjects',
  65. name: 'majorProjects',
  66. component: majorProjects,
  67. children: []
  68. }, { // 项目专题详情
  69. path: '/majorProjectsDetail',
  70. name: 'majorProjectsDetail',
  71. component: majorProjectsDetail,
  72. children: []
  73. }, { // 购买课程下单
  74. path: '/placeOrderForCourse',
  75. name: 'placeOrderForCourse',
  76. component: placeOrderForCourse,
  77. children: []
  78. }, { // 5A
  79. path: '/fiveA',
  80. name: 'fiveA',
  81. component: fiveA,
  82. children: []
  83. }, { // 绑定手机号
  84. path: '/bindMobile',
  85. name: 'bindMobile',
  86. component: bindMobile,
  87. children: []
  88. }, { // 我的订单
  89. path: '/lessonOrder',
  90. name: 'lessonOrder',
  91. component: lessonOrder,
  92. children: []
  93. }, { // vip卡说明
  94. path: '/vip',
  95. name: 'vip',
  96. component: vip,
  97. children: []
  98. }, { // 卡
  99. path: '/card',
  100. name: 'card',
  101. component: card,
  102. children: []
  103. }, { // 优惠券
  104. path: '/coupons',
  105. name: 'coupons',
  106. component: coupons,
  107. children: []
  108. }, { // 课程详情
  109. path: '/lessonDetail',
  110. name: 'lessonDetail',
  111. component: lessonDetail,
  112. children: []
  113. }, { // 体验卡详情
  114. path: '/cardDetail',
  115. name: 'cardDetail',
  116. component: cardDetail,
  117. children: []
  118. }, { // 健身卡详情
  119. path: '/gymCardDetail',
  120. name: 'gymCardDetail',
  121. component: gymCardDetail,
  122. children: []
  123. }, { // 体验券详情
  124. path: '/couponsDetail',
  125. name: 'couponsDetail',
  126. component: couponsDetail,
  127. children: []
  128. }, { // 卡券领取
  129. path: '/receive',
  130. name: 'receive',
  131. component: receive,
  132. children: []
  133. }, { // 卡券领取结果
  134. path: '/receiveResults',
  135. name: 'receiveResults',
  136. component: receiveResults,
  137. children: []
  138. }, { // 卡券领取(带参数,分享后的路径)
  139. path: '/receiveShared/:id/:salesid/:type/:random/:sharetype',
  140. name: 'receive',
  141. component: receive
  142. }, { // 渠道卡券领取
  143. path: '/receiveChannel',
  144. name: 'receiveChannel',
  145. component: receiveChannel,
  146. children: []
  147. }, { // 渠道卡券领取(带参数,分享后的路径)
  148. path: '/receiveChannelShared/:id/:type/:sharetype',
  149. name: 'receiveChannel',
  150. component: receiveChannel
  151. }],
  152. linkActiveClass: 'active',
  153. })
  154. router.beforeEach((to, from, next) => {
  155. // console.log(to)
  156. // if(){
  157. // }
  158. next()
  159. })
  160. export default router