<template>
	<view class="equipment">
		<commons-header></commons-header>
		<view class="search-warp">
			<view class="left-select" @click="openSelectQd(2)">
				<i class="iconfont">&#xe6c4;</i>
				<span style="margin:0 10rpx">1号生产线</span>
				<i class="iconfont">&#xe6b9;</i>
			</view>
			<view class="right-select" @click="openSelectQd(1)">
				<i class="iconfont">&#xe6c3;</i>
				<span style="margin: 0 10rpx;">状态</span>
				<i class="iconfont">&#xe6b9;</i>
			</view>
		</view>
		<view class="content">
			<ul>
				<li>
					<view class="list-warp"  @click="toDtl">
						<view class="list-main-info">
							<view class="img">
								<image src="../../static/images/icon_bzj@2x.png" mode=""></image>
							</view>
							<view class="text">
								<view class="list-main-title">
									注塑机
									<span>运行中</span>
								</view>
								<view class="list-main-model">
									产品型号：SMT-1029
								</view>
							</view>
							<view class="more">
								<i class="iconfont">&#xe6bb;</i>
							</view>
						</view>
						<view class="tag">
							<view class="tag-box">
								自动模式
							</view>
							<!-- <view class="tag-box">
								检测系统
							</view> -->
						</view>
						<view class="list-title">
							辅助机器
						</view>
						<view class="auxiliary-warp">
							<view class="auxiliary-list-box">
								<view class="auxiliary-img">
									<image src="../../static/images/icon_xlj@2x.png" mode=""></image>
								</view>
								<view class="auxiliary-text">
									<view class="auxiliary-text-title">
										下料机
									</view>
									<view class="model">
										产品型号：SMT-2071
									</view>
								</view>
								<view class="auxiliary-before commons-normal">
									运行中
								</view>
							</view>
						</view>
					</view>
					<view class="list-warp"  @click="toDtl3">
						<view class="list-main-info">
							<view class="img">
								<image src="../../static/images/icon_bzj@2x.png" mode=""></image>
							</view>
							<view class="text">
								<view class="list-main-title">
									注塑机
									<span class="standby">待机</span>
								</view>
								<view class="list-main-model">
									产品型号：SMT-1029
								</view>
							</view>
							<view class="more">
								<i class="iconfont">&#xe6bb;</i>
							</view>
						</view>
						<!-- <view class="tag">
							<view class="tag-box">
								自动模式
							</view>
							<view class="tag-box">
								检测系统
							</view>
						</view> -->
						<view class="list-title">
							辅助机器
						</view>
						<view class="auxiliary-warp">
							
							<view class="auxiliary-list-box">
								<view class="auxiliary-img">
									<image src="../../static/images/icon_xlj@2x.png" mode=""></image>
								</view>
								<view class="auxiliary-text">
									<view class="auxiliary-text-title">
										下料机
									</view>
									<view class="model">
										产品型号：SMT-2071
									</view>
								</view>
								<view class="auxiliary-before commons-close">
									离线
								</view>
							</view>
							
						</view>
					</view>
				</li>
				<li  @click="toDtl2">
					<view class="list-warp">
						<view class="list-main-info">
							<view class="img">
								<image src="~@/static/images/icon_mjg@2x.png" mode=""></image>
							</view>
							<view class="text">
								<view class="list-main-title">
									灭菌柜
									<span>运行中</span>
								</view>
								<view class="list-main-model">
									产品型号：SMT-5010
								</view>
							</view>
							<view class="more">
								<i class="iconfont">&#xe6bb;</i>
							</view>
						</view>
						<view class="tag">
							<view class="tag-box">
								平均温度:67.5℃
							</view>
							<view class="tag-box">
								平均湿度:67.5%RH
							</view>
						</view>
					</view>
				</li>
			</ul>
		</view>
		<uni-popup ref="popup2" type="bottom">
			<view class="search-box">
				
				<ul>
					<li @click="selectMaterialList()">
						一号生产线
					</li>
				</ul>
			</view>
		</uni-popup>
		<uni-popup ref="popup1" type="bottom">
			<view class="search-box">
				
				<ul>
					<li @click="selectMaterialList()">
						运行中
					</li>
					<li @click="selectMaterialList()">
						待机
					</li>
					<li @click="selectMaterialList()">
						离线
					</li>
				</ul>
			</view>
		</uni-popup>
	</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:[],
			}
		},
		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: {
			selectMaterialList(){
				this.$refs.popup1.close()
				this.$refs.popup2.close()
			},
			openSelectQd(_type){
				if(_type == 1){
					this.$refs.popup1.open('top')
				}else{
					this.$refs.popup2.open('top')
				}
			},
			toDtl3(){
				uni.showToast({
					icon:"none",
					title: '该设备待机中，暂无数据！'
				})
			},
			toDtl2(){
				uni.navigateTo({
					url: '/pages/equipment/sterilization'
				})
			},
			toDtl(){
				uni.navigateTo({
					url: '/pages/equipment/injectionMolding'
				})
			},
			toRouter(j) {
				console.log(j)
				uni.navigateTo({
					url: '/pages/' + j.menuKey + '/' + j.menuKey
				})
			},
		},
	}
</script>
 
<style lang="less">
	.search-box{
		background-color: #fff;
		ul{
			li{
				padding: 25rpx 30rpx;
				border-bottom: 1rpx solid #dcdcdc;
			}
		}
	}
	.equipment{
		background-color: #f0f0f0;
		min-height: 100vh;
		.search-warp{
			height: 90rpx;
			line-height: 90rpx;
			background-color: #fff;
			display: flex;
			justify-content: space-between;
			padding: 0 24rpx;
			margin-bottom: 24rpx;
			margin-top: 128rpx;
		}
		.content{
			ul{
				li{
					box-shadow: 0px 3rpx 20rpx 0px rgba(0,0,0,0.10); 
					background-color: #ffffff;
					margin-bottom:24rpx;
					padding: 0rpx 24rpx;
					.list-warp{
						padding: 24rpx 0;
						border-bottom: 14rpx solid #f0f0f0;
					}
					.list-warp:last-child{
						border:none;
					}
					.auxiliary-warp{
						display: flex;
						justify-content: space-between;
						flex-wrap: wrap;
						.auxiliary-list-box{
							width: 342rpx;
							padding: 24rpx 20rpx;
							border-radius: 10rpx;
							border: 1rpx solid #ddd;
							background-color: #fff;
							display: flex;
							position: relative;
							box-sizing: border-box;
							font-size: 24rpx;
							margin-top: 24rpx;
							.auxiliary-before{
								position: absolute;
								right: 0;
								top: 0;
								width: 120rpx;
								height: 40rpx;
								line-height: 40rpx;
								text-align: center;
								border-radius: 2px 2px 2px 10px;
							}
							.auxiliary-img{
								width: 60rpx;
								height: 60rpx;
								margin-right: 10rpx;
								image{
									width: 100%;
									height: 100%;
								}
							}
						}
						
					}
					.list-title{
						margin-top: 30rpx;
						color: #333;
						font-size: 28rpx;
					}
					.tag{
						margin-top: 32rpx;
						.tag-box{
							height: 48rpx;
							line-height: 48rpx;
							text-align: center;
							padding: 0 22rpx;
							display: inline-block;
							background-color: #F1F1F1;
							font-size: 24rpx;
							color: #666666;
							margin-left: 20rpx;
							
						}
					}
					.list-main-info{
						display: flex;
						justify-content: space-between;
						
						.img{
							width: 100rpx;
							height: 100rpx;
							image{
								width: 100rpx;
								height: 100rpx;
							}
						}
						.text{
							width: calc(~ '100% - 140rpx');
							margin-top: 10rpx;
							padding: 0 24rpx;
							.list-main-title{
								font-size: 28rpx;
								color: #333333;
								span{
									background: rgba(63,191,49,0.20);
									padding: 3rpx 24rpx;
									color: #34C724;
									border-radius: 40rpx;
									margin-left: 24rpx;
								}
								.standby{
									background-color: rgba(153, 153, 153, 0.20);
									color:#FF8800;
								}
							}
							.list-main-model{
								margin-top: 10rpx;
								font-size: 24rpx;
								color: #333333;
							}
						}
					}
				}
			}
		}
	}
</style>
  