<template>
	<!-- 组装机 -->
	<view class="equipmentDtl">
		<commons-header></commons-header>
		<view class="equ-img">
			<image src="../../static/images/icon_dqwd.png" mode=""></image>
			<view class="err-modal">
				<image src="../../static/images/icon_dqwd.png" mode=""></image>
			</view>
		</view>
		<view class="state">
			<view class="state-box">
				<image src="../../static/icon_sbzt.png" mode=""></image>
				<view class="text">
					<view class="label">
						设备状态
					</view>
					<view class="state-text">
						正常
					</view>
				</view>
			</view>
			<view class="state-box">
				<image src="../../static/icon_gzms.png" mode=""></image>
				<view class="text">
					<view class="label">
						设备状态
					</view>
					<view class="state-text">
						正常
					</view>
				</view>
			</view>
		</view>
		<view class="echarts">
			<view class="title">
				<image src="../../static/btn_kanban_blue.png" mode=""></image>
				<span>产量数据</span>
			</view>
			<view class="content">
				<view class="text">
					12小时产量
				</view>
				<qiun-data-charts type="line" :opts="opts" :chartData="chartData" />
			</view>
		</view>
		<view class="parts-list">
			<ul>
				<li>
					<image src="../../static/btn_kanban_blue.png" mode=""></image>
					<view>
						主电机
					</view>
					<view class="before succes">
					</view>
				</li>
				<li>
					<image src="../../static/btn_kanban_blue.png" mode=""></image>
					<view>
						气阀
					</view>
					<view class="before">
					</view>
				</li>
				<li>
					
					<image src="../../static/btn_kanban_blue.png" mode=""></image>
					<view>
						离心机
					</view>
					<view class="before">
					</view>
				</li>
			</ul>
		</view>
		<view class="rate-warp">
			<ul class="big-rate">
				<li>
					<view class="commons-before-40 bg-cl-yl bf-bg-cl-yl">
						
					</view>
					<view class="text">
						主电机频率
					</view>
					<view class="line">
						<view class="box">
							
						</view>
					</view>
					<view class="num">
						99%
					</view>
				</li>
			</ul>
			<ul class="sm-rate">
				<li>
					<view class="commons-before-40 bg-cl-pp bf-bg-cl-pp"></view>
					<view class="text">
						胶塞速率
					</view>
					<view class="right-box">
						<view class="num">
							95%
						</view>
						<view class="line">
							<view class="box"></view>
						</view>
					</view>
				</li>
				<li>
					<view class="commons-before-40 bg-cl-pp bf-bg-cl-pp">
					</view>
					<view class="text">
						胶塞速率
					</view>
					<view class="right-box">
						<view class="num">
							95%
						</view>
						<view class="line">
							<view class="box"></view>
						</view>
					</view>
				</li>
				<li>
					<view class="commons-before-40 bg-cl-pp bf-bg-cl-pp">
					</view>
					<view class="text">
						胶塞速率
					</view>
					<view class="right-box">
						<view class="num">
							95%
						</view>
						<view class="line">
							<view class="box"></view>
						</view>
					</view>
				</li>
				<li>
					<view class="commons-before-40 bg-cl-pp bf-bg-cl-pp">
					</view>
					<view class="text">
						胶塞速率
					</view>
					<view class="right-box">
						<view class="num">
							95%
						</view>
						<view class="line">
							<view class="box"></view>
						</view>
					</view>
				</li>
			</ul>
		</view>
	</view>
</template>

<script>
	import {
		getInfo
	} from "@/util/api.js";
	import Vue from 'vue'
	import commonsHeader from '../../components/commons-header/index.vue'
	export default {
		components: {
			commonsHeader
		},
		data() {
			return {
				userInfoData: [],
				notificationData: [],
				opts: {
					color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
						"#ea7ccc"
					],
					padding: [15, 10, 0, 15],
					legend: {},
					xAxis: {
						disableGrid: true
					},
					yAxis: {
						gridType: "dash",
						dashLength: 2
					},
					extra: {
						line: {
							type: "straight",
							width: 2
						}
					}
				},
				chartData: {
					categories: ["2016", "2017", "2018", "2019", "2020", "2021"],
					series: [{
							name: "成交量A",
							data: [35, 8, 25, 37, 4, 20]
						},
						{
							name: "成交量B",
							data: [70, 40, 65, 100, 44, 68]
						},
						{
							name: "成交量C",
							data: [100, 80, 95, 150, 112, 132]
						}
					]
				}
			}
		},
		onLoad() {
			const v = this
			// v.$post('/wx/login/getUserInfo').then(res => {
			// 	v.userInfoData = res.data
			// 	Vue.prototype.$userInfo = res.data
			// 	uni.setStorage({
			// 		key: "userInfo",
			// 		data: res.data,
			// 		success(res) {

			// 		},
			// 		fail(res) {}
			// 	})
			// })
			// v.$post('/wx/message/notification',{}).then(res=>{
			// 	v.notificationData = res.data
			// })
		},
		methods: {
			toRouter(j) {
				console.log(j)
				uni.navigateTo({
					url: '/pages/' + j.menuKey + '/' + j.menuKey
				})
			},
		},
	}
</script>

<style lang="less">
	.equipmentDtl {
		background-color: #f0f0f0;
		min-height: 100vh;
		margin-top: 128rpx;
		.rate-warp{
			margin-top: 20rpx;
			.sm-rate{
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;
				padding: 0 24rpx;
				li{
					
					background-color: #fff;
					border-radius: 10rpx;
					height: 120rpx;
					display: flex;
					justify-content: space-between;
					margin-top: 24rpx;
					align-items: center;
					padding: 0 24rpx;
					width: 296rpx;
					font-size: 28rpx;
					color: #666;
					.right-box{
						font-size: 32rpx;
						color: #333;
						.line{
							width: 70rpx;
							height: 8rpx;
							background: rgba(238,238,238,1);
							border-radius: 4rpx;
							margin-top: 6rpx;
							.box{
								width:50%;
								background-color: #BB99F6;
								height: 100%;
								border-radius: 12rpx;
							}
						}
					}
				}
			}
			.big-rate{
				li{
					margin-top: 24rpx;
					height: 128rpx;
					display: flex;
					align-items: center;
					background-color: #fff;
					margin: 0 24rpx;
					border-radius: 10rpx;
					padding: 0 24rpx;
					
					.text{
						font-weight: 500;
						font-size: 28rpx;
						color: #333;
					}
					.line{
						width: 240rpx;
						margin-left: 90rpx;
						height: 24rpx;
						background: rgba(238,238,238,1);
						margin-right: 40rpx;
						border-radius: 12rpx;
						
						.box{
							width:50%;
							background-color: rgba(255,175,83,1);
							height: 100%;
							border-radius: 12rpx;
						}
					}
				}
			}
			
		}
		.parts-list{
			padding: 0 24rpx;
			margin-top: 24rpx;
			ul{
				display: flex;
				justify-content: space-between;
			}
			li{
				width: 32%;
				padding: 30rpx 0;
				text-align: center;
				position: relative;
				background-color: #fff;
				image{
					width: 60rpx;
					height: 60rpx;
					display: block;
					margin: 0 auto 20rpx;
				}
			}
			.before{
				width: 30rpx;
				height: 30rpx;
				border-radius: 50%;
				background-color: rgba(204,204,204,0.2);
				
				display: block;
				position: absolute;
				right: 16rpx;
				top: 16rpx;
				
			}
			.before::before{
				position: absolute;
				display: block;
				top: 7rpx;
				left: 7rpx;
				width: 19rpx; 
				height: 19rpx;
				border-radius: 50%;
				content:" ";
				background: #cccccc;
				
			}
			.before.succes{
				background-color: rgba(63,191,49,0.2);
			}
			.before.succes::before{
				background: #3FBF31;
			}
		}
		.echarts {
			background: #fff;
			margin: 24rpx 24rpx 0;
			.content{
				
				.text{
					font-size: 28rpx;
					font-weight: 700;
					color: #333;
					text-align: center;
					margin-bottom: 40rpx;
				}
			}
			.title{
				font-size: 28rpx;
				height: 90rpx;
				line-height: 90rpx;
				display: flex;
				padding: 0 24rpx;
				font-weight: 500;
				image{
					width: 40rpx;
					height: 40rpx;
					margin-top: 25rpx;
					margin-right: 16rpx;
				}
			}
		}

		.parts-list {}

		.equ-img {
			padding: 24rpx;
			background-color: #ffffff;
			position: relative;
			image {
				width: 100%;
				height: 395rpx;
			}
			.err-modal{
				position: absolute;
				left: 0;
				right: 0;
				bottom: 0;
				top: 0;
				background: rgba(0,0,0,0.60);
				text-align: center;
				display: flex;
				align-items: center;
				
				image{
					width: 160rpx;
					height: 160rpx;
					margin: 0 auto;
				}
			}
		}

		.state {
			display: flex;
			justify-content: space-between;
			margin: 24rpx 24rpx 0;

			.state-box {
				padding: 20rpx;
				width: 48%;
				background-color: #fff;
				display: flex;
				box-sizing: border-box;
				border-radius: 10rpx;
				.text{
					padding: 12rpx 0;
				}
				.state-text{
					font-size: 32rpx;
					font-weight: bold;
					margin-top: 5rpx;
				}
				.label{
					font-weight: 400;
					font-size: 28rpx;
				}
				image {
					width: 110rpx;
					height: 110rpx;
				}
			}
		}
	}
</style>
