<template>
	<view>
		<view class="top">
			<image src="../img/top.jpg" mode="widthFix"></image>
		</view>

		<view class="container">
			<view class="btn">
				<view class="left">
					<view class="icon">
						<image src="../img/btn_icon.png" mode="widthFix"></image>
					</view>
					<view class="title">
						多级排水系统
					</view>
				</view>
				<!-- <view class="right">
					<uni-icons type="arrowright" color="#FFF"></uni-icons>
				</view> -->
			</view>

			<view class="info">
				<view class="box">
					<view class="item" v-for="(item,index) in info_paishui" :key="index">
						<view class="label">{{item.label}}</view>
						<view class="value">{{item.value}}</view>
					</view>
				</view>
			</view>

			<view class="btn">
				<view class="left">
					<view class="icon">
						<image src="../img/btn_icon.png" mode="widthFix"></image>
					</view>
					<view class="title">
						多级供水系统
					</view>
				</view>
				<!-- <view class="right">
					<uni-icons type="arrowright" color="#FFF"></uni-icons>
				</view> -->
			</view>

			<view class="info">
				<view class="box">
					<view class="item" v-for="(item,index) in info_gongshui" :key="index">
						<view class="label">{{item.label}}</view>
						<view class="value">{{item.value}}</view>
					</view>
				</view>
			</view>

			<view class="content">
				<view class="section" v-for="(item,index) in list" :key="index">
					<view class="title">
						<view class="left">{{item.title}}</view>
						<view class="right" @click="goto_url(item)">点击查看详情</view>
					</view>
					<view class="inner">
						<view class="item" v-for="(item_2,index_2) in item.info" :key="index_2">
							<view class="label">{{item_2.label}}</view>
							<view class="value">
								<view class="state" :style="{'backgroundColor':item_2.state == 1?'#00BD00':'#D6000F'}">
								</view>
								<view class="text">{{item_2.text}}</view>
							</view>
						</view>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

				info_paishui: [{
						label: "1#水池液位",
						value: "2.95m"
					},
					{
						label: "通讯状态",
						value: "通讯正常"
					},
					{
						label: "2#水池液位",
						value: "3.15m"
					},
					{
						label: "通讯地址",
						value: "172.16.59.241"
					}
				],

				info_gongshui: [{
						label: "补清水量",
						value: "214748364.8m3"
					},
					{
						label: "复用水累计流量",
						value: "10380792.8m3"
					},
					{
						label: "通讯状态",
						value: "通讯正常"
					}
				],


				list: [{
						title: "929水泵房",
						sys_code: "929",
						info: [{
								label: "1#水泵",
								state: 1,
								text: "开启"
							},
							{
								label: "2#水泵",
								state: 1,
								text: "开启"
							},
							{
								label: "3#水泵",
								state: 1,
								text: "开启"
							}
						]
					},
					{
						title: "+1000水泵房",
						sys_code: "1000",
						info: [{
								label: "1#污水泵",
								state: 1,
								text: "开启"
							},
							{
								label: "2#污水泵",
								state: 1,
								text: "开启"
							},
							{
								label: "1#清水泵",
								state: 0,
								text: "无信号"
							},
							{
								label: "2#清水泵",
								state: 0,
								text: "无信号"
							}
						]
					}
				],
			};
		},
		methods: {
			goto_url(item) {
				uni.navigateTo({
					url: "./pump_house/pump_house" + "?title=" + item.title + "&sys_code=" + item
						.sys_code
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F7F7F7;
	}

	.top {
		margin-top: -80rpx;

		image {
			width: 750rpx;
		}
	}

	.container {
		margin: -900rpx 0 0 0;
		position: relative;

		.btn {
			margin: 0 auto;
			width: 680rpx;
			height: 120rpx;
			background-image: url("../img/btn.png");
			background-size: cover;

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

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

			.left {
				display: flex;
				align-items: center;

				.icon {
					margin-right: 20rpx;
					font-size: 0;

					image {
						width: 36rpx;
					}
				}

				.title {
					font-size: 34rpx;
					font-weight: 700;
					color: #FFF;
				}
			}

			.right {
				font-weight: 700;
			}
		}

		.info {
			margin: 25rpx;
			padding: 10rpx 0;
			background-color: #34ADFE40;
			border-radius: 16rpx;

			.box {
				margin: 20rpx 40rpx;
				box-sizing: border-box;
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;

				.item {
					min-width: 300rpx;
					font-size: 26rpx;
					line-height: 60rpx;
					display: flex;

					.label {
						color: #FFF;
					}

					.value {
						margin-left: 20rpx;
						color: #FFFF00;
					}
				}
			}
		}

		.content {
			background-color: #F7F7F7;
			border-radius: 35rpx 35rpx 0 0;
			box-sizing: border-box;
			padding: 35rpx;

			.section {
				margin-bottom: 40rpx;
				border-radius: 14rpx;
				overflow: hidden;

				.title {
					background: linear-gradient(-90deg, #FFFFFF, #E6FAFF);

					display: flex;
					align-items: flex-end;
					justify-content: space-between;

					box-sizing: border-box;
					padding: 24rpx;

					.left {
						border-left: 6rpx solid #33C777;
						padding-left: 10rpx;
						font-size: 34rpx;
						font-weight: 700;
						color: #343434;
					}

					.right {
						font-size: 22rpx;
						color: #3394F9;
					}
				}

				.inner {
					background-color: #FFFFFF;
					padding: 30rpx 20rpx;
					display: grid;
					grid-template-columns: repeat(2, 1fr);
					gap: 0 40rpx;

					.item {
						display: flex;
						align-items: center;
						justify-content: space-around;
						line-height: 60rpx;

						.label {
							width: 150rpx;
							color: #8D8D8D;
							font-size: 26rpx;
						}

						.value {
							width: 150rpx;
							display: flex;
							align-items: center;

							.state {
								width: 30rpx;
								height: 30rpx;
								background: #D6000F;
								border-radius: 6rpx;
							}

							.text {
								margin-left: 20rpx;
								font-size: 26rpx;
							}
						}
					}
				}
			}


		}
	}
</style>