WorkItem.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. background-color: #f8f9fa;
  84. margin-bottom: 12rpx;
  85. border-radius: 16rpx;
  86. transition: all 0.3s ease;
  87. &:active {
  88. opacity: 0.9;
  89. }
  90. .icon {
  91. transition: all 0.3s ease;
  92. }
  93. &.icon-box2 {
  94. > view {
  95. width: 346rpx;
  96. height: 346rpx;
  97. overflow: hidden;
  98. }
  99. overflow: hidden;
  100. display: flex;
  101. align-items: center;
  102. padding: 0;
  103. justify-content: center;
  104. }
  105. }
  106. .name {
  107. font-size: 28rpx;
  108. color: #1a4d2e;
  109. font-family: "PingFang SC-Medium";
  110. white-space: nowrap;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. transition: all 0.3s ease;
  114. }
  115. }
  116. </style>