<template>
	<view>
		<view class="banner">
			<swiper class="box" autoplay circular>
				<swiper-item v-for="(item,index) in banners" :key="item.id">
					<view class="item">
						<view class="img">
							<image :src="item.imgURL"></image>
						</view>
						<view class="title">
							<view>{{item.title}}</view>
							<view class="num">
								- <text> {{index+1}} </text> -
							</view>
						</view>
					</view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	export default {
		name:"t-i-banner",
		props: [
			"base_url"
		],
		data() {
			return {
				banners:[]
				
			}
		},
		created() {
			this.get_banner()
		},
		methods: {
			get_banner(){
				uni.request({
					url: this.base_url + "/scrollImg/list",
					method: "GET",
					success: (res) => {
						this.banners = res.data.data.data
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.banner{
		.box{
			width: 750rpx;
			height: 600rpx;
			
			.item{
				width: 750rpx;
				.img{
					
					image{
						width: 750rpx;
						height: 500rpx;
					}
				}
				.title{
					box-sizing: border-box;
					padding: 0 25rpx;
					width: 750rpx;
					height: 120rpx;
					
					line-height: 1.5;
					font-size: 28rpx;
					
					position: relative;
					
					.num{
						position: absolute;
						bottom: 35rpx;
						right: 25rpx;
						color: #ACB0AC;
						text{
							color: #23A2EE;
						}
					}
				}
			}
		}
	}
</style>
