register page frame

This commit is contained in:
KUN1007 2023-06-16 10:15:47 +08:00
parent c6704627fc
commit 838ff0fe14
7 changed files with 107 additions and 15 deletions

View file

@ -1,8 +1,8 @@
<!-- App -->
<script setup lang="ts">
//
import Alert from '@/components/KUNGalgameAlert/Alert.vue'
import Info from '@/components/KUNGalgameAlert/Info.vue'
import Alert from '@/components/alert/Alert.vue'
import Info from '@/components/alert/Info.vue'
import { onBeforeMount } from 'vue'
// store

View file

@ -1,4 +1,6 @@
<script setup lang="ts"></script>
<script setup lang="ts">
import BackToPrevious from '@/components/BackToPrevious.vue'
</script>
<template>
<div class="root">
@ -18,6 +20,7 @@
<p>4. 因用户账号被盗等造成的损失KUNGalgame 概不承担</p>
<p>协议版本 2019/10/07</p>
</div>
<BackToPrevious />
<!-- 版权 -->
<div class="copyright">
<span>Copyright © 2023 KUNgalgame</span>

View file

@ -1,46 +1,135 @@
<script setup lang="ts">
import { reactive } from 'vue'
import { ref, reactive } from 'vue'
import { useKUNGalgamerStore } from '@/store/modules/kungalgamer'
import { useRouter } from 'vue-router'
// 使
import { useKUNGalgameMessageStore } from '@/store/modules/message'
const loginForm = reactive({
//
import Capture from '@/components/capture/Capture.vue'
//
import { isValidEmail, isValidName, isValidPassword } from '@/utils/validate'
// i18n
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
//
const isShowValidate = ref(false)
//
const isCaptureComplete = ref(false)
const router = useRouter()
const info = useKUNGalgameMessageStore()
const useStore = useKUNGalgamerStore()
const registerForm = reactive({
username: '',
email: '',
password: '',
code: '',
})
const handleRegister = () => {}
const handleVerify = (result: boolean) => {
if (result) {
//
isShowValidate.value = false
info.info(t('AlertInfo.capture.success'))
isCaptureComplete.value = true
}
}
const isEmptyInput = () => {
//
if (!registerForm.username.trim()) {
//
info.info(t('AlertInfo.login.emptyUsername'))
return false
} else if (!registerForm.password.trim()) {
//
info.info(t('AlertInfo.login.emptyPassword'))
return false
} else {
return true
}
}
//
const isValidInput = (): boolean => {
// false
if (!isEmptyInput()) {
return false
}
if (
isValidEmail(registerForm.username) ||
isValidName(registerForm.username)
) {
//
if (isValidPassword(registerForm.password)) {
return true
} else {
//
info.info(t('AlertInfo.login.invalidPassword'))
return false
}
} else {
//
info.info(t('AlertInfo.login.invalidUsername'))
return false
}
}
//
const handleRegister = () => {
//
if (isValidInput()) {
//
if (!isCaptureComplete.value) {
return
}
//
// TODO:
}
}
</script>
<template>
<!-- 注册 -->
<div class="register">
<Capture @validate="handleVerify" :isShowValidate="isShowValidate" />
<form action="#" class="form" id="form2" @submit.prevent="handleRegister">
<h2 class="title">注册</h2>
<input
v-model="loginForm.username"
v-model="registerForm.username"
type="text"
placeholder="用户名"
class="input"
/>
<input
v-model="loginForm.email"
v-model="registerForm.email"
type="email"
placeholder="邮箱"
class="input"
/>
<input
v-model="loginForm.password"
v-model="registerForm.password"
type="password"
placeholder="密码"
class="input"
/>
<input
v-model="loginForm.code"
v-model="registerForm.code"
type="text"
placeholder="邮箱验证码"
class="input"
/>
<button class="mail-confirm">发送验证码</button>
<!-- 发送时进行人机验证 -->
<button @click="isShowValidate = true" class="mail-confirm">
发送验证码
</button>
<button class="btn" type="submit">注册</button>
<span class="user-agreement"
>点击注册表示您已经同意我们的<router-link to="/licence"
@ -64,15 +153,15 @@ const handleRegister = () => {}
position: absolute;
padding: 5px;
height: 30px;
bottom: 22%;
bottom: 23%;
right: 15%;
border: 1px solid var(--kungalgame-blue-1);
color: var(--kungalgame-font-color-2);
background-color: var(--kungalgame-white);
cursor: pointer;
}
.mail-confirm:hover {
background-color: var(--kungalgame-blue-4);
color: var(--kungalgame-white);
color: var(--kungalgame-blue-4);
}
/* 用户协议 */

View file

@ -25,7 +25,7 @@ import KUNGalgameFooter from '@/components/KUNGalgameFooter.vue'
<li>Githubgithub - 配色</li>
<li>bbs.kfmax.com绯月 - 用户信息分类</li>
<li>StackOverflow StackOverflow - 页面板块的阴影</li>
<li>ChatGPT Open AIChatGPT - 各种技术问题</li>
<li>ChatGPT OpenAI ChatGPT - 各种技术问题</li>
<li>Google谷歌 - 帖子详情页面</li>
<li>YouTube 油管 - 技术交流页面</li>
<li>Adobe Adobe - 底部 Footer</li>