<template>
	<view class="app-content">
		<img :src="icon" alt="" class="tuku">
    <Nav :navname.sync="navname" :navtype="true" @fall="fall"></Nav>
    <view class="fight">
      <view class="fight_card">
        <p>CTU</p>
        <span>12:00:00 </span>
      </view>
      <view class="fight_card">
        <p>HU7412</p>
        <span>2023-02-17</span>
      </view>
      <view class="fight_card">
        <p>CSX</p>
        <span>14:23:00 </span>
      </view>
    </view>
		<view class="times"><p>{{ newData }}</p>{{ newDataday }}</view>
		<view class="content">
      <view class="card">
				<p>分拣</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card">
				<p>装车</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card">
				<p>装机</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card">
				<p>卸机</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card">
				<p>到达</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card">
				<p>提取</p>
				<span>已完成件数</span>
				<span>50件</span>
			</view>
			<view class="card">
				<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: {
      fall () {
        uni.redirectTo({
					url: "/pages/search/index"
				})
      },
			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;
	}
  >.fight{
    padding: 0 3.75rem 0 3.75rem;
    // height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin-top: 1.375rem;
    >.fight_card{
      display: flex;
      flex-direction: column;
      align-items: start;
      justify-content: center;
      >p{
        color: rgb(255, 255, 255);
        font-family: Noto Sans SC;
        font-size: 16px;
        font-weight: 700;
      }
      >span{
        color: rgb(255, 255, 255);
        font-family: Noto Sans SC;
        font-size: 11px;
        font-weight: 500;
      }
    }
  }
	>.times{
		width: 100%;
    height: 3.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>