index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!-- @format -->
  2. <script lang="ts" setup>
  3. import { ConstKeys } from '~/enums/const-enums'
  4. import { Api } from '@/api/model/url'
  5. const list = ref([])
  6. const requestUrl = `${ConstKeys.DOMAINDEV}${Api.CatalogueList}`
  7. const params = { pageNo: 1, pageSize: 3, state: 1, trend: 1, order: 'desc' }
  8. const { data, pending, error, refresh } = await useAsyncData(
  9. 'catalogue-list',
  10. () => $fetch(requestUrl, { params }),
  11. )
  12. list.value = data.value?.result.records
  13. </script>
  14. <template>
  15. <div class="bg-#fff py-120px">
  16. <div class="w-1200-auto text-center">
  17. <h2 class="text-36px fw-800 text-#333 !mb-20px custom-title-font">
  18. Download with The Latest <span class="custom-title-bg">Trends</span>
  19. </h2>
  20. <div class="text-#999 w-850px text-22px mb-80px mx-auto lh-34px">
  21. Spot emerging hits, viral styles, and seasonal must-haves. Curated with
  22. real-time market insights to help you stock ahead of the trend curve.
  23. </div>
  24. <div class="flex flex-col gap-40px">
  25. <div v-for="(item, index) in list" :key="index">
  26. <business-trends-comp-item v-if="index % 2 === 0" :item="item" />
  27. <business-trends-comp-item2 v-else :item="item" />
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <style lang="less" scoped>
  34. </style>