item.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <script lang='ts' setup>
  2. import { useCommonStore } from '@/stores/modules/common'
  3. defineProps({
  4. item: Object as any,
  5. })
  6. const { openLoginAndDownloadModal } = useLoginAndDownLoadModal()
  7. async function clickLoginAndDownload(item: any) {
  8. try {
  9. const commonStore = useCommonStore()
  10. commonStore.setDownloadCatalog(item)
  11. const { status } = await openLoginAndDownloadModal()
  12. if (status)
  13. location.reload()
  14. }
  15. catch (error) {
  16. console.log(error)
  17. }
  18. }
  19. </script>
  20. <template>
  21. <div>
  22. <div class="pos-relative bg-#fff shadow-item flex b-rd-20px overflow-hidden p-40px items-center">
  23. <img
  24. :src="item.coverImg"
  25. :alt="item.coverAlt" srcset="" class="w-500px h-380px b-rd-10px object-cover mr-50px"
  26. >
  27. <div class="flex-1 text-left">
  28. <h3
  29. class="!mb-20px fw-800 text-24px text-#333 line-clamp-2"
  30. >
  31. {{ item.title }}
  32. </h3>
  33. <div class="text-16px text-#999 lh-24px mb-60px">
  34. {{ item.subhead }}
  35. </div>
  36. <div class="flex items-center">
  37. <el-button class="!bg-#9B6CFF w-140px text-14px !text-#fff !b-#9B6CFF !h-48px py-18px">
  38. <NuxtLink :to="`/blog/${item.blogSlug}`">
  39. Learn More
  40. </NuxtLink>
  41. </el-button>
  42. <el-button class="!bg-#fff w-150px text-14px !text-#9B6CFF !b-#9B6CFF !h-48px px-24px" @click="clickLoginAndDownload(item)">
  43. Download Catalog
  44. </el-button>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <style lang='less' scoped>
  51. .shadow-item{
  52. box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.1);
  53. }
  54. </style>