<template>
	<view style="height: 100vh;">
		<launch-screen v-if="pageState==0"/>
		<login-page v-if="pageState==1"/>
		<tabbar-page v-if="pageState==2"/>
	</view>
</template>

<script>
	import { mapState, mapMutations } from 'vuex'  
	import LaunchScreen from './screen.vue'
	import TabbarPage from '../index/index.vue'
	import LoginPage from '../login/index.vue'
	import getPlatform from '../../common/platform.js'
	export default {
		components: {
			TabbarPage,
			LoginPage,
			LaunchScreen
		},
		data() {
			return {
				platform: '',
				/// 也没状态, 0: 加载启动页, 1: 登录页面,  2: 已登录, 首页
				pageState: 0,
			}
		},
		computed: {
			...mapState(['userInfo'])
		},
		mounted() {
			setTimeout(() => { 
				if (this.userInfo.token) {
					this.pageState = 2
				} else {
					this.pageState = 1
				}
			}, 0.5*1000);
			
			console.log(uni.getSystemInfoSync())
			console.log(uni.getSystemInfoSync().platform)
			console.log(getPlatform())
		}
	}
</script>

<style>
.launch-screen {
	width: 100%;
	height: 100%;
}
</style>
