router.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. import { normalizeURL, decode } from 'ufo'
  4. import { interopDefault } from './utils'
  5. import scrollBehavior from './router.scrollBehavior.js'
  6. const _20cc4777 = () => interopDefault(import('../pages/category.vue' /* webpackChunkName: "pages/category" */))
  7. const _53a8f1e6 = () => interopDefault(import('../pages/confirm_order.vue' /* webpackChunkName: "pages/confirm_order" */))
  8. const _c053a18a = () => interopDefault(import('../pages/get_coupons.vue' /* webpackChunkName: "pages/get_coupons" */))
  9. const _94f6dea6 = () => interopDefault(import('../pages/help_center/index.vue' /* webpackChunkName: "pages/help_center/index" */))
  10. const _ddf8d1b8 = () => interopDefault(import('../pages/news_list/index.vue' /* webpackChunkName: "pages/news_list/index" */))
  11. const _b747eac6 = () => interopDefault(import('../pages/payment.vue' /* webpackChunkName: "pages/payment" */))
  12. const _764a8346 = () => interopDefault(import('../pages/seckill.vue' /* webpackChunkName: "pages/seckill" */))
  13. const _bd7583c0 = () => interopDefault(import('../pages/shop_cart.vue' /* webpackChunkName: "pages/shop_cart" */))
  14. const _228b20fa = () => interopDefault(import('../pages/shop_street.vue' /* webpackChunkName: "pages/shop_street" */))
  15. const _c0a4f686 = () => interopDefault(import('../pages/shop_street_detail.vue' /* webpackChunkName: "pages/shop_street_detail" */))
  16. const _1a495868 = () => interopDefault(import('../pages/special_area.vue' /* webpackChunkName: "pages/special_area" */))
  17. const _a3014a16 = () => interopDefault(import('../pages/store_settled/index.vue' /* webpackChunkName: "pages/store_settled/index" */))
  18. const _2956a4c6 = () => interopDefault(import('../pages/account/forget_pwd.vue' /* webpackChunkName: "pages/account/forget_pwd" */))
  19. const _38939dde = () => interopDefault(import('../pages/account/login.vue' /* webpackChunkName: "pages/account/login" */))
  20. const _bebd7384 = () => interopDefault(import('../pages/account/register.vue' /* webpackChunkName: "pages/account/register" */))
  21. const _905be49c = () => interopDefault(import('../pages/help_center/help_center_detail.vue' /* webpackChunkName: "pages/help_center/help_center_detail" */))
  22. const _760c0378 = () => interopDefault(import('../pages/news_list/news_list_detail.vue' /* webpackChunkName: "pages/news_list/news_list_detail" */))
  23. const _8c81d984 = () => interopDefault(import('../pages/store_settled/detail.vue' /* webpackChunkName: "pages/store_settled/detail" */))
  24. const _2351673e = () => interopDefault(import('../pages/store_settled/record.vue' /* webpackChunkName: "pages/store_settled/record" */))
  25. const _3572766c = () => interopDefault(import('../pages/user/address/index.vue' /* webpackChunkName: "pages/user/address/index" */))
  26. const _246752a1 = () => interopDefault(import('../pages/user/after_sales/index.vue' /* webpackChunkName: "pages/user/after_sales/index" */))
  27. const _2d1d9a0e = () => interopDefault(import('../pages/user/collection.vue' /* webpackChunkName: "pages/user/collection" */))
  28. const _4b5eaf42 = () => interopDefault(import('../pages/user/coupons.vue' /* webpackChunkName: "pages/user/coupons" */))
  29. const _320e85da = () => interopDefault(import('../pages/user/evaluation/index.vue' /* webpackChunkName: "pages/user/evaluation/index" */))
  30. const _830626f4 = () => interopDefault(import('../pages/user/order/index.vue' /* webpackChunkName: "pages/user/order/index" */))
  31. const _24454444 = () => interopDefault(import('../pages/user/profile.vue' /* webpackChunkName: "pages/user/profile" */))
  32. const _2a6c52bc = () => interopDefault(import('../pages/user/user_wallet.vue' /* webpackChunkName: "pages/user/user_wallet" */))
  33. const _46e7110e = () => interopDefault(import('../pages/user/after_sales/after_sale_details.vue' /* webpackChunkName: "pages/user/after_sales/after_sale_details" */))
  34. const _a39ccce2 = () => interopDefault(import('../pages/user/after_sales/apply_result.vue' /* webpackChunkName: "pages/user/after_sales/apply_result" */))
  35. const _63c2098e = () => interopDefault(import('../pages/user/after_sales/apply_sale.vue' /* webpackChunkName: "pages/user/after_sales/apply_sale" */))
  36. const _2f441141 = () => interopDefault(import('../pages/user/evaluation/evaluate.vue' /* webpackChunkName: "pages/user/evaluation/evaluate" */))
  37. const _ad189866 = () => interopDefault(import('../pages/user/order/detail.vue' /* webpackChunkName: "pages/user/order/detail" */))
  38. const _75e8abdb = () => interopDefault(import('../pages/goods_details/_id.vue' /* webpackChunkName: "pages/goods_details/_id" */))
  39. const _6e7ea3ea = () => interopDefault(import('../pages/goods_list/_type.vue' /* webpackChunkName: "pages/goods_list/_type" */))
  40. const _0f6a21ae = () => interopDefault(import('../pages/index.vue' /* webpackChunkName: "pages/index" */))
  41. const emptyFn = () => {}
  42. Vue.use(Router)
  43. export const routerOptions = {
  44. mode: 'history',
  45. base: '/pc/',
  46. linkActiveClass: 'nuxt-link-active',
  47. linkExactActiveClass: 'nuxt-link-exact-active',
  48. scrollBehavior,
  49. routes: [{
  50. path: "/category",
  51. component: _20cc4777,
  52. name: "category"
  53. }, {
  54. path: "/confirm_order",
  55. component: _53a8f1e6,
  56. name: "confirm_order"
  57. }, {
  58. path: "/get_coupons",
  59. component: _c053a18a,
  60. name: "get_coupons"
  61. }, {
  62. path: "/help_center",
  63. component: _94f6dea6,
  64. name: "help_center"
  65. }, {
  66. path: "/news_list",
  67. component: _ddf8d1b8,
  68. name: "news_list"
  69. }, {
  70. path: "/payment",
  71. component: _b747eac6,
  72. name: "payment"
  73. }, {
  74. path: "/seckill",
  75. component: _764a8346,
  76. name: "seckill"
  77. }, {
  78. path: "/shop_cart",
  79. component: _bd7583c0,
  80. name: "shop_cart"
  81. }, {
  82. path: "/shop_street",
  83. component: _228b20fa,
  84. name: "shop_street"
  85. }, {
  86. path: "/shop_street_detail",
  87. component: _c0a4f686,
  88. name: "shop_street_detail"
  89. }, {
  90. path: "/special_area",
  91. component: _1a495868,
  92. name: "special_area"
  93. }, {
  94. path: "/store_settled",
  95. component: _a3014a16,
  96. name: "store_settled"
  97. }, {
  98. path: "/account/forget_pwd",
  99. component: _2956a4c6,
  100. name: "account-forget_pwd"
  101. }, {
  102. path: "/account/login",
  103. component: _38939dde,
  104. name: "account-login"
  105. }, {
  106. path: "/account/register",
  107. component: _bebd7384,
  108. name: "account-register"
  109. }, {
  110. path: "/help_center/help_center_detail",
  111. component: _905be49c,
  112. name: "help_center-help_center_detail"
  113. }, {
  114. path: "/news_list/news_list_detail",
  115. component: _760c0378,
  116. name: "news_list-news_list_detail"
  117. }, {
  118. path: "/store_settled/detail",
  119. component: _8c81d984,
  120. name: "store_settled-detail"
  121. }, {
  122. path: "/store_settled/record",
  123. component: _2351673e,
  124. name: "store_settled-record"
  125. }, {
  126. path: "/user/address",
  127. component: _3572766c,
  128. name: "user-address"
  129. }, {
  130. path: "/user/after_sales",
  131. component: _246752a1,
  132. name: "user-after_sales"
  133. }, {
  134. path: "/user/collection",
  135. component: _2d1d9a0e,
  136. name: "user-collection"
  137. }, {
  138. path: "/user/coupons",
  139. component: _4b5eaf42,
  140. name: "user-coupons"
  141. }, {
  142. path: "/user/evaluation",
  143. component: _320e85da,
  144. name: "user-evaluation"
  145. }, {
  146. path: "/user/order",
  147. component: _830626f4,
  148. name: "user-order"
  149. }, {
  150. path: "/user/profile",
  151. component: _24454444,
  152. name: "user-profile"
  153. }, {
  154. path: "/user/user_wallet",
  155. component: _2a6c52bc,
  156. name: "user-user_wallet"
  157. }, {
  158. path: "/user/after_sales/after_sale_details",
  159. component: _46e7110e,
  160. name: "user-after_sales-after_sale_details"
  161. }, {
  162. path: "/user/after_sales/apply_result",
  163. component: _a39ccce2,
  164. name: "user-after_sales-apply_result"
  165. }, {
  166. path: "/user/after_sales/apply_sale",
  167. component: _63c2098e,
  168. name: "user-after_sales-apply_sale"
  169. }, {
  170. path: "/user/evaluation/evaluate",
  171. component: _2f441141,
  172. name: "user-evaluation-evaluate"
  173. }, {
  174. path: "/user/order/detail",
  175. component: _ad189866,
  176. name: "user-order-detail"
  177. }, {
  178. path: "/goods_details/:id?",
  179. component: _75e8abdb,
  180. name: "goods_details-id"
  181. }, {
  182. path: "/goods_list/:type?",
  183. component: _6e7ea3ea,
  184. name: "goods_list-type"
  185. }, {
  186. path: "/",
  187. component: _0f6a21ae,
  188. name: "index"
  189. }],
  190. fallback: false
  191. }
  192. export function createRouter (ssrContext, config) {
  193. const base = (config._app && config._app.basePath) || routerOptions.base
  194. const router = new Router({ ...routerOptions, base })
  195. // TODO: remove in Nuxt 3
  196. const originalPush = router.push
  197. router.push = function push (location, onComplete = emptyFn, onAbort) {
  198. return originalPush.call(this, location, onComplete, onAbort)
  199. }
  200. const resolve = router.resolve.bind(router)
  201. router.resolve = (to, current, append) => {
  202. if (typeof to === 'string') {
  203. to = normalizeURL(to)
  204. }
  205. return resolve(to, current, append)
  206. }
  207. return router
  208. }