<template name="navbars">
	<view>
		<view class="navbars-content clearfix">
			<view class="nav-item" v-for="(item,index) in navList" :key="index" @click="tabClick(index)">
				<view class="icon">
					<image class="icon-image" :src="item.icon" mode="widthFix"></image>
					<image class="icon-new" src="../../../static/temp/icon-new.png" mode="widthFix" v-if="index === 7"></image>
				</view>
				<view class="name">{{ item.name }}</view>
				<view class="nav-cell-main" v-if="index === current">
					<view class="nav-cell" v-for="(cell,idx) in item.children" :key="idx">
						<view class="icon">
							<image class="icon-image" :src="cell.icon" mode="widthFix"></image>
						</view>
						<view class="name">{{ cell.name }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		name:"navbars",
		props:{
			list:{
				type:Array
			}
		},
		data() {
			return{
				current:100,
				navList:[
					{
						name:'找产品',
						icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E4%BA%A7%E5%93%81.png',
						children:[
							{name:'商品专题',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E4%BA%A7%E5%93%81.png'},
							{name:'导入液',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E4%BB%AA%E5%99%A8.png'},
							{name:'高端院用产品',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E4%BB%AA%E5%99%A8.png'},
							{name:'术后修护',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E4%BB%AA%E5%99%A8.png'},
							{name:'科学护肤品',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E4%BB%AA%E5%99%A8.png'},
						]
					},
					{name:'找仪器',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E4%BB%AA%E5%99%A8.png'},
					{name:'找项目',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%89%BE%E9%A1%B9%E7%9B%AE.png'},
					{name:'信息平台',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E4%BF%A1%E6%81%AF%E5%B9%B3%E5%8F%B0.png'},
					{name:'二手市场',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E4%BA%8C%E6%89%8B%E5%B8%82%E5%9C%BA.png'},
					{name:'正品联盟',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E6%AD%A3%E5%93%81%E8%81%94%E7%9B%9F.png'},
					{name:'品牌招商',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E5%93%81%E7%89%8C%E6%8B%9B%E5%95%86.png'},
					{name:'维修',icon:'https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E7%BB%B4%E4%BF%AE.png'},
					
				]
			}
		},
		created(){
			
		},
		computed: {
	
		},
		methods:{
			tabClick(index) {//轮播图切换
				this.current = index;
			},
			
		}
	}
</script>

<style lang="scss">
	.navbars-content{
		width: 100%;
		height: auto;
		box-sizing: border-box;
		padding: 0 24rpx;
		margin-top: 30rpx;
		.nav-item{
			width: 164rpx;
			height: auto;
			float: left;
			margin-bottom: 30rpx;
			margin-right: 15.3rpx;
			&:nth-child(4){
				margin-right: 0;
			}
			&:nth-child(8){
				margin-right: 0;
			}
			.icon{
				width: 130rpx;
				height: 130rpx;
				margin: 0 auto;
				position: relative;
				.icon-image{
					width: 130rpx;
					height: 130rpx;
					display: block;
				}
				.icon-new{
					width: 44rpx;
					height: 22rpx;
					display: block;
					position: absolute;
					right: 0;
					top: 20rpx;
				}
			}
			.name{
				width: 100%;
				height: 40rpx;
				line-height: 40rpx;
				text-align: center;
				font-size: $font-size-28;
				color: #666666;
			}
			.nav-cell-main{
				width: 100%;
				height: auto;
				position: absolute;
				right: 0;
				.nav-cell{
					width: 164rpx;
					height: auto;
					float: left;
					margin-bottom: 30rpx;
					margin-right: 15.3rpx;
					&:nth-child(4){
						margin-right: 0;
					}
					&:nth-child(8){
						margin-right: 0;
					}
					.icon{
						width: 130rpx;
						height: 130rpx;
						margin: 0 auto;
						position: relative;
						.icon-image{
							width: 130rpx;
							height: 130rpx;
							display: block;
						}
						.icon-new{
							width: 44rpx;
							height: 22rpx;
							display: block;
							position: absolute;
							right: 0;
							top: 20rpx;
						}
					}
					.name{
						width: 100%;
						height: 40rpx;
						line-height: 40rpx;
						text-align: center;
						font-size: $font-size-28;
						color: #666666;
					}
				}
			}
		}
	}
</style>
