<!-- 我的 -->
<template>
	<view id="mine">
		<teacherMine class="flex-box-page" ref="teacherMine" v-if="userType==1"></teacherMine>
		<pupilMine class="flex-box-page" ref="pupilMine" v-if="userType==2"></pupilMine>
	</view>
</template>

<script>
	import {
		teacherMine
	} from '@/pages/views/teacherPage/teacherMine'
	import {
		pupilMine
	} from '@/pages/views/pupilPage/pupilMine'
	
	export default {
		onShareAppMessage(res) {
			return {
				title: '实验室安全智慧化管控系统',
				path: '/pages/views/login/login'
			}
		},
		components: {
			teacherMine,
			pupilMine,
		},
		
		data() {
			return {
				userType: 0,
			}
		},
		onLoad() {

		},
		onShow() {
			this.userType = uni.getStorageSync('userType')
			this.$nextTick(()=>{
				if(this.userType == 1){
					this.$refs.teacherMine.initialize();
				}else if(this.userType == 2){
					this.$refs.pupilMine.initialize();
				}
			})
		},
		methods: {
			
		},
	}
</script>
<style lang="stylus" scoped>
	#mine {
		height: 100%;
		display: flex;
		flex-direction: column;
		.flex-box-page{
			flex:1;
			display: flex;
			flex-direction: column;
		}
	}
</style>