<template>
	<view>
		<view class="banner">
			<swiper class="box" autoplay circular @animationfinish="animationfinish">
				<swiper-item v-for="(item,index) in banner" :key="index" @click="go_link(item.jumpURL)">
					<view class="item">
						<view class="img">
							<image :src="item.imgURL" mode="aspectFill"></image>
						</view>
						<view class="title">
							<view class="text">{{item.title}}</view>
							<view class="num">
								<!-- — <text> {{index+1}} </text> — -->
								<text>{{index+1}} / {{banner.length}}</text>
							</view>
						</view>
					</view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	import {goToLink} from "@/common/common.js"
	export default {
		name:"t-i-banner",
		props: [
			"banner",
			"mine_code"
		],
		data() {
			return {
				
			}
		},
		methods:{
			go_link(link){
				console.log(link)
				
				let item = {
					link:link
				}
				
				goToLink(item,this.mine_code)
			},
			animationfinish($event){
				this.$emit('change_top_bg_color_img',$event.detail.current)
			}
		}
	}
</script>

<style lang="scss">
	.banner{
		margin-top: -60rpx;
		.box{
			width: 750rpx;
			height: 430rpx;
			
			.item{
				width: 750rpx;
				
				position: relative;
				.img{
					text-align: center;
					image{
						width: 700rpx;
						height: 400rpx;
						border-radius: 20rpx;
						
					}
				}
				.title{
					position: absolute;
					left: 0;
					bottom: 0;
					
					box-sizing: border-box;
					padding: 15rpx 50rpx;
					width: 750rpx;
					
					line-height: 1.5;
					font-size: 32rpx;
					
					display: flex;
					justify-content: space-between;
					
					.text{
						width: 520rpx;
						color: #FFFFFF;
						
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
					}
					
					.num{
						color: #ACB0AC;
						text{
							// color: #23A2EE;
							color: #FFFFFF;
						}
					}
				}
			}
		}
	}
</style>
