index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <script lang='ts' setup>
  2. import { ArrowRight } from '@element-plus/icons-vue'
  3. import { getFeatureListApi } from '~/api/model/feature'
  4. import { PageSizeEnum } from '~/enums/sizeEnum'
  5. import { useUserStore } from '@/stores/modules/user'
  6. import { ConstKeys } from '~/enums/const-enums'
  7. useHead({
  8. title:
  9. 'Product Collections | Discover Top Picks and Trending Items at EJET Selection',
  10. meta: [
  11. {
  12. name: 'description',
  13. content: `Explore unique and high-quality wholesale products designed to elevate your retail success! Discover top brands and trending products at EJET Selection's Product Collections. `,
  14. },
  15. {
  16. property: 'og:title',
  17. content: 'Product Collections | Discover Top Picks and Trending Items at EJET Selection',
  18. },
  19. {
  20. property: 'og:description',
  21. content:
  22. `Explore unique and high-quality wholesale products designed to elevate your retail success! Discover top brands and trending products at EJET Selection's Product Collections. `,
  23. },
  24. {
  25. property: 'og:type',
  26. content: 'website',
  27. },
  28. {
  29. property: 'twitter:title',
  30. content: 'Product Collections | Discover Top Picks and Trending Items at EJET Selection',
  31. },
  32. {
  33. property: 'twitter:description',
  34. content:
  35. `Explore unique and high-quality wholesale products designed to elevate your retail success! Discover top brands and trending products at EJET Selection's Product Collections. `,
  36. },
  37. {
  38. property: 'twitter:card',
  39. content: 'summary_large_image',
  40. },
  41. ],
  42. link: [
  43. {
  44. rel: 'canonical',
  45. href: `${ConstKeys.DOMAINPRO}/collections`,
  46. },
  47. ],
  48. })
  49. const userStore = useUserStore()
  50. const { isLogin } = storeToRefs(userStore)
  51. const { openLoginModal } = useLoginModal()
  52. const list = ref<any>([])
  53. const moreList = ref<any>([])
  54. const total = ref(0)
  55. const currentPage = ref(0)
  56. const page_size = ref(10)
  57. async function getFeatureList(
  58. pageNo = PageSizeEnum.PAGE,
  59. pageSize = page_size.value,
  60. ) {
  61. const params = {
  62. pageNo,
  63. pageSize,
  64. }
  65. const res: any = await getFeatureListApi(params)
  66. list.value = res.records
  67. currentPage.value = res.current
  68. total.value = res.total
  69. }
  70. async function getMoreList(pageNo = PageSizeEnum.PAGE, pageSize = 3) {
  71. const params = {
  72. pageNo,
  73. pageSize,
  74. }
  75. const res: any = await getFeatureListApi(params)
  76. moreList.value = res.records
  77. }
  78. getFeatureList()
  79. getMoreList()
  80. function updatePage(currentPage: number, pageSize: number) {
  81. const dom: any = document.getElementById('app-scroller')
  82. dom.scrollTo({
  83. top: 400,
  84. behavior: 'smooth',
  85. })
  86. getFeatureList(currentPage, pageSize)
  87. }
  88. </script>
  89. <template>
  90. <div>
  91. <div>
  92. <div class="relative">
  93. <img
  94. src="~/assets/images/featured_banner.png"
  95. class="w-full h-[400px] object-cover"
  96. alt=""
  97. srcset=""
  98. >
  99. <div
  100. class="pos-absolute text-center top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]"
  101. >
  102. <h1 class="!mb-20px text-#fff text-48px fw-700 custom-title-font">
  103. Product Collections
  104. </h1>
  105. <div class="mb-48px text-#f4f4f4 text-24px">
  106. Discover top picks and trending items for your retail success
  107. </div>
  108. <div v-if="!isLogin">
  109. <el-button
  110. type="primary"
  111. plain
  112. class="w-176px !bg-#C58C46 !text-#fff !h-48px !text-18px !fw-500 !b-rd-150px"
  113. @click="openLoginModal"
  114. >
  115. Sign on EJET
  116. </el-button>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="w-1400px mx-auto">
  121. <div class="pt-40px pb-60px">
  122. <el-breadcrumb :separator-icon="ArrowRight">
  123. <el-breadcrumb-item :to="{ path: '/' }">
  124. Home
  125. </el-breadcrumb-item>
  126. <el-breadcrumb-item> Collections</el-breadcrumb-item>
  127. </el-breadcrumb>
  128. </div>
  129. <div class="mb-100px">
  130. <div
  131. v-if="list.length"
  132. class="grid grid-cols-2 gap-x-60px gap-y-100px"
  133. >
  134. <div v-for="item in list" :key="item.id">
  135. <common-featured-item3 v-if="item.type === '1'" :item />
  136. <common-featured-item v-else :item />
  137. </div>
  138. </div>
  139. <div v-if="list.length" class="flex justify-center mt-60px">
  140. <el-pagination
  141. v-model:current-page="currentPage"
  142. :page-size="page_size"
  143. :pager-count="10"
  144. layout="prev, pager, next"
  145. :total="total"
  146. @change="updatePage"
  147. />
  148. </div>
  149. <common-empty v-else class="pt-50px" title="">
  150. <template #icon>
  151. <img
  152. src="~/assets/images/featured_empty.png"
  153. class="w-200px h-200px"
  154. alt=""
  155. srcset=""
  156. >
  157. </template>
  158. </common-empty>
  159. </div>
  160. </div>
  161. </div>
  162. <div class="w-1400px mx-auto mb-160px">
  163. <h1 class="fw-500 text-30px text-center text-#333 !mb-50px">
  164. Explore More Product Collections
  165. </h1>
  166. <div class="grid grid-cols-3 gap-x-106px px-66px">
  167. <div v-for="(item, index) in moreList" :key="index">
  168. <common-featured-item2 :item />
  169. </div>
  170. </div>
  171. </div>
  172. <AppFooter />
  173. </div>
  174. </template>
  175. <style lang='less' scoped>
  176. </style>