<template>
	<view class="cardList">
		<view class="content" >
			<view class="left">
				<image :src="images[0]" mode="aspectFill"></image>
			</view>
			<view class="right">
				<view class="detailed">
					<view class="title">{{$ot(item, 'active', 'title')}}</view>
					<view class="date">{{item.createTime}}</view>
					<view class="address">{{$ot(item, 'active', 'address')}}</view>
				</view>
				<view class="price" v-if="showBottom">
					<view class="num-box">{{ item.doNum || 0 }}/{{ item.num || 0 }}</view>
					<view class="btn-box" @click="qiandaoClick"
					>{{$t('components.zhaomu.zlxItem.startSignIn')}}</view>
					<!-- <view class="btn-box jieshu-btn" v-else>已结束</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			item: {
				type: Object,
				default: {}
			},
			showBottom : {
				default : false,
			},
		},
		data() {
			return {

			};
		},
		components: {

		},
		computed: {
			images(){
				return this.item.image ? this.item
				.image.split(','): []
			},
		},
		watch: {

		},
		created() {

		},
		mounted() {},
		methods: {
			qiandaoClick() {
				this.$emit('qiandaoClick')
			}
		}
	};
</script>

<style scoped lang="scss">
	.cardList {
		.content {
			display: flex;
			padding: 24rpx 35rpx;
			background: #1B1713;
			border-radius: 20rpx;
			margin-bottom: 20rpx;

			.left {
				width: 228rpx;
				height: 228rpx;
				border-radius: 20rpx;
				overflow: hidden;
				flex-shrink: 0;
				image {
					width: 100%;
					height: 100%;
				}
			}

			.right {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				flex: 1;
				margin-left: 26rpx;
				color: $uni-text-color-grey;
				font-size: 24rpx;
				width: 320rpx;
				.detailed {
					.title {
						font-size: 32rpx;
						color: #fff;
						padding-top: 11rpx;
						overflow:hidden; //超出的文本隐藏
						text-overflow:ellipsis; //溢出用省略号显示
						white-space:nowrap; //溢出不换行
					}

					.date {
						padding: 25rpx 0 19rpx;
						display: flex;
						align-items: center;

						&::before {
							content: '';
							display: block;
							background: url('@/static/image/cart/timeIcon.png') no-repeat;
							background-size: 100% 100%;
							width: 24rpx;
							height: 24rpx;
							margin-right: 10rpx;
						}
					}

					.address {
						display: flex;
						align-items: center;

						&::before {
							content: '';
							display: block;
							background: url('@/static/image/cart/addressIcon.png') no-repeat;
							background-size: 100% 100%;
							width: 22rpx;
							height: 26rpx;
							margin-right: 10rpx;
						}
					}
				}

				.price {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 10rpx;
					.num-box {
						font-size: 27rpx;
						color: #fff;
					}

					.btn-box {
						width: 180rpx;
						height: 54rpx;
						background: url('@/static/image/member/btn-2.png') no-repeat;
						background-size: 100% 100%;
						font-weight: 500;
						font-size: 23rpx;
						color: #FFFFFF;
						text-align: center;
						line-height: 54rpx;
						border-radius: 30rpx;
					}

					.jieshu-btn {
						background: #666666;
					}
				}
			}
		}

		.button-sp-area {
			text-align: right;
			padding-top: 20rpx;

			.mini-btn {
				width: 166rpx;
				height: 53rpx;
				line-height: 53rpx;
				font-size: 24rpx;
				border-radius: 50rpx;
				margin-left: 20rpx;
				background-color: #34312E;
				color: #AFAFAF;
			}
		}
	}

	.active {
		color: $uni-color-primary !important;
	}
</style>