<template>
	<view class="app-content">
		<img :src="icon" alt="" class="tuku">
    <Nav :navname.sync="navname" :navtype="false" ></Nav>
		<view class="times"><p>{{ newData }}</p>{{ newDataday }}</view>
		<view class="content">
      <view class="card" @tap="clickOrder('分拣')">
				<p>分拣</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card" @tap="clickOrder('装车')">
				<p>装车</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card" @tap="clickOrder('装机')">
				<p>装机</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card" @tap="clickOrder('卸机')">
				<p>卸机</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card" @tap="clickOrder('到达')">
				<p>到达</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card" @tap="clickOrder('提取')">
				<p>提取</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card" @tap="clickOrder('异常登记')">
				<p>异常登记</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card_no">
			</view>
		</view>
	</view>
</template>
<script>
	import Nav from '../../components/header/nav.vue'
	import {allScan, startScan ,stopScan,Format} from '@/components/utils/validate'
	export default {
		data() {
			return {
				input: '',
				main: null,
				poll: null,
				filter:null,
				pusher:null,
				intentServer:null,
				timeShow: true,
				arr: [],
				navname: '首页',
				icon: 'static/beijing.png',
				newData: '',
				newDataday: ''
			}
		},
		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() {
			this.datatime()
		},
		beforeDestroy() {
			console.log(this.arr[0],this.arr[1])
		},
	components: {
		Nav
	},
		methods: {
			datatime () {
				this.newDataday = Format("yyyy/MM/dd", new Date());
				setInterval(() => {
					this.newData = Format("hh:mm", new Date());
				}, 1000);
			},
			clickOrder (data) {
				uni.navigateTo({
					url: "/pages/sorting/index?item=" + encodeURIComponent(JSON.stringify(data))
				})
				// uni.navigateTo({
				// 	url: "/pages/myrecords/index"
				// })
			}
		},
	}
</script>
 
<style lang="scss" scoped>
.app-content{
	position: relative;
	>.tuku{
		position: absolute;
		z-index: -1;
		width: 100%;
		top: 0;
	}
	>.times{
		width: 100%;
    height: 4.6875rem;
		display: flex;
		align-items: center;
		justify-content: center;
		color: rgb(255, 255, 255);
		font-family: Noto Sans SC;
		font-size: 18px;
		font-weight: 700;
		p{
			margin-right: .625rem;
		}
	}
	.content{
		padding: 0 1.5rem 0 1.5rem;
		display: flex;
		justify-content: space-around;
		flex-wrap: wrap;
		.card{
			width: 7.5rem;
			height: 7.5rem;
			/* 卡片渐变 */
			background: linear-gradient(188.06deg, rgba(65.49,109.04,128.64,1.00) 3.551%,rgba(38,68.32,81.96,1.00) 110.878%);
			box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
			border-radius: 4px;
			margin-bottom: 2.25rem;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			>p{
				color: rgb(255, 255, 255);
				font-family: Noto Sans SC;
				font-size: 18px;
				font-weight: 700;
				margin-bottom: .375rem;
				line-height: 1.6875rem;
			}
			>span{
				color: rgb(255, 255, 255);
				font-family: Noto Sans SC;
				font-size: 13px;
				font-weight: 500;
				line-height: 1.1875rem;
			}
		}
		.card_no{
			width: 7.5rem;
			height: 7.5rem;
		}
	}
}
</style>
