item2.vue 1.7 KB

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