<template>
  <view class="app-content">
		<img src="~@/static/beijing.png" alt="" class="tuku">
		<Nav :navname.sync="navname" :navtype="false" :navtypes="true"></Nav>
    <view class="cont">
			<view class="photograph"  @tap="upindiv">
				<img src="~@/static/shuai.png" alt="">
			</view>
			<view class="details">
				<p>Admin</p>
				<span>工号：E002</span>
			</view>
			<view class="detail_list">
				<view class="list_child">
          <p>分拣</p>
					<span>200</span>
				</view>
				<view class="list_child">
          <p>装车</p>
					<span>200</span>
				</view>
				<view class="list_child">
          <p>上机</p>
					<span>200</span>
				</view>
				<view class="list_child">
          <p>卸机</p>
					<span>200</span>
				</view>
				<view class="list_child">
          <p>卸车</p>
					<span>200</span>
				</view>
			</view>
			<view class="detail_type">
				<view class="list_child" @tap="recup">
					<view class="log bg1"></view>
					<p>我的记录</p>
				</view>
				<view class="list_child" @tap="uppop">
					<view class="log bg2"></view>
					<p>扫码开关</p>
				</view>
				<view class="list_child" @tap="uppops">
					<view class="log bg3"></view>
					<p>工作方式</p>
				</view>
				<view class="list_child" @tap="uphelp">
					<view class="log bg4"></view>
					<p>帮助</p>
				</view>
			</view>
		</view>
		<z-popup v-model="all">
				<view class="popup_title">
					<p>请选择扫码开关</p>
				</view>
				<view class="popup_content">
					<ul>
						<li v-for="(item, index) in list" :key="index" @tap="()=>selectup(index)">
							<p>{{item.name}}</p>
							<view class="start" v-if="action === index ? true: false">
								<img src="~@/static/gou.png" alt="">
							</view>
						</li>
					</ul>
					<view class="top"></view>
					<view class="cancel" @tap="()=>topup()">取消</view>
				</view>
	</z-popup>
	<z-popup v-model="allshow">
				<view class="popup_title">
					<p>请选择工作方式</p>
				</view>
				<view class="popup_content">
					<ul>
						<li v-for="(item, index) in lists" :key="index" @tap="()=>selectup(index)">
							<p>{{item.name}}</p>
							<view class="start" v-if="action === index ? true: false">
								<img src="~@/static/gou.png" alt="">
							</view>
						</li>
					</ul>
					<view class="top"></view>
					<view class="cancel" @tap="()=>topup()">取消</view>
				</view>
	</z-popup>
  </view>
</template>
<script>
	import Nav from '../../components/header/nav.vue'
	// import Popup from '../../uni_modules/z-popup/components/z-popup'
	export default {
		data() {
			return {
				main: null,
				poll: null,
				filter:null,
				pusher:null,
				intentServer:null,
				navname: '我的',
				all: false,
				allshow: false,
				action: '',
				list: [{
					name: '相机'
				},
				{
					name: '激光扫描枪'
				},
				{
					name: 'RFID读取器'
				}],
				lists: [
					{
						name: '单次扫描'
					},
					{
						name: '连续扫描'
					}
				]
			}
		},
		created(option) {
		},
		onLoad(){
		},
		onUnload() {
		},
		onShow() {
			// uni.hideTabBar()//关闭导航栏
			// uni.showTabBar()//显示导航栏
		},
		mounted() {
		},
		components: {
			Nav
		},
		watch: {
      allshow () {
				if (this.allshow) {
					uni.hideTabBar({})
				} else{
					uni.showTabBar()
				}
			},
			all () {
				if (this.all) {
					uni.hideTabBar({})
				} else{
					uni.showTabBar()
				}
			}
		},
		methods: {
			recup () {
				uni.redirectTo({
					url: "/pages/myrecords/index"
				})
			},
			fall () {
				uni.switchTab({
					url: "/pages/index/index"
				})
			},
			upindiv () {
				uni.redirectTo({
					url: "/pages/individual/index"
				})
			},
			uphelp () {
				uni.redirectTo({
					url: "/pages/help/index"
				})
			},
			uppop () {
				uni.hideTabBar({})
				this.all = true
			},
			uppops () {
				uni.hideTabBar({})
				this.allshow = true
			},
			selectup (index) {
        this.action = index
			},
			topup () {
				this.all = false
				this.allshow = false
				uni.showTabBar()//显示导航栏
			}
		},
	}
</script>
<style lang="scss" scoped>
.app-content{
	// position: relative;
  >.tuku{
		position: absolute;
		z-index: -1;
		width: 100%;
		top: 0;
	}
  >.cont{
		z-index: 999;
    >.photograph{
			width: 6rem;
			height: 6rem;
			// background: red;
			border-radius: 50%;
			margin: 0 auto;
			margin-top: .625rem;
		}
		>.details{
			width: 100%;
			height: 3.125rem;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			// background: red;
			margin-top: .625rem;
			>p{
				color: rgb(255, 255, 255);
				font-family: Noto Sans SC;
				font-size: 1rem;
				font-weight: 500;
			}
			>span{
				color: rgb(255, 255, 255);
				font-family: Noto Sans SC;
				font-size: .8125rem;
				font-weight: 500;
			}
		}
		>.detail_list{
			width: 100%;
			// background: red;
			display: flex;
			flex-wrap: wrap;
			margin-top: 1rem;
			>.list_child{
				width: 33%;
				display: flex;
				flex-direction: column;
				justify-items: center;
				align-items: center;
				margin-bottom: 1rem;
				>p{
					color: rgb(255, 255, 255);
					font-family: Noto Sans SC;
					font-size: .8125rem;
					font-weight: 500;
				}
				>span{
					color: rgb(255, 255, 255);
					font-family: Helvetica;
					font-size: 1rem;
					font-weight: 700;
				}
			}

		}
		>.detail_type{
			height: calc(100vh - 35.875rem);
			padding: 0 3.125rem 0 3.125rem;
			display: flex;
			justify-content: space-around;
			flex-wrap: wrap;
			flex: 1;
			>.list_child{
				width: 7.5rem;
        height: 7.5rem;
				background: rgb(37, 121, 160);
				box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
				border-radius: 4px;
				margin-bottom: 4%;
				display: flex;
				flex-direction: column;
				justify-content: center;
				align-items: center;
				>.log{
					width: 2.25rem;
					height: 2.25rem;
					// background: rgb(196, 196, 196);
					margin-bottom: .5rem;
				}
				.bg1{
					background: url('../../static/gongzuo.png') no-repeat;
          background-size: 100% 100%;
				}
				.bg2{
					background: url('../../static/kaiguan.png') no-repeat;
          background-size: 100% 100%;
				}
				.bg3{
					background: url('../../static/jilu.png') no-repeat;
          background-size: 100% 100%;
				}
				.bg4{
					background: url('../../static/bagzu.png') no-repeat;
          background-size: 100% 100%;
				}
				>p{
					color: rgb(255, 255, 255);
					font-family: Noto Sans SC;
					font-size: .9375rem;
					font-weight: 500;
				}
			}
		}
	}
	.popup_title{
		width: 100%;
		height: 4.5rem;
		background: rgb(255, 255, 255);
    border-radius: 10px 10px 0px 0px;
		display: flex;
		align-items: center;
		color: rgb(16, 17, 22);
		font-family: Noto Sans SC;
		font-size: 1rem;
		font-weight: 700;
		>p{
			margin-left: 1.5rem;
			color: rgb(16, 17, 22);
			font-family: Noto Sans SC;
			font-size: 1rem;
			font-weight: 700;
		}

	}
	.popup_content{
		width: 100%;
		background: rgb(255, 255, 255);
		>ul{
			width: 100%;
			>li{
				width: 82%;
				height: 2.6875rem;
				display: flex;
				align-items: center;
				justify-content: space-between;
				>p{
					color: rgb(0, 0, 0);
					font-family: Noto Sans SC;
					font-size: .8125rem;
					font-weight: 400;
				}
				>.start{
					width: 1rem;
					height: 1rem;
					background: rgb(37, 121, 160);
					display: flex;
					align-items: center;
					justify-content: center;
					border-radius: 50%;
				}
			}
		}
		>.top{
			width: 100%;
			height: .875rem;
			background: rgb(249, 249, 249);
		}
		>.cancel{
			width: 100%;
			height: 3.3125rem;
			display: flex;
			align-items: center;
			justify-content: center;
			color: rgb(0, 0, 0);
			font-family: Noto Sans SC;
			font-size: .9375rem;
			font-weight: 500;
		}
	}
}
</style>