index.vue 1.3 KB

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