<template>
	<view class="special-content clearfix">
		<view class="swiper-banner-title">商品专题</view>
		<view class="swiper-banner-box" >
			<swiper class="tui-banner-swiper tui-banner tui-skeleton-fillet" :autoplay="true" :interval="5000" :duration="500"  @change="swiperChange" :circular="true">
				<swiper-item v-for="(item,index) in listArray" :key="index">
					<image :src="item.image" class="tui-slide-image" mode="scaleToFill"/>
				</swiper-item>
			</swiper>
			<view class="swiper__dots-box" v-if="listArray.length > 1">
				<view v-for="(item,idx) in listArray" 
					  :key="idx" 
					  :class="[idx===current?'swiper__dots-long':'none']" 
					  :data-index="current" class="swiper__dots-item">
				</view>	  
			</view>
		</view>
		<view class="swiper-goods-box">
			<view class="goods-box-item" v-for="(item,index) in goodArray" :key="index">
				<image :src="item.image" mode="" class="box-item-image"></image>
				<view class="box-item-mask">{{ item.title }}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		name:"specialContent",
		props:{
			list:{
				type:Array
			}
		},
		data() {
			return{
				current:0,
				listArray:[
					{image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/114550/12/7437/102254/5ec3971fE78db18f4/438d4775f9d653ee.jpg!q70.jpg.dpg'},
					{image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/126187/19/17323/149042/5fa13ef1E6bc65f5b/8fbecafdbf0e4736.jpg!q70.jpg.dpg'},
					{image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/126522/38/16493/151268/5f9940bfE9bf4ce43/b9a09e36102a9667.jpg!q70.jpg.dpg'}
				],
				goodArray:[
					{image:'https://img.caimei365.com/group1/M00/03/A2/Cmis2F8VTz2AIH2JAAIDFdpGDsE352.jpg',title:'优斐斯术后护理产品搭配应用'},
					{image:'https://img.caimei365.com/group1/M00/03/5B/Cmis2F1bq0yATM6SAAEcNkc0bwk054.jpg',title:'肌本演绎·动能精华素'},
					{image:'https://img.caimei365.com/group1/M00/03/BF/Cmis2F-GZJOAdquJAADIHkLdHVE324.jpg',title:'科医人第六代王者之冠M22'},
					{image:'https://img.caimei365.com/group1/M00/03/38/Cmis21yweGSAdSCdAADddSdkc1E158.jpg',title:'赛诺龙360'},
				]
			}
		},
		created(){
			
		},
		computed: {
	
		},
		methods:{
			swiperChange(e) {//轮播图切换
				const index = e.detail.current;
				this.current = index;
			},
		}
	}
</script>

<style lang="scss">
	.special-content{
		background-color: #F7F7F7;
		width: 100%;
		height: auto;
		box-sizing: border-box;
		padding: 0 24rpx;
	}
	.swiper-banner-box{
		width: 100%;
		height: 284rpx;
		background:#F7F7F7;
		position: relative;
		background-size: cover;
		float: left;
		margin: 20rpx 0;
	}	
	.swiper-banner-title{
		width: 100%;
		float: left;
		font-size: 34rpx;
		font-weight: bold;
		text-align: left;
		line-height: 49rpx;
		color: #333;
		ackground:#F7F7F7;
	}
	.tui-banner-swiper {
		width: 700rpx;
		margin: 0 auto;
		height: 284rpx;
		border-radius: 2rpx;
		overflow: hidden;
		transform: translateY(0);
		box-shadow:0px 3px 6px rgba(225,86,22,0.08);
		.banner-item{
			border-radius: 16rpx;
		}
		.tui-slide-image {
			width: 100%;
			height: 284rpx;
			display: block;
			border-radius: 2rpx;
		}
	}
	.swiper__dots-box{
		position: absolute;
		bottom: 30rpx;
		left: 0;
		right: 0;
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex: 1;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		.swiper__dots-item{
			width: 8rpx;
			height: 8rpx;
			border-radius: 100%;
			margin-left: 6px;
			background-color:rgba(255,255,255,.7);
		}
		.swiper__dots-long{
			width: 35rpx;
			height: 8rpx;
			border-radius: 4rpx;
			background-color: #ffff;
			transition: all 0.4s;
		}
	}
	.swiper-goods-box{
		width: 100%;
		height: auto;
		float: left;
		.goods-box-item{
			width: 340rpx;
			height: 340rpx;
			float: left;
			margin-right: 20rpx;
			margin-bottom: 20rpx;
			&:nth-child(2n){
				margin-right: 0;
			}
			position: relative;
			.box-item-image{
				width: 340rpx;
				height: 340rpx;
				display: block;
			}
			.box-item-mask{
				width: 100%;
				height: 64rpx;
				background: rgba(0,0,0,.36);
				line-height: 64rpx;
				font-size: $font-size-26;
				text-align: center;
				color: #FFFFFF;
				position: absolute;
				bottom: 0;
				left: 0;
				box-sizing: border-box;
				padding:0 20rpx;
				white-space: normal;
				word-break: break-all;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 1;
			}
		}
	}
</style>
