item.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 class="custom-main mx-auto overflow-hidden pos-relative">
  22. <svgo-star class="pos-absolute top-20px right-20px w-20px h-20px" />
  23. <div class="p-20px pb-30px">
  24. <h2 class="!mb-15px w-250px text-24px fw-800 text-#333 line-clamp-2 custom-title-font">
  25. {{ item.title }}
  26. </h2>
  27. <div class="text-#666 lh-24px line-clamp-2">
  28. {{ item.subhead }}
  29. </div>
  30. </div>
  31. <img
  32. :src="item.coverImg"
  33. :alt="item.coverAlt"
  34. srcset=""
  35. class="w-100% b-rd-tl-10px b-rd-tr-10px object-cover"
  36. >
  37. <div class="pos-absolute bottom-20px left-20px cursor-pointer text-#fff bg-#fff/50 b-1px b-transparent b-solid h-40px pr-8px pl-30px hover:b-1px hover:b-#fff hover:b-solid backdrop-blur-20px text-14px fw-bold b-rd-400px flex items-center justify-center" @click="clickLoginAndDownload(item)">
  38. <div>Download</div>
  39. <div class="p-5px b-rd-50% bg-#fff ml-20px">
  40. <svgo-download class="w-14px h-14px text-#333333" />
  41. </div>
  42. </div>
  43. </div>
  44. </template>
  45. <style lang="less" scoped>
  46. .custom-main{
  47. width: 386px;
  48. height: 468px;
  49. border-radius: 10px;
  50. // background: #fff;
  51. }
  52. </style>