From ec94aa7ba4b2d2ca2f5acc06d20f8468de56fb97 Mon Sep 17 00:00:00 2001 From: lq Date: Mon, 5 May 2025 10:48:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E3=80=81=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/AuthModal.vue | 213 ++++++++++++++++++++++------ src/layouts/MainLayout.vue | 3 +- 2 files changed, 175 insertions(+), 41 deletions(-) diff --git a/src/components/common/AuthModal.vue b/src/components/common/AuthModal.vue index 33d6883..c4ec31b 100644 --- a/src/components/common/AuthModal.vue +++ b/src/components/common/AuthModal.vue @@ -9,10 +9,17 @@ const loading = ref(false) const formState = ref({ username: '', password: '', - remember: true + remember: true, + email: '', + code: '' }) -const userStore = useUserStore() // Initialize the store outside the handleSubmit function +const loginType = ref(1) +const isSend = ref(1) +const reloadSendTime = ref(60) +let timer = null + +const userStore = useUserStore() onMounted(() => { AOS.init({ @@ -25,7 +32,6 @@ onMounted(() => { const show = () => { visible.value = true - // 在下一个渲染周期触发AOS动画 setTimeout(() => { document.querySelectorAll('[data-aos]').forEach(el => { el.classList.add('aos-animate') @@ -47,12 +53,26 @@ const handleSubmit = async () => { } } +const sendEmailCode = () => { + // 模拟发送验证码 + alert('验证码已发送,验证码为:123456') + isSend.value = 2 + timer = setInterval(() => { + if (reloadSendTime.value > 0) { + reloadSendTime.value-- + } else { + clearInterval(timer) + isSend.value = 1 + reloadSendTime.value = 60 + } + }, 1000) +} + defineExpose({ show, close }) -