course-card.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div class="course-card list_item_animation" >
  3. <div class="bg_color_f5 coverImg" @click.stop.prevent="goWorkflowDetail">
  4. <img :src="info.coverImage" alt="" class="coverImg" />
  5. </div>
  6. <div class="course-card-bottom-height"></div>
  7. <div class="padding16 course-card-bottom">
  8. <div class="gap10">
  9. <img :src="riliIcon" alt="" style="width: 16px; height: 16px;">
  10. <div class="font_size13">{{info.createTime || ''}}</div>
  11. </div>
  12. <div style="min-height: 82px;" @click.stop.prevent="goWorkflowDetail">
  13. <div class="line2 font_size18 line_height26 bold mt10">
  14. {{info.workflowTitle || ''}}
  15. </div>
  16. <div class="mt10 line1 gray font_size13">
  17. {{info.description || ''}}
  18. </div>
  19. </div>
  20. <div class="mt10 flex-center-between">
  21. <div class="gap10">
  22. <el-avatar :size="24" :src="info.userAvatar || appStore.avatarDefault" />
  23. <div class="font_size14">{{info.nickName || '张三'}}</div>
  24. </div>
  25. <div class="gap10 contactInfo_bg border_radius_4">
  26. <img :src="yunIcon" alt="" style="width: 16px; height: 16px;" />
  27. <div class="font_size13">{{info.categoryName1}}平台</div>
  28. </div>
  29. </div>
  30. <div class="gap10 mt16 button-container">
  31. <el-button type="primary" class="flex_1" size="large" plain @click.stop.prevent="goWorkflowDetail">
  32. <el-icon class="mr10"><Document /></el-icon>
  33. 查看详情
  34. </el-button>
  35. <el-button type="primary" class="flex_1 gradient" size="large">
  36. <el-icon class="mr10"><VideoPlay /></el-icon>
  37. 开始使用
  38. </el-button>
  39. </div>
  40. </div>
  41. <!-- <div class="flex-center-between">
  42. <img :src="n8Icon" alt="" style="width: 50px; height: 50px;" class="mr10">
  43. <div class="line2 font_size18 line_height22 font_weight400">
  44. 【Linux】【操作】Linux操作集锦系列之十五——如何破解pdf如何破解pdf如何破解pdf如何破解pdf如何破解pdf
  45. </div>
  46. </div>
  47. <div class="mt16 gap10">
  48. <img :src="yunIcon" alt="" style="width: 16px; height: 16px;">
  49. <div class="font_size13">n8n平台</div>
  50. <img :src="riliIcon" alt="" style="width: 16px; height: 16px;">
  51. <div class="font_size13">2023-10-15</div>
  52. </div>
  53. <div class="mt16 line3 gray font_size13">
  54. - 本文介绍两款开源的密码破解工具John the Ripper和PDFCrack,用于破解PDF、Word、Excel、ZIP、RAR等文件的密码。John the Ripper支持字典和暴力破解两种模
  55. </div>
  56. <div class="gap10 mt16">
  57. <el-button type="primary" class="flex_1" size="large" plain>
  58. <el-icon class="mr10"><Document /></el-icon>
  59. 查看详情
  60. </el-button>
  61. <el-button type="primary" class="flex_1 gradient" size="large">
  62. <el-icon class="mr10"><VideoPlay /></el-icon>
  63. 开始使用
  64. </el-button>
  65. </div> -->
  66. </div>
  67. </template>
  68. <script setup>
  69. import n8Icon from '@/assets/imgs/8n8.png'
  70. import yunIcon from '@/assets/imgs/yun.png'
  71. import riliIcon from '@/assets/imgs/rili.png'
  72. import { useAppStore } from '@/pinia/appStore'
  73. const appStore = useAppStore();
  74. import { useRouter } from 'vue-router'
  75. const router = useRouter()
  76. const props = defineProps({
  77. info: {
  78. type: Object,
  79. default: () => ({})
  80. },
  81. fromPage: {
  82. type: String,
  83. default: () => ''
  84. }
  85. });
  86. const goWorkflowDetail = () => {
  87. let path = `/search-platform/workflow-detail`
  88. if(props.fromPage === 'home'){
  89. path = `/workflow-detail`
  90. }
  91. //增加参数名称
  92. router.push({
  93. path: path,
  94. query: {
  95. publishId:props.info.publishId,
  96. metaTitle: 'route.WorkflowDetail'
  97. }
  98. })
  99. };
  100. </script>
  101. <style scoped lang="scss">
  102. .course-card {
  103. width: 368px;
  104. border: 1px solid #ffffff;
  105. // background-color: rgba(255, 255, 255, 0.5);
  106. background-color: #ffffff;
  107. border-radius: 8px;
  108. overflow: hidden;
  109. cursor: pointer;
  110. position: relative; // 添加相对定位
  111. // transition: transform 0.3s;
  112. // &:hover {
  113. // transform: translateY(-5px);
  114. // box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  115. // }
  116. .line2{
  117. //hover 显示下划线
  118. text-decoration: none;
  119. &:hover{
  120. text-decoration: underline;
  121. }
  122. }
  123. .coverImg{
  124. width: 100%;
  125. height: 204px;
  126. }
  127. .course-card-bottom {
  128. position: absolute;
  129. left: 0;
  130. right: 0;
  131. bottom: 0;
  132. padding: 16px;
  133. background: white; // 确保背景色
  134. transform: translateY(60px); // 初始完全在下方隐藏
  135. transition: transform 0.3s ease;
  136. }
  137. &:hover {
  138. .course-card-bottom {
  139. transform: translateY(0); // 悬浮时上移显示
  140. }
  141. }
  142. .course-card-bottom-height{
  143. height: 174px;
  144. }
  145. }
  146. </style>