<template>
  <view
    style="width: 210rpx;"
    @click="navGetVideo"
  >
    <view class="dataItem-header">
      <image
        :src="data.cover"
        mode="aspectFill"
        style="width:210rpx;height:280rpx;"
      />
      <image
        v-if="isEdit"
        style="position: absolute;top: 0;left:0;width:210rpx;height:280rpx;"
       
        src="/static/images/edit-show.png"
        mode="aspectFill"
        @click="delItem(data)"
      />
    </view>
    <text class="dataItem-title text-one">
      {{ data.name }}
    </text>
    <text class="dataItem-text text-one">
      {{ data.description }}
    </text>
  </view>
</template>

<script>
export default {
	props: {
		data: {
			type: Object,
			default: () => {
				return {};
			}
		},
		isEdit: {
			type: Boolean,
			defaule: false
		}
	},
	methods: {
		navGetVideo() {
			if (!this.isEdit) {
				
				uni.navigateTo({
					url: `/pages/video/index?sid=${this.data.id}`
				});
			}
		},
		delItem(item) {
			this.$emit('del', item);
			this.$forceUpdate();
		}
	}
};
</script>

<style lang="scss">
.dataItem-header {
	position: relative;
	width: 210rpx;
	height: 280rpx;
	border-radius: 10rpx;
	overflow: hidden;
}
.dataItem-title {
	font-size: 28rpx;
	font-weight: 500;
	color: #1a1a1a;
	margin-top: 12rpx;
	margin-bottom: 8rpx;
}
.dataItem-text {
	font-size: 24rpx;
	font-weight: 400;
	color: #999999;
}
</style>
