WorkItem.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="item" @click="handleClick">
  3. <view v-if="item.task_type == 1" class="icon-box">
  4. <image :class="'icon' + item.images" :src="item.result_images||item.images || item.img_url || item.url || '../../static/logo.png'" mode="widthFix" />
  5. </view>
  6. <view v-if="item.task_type == 2" :class="'icon-box icon-box' + item.task_type">
  7. <view>
  8. <image :class="'icon' + item.images" :src="item.result_images||item.images || item.img_url || item.url || '../../static/logo.png'" mode="widthFix" />
  9. </view>
  10. </view>
  11. <view class="name one-omit" v-if="subtitle">{{ item.title || item.description || "作品" + index }}</view>
  12. <view class="secrecy" v-if="secrecy && item.status!=1">
  13. <image src="@/static/icon/wd_icon_suo.png"></image>
  14. 仅个人可见
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. item: {
  22. type: Object,
  23. required: true
  24. },
  25. secrecy:{
  26. type: Boolean,
  27. default: false
  28. },
  29. subtitle:{
  30. type: Boolean,
  31. default: false
  32. },
  33. },
  34. methods: {
  35. handleClick() {
  36. this.$emit('click', this.item);
  37. }
  38. }
  39. };
  40. </script>
  41. <style scoped lang="scss">
  42. .item {
  43. width: 346rpx;
  44. height: 520rpx;
  45. margin-bottom: 30rpx;
  46. background: #fff;
  47. overflow: hidden;
  48. position: relative;
  49. left: 0;
  50. top: 0;
  51. transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  52. // box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  53. border-radius: 16rpx;
  54. &:active {
  55. transform: scale(0.98);
  56. box-shadow: 0 1rpx 4rpx rgba(0, 0, 0, 0.05);
  57. }
  58. .secrecy {
  59. position: absolute;
  60. left: 14rpx;
  61. top: 14rpx;
  62. background: rgba(0, 0, 0, 0.3);
  63. border-radius: 12rpx;
  64. font-family: "PingFang SC-Medium";
  65. font-size: 20rpx;
  66. font-weight: 400;
  67. color: #fff;
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. padding: 3rpx 12rpx;
  72. z-index: 1;
  73. image {
  74. width: 24rpx;
  75. height: 24rpx;
  76. }
  77. }
  78. .icon-box {
  79. width: 346rpx;
  80. height: 468rpx;
  81. // padding: 28rpx 20rpx;
  82. box-sizing: border-box;
  83. margin-bottom: 12rpx;
  84. border-radius: 16rpx;
  85. transition: all 0.3s ease;
  86. >image{
  87. border-radius: 16rpx;
  88. }
  89. &:active {
  90. opacity: 0.9;
  91. }
  92. .icon {
  93. transition: all 0.3s ease;
  94. }
  95. &.icon-box2 {
  96. >image{
  97. border-radius: 0;
  98. }
  99. > view {
  100. width: 346rpx;
  101. height: 346rpx;
  102. overflow: hidden;
  103. }
  104. background-color: #f8f9fa;
  105. overflow: hidden;
  106. display: flex;
  107. align-items: center;
  108. padding: 0;
  109. justify-content: center;
  110. }
  111. }
  112. .name {
  113. font-size: 28rpx;
  114. color: #1a4d2e;
  115. font-family: "PingFang SC-Medium";
  116. white-space: nowrap;
  117. overflow: hidden;
  118. text-overflow: ellipsis;
  119. transition: all 0.3s ease;
  120. }
  121. }
  122. </style>