WorkItem.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. .secrecy {
  52. position: absolute;
  53. left: 14rpx;
  54. top: 14rpx;
  55. background: rgba(0, 0, 0, 0.3);
  56. border-radius: 24rpx;
  57. font-family: "PingFang SC-Medium";
  58. font-size: 20rpx;
  59. font-weight: 400;
  60. color: #fff;
  61. display: flex;
  62. align-items: center;
  63. justify-content: center;
  64. padding: 3rpx 12rpx;
  65. image {
  66. width: 24rpx;
  67. height: 24rpx;
  68. }
  69. }
  70. .icon-box {
  71. width: 346rpx;
  72. height: 468rpx;
  73. padding: 28rpx 20rpx;
  74. box-sizing: border-box;
  75. background-color: #f8f9fa;
  76. margin-bottom: 12rpx;
  77. .icon {
  78. }
  79. &.icon-box2 {
  80. > view {
  81. width: 346rpx;
  82. height: 346rpx;
  83. overflow: hidden;
  84. }
  85. overflow: hidden;
  86. display: flex;
  87. align-items: center;
  88. padding: 0;
  89. justify-content: center;
  90. }
  91. }
  92. .name {
  93. font-size: 28rpx;
  94. color: #1a4d2e;
  95. font-family: "PingFang SC-Medium";
  96. white-space: nowrap;
  97. overflow: hidden;
  98. text-overflow: ellipsis;
  99. }
  100. }
  101. </style>