<template>
	<view v-show="show">
		<view class="ad-mask">
			<slot>
				<view class="adbox">
					<image class="adbox-bg"  src="@/static/images/ad/service.png" mode="aspectFill"></image>
					<view class="es es-fs-40 es-fw-400 es-c-00 es-mt-38">添加健康管家</view>
					<view class="es es-c-99 es-fs-28 es-mt-12">-解锁更多权益-</view>
					
					<view class="box-footer es-mt-48">
						<button class="box-footer-btn" @click="addAction()" :loading="signLoading" :disabled="signLoading">立即添加</button>
					</view>
				</view>
				
				<view class="adbox-close">
					<image src="@/static/images/ad/close_icon.png" @click="close"></image>
				</view>
				
				
			</slot>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			show: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				signLoading: false,
			}
		},
		methods: {
			close() {
			    this.$emit("close");
			},
			addAction(){
				
			},
		}
	}
</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;
			background: linear-gradient( 180deg, #FFD0B5 0%, #FFFFFF 20%, #FFFFFF 100%);
			border-radius: 16px 16px 16px 16px;
			@include u-flex(column, center, center);
			
			&-bg {
				width: 312rpx;
				height: 312rpx;
		        margin-top: -150rpx;
			}
		}
		.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;
		}
		
		.adbox-close{
			margin-top: 64rpx;
			width: 100%;
			@include u-flex(row, center, center);
			image {
				width: 64rpx;
				height: 64rpx;
			}
			
		}
	}

    .box-footer { 
     	&-btn {
     		width: 520rpx;
     		min-height: 88rpx;
     		line-height: 88rpx;
     		background: linear-gradient( 180deg, #FF9F22 0%, #FA1E05 100%);
     		border-radius: 26px 26px 26px 26px;
     	
     		border-image: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1)) 2 2;
     		font-family: PingFang SC, PingFang SC;
     		font-weight: 600;
     		font-size: 32rpx;
     		color: #FFFFFF;
			margin-bottom: 64rpx;
     		&::after {
     			border: none;
     		}
     	}
     }


</style>