<template>
	<view>
		<u-navbar :is-back="false" title="WMS PDA" :background="background"></u-navbar>
		<scroll-view scroll-y class="page">
			<view class="nav-list">
				<view class="row-flex">
					<view v-for="(item, i) in elements" :key="i" class="nav-view" v-if="$menuLimit(item.id)">
						<navigator hover-class="none" :url="'/pages/checkplan/' + item.name" class="nav-a nav-li" navigateTo
							:class="'bg-'+item.color">
							<view class="nav-title">{{item.title}}</view>
							<view class="nav-name">{{item.en_name}}</view>
							<text :class="'cuIcon-' + item.cuIcon"></text>
						</navigator>
					</view>
				</view>
			</view>
		</scroll-view>
		<u-gap height="70"></u-gap>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				background: {
					backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
				},
				elements: [{
						title: '盘点',
						name: 'InventPage/index',
						en_name: 'InventPage',
						color: 'cyan',
						cuIcon: 'shop',
						label: '盘点',
						id:'400001'
					},
					{
						title: '库存查询',
						name: 'MaterialQuery/index',
						en_name: 'MaterialQuery',
						color: 'cyan',
						cuIcon: 'cascades',
						label: '库存查询',
						id:'400002'
					},
					{
						title: '转库',
						name: 'ErpLocationMove/ErpLocationMove',
						en_name: 'ErpLocationMove',
						color: 'yellow',
						cuIcon: 'cascades',
						label: '库位移动',
						id:'400003'
					},
					{
						title: '无单据转库',
						name: 'ErpLocationMoveNoInvoice/ErpLocationMoveNoInvoice',
						en_name: 'ErpLocationNoInvoice',
						color: 'yellow',
						cuIcon: 'cascades',
						label: '无单据转库',
						id:'400004'
					},
					{
						title: '上架/转货位',
						name: 'ModifyLocationName/ModifyLocationName',
						en_name: 'ModifyLocationName',
						color: 'yellow',
						cuIcon: 'cascades',
						label: '上架/转货位',
						id:'400005'
					},
					{
						title: '换绑批次',
						name: 'ModifyMaterialPaking/ModifyMaterialPaking',
						en_name: 'ModifyMaterialPaking',
						color: 'yellow',
						cuIcon: 'cascades',
						label: '换绑批次',
						id:'400006'
					},
					{
						title: '组托拆托',
						name: 'Palletizing/Palletizing',
						en_name: 'Palletizing',
						color: 'yellow',
						cuIcon: 'cascades',
						label: '组托拆托',
						id:'400007'
					}
				],
			}
		},
		computed: {
			tabbar() {
				return store.vuex_tabbar
			}
		},
	}
</script>

<style lang="scss" scoped>
	.demo-layout {
		height: 80rpx;
		border-radius: 8rpx;
	}

	.bg-purple {
		background: #d3dce6;
	}

	.mt-10 {
		margin-top: 10px;
	}

	.nav-view {
		width: 45%;
		margin: 2.5%;
		// display: contents;
	}
	.row-flex {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
	}
	.nav-li {
		// width: 45%;
		width: 100%;
		// margin: 0 2.5% 40upx;
		background-image: url('../../static/img/background.png');
		background-size: cover;
		background-position: center;
		position: relative;
		z-index: 1;
	}

	.nav-a {
		padding: 30upx;
		border-radius: 12upx;
	}

	.nav-li::after {
		content: "";
		position: absolute;
		z-index: -1;
		background-color: inherit;
		width: 100%;
		height: 100%;
		left: 0;
		bottom: -10%;
		border-radius: 10upx;
		opacity: 0.2;
		transform: scale(0.9, 0.9);
	}

	.nav-li.cur {
		color: #fff;
		background: rgb(94, 185, 94);
		box-shadow: 4upx 4upx 6upx rgba(94, 185, 94, 0.4);
	}

	.nav-title {
		font-size: 32upx;
		font-weight: 300;
	}

	.nav-title::first-letter {
		font-size: 40upx;
		margin-right: 4upx;
	}

	.nav-name {
		font-size: 28upx;
		text-transform: Capitalize;
		margin-top: 20upx;
		position: relative;
	}

	.nav-name::before {
		content: "";
		position: absolute;
		display: block;
		width: 40upx;
		height: 6upx;
		background: #fff;
		bottom: 0;
		right: 0;
		opacity: 0.5;
	}

	.nav-name::after {
		content: "";
		position: absolute;
		display: block;
		width: 100upx;
		height: 1px;
		background: #fff;
		bottom: 0;
		right: 40upx;
		opacity: 0.3;
	}

	.nav-name::first-letter {
		font-weight: bold;
		font-size: 36upx;
		margin-right: 1px;
	}

	.nav-li text {
		position: absolute;
		right: 30upx;
		top: 30upx;
		font-size: 52upx;
		width: 60upx;
		height: 60upx;
		text-align: center;
		line-height: 60upx;
	}

	.text-light {
		font-weight: 300;
	}

	@keyframes show {
		0% {
			transform: translateY(-50px);
		}

		60% {
			transform: translateY(40upx);
		}

		100% {
			transform: translateY(0px);
		}
	}

	@-webkit-keyframes show {
		0% {
			transform: translateY(-50px);
		}

		60% {
			transform: translateY(40upx);
		}

		100% {
			transform: translateY(0px);
		}
	}
</style>