item2.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. <div class="flex-1 text-left">
  24. <h3
  25. class="!mb-20px fw-800 text-24px text-#333 line-clamp-2"
  26. >
  27. {{ item.title }}
  28. </h3>
  29. <div class="text-16px text-#999 lh-24px mb-60px">
  30. {{ item.subhead }}
  31. </div>
  32. <div class="flex items-center">
  33. <el-button class="!bg-#9B6CFF w-140px text-14px !text-#fff !b-#9B6CFF !h-48px py-18px">
  34. <NuxtLink :to="`/blog/${item.blogSlug}`">
  35. Learn More
  36. </NuxtLink>
  37. </el-button>
  38. <el-button class="!bg-#fff w-150px text-14px !text-#9B6CFF !b-#9B6CFF !h-48px px-24px" @click="clickLoginAndDownload(item)">
  39. Download Catalog
  40. </el-button>
  41. </div>
  42. </div>
  43. <img
  44. :src="item.coverImg"
  45. :alt="item.coverAlt" srcset="" class="w-500px h-380px b-rd-10px object-cover ml-50px"
  46. >
  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>