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

		<view class="container">

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

			<view class="tab_info">
				<view class="img">
					<image src="../img/jkcr.png" mode="widthFix"></image>
					<view class="text">东井架空乘人器</view>
				</view>
			</view>

			<view class="content">
				<view class="section">
					<view class="title">
						<view class="left">保护状态</view>
					</view>
					<view class="inner">
						<view class="item" v-for="(item,index) in state" :key="index">
							<view class="label">{{item.label}}</view>
							<view class="value">
								<view class="state" :style="{'backgroundColor':item.state == 1?'#00BD00':'#D6000F'}">
								</view>
							</view>
						</view>
					</view>
				</view>

				<view class="section section_2">
					<view class="title">
						<view class="left">运行参数</view>
					</view>
					<view class="inner">
						<view class="list">
							<view class="item" v-for="(item,index) in canshu.data" :key="index">
								<view class="label">{{item.label}}</view>
								<view class="value">{{item.value}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				sys_code: "",
				info: [{
						label: "行人斜井",
						value: "9人"
					},
					{
						label: "行人斜井井底",
						value: "2人"
					},
					{
						label: "行人斜井井口",
						value: "0人"
					},
					{
						label: "行人斜井258米",
						value: "0米"
					},
					{
						label: "22采区985行人通道",
						value: "2人"
					},
					{
						label: "行人斜井100米",
						value: "6人"
					},
					{
						label: "行人斜井538米",
						value: "1人"
					},
					{
						label: "通讯状态",
						value: "通讯正常"
					},
					{
						label: "通讯地址",
						value: "172.17.55.22"
					}
				],
				state: [{
						label: "机头越位",
						state: 1,
					},
					{
						label: "驱动轮轴断",
						state: 1,
					},
					{
						label: "机尾越位",
						state: 1,
					},
					{
						label: "安全闸越位",
						state: 1,
					},
					{
						label: "运行欠速",
						state: 1,
					}
				],
				canshu: {
					data: [{
							label: "运行状态",
							value: "正在运行"
						},
						{
							label: "主电机温度",
							value: "48.54℃"
						},
						{
							label: "运行速度",
							value: "1.08m/s"
						},
						{
							label: "减速机温度",
							value: "49℃"
						}
					]
				},
			};
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
				title: options.title
			})
			this.sys_code = options.sys_code
		},
		mounted() {

		},
		methods: {

		}
	}
</script>

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

	.top {
		margin-top: -80rpx;

		image {
			width: 750rpx;
		}
	}

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

		.info {
			margin: 40rpx 0;
			box-sizing: border-box;
			padding: 20rpx;
			display: grid;
			grid-template-columns: repeat(3, 1fr);
			gap: 40rpx 10rpx;

			.item {
				text-align: center;
				border-right: 1rpx solid #FFFFFF80;

				.label {
					font-size: 22rpx;
					color: #FFF;
					margin-bottom: 10rpx;
				}

				.value {
					flex-wrap: wrap;
					color: #FFF600;
					font-weight: 700;
				}
			}

			.item:nth-child(3n) {
				border: none;
			}
		}


		.tab_info {
			margin: 40rpx 60rpx 0rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			box-sizing: border-box;
			padding: 40rpx;
			border-top: 2rpx dashed #FFF;

			.img {
				image {
					width: 324rpx;
				}
			}

			.text {
				text-align: center;
				color: #FFF;
				font-size: 28rpx;
				line-height: 90rpx;
			}
		}

		.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: 80rpx;

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

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

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

					.list {
						display: grid;
						grid-template-columns: repeat(2, 1fr);
						gap: 0 40rpx;

						.item {
							width: 300rpx;
							height: 90rpx;
							display: flex;
							align-items: center;
							justify-content: space-around;

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

							.value {
								width: 120rpx;
								font-size: 26rpx;
							}
						}
					}

				}
			}
		}
	}
</style>