<template>
	<view v-show="show">
		<view class="ad-mask">
			<slot>
				<view class="adbox">
					<view class="adbox-close">
						<image src="@/static/images/ad/close_icon.png" @click="close"></image>
					</view>
					<image class="adbox-bg" v-show="imgType==0" src="@/static/images/ad/tc_kcc_bg.png" mode="aspectFill"></image>
					<image class="adbox-bg" v-show="imgType==1" src="@/static/images/ad/tc_kzb_bg.png" mode="aspectFill"></image>
					<image class="adbtn" src="@/static/images/ad/adbtn.gif"></image>
					<image class="pointer" src="@/static/images/ad/pointer.gif"></image>
				</view>
			</slot>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			show: {
				type: Boolean,
				default: false
			},
			imgType: {
				type: [String,Number],
				default: 0
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			close() {
				this.$emit("close");
				this.show=false;
			}
		}
	}
</script>

<style scoped lang="scss">
	@mixin u-flex($flexD, $alignI, $justifyC) {
		display: flex;
		flex-direction: $flexD;
		align-items: $alignI;
		justify-content: $justifyC;
	}
	.ad-mask {
		width: 100vw;
		height: 100vh;
		background-color: rgba(0,0,0,0.6);
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
		@include u-flex(column, center, center);
		.adbox {
			width: 620rpx;
			position: relative;
			@include u-flex(column, center, center);
			&-close{
				width: 100%;
				margin-bottom: 74rpx;
				@include u-flex(row, center, flex-end);
				image {
					width: 64rpx;
					height: 64rpx;
				}
			}
			&-bg {
				width: 580rpx;
				height: 620rpx;
			}
		}
		.adbtn{
			width: 412rpx;
			height: 104rpx;
			position: absolute;
			bottom: 80rpx;
			left: 50%;
			transform: translate(-50%,0);
		}
		.pointer {
			width: 180rpx;
			height: 194rpx;
			position: absolute;
			bottom: -52rpx;
			right: -42rpx;
		}
	}
</style>