WorkItem.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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">{{ 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. },
  30. methods: {
  31. handleClick() {
  32. this.$emit('click', this.item);
  33. }
  34. }
  35. };
  36. </script>
  37. <style scoped lang="scss">
  38. .item {
  39. width: 346rpx;
  40. height: 520rpx;
  41. margin-bottom: 30rpx;
  42. background: #fff;
  43. overflow: hidden;
  44. position: relative;
  45. left: 0;
  46. top: 0;
  47. .secrecy {
  48. position: absolute;
  49. left: 14rpx;
  50. top: 14rpx;
  51. background: rgba(0, 0, 0, 0.3);
  52. border-radius: 24rpx;
  53. font-family: "PingFang SC-Medium";
  54. font-size: 20rpx;
  55. font-weight: 400;
  56. color: #fff;
  57. display: flex;
  58. align-items: center;
  59. justify-content: center;
  60. padding: 3rpx 12rpx;
  61. image {
  62. width: 24rpx;
  63. height: 24rpx;
  64. }
  65. }
  66. .icon-box {
  67. width: 346rpx;
  68. height: 468rpx;
  69. padding: 28rpx 20rpx;
  70. box-sizing: border-box;
  71. background-color: #f8f9fa;
  72. margin-bottom: 12rpx;
  73. .icon {
  74. }
  75. &.icon-box2 {
  76. > view {
  77. width: 346rpx;
  78. height: 346rpx;
  79. overflow: hidden;
  80. }
  81. overflow: hidden;
  82. display: flex;
  83. align-items: center;
  84. padding: 0;
  85. justify-content: center;
  86. }
  87. }
  88. .name {
  89. font-size: 28rpx;
  90. color: #1a4d2e;
  91. font-family: "PingFang SC-Medium";
  92. white-space: nowrap;
  93. overflow: hidden;
  94. text-overflow: ellipsis;
  95. }
  96. }
  97. </style>