新增加入学校 学校认证

This commit is contained in:
zhangxuelin 2024-10-30 15:06:37 +08:00
parent b7dc080840
commit 7319c396c4
5 changed files with 105 additions and 11 deletions

View File

@ -11,11 +11,12 @@
</template> </template>
<div class="head-aside"> <div class="head-aside">
<ul> <ul>
<li class="auth-li"> <li class="auth-li" @click="onUserTo('/schoolCertification')">
<i class="iconfont icon-renzheng-"></i> <i class="iconfont icon-renzheng-"></i>
<span class="mlr-5">学校认证</span> <span class="mlr-5">学校认证</span>
<span class="gray">未认证</span> <span class="gray">未认证</span>
</li> </li>
<li @click="onUserTo('/joinSchool')">加入学校</li>
<li @click="onUserTo('/profile')">个人中心</li> <li @click="onUserTo('/profile')">个人中心</li>
<li @click="onUserTo('/class')">班级中心</li> <li @click="onUserTo('/class')">班级中心</li>
<li @click="logout">退出登录</li> <li @click="logout">退出登录</li>

View File

@ -134,6 +134,19 @@ export const constantRoutes = [
name: 'setting', name: 'setting',
meta: {title: '设置'} meta: {title: '设置'}
}, },
{
path: '/joinSchool',
component: () => import('@/views/joinSchool/index.vue'),
name: 'joinSchool',
meta: {title: '加入学校'}
},
{
path: '/schoolCertification',
component: () => import('@/views/schoolCertification/index.vue'),
name: 'schoolCertification',
meta: {title: '学校认证'}
},
] ]
}, },
...toolRouters ...toolRouters

View File

@ -0,0 +1,42 @@
<template>
<div class="joinschool">
<div>加入学校</div>
<div class="box-item login" >
<el-form ref="ruleFormRef" label-width="auto" size="large">
<el-form-item label="所属地区" prop="username">
<el-cascader
style="width:100%"
popper-class="aix-regist-address"
:options="regionData"
/>
</el-form-item>
<el-form-item label="学校名称" prop="Code">
<el-input placeholder="请输入学校名称" />
</el-form-item>
<el-form-item label="申请人" >
</el-form-item>
<el-form-item label="申请人电话" >
</el-form-item>
<el-form-item >
<div style="width:100%;text-align: right;padding-right:100px">
<el-button style="width:100px" type="default">关闭</el-button>
<el-button style="width:100px" type="primary" >确定</el-button>
</div>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script setup >
import { regionData, codeToText } from 'element-china-area-data'
</script>
<style scoped>
.joinschool{
padding: 20px;
}
</style>

View File

@ -26,8 +26,6 @@
</el-form-item> </el-form-item>
<div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;"> <div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;">
<a class="hover:text-sky-500" style="margin-right: 10px;" @click="isRegister=false">注册账号</a> <a class="hover:text-sky-500" style="margin-right: 10px;" @click="isRegister=false">注册账号</a>
|
<a class="hover:text-sky-500" style="margin-left: 10px;" >忘记密码</a>
</div> </div>
</el-form> </el-form>
</div> </div>
@ -35,22 +33,22 @@
<div class="box-item login" v-else> <div class="box-item login" v-else>
<WindowTools :is-has-max="false" /> <WindowTools :is-has-max="false" />
<div class="login-title">账号注册</div> <div class="login-title">账号注册</div>
<el-form ref="formRef" class="login-form" :rules="rules" size="large"> <el-form ref="ruleFormRef" class="login-form" :model="ruleForm" label-width="auto" :rules="rules" size="large">
<el-form-item label="手机号" prop="username"> <el-form-item label="手机号" prop="username">
<el-input placeholder="请输入手机号" /> <el-input placeholder="请输入手机号" />
</el-form-item> </el-form-item>
<el-form-item label="验证码" prop="username"> <el-form-item label="验证码" prop="Code">
<el-input style="width:185px" placeholder="请输入验证码" /><el-button type="primary" >发送验证码</el-button> <el-input style="width:185px" placeholder="请输入验证码" /><el-button type="primary" >发送验证码</el-button>
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="password" > <el-form-item label="密码" prop="password" >
<el-input v-model="loginForm.password" autocomplete="on" type="password" placeholder="请输入密码" /> <el-input autocomplete="on" type="password" placeholder="请输入密码" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" >立即注册</el-button> <el-button class="btn" type="primary" @click="RegisterForm(ruleFormRef)">立即注册</el-button>
</el-form-item> </el-form-item>
<div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;"> <div class="flex mb-4" style="display: flex;justify-content: center;color: #ccc;cursor: pointer;">
<a class="hover:text-sky-500" style="margin-right: 10px;"> 返回登录 </a> <a class="hover:text-sky-500" style="margin-right: 10px;" @click="isRegister=true"> 返回登录 </a>
</div> </div>
</el-form> </el-form>
</div> </div>
@ -86,13 +84,17 @@ const btnLoading = ref(false)
const isSubject = ref(false) const isSubject = ref(false)
const RegModel = ref(false) const RegModel = ref(false)
const isRegister = ref(true) const isRegister = ref(true)
const ruleFormRef = ref(null)
// //
const loginForm = reactive({ const loginForm = reactive({
username: '', username: '',
password: '', password: '',
rememberMe: false rememberMe: false
}) })
//
const ruleForm = reactive({
})
// //
const rules = reactive({ const rules = reactive({
username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }], username: [{ required: true, trigger: 'blur', message: '请输入您的账号' }],
@ -172,7 +174,30 @@ const setCookie = (name, value) => {
} }
return session.defaultSession.cookies.set(cookie) return session.defaultSession.cookies.set(cookie)
} }
//
const RegisterForm = async (formEl) => {
if (!formEl) return
await formEl.validate((valid, fields) => {
if (valid) {
var form={
}
// signIn(form).then(res=>{
// if(res.code==200){
// ElMessage.success('')
// if (ruleFormRef.value) ruleFormRef.value.resetFields()
// }else{
// ElMessage.error(res.msg)
// }
// })
console.log('submit!')
} else {
console.log('error submit!', fields)
}
})
}
onMounted(() => { onMounted(() => {
localStorage.clear() localStorage.clear()
sessionStore.set('subject', { sessionStore.set('subject', {

View File

@ -0,0 +1,13 @@
<template>
<div>
<div>加入学校</div>
</div>
</template>
<script setup >
</script>
<style scoped>
</style>