TaskCard.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <div class="card">
  3. <div class="card-header card-header-image">
  4. <a href="#">
  5. <img src="@/assets/img/home_ban1.jpg" alt>
  6. </a>
  7. </div>
  8. <div class="card-body">
  9. <div class="card-title" :title="item.title">{{item.title}}</div>
  10. <div class="card-desc">
  11. <!-- <span>{{item.participantNum}}人已参与</span> -->
  12. </div>
  13. <div class="card-action">
  14. <div class="btn btn-small btn-info" @click="goToTaskDetail(item.projectId,item.id)">查看详情</div>
  15. <div class="participate-num">
  16. <!-- <span v-bind:class="['badge',{ 'ios-platform': item.toLowerCase()=='ios','android-platform': item.toLowerCase()=='android','web-platform': item.toLowerCase()=='web'}]" v-for="item in platformType">{{item}}</span> -->
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. // import PlatformType from '@/constants/enum/platform-type'
  24. export default {
  25. name: "Task-Card",
  26. props: { item: {} },
  27. data() {
  28. return {
  29. // platformType:[]
  30. }
  31. },
  32. mounted() {
  33. // this.item.platform.map((item)=>{
  34. // this.platformType.push(PlatformType[item])
  35. // })
  36. },
  37. watch:{
  38. item() {
  39. }
  40. },
  41. methods:{
  42. goToTaskDetail(projectId,id){
  43. this.$router.push({name: "Task", params: {projectId:projectId,taskId: id}})
  44. }
  45. }
  46. };
  47. </script>
  48. <style lang="less" scoped>
  49. .card {
  50. cursor: default;
  51. position: relative;
  52. display: flex;
  53. flex-direction: column;
  54. min-width: 0;
  55. word-wrap: break-word;
  56. border: 0;
  57. margin-bottom: 30px;
  58. margin-top: 30px;
  59. border-radius: 6px;
  60. color: rgba(0, 0, 0, 0.87);
  61. background: #fff;
  62. width: 100%;
  63. box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2),
  64. 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  65. .card-header {
  66. border: 0;
  67. }
  68. .card-body {
  69. padding: 5px 30px 15px;
  70. flex: 1 1 auto;
  71. }
  72. }
  73. .card .card-header.card-header-image {
  74. position: relative;
  75. padding: 0;
  76. z-index: 1;
  77. margin-left: 15px;
  78. margin-right: 15px;
  79. margin-top: -30px;
  80. border-radius: 6px;
  81. }
  82. .card .card-header.card-header-image img {
  83. width: 100%;
  84. border-radius: 6px;
  85. pointer-events: none;
  86. box-shadow: 0px 16px 20px -8px rgba(0, 0, 0, 0.24),
  87. 0px 9px 9px -5px rgba(0, 0, 0, 0.2);
  88. }
  89. .card .card-header.card-header-image .colored-shadow {
  90. transform: scale(0.94);
  91. top: 12px;
  92. filter: blur(12px);
  93. position: absolute;
  94. width: 100%;
  95. height: 100%;
  96. background-size: cover;
  97. z-index: -1;
  98. transition: opacity 0.45s;
  99. opacity: 1;
  100. }
  101. .card .card-desc {
  102. min-height: 5px;
  103. margin: 10px 0;
  104. font-size: 1.2rem;
  105. text-transform: uppercase;
  106. font-weight: 500;
  107. line-height: 18px;
  108. }
  109. .card .card-title:last-child {
  110. margin-bottom: 0;
  111. }
  112. .card .card-title {
  113. margin-top: 10px;
  114. color: #3c4858;
  115. font-size: 1.8rem;
  116. font-weight: 700;
  117. text-overflow: ellipsis;
  118. overflow: hidden;
  119. white-space: nowrap;
  120. text-align: center;
  121. }
  122. .card-action {
  123. margin: 0 auto;
  124. text-align: center;
  125. }
  126. .participate-num{
  127. font-size: 1rem;
  128. padding-top:5px;
  129. }
  130. </style>