<template>
	<view class="content" v-if="iconList.arr || iconList.data">
		<view class="nav">
			<view class="item" v-for="(item,index) in iconList.arr" :key="index" @click="go_link(item)">
				<view class="icon">
					<image :src="item.icon" mode=""></image>
				</view>
				<view class="name">{{item.title}}</view>
			</view>
		</view>
		<view class="section" v-for="(item,index) in iconList.data" :key="index">
			<view v-if="item.data.length > 0">
				<view class="title">{{item.category_name}}</view>
				<view class="list">
					<view class="item" v-for="(item_2,index_2) in item.data" :key="index_2" @click="go_link(item_2)">
						<view class="icon">
							<image :src="item_2.icon" mode=""></image>
						</view>
						<view class="name">{{item_2.title}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {goToLink} from "@/common/common.js"
	export default {
		name: "t-i-icon",
		props: [
			"iconList",
			"mine_code"
		],
		data() {
			return {

			};
		},
		methods: {

			go_link(item) {
				
				goToLink(item,this.mine_code)

			}
		}
	}
</script>

<style lang="scss">
	.content {
		margin-bottom: 20rpx;
		background-color: #FFFFFF;

		box-sizing: border-box;
		padding: 50rpx 25rpx 15rpx;
	}

	.nav {
		overflow: hidden;

		.item {
			float: left;
			width: 120rpx;

			margin-right: 25rpx;
			margin-bottom: 30rpx;

			.icon {
				width: 120rpx;
				text-align: center;

				image {
					width: 100rpx;
					height: 100rpx;
					border-radius: 50%;
				}
			}

			.name {
				width: 120rpx;
				text-align: center;
				font-size: 30rpx;

				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
		}

		.item:nth-child(5n) {
			margin-right: 0;
		}
	}

	.section {
		margin-top: 20rpx;

		.title {
			font-size: 36rpx;
			margin-bottom: 40rpx;
		}

		.list {
			overflow: hidden;

			.item {
				float: left;
				width: 148rpx;

				margin-right: 36rpx;
				margin-bottom: 30rpx;

				.icon {
					width: 148rpx;
					text-align: center;

					image {
						width: 104rpx;
						height: 104rpx;
						border-radius: 50%;
					}
				}

				.name {
					width: 148rpx;
					text-align: center;
					font-size: 30rpx;

					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
			}

			.item:nth-child(4n) {
				margin-right: 0;
			}
		}

	}
</style>
