<template>
	<view class="content" v-if="value">
		<view class="box">
			<swiper class="swiper" :circular="true" 
				indicator-active-color="#0091ff" 
				:current="current" 
				:indicator-dots="list.length > 1">
				<swiper-item v-for="(item, index) in list" :key="index">
					<image class="img" :src="item" mode="aspectFill" @click="clickAd"></image>
				</swiper-item>
			</swiper>
			<view class="close" @click="close">
				<text class="lf-iconfont icon-shanchu"></text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			value: {
				type: Boolean,
				default: true
			}
		},
		data(){
			return {
				list: ['https://picsum.photos/200', 'https://picsum.photos/200']
			}
		},
		created(){
			
		},
		methods: {
			clickAd(){
				this.$msg('您点击了广告图')
			},
			close(){
				this.$emit('update:value', false);
			}
		}
	}
</script>

<style lang="scss" scoped="scoped">
	.content{
		width: 100vw;
		height: 100vh;
		display: flex;
		justify-content: center;
		align-items: center;
		position: fixed;
		left: 0;
		top: 0;
		z-index: 99;
		.box{
			width: 600rpx;
			height: max-content;
			.swiper{
				width: 600rpx;
				height: 840rpx;
				.img{
					width: 100%;
					height: 100%;
				}
			}
			.close{
				width: 70rpx;
				height: 70rpx;
				margin: 34rpx auto 0;
				border-radius: 50%;
				display: flex;
				justify-content: center;
				align-items: center;
				text{
					font-size: 80rpx;
				}
			}
		}
	}
</style>
