<template>
	<view>
		<view class="tab">
			<view class="item" @click="change_active(1)">
				<view class="text" :class="active == 1?'active':''">安全管理</view>
				<view class="line" v-if="active == 1"></view>
			</view>
			<view class="item" @click="change_active(2)">
				<view class="text" :class="active == 2?'active':''">巡检维护</view>
				<view class="line" v-if="active == 2"></view>
			</view>
			<view class="item" @click="change_active(3)">
				<view class="text" :class="active == 3?'active':''">党建经营</view>
				<view class="line" v-if="active == 3"></view>
			</view>
			<view class="item" @click="change_active(4)">
				<view class="text" :class="active == 4?'active':''">其他</view>
				<view class="line" v-if="active == 4"></view>
			</view>

		</view>


		<view class="list">
			<view class="item" v-for="(item,index) in 2" :key="index">
				<view class="title">
					<view class="text">车辆管理</view>
					<view class="tip">24</view>
				</view>
				<view class="inner">
					<view class="left">
						<view class="user">
							<image
								src="https://cdn.colorhub.me/X-ec79ZLNkBQcrD3tH7tRV-nrSrcZDvlEdM-c_-pAWA/rs:fill:280:280:0/g:sm/bG9jYWw6Ly8vODcv/ZWIvZDlkMmNkZDkz/MjBkZTI0ZDUxZWE4/MTQyYmQzNThhNmY4/MWU0ODdlYi5qcGVn.jpg"
								mode="aspectFill"></image>
						</view>
					</view>
					<view class="right">
						<view class="name">李建中<text>信息化站</text></view>
						<view class="text">
							在“车辆管理”中“司机出车记录”内新增内容。
						</view>
						<view class="img_box">
							<view class="img" v-for="item in 4">
								<image
									src="https://cdn.colorhub.me/8pIGfpKGL2VzBVaKPEX0htM1Cy0xMjOPtWV8HDbDQKs/rs:fill:280:280:0/g:sm/bG9jYWw6Ly8vYjIv/ZmMvZmI4Mjc4YmE5/NzJhNzVhZWYwYzZh/NzE1OTMzMjk0MWU5/ODVhYjJmYy5qcGVn.jpg"
									mode="aspectFill"></image>
							</view>
						</view>
						<view class="time">2021-12-14 08:32:56</view>
						<view class="btn">
							<view class="icon">
								<image src="./icon/btn.png" mode=""></image>
							</view>
							<view class="btn_text" @click="go_all_list()">点击查看全部信息</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "t-o-news-tab-2",
		data() {
			return {
				active: 1,
			};
		},
		methods: {
			change_active(item) {
				this.active = item
			},
			go_all_list() {
				uni.navigateTo({
					url: "../../origanization/news/tab_2/all_list/all_list"
				})
			}
		}
	}
</script>

<style lang="scss">
	.tab {
		display: flex;
		justify-content: space-around;
		align-items: center;

		background-color: #FFFFFF;
		margin-bottom: 20rpx;
		height: 90rpx;

		.item {
			position: relative;

			.text {
				font-size: 30rpx;
				color: #666666;
			}

			.active {
				font-weight: 700;
				color: #000000;
			}

			.line {
				position: absolute;
				bottom: -15rpx;
				left: 50%;

				transform: translateX(-30rpx);

				width: 60rpx;
				height: 4rpx;
				background-color: #009FE8;
			}
		}
	}

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

		.item {
			margin-bottom: 20rpx;
			width: 700rpx;
			background-color: #FFFFFF;
			border-radius: 20rpx;

			box-sizing: border-box;
			padding: 0 25rpx;

			.title {
				display: flex;
				justify-content: center;
				align-items: center;

				.text {
					text-align: center;
					height: 120rpx;
					line-height: 120rpx;
					font-size: 40rpx;
					font-weight: 700;
				}

				.tip {
					margin-left: 10rpx;
					width: 64rpx;
					height: 30rpx;
					color: red;
					text-align: right;
					font-size: 24rpx;

					background-image: url(./icon/new.png);
					background-size: 43rpx 30rpx;
					background-repeat: no-repeat;
				}
			}

			.inner {
				width: 650rpx;
				display: flex;

				.left {
					.user {
						image {
							width: 90rpx;
							height: 90rpx;

							border-radius: 50%;
						}
					}
				}

				.right {
					margin-left: 20rpx;

					width: 600rpx;

					.name {
						margin-top: 5rpx;
						font-size: 32rpx;

						text {
							margin-left: 20rpx;
							font-size: 26rpx;
							color: #3a3a3a;
						}
					}

					.text {
						width: 550rpx;
						margin-top: 10rpx;
						font-size: 28rpx;
					}

					.img_box {
						margin-top: 20rpx;

						width: 550rpx;
						overflow: hidden;

						.img {
							margin-bottom: 10rpx;
							float: left;
							margin-right: 20rpx;

							image {
								width: 170rpx;
								height: 170rpx;

								border-radius: 10rpx;
							}
						}

						.img:nth-child(3n) {
							margin-right: 0;
						}
					}

					.time {
						font-size: 24rpx;
						color: #999999;
					}

					.btn {
						margin: 20rpx auto;
						width: 400rpx;
						height: 50rpx;

						background-color: #69BBFA;
						border-radius: 50rpx;

						display: flex;
						align-items: center;
						justify-content: center;

						.icon {
							image {
								width: 23rpx;
								height: 24rpx;

								display: block;
							}
						}

						.btn_text {
							margin-left: 10rpx;
							font-size: 28rpx;
							color: #FFFFFF;
						}
					}
				}
			}
		}
	}
</style>
