<template>
	<u-popup :show="show" round="20rpx" mode="center" zIndex="10076" bgColor="transparent" @close="$emit('close')">
		<view class="red-envelope-popup" @click="$emit('claim')">
			<image class="red-envelope-close-button"
				src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/close_white.png"
				@click.stop="$emit('close')" />
			<image class="red-envelope-background"
				src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/pop1.png" />
			<view class="red-envelope-content">
				<view class="red-envelope-header">
					<image class="header-decoration-left"
						src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/top_left.png"
						mode="widthFix" />
					<view class="header-title">恭喜您可以</view>
					<image class="header-decoration-right"
						src="https://bjzmky-1323137866.cos.ap-chongqing.myqcloud.com/userapp/images/top_right.png"
						mode="widthFix" />
				</view>
				<view class="red-envelope-text">领红包</view>
				<view class="red-envelope-open-text">开</view>
			</view>
		</view>
	</u-popup>
</template>

<script>
export default {
	name: 'LiveRedPanel',
	props: {
		show: { type: Boolean, default: false }
	}
}
</script>

<style scoped lang="scss">
.red-envelope-popup {
	width: 504rpx;
	position: relative;
	text-align: center;
	height: 610rpx;
	display: flex;
	align-items: center;

	.red-envelope-close-button {
		position: absolute;
		right: 0;
		top: -180rpx;
		width: 64rpx;
		height: 64rpx;
	}

	.red-envelope-background {
		width: 100%;
		height: 100%;
	}

	.red-envelope-content {
		position: absolute;
		top: 0;
		left: 50%;
		transform: translateX(-50%);
		display: flex;
		flex-direction: column;
		align-items: center;

		.red-envelope-header {
			margin-top: 68rpx;
			display: flex;
			align-items: center;

			.header-decoration-left,
			.header-decoration-right {
				width: 44rpx;
				height: 20rpx;
			}

			.header-title {
				margin: 0 12rpx;
				font-size: 28rpx;
				color: #FFF1BC;
			}
		}

		.red-envelope-text {
			font-weight: 600;
			font-size: 80rpx;
			color: #FFF1BC;
			margin-top: 42rpx;
		}

		.red-envelope-open-text {
			font-weight: 800;
			font-size: 110rpx;
			color: #F41420;
			margin-top: 70rpx;
		}
	}
}
</style>
