<template>
	<view :style="{display: isShow ? 'block' : 'none'}" class="ad-view">
		<ad-custom :unit-id="unitId" :ad-intervals="adIntervals" @error="onerror" @load="onload"></ad-custom>
	</view>
</template>

<script>
	export default {
		name:"ad-custom-view",
		props: {
			// 广告id
			unitId: {
				type: String,
				default: ""
			},
			// 广告自动刷新时间
			adIntervals: {
				type: String,
				default: '100'
			}
		},
		data() {
			return {
				isShow: true
			};
		},
		methods: {
			onload(e) {
				this.isShow = true
			},
			onerror(e) {
				this.isShow = false
			}
		}
	}
</script>

<style>
	.ad-view {
		overflow: hidden;
		border-radius: 20rpx;
		margin-top: 40rpx;
	}
</style>
