<template>
	<view class="u-demo-block">
		<u-swiper :list="banner" @change="e => currentNum = e.current" :autoplay="false" indicatorStyle="right: 40rpx" radius="0" height="400rpx">
			<view slot="indicator" class="indicator-num">
				<text class="indicator-num__text">{{ currentNum + 1 }}/{{ banner.length }}</text>
			</view>
		</u-swiper>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				banner: [
					'http://cloud.lincq.cn/%E5%B7%A5%E4%BD%9C%E9%A1%B9%E7%9B%AE/images/poster-1.png',
					'http://cloud.lincq.cn/%E5%B7%A5%E4%BD%9C%E9%A1%B9%E7%9B%AE/images/poster-1.png',
					'http://cloud.lincq.cn/%E5%B7%A5%E4%BD%9C%E9%A1%B9%E7%9B%AE/images/poster-1.png',
				],
				currentNum: 0
			}
		}
	}
</script>

<style lang="scss" scoped>
	.indicator {
		@include flex(row);
		justify-content: center;

		&__dot {
			height: 12rpx;
			width: 12rpx;
			border-radius: 200rpx;
			background-color: rgba(255, 255, 255, 0.35);
			margin: 0 10rpx;
			transition: background-color 0.3s;

			&--active {
				background-color: #ffffff;
			}
		}
	}

	.indicator-num {
		padding: 4rpx 0;
		background-color: rgba(0, 0, 0, 0.35);
		border-radius: 200rpx;
		width: 80rpx;
		@include flex;
		justify-content: center;

		&__text {
			color: #FFFFFF;
			font-size: 28rpx;
			display: inline-block;
			letter-spacing: 0rpx;
		}
	}
</style>
