<template>
	<!-- 判断是否是大雅机构 -->
	<div v-if="tenantId == 1">
		<van-tabs v-model="active" swipe-threshold="3" sticky class="vanTabs" @change="onChange" color="#01C1B5"> 
			<van-tab title="VIP申请" :name="1">
				<vip-00-apply v-if="active === 1" />
			</van-tab>
			<van-tab title="双十一排课" :name="2">
				<vip-11-apply v-if="active === 2" />
			</van-tab>
			<van-tab title="考级VIP排课" :name="3">
				<vip-course v-if="active === 3" />
			</van-tab>
			<van-tab title="考级乐理排课" :name="4">
				<theory-course v-if="active === 4" />
			</van-tab>
		</van-tabs>
	</div>
	<div v-else>
		<vip-00-apply />
	</div>
</template>

<script>
import vip00Apply from './VIP00Apply'
import vip11Apply from './VIP11Apply'
import VipCourse from "../applyActive/components/vipCourse";
import TheoryCourse from "../applyActive/components/theoryCourse";
export default {
	components: {
		vip00Apply,
		vip11Apply,
		VipCourse,
		TheoryCourse
	},
	data() {
		return {
			active: 1,
			tenantId: null,
		}
	},
	created() {
		this.tenantId = sessionStorage.getItem('tenantId') || null
	},
	mounted() {
		let params = this.$route.query;
    if (params.Authorization) {
      localStorage.setItem("Authorization", decodeURI(params.Authorization));
      localStorage.setItem("userInfo", decodeURI(params.Authorization));
    }
		document.title = '课程申请'
	},
	methods: {
		onChange(value) {
			if(value == 1) {
				document.title = 'VIP课程申请'
			} else if(value == 2) {
				document.title = '双十一排课'
			} else if(value == 3) {
				document.title = '考级VIP排课'
			} else if(value == 4) {
				document.title = '考级乐理排课'
			}
		}
	}
}
</script>

<style lang="less" scoped>
.vanTabs {
	min-height: 100vh;
	overflow: hidden;
}

</style>