<template>
	<view class="page-body">
		<page-header :name="'东井驾空乘人器'" :bg="'#1560e0'" :showLeft="true" @goBack="goBack()"></page-header>
		<view class="scroll-wrap">
			<view class="basic-info-wrap">
				<view class="info-wrap">
					<view v-for="(item,index) in list" class="data-item-wrap">
						<view class="title">{{ item.name }}</view>
						<view class="data">{{ item.params }}</view>
					</view>
				</view>
				<view class="img-wrap">
					<image src="@/static/passenger.png" />
				</view>
				<view class="radius-wrap"></view>
			</view>
			<view class="detail-info-wrap">
				<page-card style="margin-bottom: 30rpx;" :notShow="true" :name="'信号参数'">
					<template v-slot:content>
						<view class="detail-wrap">
							<template v-for="(item, index) in statusList">
								<view class="item" v-if="!item.data">
									<status-tip class="status-wrap" :name="item.name"
										:status="item.status"></status-tip>
								</view>
								<view class="item" v-else>
									<view>{{ item.name }}</view>
									<view class="params">{{ item.params }}</view>
								</view>
							</template>
						</view>
					</template>
				</page-card>
				<page-card style="margin-bottom: 30rpx;" :notShow="true" :name="'变频参数'">
					<template v-slot:content>
						<view class="params-wrap">
							<view class="item" v-for="(item, index) in paramsList">
								<view>
									{{ item.name }}
								</view>
								<view>
									{{ item.params }}
								</view>
							</view>
						</view>
					</template>
				</page-card>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '停车倒计时',
					params: '0s'
				}, {
					name: '猴车速度',
					params: '0m/s'
				}, {
					name: '制动闸压力',
					params: '07.54MPa'
				}],
				statusList: [{
					name: '操作台急停',
					status: 1,
				}, {
					name: '965通讯中断',
					status: 1,
				}, {
					name: '1172通讯中断',
					status: 1,
				}, {
					name: '机尾上人信号',
					status: 1,
				}, {
					name: '1065上人信号',
					status: 1,
				}, {
					name: '1172上人信号',
					status: 1,
				}, {
					name: '上位机急停',
					status: 1,
				}, {
					name: '1065通讯中断',
					status: 1,
				}, {
					name: '机尾通讯中断',
					status: 1,
				}],
				paramsList: [{
					name: '母线电压',
					data: '999.00',
				},{
					name: '输入电压',
					data: '699.60',
				},{
					name: '输入电流',
					data: '9.49',
				},{
					name: '输入频率',
					data: '49.94',
				},{
					name: '有功功率',
					data: '11.00',
				},{
					name: '无功功率',
					data: '0.00',
				},{
					name: '变频温度',
					data: '19.80',
				},{
					name: '逆母线电压',
					data: '995.00',
				},{
					name: '输出电压',
					data: '584.40',
				},{
					name: '输出转矩',
					data: '50.10',
				},{
					name: '输出频率',
					data: '44.30',
				},{
					name: '电机速度',
					data: '885.00',
				},{
					name: '输出电流',
					data: '27.00',
				},{
					name: '输出功率',
					data: '4.30',
				},{
					name: '输入功率',
					data: '6.30',
				},{
					name: '交频温度',
					data: '21.20',
				}]
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {
			goBack() { // 返回上一頁面
				uni.navigateBack()
			},
			async getData() {
				let res = await this.$http({
					url: `/qsy/dcs/transform/djjkcrq`,
					method: 'POST'
				})
				this.list = res.data.data.list
				this.statusList = res.data.data.statusList
				this.paramsList = res.data.data.paramsList
			}
		}
	}
</script>

<style scoped lang="scss">
	.page-body {
		.scroll-wrap {
			height: calc(100vh - 85rpx);
			overflow: scroll;

			.basic-info-wrap {
				position: relative;
				height: auto;
				padding: 50rpx 49rpx 0;
				background: url(../../../../static/page_bg.png);
				background-size: 110%;

				.info-wrap {
					display: flex;
					flex-wrap: wrap;

					.data-item-wrap {
						width: 33.33%;
						padding: 9rpx 0;
						min-height: 81rpx;
						text-align: center;
						margin-top: 48rpx;
						border-right: 1px solid #FFFFFF;

						.title {
							font-size: 22rpx;
							color: #FFFFFF;
							margin-bottom: 14rpx;
						}

						.data {
							font-weight: 700;
							font-size: 32rpx;
							color: #FFF600;
						}
					}

					.data-item-wrap:nth-child(-n+3) {
						margin-top: 0;
					}

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

				.img-wrap {
					padding: 38rpx 0 57rpx;
					text-align: center;

					image {
						width: 350rpx;
						height: 194rpx;
					}
				}

				.radius-wrap {
					position: absolute;
					left: 0;
					bottom: 0;
					width: 100vw;
					height: 30rpx;
					background-color: #fff;
					border-radius: 35rpx 35rpx 0 0;
				}
			}

			.detail-info-wrap {
				padding: 40rpx 35rpx;

				.detail-wrap {
					display: flex;
					flex-wrap: wrap;
					padding: 35rpx 55rpx 18rpx 55rpx;
					color: #8D8D8D;

					.item {
						display: flex;
						font-size: 26rpx;
						justify-content: space-between;
						width: calc(50% - 61rpx);
						margin-bottom: 50rpx;

						.params {
							color: #00BD00;
						}

						.status-wrap {
							width: 100%;

							/deep/ .tip-wrap {
								width: 100%;
								justify-content: space-between;
							}
						}
					}

					.item:nth-child(2n) {
						margin-left: 120rpx;
					}
				}

				.params-wrap {
					display: flex;
					flex-wrap: wrap;
					font-size: 26rpx;
					padding: 35rpx 55rpx;

					.item {
						width: calc(50% - 32rpx);
						display: flex;
						justify-content: space-between;
						margin-top: 50rpx;

						view:first-child {
							color: #8D8D8D;
						}
					}

					.item:nth-child(2n) {
						margin-left: 62rpx;
					}

					.item:nth-child(-n+2) {
						margin-top: 0;
					}
				}
			}
		}
	}
</style>