<template>
	<view class="app-content">
		<img src="~@/static/beijing.png" alt="" class="tuku">
    <Nav :navname.sync="navname" :navtype="false" ></Nav>
		<view class="content">
			<view class="card" @tap="clickOrder('分拣')">
				<view class="card_name">
					<view class="name">分拣</view>
					<view class="number">已完成件数 50</view>
				</view>
				<view class="card_right"></view>
			</view>
			<view class="card"  @tap="clickOrder('装车')">
				<view class="card_name">
					<view class="name">装车</view>
					<view class="number">已完成件数 50</view>
				</view>
				<view class="card_right"></view>
			</view>
			<view class="card" @tap="clickOrder('上机')">
				<view class="card_name">
					<view class="name">上机</view>
					<view class="number">已完成件数 50</view>
				</view>
				<view class="card_right"></view>
			</view>
			<view class="card"  @tap="clickOrder('卸机')">
				<view class="card_name">
					<view class="name">卸机</view>
					<view class="number">已完成件数 50</view>
				</view>
				<view class="card_right"></view>
			</view>
			<view class="card" @tap="clickOrder('卸车')">
				<view class="card_name">
					<view class="name">卸车</view>
					<view class="number">已完成件数 50</view>
				</view>
				<view class="card_right">
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import Nav from '../../components/header/nav.vue'
	import {allScan, startScan ,stopScan} from '@/components/utils/validate'

	export default {
		data() {
			return {
				input: '',
				main: null,
				poll: null,
				filter:null,
				pusher:null,
				intentServer:null,
				arr: [],
				navname: '首页',
			}
		},
		created(option) {
			this.arr = allScan(this.main,this.poll,this.filter)
			startScan(this.arr[0],this.arr[1],this.arr[2])
		},
		onLoad(){
		},
		onUnload() {
		},
		onShow() {
		},
		mounted() {
			console.log(this.main,this.poll)
		},
		beforeDestroy() {
			console.log(this.arr[0],this.arr[1])
		},
	components: {
		Nav
	},
		methods: {
			clickOrder (data) {
				uni.navigateTo({
					url: "/pages/sorting/index?item=" + encodeURIComponent(JSON.stringify(data))
				})
			}
		},
	}
</script>
 
<style lang="scss" scoped>
.app-content{
	position: relative;
	>.tuku{
		position: absolute;
		z-index: -1;
		width: 100%;
		top: 0;
	}
	.content{
		padding: 0 1.5rem 0 1.5rem;
		.card{
			width: 100%;
			height: 5.5rem;
			background: rgb(37, 121, 160);
			box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
      border-radius: 4px;
			margin-top: .75rem;
			display: flex;
			justify-content: space-between;
			align-items: center;
			>.card_name{
				margin-left: 1.25rem;
				>.name{
					color: rgb(255, 255, 255);
					font-family: Noto Sans SC;
					font-size: 24px;
					margin-bottom: 4px;
				}
				>.number{
					color: rgb(255, 255, 255);
					font-family: Noto Sans SC;
					font-size: 13px;
				}
			}
			>.card_right{
				margin-right: 2rem;
				width: 2rem;
				height: 2rem;
				background: url('../../static/Icon@1x.png') no-repeat;
				background-size: 100% 100%;
			}
		}
	}
}
</style>
