index.vue 1.2 KB

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