<template>
	<view class="item" @click="handleClick">
		<view v-if="item.task_type == 1" class="icon-box">
			<image :class="'icon' + item.images" :src="item.result_images||item.images || item.img_url || item.url || '../../static/logo.png'" mode="widthFix" />
		</view>
		<view v-if="item.task_type == 2" :class="'icon-box icon-box' + item.task_type">
			<view>
				<image :class="'icon' + item.images" :src="item.result_images||item.images || item.img_url || item.url || '../../static/logo.png'" mode="widthFix" />
			</view>
		</view>
		<view class="name one-omit">{{ item.title || item.description || "作品" + index }}</view>
		<view class="secrecy" v-if="secrecy && item.status!=1">
			<image src="@/static/icon/wd_icon_suo.png"></image>
			仅个人可见
		</view>
	</view>
</template>

<script>
export default {
	props: {
		item: {
			type: Object,
			required: true
		},
		secrecy:{
			type: Boolean,
			default: false
		}, 
		
	},
	methods: {
		handleClick() {
			this.$emit('click', this.item);
		}
	}
};
</script>

<style scoped lang="scss">
 .item {
      width: 346rpx;
      height: 520rpx;
      margin-bottom: 30rpx;
      background: #fff;
      overflow: hidden;
      position: relative;
      left: 0;
      top: 0;
      .secrecy {
        position: absolute;
        left: 14rpx;
        top: 14rpx;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 24rpx;
        font-family: "PingFang SC-Medium";
        font-size: 20rpx;
        font-weight: 400;
        color: #fff;
        display: flex;
        align-items: center;
		justify-content: center;
		padding: 3rpx 12rpx;

        image {
          width: 24rpx;
          height: 24rpx;
        }
      }
      .icon-box {
        width: 346rpx;
        height: 468rpx;
        padding: 28rpx 20rpx;
        box-sizing: border-box;
        background-color: #f8f9fa;
        margin-bottom: 12rpx;
        .icon {
        }
        &.icon-box2 {
          > view {
            width: 346rpx;
            height: 346rpx;
            overflow: hidden;
          }
          overflow: hidden;
          display: flex;
          align-items: center;
          padding: 0;
          justify-content: center;
        }
      }
      .name {
        font-size: 28rpx;
        color: #1a4d2e;
        font-family: "PingFang SC-Medium";
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

	
</style>