<template>
	<view>
		<index ref="首页" v-show="page == '首页'" />
		<dataBank ref="资料库" v-show="page == '资料库'" />
		<school ref="商学院" v-show="page == '商学院'" />
		<bottom-suspension-frame ref="pages" @onChange="pageChange" />
	</view>
</template>

<script>
import index from './index/index.vue'
import dataBank from './cloud/dataBank.vue'
import school from './cloud/school.vue'

import bottomSuspensionFrame from "./modules/bottomSuspensionFrame.vue";
export default {
	components: { bottomSuspensionFrame, index, dataBank, school },
	data() {
		return {
			swiperItemID: 'cloud',
			page: '资料库'
		}
	},
	onLoad() {
	},
	onShow() {
		// #ifdef MP-WEIXIN
		this.updatePageData(this.swiperItemID, this.page)
		// #endif
	},
	methods: {
		updatePageData(itemId, page) {
			this.$refs.pages.onClick(itemId, page)
		},
		pageChange(detail) {
			// this.$refs[detail.name]
			uni.setNavigationBarTitle({
				title: detail.name,
			})
			setTimeout(() => { detail.callBack() }, 300)
			this.page = detail.name
			console.log("切换页面", detail)
		}
	}
}
</script>

<style lang="scss"></style>
