<template>
  <view class="ezy-login-page">
	  <view class="tel-box">
	  		<view class="tel-img"></view>
	  		<!-- 手机号输入框（使用+86前缀，并隐藏真实号码部分数字） -->
	  		  <view class="phone-input-box">
	  		    <text class="phone-prefix">+86</text>
	  		    <input class="phone-input" type="text" v-model="phoneNumber" placeholder="请输入手机号" />
				<view class="close-btn"></view>
	  		  </view>
	  		  <!-- 协议勾选框和按钮 -->
	  		  <view class="agreement-checkbox-box">
	  		    <checkbox class="agreement-checkbox" color="#FFFFFF" :checked="isAgreed" @change="handleAgreementChange">
				  我已阅读并同意
				  <text class="agreement-text">《用户协议》</text>
				  和
				  <text class="agreement-text">《隐私政策》</text>
	  		    </checkbox>
	  		  </view>
			  <view class="yzm-btn-img"></view>
	  	  </view>
		  <view class="wx-btn-img"></view>
  </view>
</template>

<script setup>
	import {
		getAppConfig,
		login,
		kaoshiList
	} from '@/api/login.js'
	import JSEncrypt from 'jsencrypt';
	import {
		ref
	} from 'vue';
	let systemName = ref('麦塔考试系统')
	let username = ref('')
	let password = ref('')
	// 密码公钥
	const publicKey ='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1xwHUB9shgHJlVbs3/LK8CbUa0KMrSfw/M2SAdXpy/iYvwyMacigKNkCi+fiLGcnBigzwO9WtiT/oceF431UsJs2MqLS2ZPzaL+BktR9zWWtNAsZpxUfGyI3YT+T7TT94Rs9O80896FHx9MvE1cHR2bvybskgfB2zuzd9c96+yZ9KXebhbIwDZpMW0fwx7vZ+OywTL3/6SSg2pRf+AvHQsBfTPVbMSgIQegAL4WocD2PerpSGlFElnzZT8jKM4TqDVyhfsYT+4/Gi7/RDDCngdtmruCUIoz8OCLfjVrBsvHfuNNBFIwjTbxtWhrRhVii+wz7RfNxT9+pU/3sjIRKtwIDAQAB'
	const encrypt = new JSEncrypt();
	encrypt.setPublicKey(publicKey);
	const changePassword = () => {

	}
	const handleLogin = () => {
		uni.switchTab({
			url: '/pages/score/index'
		});
		/* console.log('Username:', username.value);
		console.log('Password:', password.value);
		let req = {
			password: 'sslQR4MPhS/du9qQ7/sRc6OFaVIZ0GwHDWmgAhUj08+BBlTzo+kEMgfgi0rrLFx59mrK5ypJc71Ojn3bHciHSlRGcIJex80RHVQyknC1i1HnkQ1T6vgKWBFHISQpd9qEo2fXCEYSRh8Rl3/qfO8XD5NuCrQxqF/REaVUX3fLVB8=',
			//password: encrypt.encrypt(password.value),
			userName: 'root'
		}
		login(req).then(res => {
			let obj = JSON.stringify(res.data)
			console.log(obj)
			uni.setStorage({
				key: 'Mta-Auth',
				data: obj // 假设 this.userInputValue 是用户输入的数据
			});
			uni.switchTab({
				url: '/pages/index/index'
			});
			// setTimeout(() => {
			// 	let req = {
			// 		'page': 1,
			// 		'size': 4,
			// 		'status': 1,
			// 	}
			// 	kaoshiList(req).then(res => {
			// 		console.log(res)
			// 	})
			// }, 5000)
		}) */
	}
</script>
