item.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 class="custom-main mx-auto overflow-hidden pos-relative bg-#F3F4FB">
  23. <svgo-star class="pos-absolute top-20px right-20px w-20px h-20px" />
  24. <div class="p-20px pb-30px">
  25. <h2 class="!mb-15px w-250px text-24px fw-800 text-#333 line-clamp-2 custom-title-font">
  26. {{ item.title }}
  27. </h2>
  28. <div class="text-#666 lh-24px line-clamp-2">
  29. {{ item.subhead }}
  30. </div>
  31. </div>
  32. <img
  33. :src="item.coverImg"
  34. :alt="item.coverAlt"
  35. srcset=""
  36. class="w-100% b-rd-tl-10px b-rd-tr-10px object-cover"
  37. >
  38. <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)">
  39. <div>{{ item.downloadCondition === Condition.REQUEST ? 'Request' : 'Download' }}</div>
  40. <div class="p-5px b-rd-50% bg-#fff ml-20px">
  41. <svgo-download class="w-14px h-14px text-#333333" />
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <style lang="less" scoped>
  47. .custom-main{
  48. width: 386px;
  49. height: 468px;
  50. border-radius: 10px;
  51. // background: #fff;
  52. }
  53. </style>