<template>
	<div class="LoginMain">
		<!-- <van-loading color="#1989fa" >登录中...</van-loading> -->
		<van-button class="button" round type="default" :loading="loading" @click="login">{{buttonText}}</van-button>
	</div>
</template>

<script setup>
	import {
		ref,
		onMounted
	} from 'vue';
	import {
		useRoute,
		useRouter
	} from "vue-router"
	const route = useRoute()
	const login = () => {
		loading.value=true
		window.location.replace(import.meta.env.VITE_APP_WXCODE_URL)
	}
	let loading=ref(false)
	let buttonText=ref('开始预约')
	onMounted(() => {
		
		let tijian_num =route.query.tijian_num
		let logintype =route.query.logintype
	
		sessionStorage.setItem('loginType', logintype);
		sessionStorage.setItem('tijian_num', tijian_num);
		let sloginType=sessionStorage.getItem('loginType');
		console.log(sloginType)
		if(sloginType=='undefined'){
			console.log('denglu')
			buttonText.value='开始预约'
		}else{
			console.log('report')
			buttonText.value='查看报告'
		}
		//router.replace('/selectOrganization')
		//window.location.href="http://localhostcommon/wxLogin"

	})
</script>

<style scoped>
	.LoginMain {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100vh;
		background-image: url('../assets/image/login.jpg');
		background-size: 100%;
		background-repeat: no-repeat;
		background-color: #afeefd;
		background-position: top center;

	}
	.button{
		width: 60%;
		margin-top: 50%;
		background-color: #33cdc9;
		color:#fff;
		border: 3px solid #e6f5fd;
	}
</style>