<template>
	<view v-if="list.length > 0" class="list">
		<view class="item" v-for="(item,index) in list" @click="$emit('select', item)" :key="index">

			<view class="price">
				<view class="num">
					<view class="icon">
						￥
					</view>
					{{ item.money }}
				</view>
				<view class="tiao">
					满{{ item.useMoney }}可用
				</view>
			</view>
			<view class="date">
				有效期{{ item.endTime }}
			</view>

			<view @click.stop="$emit('select',item)" class="status">
				<!-- 已 使 用 -->
				立 即 使 用
			</view>
		</view>
	</view>

	<van-empty v-else image="/static/empty/coupon.png" image-size="400rpx" description="暂无优惠券" />

</template>

<script>
	export default {
		props: ['list'],
		name: "couponList",
		data() {
			return {

			};
		},
		methods: {

		}
	}
</script>

<style scoped lang="scss">
	.list {
		.item {
			color: #EF8C94;
			position: relative;
			width: calc(100% - 40rpx);
			height: 220rpx;
			background: url(/static/coupon/c.png);
			background-size: 100% 100%;
			margin: 20rpx;
			box-sizing: border-box;
			padding: 30rpx;

			.status {
				position: absolute;
				right: 20rpx;
				top: 20rpx;
				height: calc(100% - 40rpx);
				width: 60rpx;
				writing-mode: vertical-rl;
				box-sizing: border-box;
				padding: 20rpx;
				background-color: #fff;
				border-radius: 60rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}

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

				.num {
					color: #EF8C94;
					font-weight: 900;
					font-size: 70rpx;
					display: flex;
					align-items: flex-end;

					.icon {
						color: #fff;
						background-color: #EF8C94;
						width: 30rpx;
						height: 30rpx;
						display: flex;
						justify-content: center;
						align-items: center;
						font-size: 20rpx;
						border-radius: 14rpx;
						margin-bottom: 14rpx;
						margin-right: 10rpx;
					}
				}

				.tiao {
					padding: 10rpx 20rpx;
					background-color: #F1B8BD;
					color: #EF8C94;
					font-size: 22rpx;
					margin-left: 20rpx;
					border-radius: 10rpx;
				}
			}

			.date {}
		}
	}
</style>