<template>
	<view class="app-container">

		<view>
			<button type="primary" size="small"  @click="jump(1)">入库登记</button>
		</view>

		<view style="margin-top: 20px;">
			<button type="primary" size="small"  @click="jump(2)">出库登记</button>
		</view>

		<view style="margin-top: 20px;">
			<button type="primary" size="small" @click="jump(3)">油罐读数</button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				gv: {},
				resinfo: ''
			}
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData() {
				this.gv = getApp().globalData
				console.log('this.gv', this.gv)
			},

			jump(index) {

				switch (index) {
					case 0: // 设置
						console.log('index', index)
						break;
					case 1: // 入库
						console.log('index', index)

						uni.navigateTo({
							url: '/pages/business/inBound',
						})

						break;
					case 2: // 出库
						console.log('index', index)
						uni.navigateTo({
							url: '/pages/business/outBound',
						})

						break;
					case 3: // 油罐库存
						console.log('index', index)
						uni.navigateTo({
							url: '/pages/business/inventoryRegistration',
						})

						break;
					case 4: // 操作记录
						console.log('index', index)
						break;
					case 5: // 个人中心
						console.log('index', index)
						break;


				}
			},

			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'
				})
			}
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>