<template>
	<view class="content">
		<u-navbar autoBack placeholder bgColor="">
			<!-- linear-gradient(91deg, #FDEDEE 0%, #FFFFFF 100%) -->
			<view class="navSlot" slot="left">
				<u-icon name="arrow-left" size="19"></u-icon>
				<text class="title">设备状态</text>
			</view>
		</u-navbar>
		<image class="icon" src="../../static/hoem/s_type.png" mode=""></image>
		<view class="s_text">
			当前状态：
			<text class="subscript" v-if="state.notificationStatus == 0">设备正常</text>
			<text class="subscript" v-else-if="state.notificationStatus == 1">主动下线</text>
			<text class="subscript" v-else-if="state.notificationStatus == 2">用纸预警</text>
			<text class="subscript" v-else-if="state.notificationStatus == 3">设备异常</text>
			<text class="subscript" v-else-if="state.notificationStatus == 5">设备维护</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
				state: {}
			}
		},
		onLoad(data) {
			this.getallEquipmentById(data.id);
		},
		methods: {
			//获取详情
			getallEquipmentById(id) {
				const params = {
					url: '/sun/mqtt/allEquipmentById',
					data: {
						id: id
					},
				}
				this.$request(params).then(res => {
					this.state = res.rows[0];
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 750rpx;
		height: 700rpx;
		background-image: url("../../static/hoem/statusback.png");
		background-repeat: no-repeat;
		background-size: 100% 100%;

		.icon {
			width: 296rpx;
			height: 296rpx;
			display: block;
			margin: 0 auto;
			margin-top: 60rpx;
			margin-bottom: 30rpx;
		}

		.s_text {
			font-family: Microsoft YaHei, Microsoft YaHei;
			color: #333333;
			font-size: 28rpx;
			text-align: center;
			display: block;
			margin: 0 auto;

			text {
				font-family: Microsoft YaHei, Microsoft YaHei;
				font-weight: bold;
				font-size: 28rpx;
				color: #FFA42E;
			}
		}
	}

	.navSlot {
		display: flex;
		align-items: center;
		font-weight: bold;
		text-align: center;
		font-size: 36rpx;
		color: #333333;
	}
</style>