router.js 7.5 KB

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