<template>
	<view class="container">
		<view class="content">
			<image class="close" src="../../static/close-gray.png" mode="" @click="close()"></image>
			<view class="title">选择卡券状态</view>
			<view class="select">
				<view class="item" @click="selectType = 10">
					<image class="img" v-if="selectType === 10" src="../../static/select-h.png" mode=""></image>
					<image class="img" v-else src="../../static/select-n.png" mode=""></image>
					<view class="text">待使用</view>
				</view>
				<view class="item" @click="selectType = 20">
					<image class="img" v-if="selectType === 20" src="../../static/select-h.png" mode=""></image>
					<image class="img" v-else src="../../static/select-n.png" mode=""></image>
					<view class="text">已使用</view>
				</view>
			</view>
			<view @click="$emit('change', selectType)" class="buy-bottom" :style="{'background-color':'#FF0520'}">确定</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"AlertSelectStatus",
		data() {
			return {
				selectType: this.useState || 10
			};
		},
		props: {
			useState: {
				type: Number
			},
			closeName: {
				type: String
			}
		},
		methods: {
			close() {
				this.$parent[this.closeName] = false
			}
		}
	}
</script>

<style lang="scss" scoped>
.container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba($color: #000000, $alpha: 0.7);
	z-index: 99999;
	.content {
		margin: 50% 55rpx;
		border-radius: 16rpx;
		background-color: #FFFFFF;
		padding: 48rpx 40rpx;
		// width: 640rpx;
		position: relative;
		.close {
			position: absolute;
			top: 24rpx;
			right: 24rpx;
			height: 36rpx;
			width: 36rpx;
		}
		.title {
			font-size: 32rpx;
			font-weight: bolder;
			color: #333333;
			line-height: 44rpx;
			text-align: center;
		}
		.select {
			display: flex;
			padding: 48rpx 96rpx 0;
			justify-content: space-between;
			align-items: center;
			.item {
				display: flex;
				align-items: center;
				.img {
					width: 32rpx;
					height: 32rpx;
				}
				.text {
					margin-left: 16rpx;
					font-size: 32rpx;
					color: #333333;
				}
			}
		}
		.buy-bottom {
			margin-top: 70rpx;
			border-radius: 40rpx;
			height: 80rpx;
			width: 560rpx;
			background-color: rgba($color: #FF0520, $alpha: 0.5);
			line-height: 82rpx;
			text-align: center;
			color: #FFFFFF;
			font-size: 32rpx;
			z-index: 99999;
			margin-bottom: 32rpx;
		}
	}
}
</style>