<template>
	<view class="page">

		<view class="layout">

			<view class="item" style="margin-right: 10px;" @click="onClick('1')">

				<image class="item_img"  src="https://jianguan.yyundong.com/img/newApp/yclb.png" mode="aspectFit"></image>
				<text class="item_text">云仓列表</text>
			</view>

			<view class="item"  style="margin-left: 10px;"  @click="onClick('2')">

				<image class="item_img" src="https://jianguan.yyundong.com/img/newApp/jczl.png" mode="aspectFit"></image>
				<text class="item_text">基础资料</text>
			</view>


		</view>
		
		<view class="layout">
		
			<view class="item" style="margin-right: 10px;"  @click="onClick('3')">
		
				<image class="item_img"  src="https://jianguan.yyundong.com/img/newApp/rkgl.png" mode="aspectFit"></image>
				<text class="item_text">入库管理</text>
			</view>
		
			<view class="item"  style="margin-left: 10px;" @click="onClick('4')">
		
				<image class="item_img" src="https://jianguan.yyundong.com/img/newApp/ckgl.png" mode="aspectFit"></image>
				<text class="item_text">出库管理</text>
			</view>
		
		
		</view>
		
		<view class="layout">
		
			<view class="item" style="margin-right: 10px;"  @click="onClick('5')">
		
				<image class="item_img"  src="https://jianguan.yyundong.com/img/newApp/ckdj.png" mode="aspectFit"></image>
				<text class="item_text">仓库登记</text>
			</view>
		
			<view  style="margin-left: 10px;flex: 1;
				padding: 30px 20px;">
		
				<!-- <image class="item_img" src="../../static/newApp/gzdd.png"></image> -->
				<!-- <text class="item_text">云仓列表</text> -->
			</view>
		
		
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				// href: '',
				// gv: {},
				// resinfo: ''
			}
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData() {
				this.gv = getApp().globalData
				console.log('hasLogin', this.$store.getters.hasLogin)
				console.log('token', this.$store.getters.token)
				console.log('uinfo', this.$store.getters.userinfo)
				console.log('uinfo-id', this.$store.getters.userinfo.userid)
				console.log('uinfo-name', this.$store.getters.userinfo.name)
				getApp().globalData.uinfo = this.$store.getters.userinfo
			},
			// sayhello() {
			// 	this.$api.sayhello({name:'mynameislll'}).then(res => {
			// 		this.resinfo = res
			// 	})
			// },
			// logout() {
			// 	this.$store.dispatch('logout').then(() => {
			// 		console.log('NNNN:退出 ')
			// 	})
			// },
			// gologin() {
			// 	uni.reLaunch({ url: '/pages/login/index' })
			// }
			
			onClick(index) {
				switch (index) {
					case "1":
						// 云仓列表
						uni.showToast({
							icon: "none",
							title: '云仓列表',
							duration: 2000,
						});
						
						uni.navigateTo({
							url: '../index/WarehouseList'
						});
						
						break;
					case "2":
						// 基础资料
						uni.showToast({
							icon: "none",
							title: '基础资料',
							duration: 2000,
						});
						break;
					case "3":
						// 入库管理
						uni.showToast({
							icon: "none",
							title: '入库管理',
							duration: 2000,
						});
						break;
					case "4":
						// 出库管理
						uni.showToast({
							icon: "none",
							title: '出库管理',
							duration: 2000,
						});
						break;
						case "5":
							// 仓库登记
							uni.showToast({
								icon: "none",
								title: '仓库登记',
								duration: 2000,
							});
							
							uni.navigateTo({
								url: '../index/WarehouseRegistration'
							});
							
							break;
					default:
						break;
				}
			},
			
		}
	}
</script>

<style lang="scss">
	.page {
		background: #fff;
		width: 100%;
		height: 100%;
		padding-top: 25px;

		.layout {
			display: flex;
			flex-direction: row;
			margin-left: 20px;
			margin-right: 20px;

			.item {
				margin-top: 25px;
				flex: 1;
				display: flex;
				align-items: center;
				border-radius: 12px;
				background: #F1F3F5 100%;
				padding: 20px 10px;

				.item_img {
					width: 35px;
					height: 35px;
				}

				.item_text {
					margin-left: 10px;
					font-size: 15px;
					color: #757575;
				}
			}
		}
	}
</style>