<template>
	<view class="content">
		<view class="section_1">
			<view class="tab">
				<view class="title active">科室部门</view>
			</view>
			<view class="list">
				<view class="item" v-for="(item,index) in list_1.children" :key="index" @click="go_record(item)">
					{{item.title}}
				</view>
			</view>
		</view>

		<!-- 图片链接 -->
		<view class="section_2">
			<view class="title">图片链接</view>
			<view class="list">
				<view class="item" v-for="(item,index) in list_2.children" :key="index" @click="go_record(item)">
					<image :src="item.thumb" mode=""></image>
				</view>
			</view>
		</view>

		<!-- 快速通道 -->
		<view class="section_3">
			<view class="title">快速通道</view>
			<view class="list">
				<view class="item" v-for="(item,index) in list_3.children" :key="index" @click="go_record(item)">
					<image :src="item.thumb" mode=""></image>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import {goToLink} from "@/common/common.js"
	
	export default {
		name: "t-i-ningdongyunying",
		props: [
			"mine_code"
		],
		data() {
			return {
				active: 1,
				list_1: [],
				// 图片链接
				list_2: [],
				// 快速通道
				list_3: [],
			};
		},
		created() {
			this.get_home_link()
		},
		methods: {
			get_home_link() {
				this.$api.home_link({

				}).then((res) => {
					// console.log(res.data.data)

					// 科室部门
					this.list_1 = res.data.data[1]
					// 图片链接
					this.list_2 = res.data.data[2]

					// 快速通道
					this.list_3 = res.data.data[3]
				})
			},
			go_record(item) {
				goToLink(item,this.mine_code)
			}
		}
	}
</script>

<style lang="scss">
	.content {
		margin-top: 10rpx;
		padding-bottom: 40rpx;
		background-color: #FFFFFF;
	}

	.section_1 {
		box-sizing: border-box;
		padding: 25rpx;

		.tab {
			display: flex;
			
			padding-left: 10rpx;
			.title {
				line-height: 80rpx;
				font-weight: 700;
			}

			.active {
				color: #009fe8;
				border-bottom: 6rpx solid #009fe8;
			}
		}

		.list {
			margin-top: 30rpx;
			overflow: hidden;

			.item {
				float: left;
				margin-right: 20rpx;
				margin-bottom: 30rpx;

				width: 160rpx;
				box-sizing: border-box;
				border: 2rpx solid #009fe8;
				border-radius: 20rpx;
				font-size: 28rpx;
				line-height: 70rpx;
				//超过一行省略号
				overflow: hidden;
				white-space: nowrap;
				text-overflow: ellipsis;

				padding: 0 10rpx;
				background-color: #66C7F218;
				color: #009FE8;

				text-align: center;
			}

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

	}

	.section_2 {
		box-sizing: border-box;
		padding: 0 25rpx;
		
		.title {
			line-height: 120rpx;
			font-size: 36rpx;
			font-weight: 700;
		}

		.list {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;

			.item {
				margin-bottom: 20rpx;
				width: 340rpx;
				height: 180rpx;

				border-radius: 20rpx;
				overflow: hidden;

				image {
					width: 340rpx;
					height: 180rpx;
				}
			}
		}
	}

	.section_3 {
		box-sizing: border-box;
		padding: 0 25rpx;

		.title {
			line-height: 120rpx;
			font-size: 36rpx;
			font-weight: 700;
		}

		.list {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;

			.item {
				margin-bottom: 20rpx;
				width: 700rpx;
				height: 240rpx;

				border-radius: 10rpx;
				overflow: hidden;

				image {
					width: 700rpx;
					height: 240rpx;
				}
			}
		}
	}

	.bottom{
		margin-top: 10rpx;
		text-align: center;
		image{
			width: 700rpx;
			height: 240rpx;
		}
	}
</style>
