<template>
	<view class="container">
		<enterNavigator :selectedIndex="nav_current_index" @clickToIndex='homeNavigatorClick'/>
		<home :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == 0" />
		<AIChat :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == 1" />
		<AIDraw :viewTop="subviewTop" :viewHeight="subviewHeight" v-if="nav_current_index == 2" />
	</view>
</template>

<script>
	import enterNavigator from '../../pages/enter/enter-navigator.vue'
	import home from '../../pages/home/home.vue'
	import AIChat from '../../pages/AI_chat/AI_chat.vue'
	import AIDraw from '../../pages/AI-draw/AI-draw.vue'
	export default {
		data() {
			return {
				nav_current_index: 0,     // 当前导航索引
				subviewTop: 0,
				subviewHeight: 0,
			}
		},
		methods: {
			homeNavigatorClick(index) {
				this.nav_current_index = index
			}
		},
		mounted() {
			let systemInfo = uni.getSystemInfoSync()
			
			this.subviewTop = 60
			this.subviewHeight = systemInfo.screenHeight - this.subviewTop
		},
		components: {
			enterNavigator,
			home,
			AIChat,
			AIDraw
		}
	}
</script>

<style lang="scss">
	.container{
		
	}
</style>
