<template>
	<view class="content">
		<view class="list">
			<view class="item" v-for="(item,index) in iconList" :key="index" @click="go_link(item.link)">
				<view class="icon">
					<image :src="item.icon" mode=""></image>
				</view>
				<view class="name">{{item.title}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"t-i-icon",
		props: [
			"iconList",
			"mine_code"
		],
		data() {
			return {
				
			};
		},
		methods:{
			go_link(link){
				// console.log(link.split('=')[3].split('&')[0])
				// let pageId = link.split('=')[3].split('&')[0]
				
				let pageId = ""
				function GetQueryString(name) {
					var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
					var r = link.match(reg);
					if (r != null) return unescape(r[2]);
					return null;
				}
				console.log(GetQueryString("pageId"))
				if (GetQueryString("pageId")) {
					pageId = GetQueryString("pageId")
				} else {
					pageId = link.split('=')[1]
				}
				
				uni.navigateTo({
					url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
				})
			}
		}
	}
</script>

<style lang="scss">
	.content{
		margin-bottom: 30rpx;
		background-color: #FFFFFF;
		
		box-sizing: border-box;
		padding: 50rpx 25rpx;
	}
	
	.list{
		display: flex;
		justify-content: space-between;
		.item{
			width: 104rpx;
			.icon{
				image{
					width: 104rpx;
					height: 104rpx;
				}
			}
			.name{
				text-align: center;
			}
		}
	}
</style>
