<script setup>
	import {
		onLaunch,
		onShow,
		onHide,
	} from '@dcloudio/uni-app'
	import {
		getInfo,
		getRouters
	} from '@/api/user.js'
	import {
		setGlobalData
	} from '@/store/index.js'
	onLaunch(() => {
		console.log('App Launch')
	})
	onShow(() => {
		console.log('App Show')
		getInfo().then(e => {
			let data = e.data
			setGlobalData('permissions', data.permissions)
			setGlobalData('userInfo', data.user)
		})
		getRouters().then(e => {
			let data = e.data.find(v => v.path === '/app')
			setGlobalData('route', data.children)
		})
	})
	onHide(() => {
		console.log('App Hide')
	})
</script>

<style lang="scss">
	.form-item {
		padding: 20rpx;
		border-bottom: 1px solid #eee;
		display: flex;

		&:last-child {
			margin-bottom: 10rpx;
		}
	}

	.uni-input {
		height: 60rpx;
		line-height: 60rpx;
		color: #aaa;
	}

	.moreFormItem-enter-active,
	.moreFormItem-leave-active {
		transition: max-height 0.3s ease, opacity 0.3s ease;
		overflow: hidden;
	}

	.moreFormItem-enter-from,
	.moreFormItem-leave-to {
		max-height: 0;
		opacity: 0;
	}

	.moreFormItem-enter-to,
	.moreFormItem-leave-from {
		max-height: 500rpx;
		opacity: 1;
	}
</style>