router.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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 _7c7dbcee = () => interopDefault(import('../pages/category/index.vue' /* webpackChunkName: "pages/category/index" */))
  7. const _aa3d22f2 = () => interopDefault(import('../pages/media.vue' /* webpackChunkName: "pages/media" */))
  8. const _401b3855 = () => interopDefault(import('../pages/product/index.vue' /* webpackChunkName: "pages/product/index" */))
  9. const _5af35f06 = () => interopDefault(import('../pages/setNewPassword.vue' /* webpackChunkName: "pages/setNewPassword" */))
  10. const _69a8e4bc = () => interopDefault(import('../pages/category/searchResult/index.vue' /* webpackChunkName: "pages/category/searchResult/index" */))
  11. const _96c656d2 = () => interopDefault(import('../pages/home/api.vue' /* webpackChunkName: "pages/home/api" */))
  12. const _6fc9ddc6 = () => interopDefault(import('../pages/home/contact.vue' /* webpackChunkName: "pages/home/contact" */))
  13. const _0f95dfe0 = () => interopDefault(import('../pages/home/contactPromoCollection.vue' /* webpackChunkName: "pages/home/contactPromoCollection" */))
  14. const _7791253d = () => interopDefault(import('../pages/home/currentFlyer/index.vue' /* webpackChunkName: "pages/home/currentFlyer/index" */))
  15. const _5f561110 = () => interopDefault(import('../pages/home/downloadCenter.vue' /* webpackChunkName: "pages/home/downloadCenter" */))
  16. const _5b52961e = () => interopDefault(import('../pages/home/loyaltyProgram.vue' /* webpackChunkName: "pages/home/loyaltyProgram" */))
  17. const _2c1031f3 = () => interopDefault(import('../pages/home/myDetail/index.vue' /* webpackChunkName: "pages/home/myDetail/index" */))
  18. const _385ecf17 = () => interopDefault(import('../pages/home/privacyPolicy.vue' /* webpackChunkName: "pages/home/privacyPolicy" */))
  19. const _702bda68 = () => interopDefault(import('../pages/home/refundReturns.vue' /* webpackChunkName: "pages/home/refundReturns" */))
  20. const _51dd401c = () => interopDefault(import('../pages/home/termsConditions.vue' /* webpackChunkName: "pages/home/termsConditions" */))
  21. const _423a5215 = () => interopDefault(import('../pages/home/myDetail/enquiryDetail.vue' /* webpackChunkName: "pages/home/myDetail/enquiryDetail" */))
  22. const _1e9e4dc0 = () => interopDefault(import('../pages/home/myDetail/orderDetail.vue' /* webpackChunkName: "pages/home/myDetail/orderDetail" */))
  23. const _3084c9f0 = () => interopDefault(import('../pages/home/myDetail/components/orderDetailPart.vue' /* webpackChunkName: "pages/home/myDetail/components/orderDetailPart" */))
  24. const _09a9ff16 = () => interopDefault(import('../pages/index.vue' /* webpackChunkName: "pages/index" */))
  25. const _141c59b4 = () => interopDefault(import('../pages/category/_firstCategory/index.vue' /* webpackChunkName: "pages/category/_firstCategory/index" */))
  26. const _c045b4e4 = () => interopDefault(import('../pages/news/_newsName.vue' /* webpackChunkName: "pages/news/_newsName" */))
  27. const _5aa052d9 = () => interopDefault(import('../pages/product-record/_code.vue' /* webpackChunkName: "pages/product-record/_code" */))
  28. const _41e5e94f = () => interopDefault(import('../pages/product/_code.vue' /* webpackChunkName: "pages/product/_code" */))
  29. const _17b97aa6 = () => interopDefault(import('../pages/qrcode/_id.vue' /* webpackChunkName: "pages/qrcode/_id" */))
  30. const _98d6d370 = () => interopDefault(import('../pages/category/_firstCategory/_secondCategory/index.vue' /* webpackChunkName: "pages/category/_firstCategory/_secondCategory/index" */))
  31. const _36fded83 = () => interopDefault(import('../pages/category/_firstCategory/_secondCategory/_thirdCategory/index.vue' /* webpackChunkName: "pages/category/_firstCategory/_secondCategory/_thirdCategory/index" */))
  32. const _88e82796 = () => interopDefault(import('../pages/orderShare/_uid/_aid/_id.vue' /* webpackChunkName: "pages/orderShare/_uid/_aid/_id" */))
  33. const emptyFn = () => {}
  34. Vue.use(Router)
  35. export const routerOptions = {
  36. mode: 'history',
  37. base: '/',
  38. linkActiveClass: 'nuxt-link-active',
  39. linkExactActiveClass: 'nuxt-link-exact-active',
  40. scrollBehavior,
  41. routes: [{
  42. path: "/category",
  43. component: _7c7dbcee,
  44. name: "category"
  45. }, {
  46. path: "/media",
  47. component: _aa3d22f2,
  48. name: "media"
  49. }, {
  50. path: "/product",
  51. component: _401b3855,
  52. name: "product"
  53. }, {
  54. path: "/setNewPassword",
  55. component: _5af35f06,
  56. name: "setNewPassword"
  57. }, {
  58. path: "/category/searchResult",
  59. component: _69a8e4bc,
  60. name: "category-searchResult"
  61. }, {
  62. path: "/home/api",
  63. component: _96c656d2,
  64. name: "home-api"
  65. }, {
  66. path: "/home/contact",
  67. component: _6fc9ddc6,
  68. name: "home-contact"
  69. }, {
  70. path: "/home/contactPromoCollection",
  71. component: _0f95dfe0,
  72. name: "home-contactPromoCollection"
  73. }, {
  74. path: "/home/currentFlyer",
  75. component: _7791253d,
  76. name: "home-currentFlyer"
  77. }, {
  78. path: "/home/downloadCenter",
  79. component: _5f561110,
  80. name: "home-downloadCenter"
  81. }, {
  82. path: "/home/loyaltyProgram",
  83. component: _5b52961e,
  84. name: "home-loyaltyProgram"
  85. }, {
  86. path: "/home/myDetail",
  87. component: _2c1031f3,
  88. name: "home-myDetail"
  89. }, {
  90. path: "/home/privacyPolicy",
  91. component: _385ecf17,
  92. name: "home-privacyPolicy"
  93. }, {
  94. path: "/home/refundReturns",
  95. component: _702bda68,
  96. name: "home-refundReturns"
  97. }, {
  98. path: "/home/termsConditions",
  99. component: _51dd401c,
  100. name: "home-termsConditions"
  101. }, {
  102. path: "/home/myDetail/enquiryDetail",
  103. component: _423a5215,
  104. name: "home-myDetail-enquiryDetail"
  105. }, {
  106. path: "/home/myDetail/orderDetail",
  107. component: _1e9e4dc0,
  108. name: "home-myDetail-orderDetail"
  109. }, {
  110. path: "/home/myDetail/components/orderDetailPart",
  111. component: _3084c9f0,
  112. name: "home-myDetail-components-orderDetailPart"
  113. }, {
  114. path: "/",
  115. component: _09a9ff16,
  116. name: "index"
  117. }, {
  118. path: "/category/:firstCategory",
  119. component: _141c59b4,
  120. name: "category-firstCategory"
  121. }, {
  122. path: "/news/:newsName?",
  123. component: _c045b4e4,
  124. name: "news-newsName"
  125. }, {
  126. path: "/product-record/:code",
  127. component: _5aa052d9,
  128. name: "product-record-code"
  129. }, {
  130. path: "/product/:code",
  131. component: _41e5e94f,
  132. name: "product-code"
  133. }, {
  134. path: "/qrcode/:id?",
  135. component: _17b97aa6,
  136. name: "qrcode-id"
  137. }, {
  138. path: "/category/:firstCategory/:secondCategory",
  139. component: _98d6d370,
  140. name: "category-firstCategory-secondCategory"
  141. }, {
  142. path: "/category/:firstCategory/:secondCategory/:thirdCategory",
  143. component: _36fded83,
  144. name: "category-firstCategory-secondCategory-thirdCategory"
  145. }, {
  146. path: "/orderShare/:uid?/:aid?/:id?",
  147. component: _88e82796,
  148. name: "orderShare-uid-aid-id"
  149. }],
  150. fallback: false
  151. }
  152. export function createRouter (ssrContext, config) {
  153. const base = (config._app && config._app.basePath) || routerOptions.base
  154. const router = new Router({ ...routerOptions, base })
  155. // TODO: remove in Nuxt 3
  156. const originalPush = router.push
  157. router.push = function push (location, onComplete = emptyFn, onAbort) {
  158. return originalPush.call(this, location, onComplete, onAbort)
  159. }
  160. const resolve = router.resolve.bind(router)
  161. router.resolve = (to, current, append) => {
  162. if (typeof to === 'string') {
  163. to = normalizeURL(to)
  164. }
  165. return resolve(to, current, append)
  166. }
  167. return router
  168. }