|
@@ -6,8 +6,10 @@ import QrcodeVue from 'qrcode.vue'
|
|
|
import QrLogin from './components/qr-login'
|
|
|
import TeacherAuth from './components/teacher-auth'
|
|
|
import { state } from '@/state'
|
|
|
-import sutdentDownLoad from '@/common/images/student_download.png'
|
|
|
-import teacherDownLoad from '@/common/images/teacher_download.png'
|
|
|
+import Login from './components/login'
|
|
|
+import Register from './components/register'
|
|
|
+import { CloseBold } from '@element-plus/icons-vue'
|
|
|
+import RegisterSuccess from './components/register-success'
|
|
|
|
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
|
const path = `./images/${fileName}`
|
|
@@ -37,19 +39,19 @@ export default defineComponent({
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- onReset(type: 'login' | 'register') {
|
|
|
- if (type === 'login') {
|
|
|
- ;(this as any).$refs.teacherLogin &&
|
|
|
- (this as any).$refs.teacherLogin.onResetFields()
|
|
|
- ;(this as any).$refs.studentLogin &&
|
|
|
- (this as any).$refs.studentLogin.onResetFields()
|
|
|
- } else if (type === 'register') {
|
|
|
- ;(this as any).$refs.teacherRegister &&
|
|
|
- (this as any).$refs.teacherRegister.onResetFields()
|
|
|
- ;(this as any).$refs.studentRegister &&
|
|
|
- (this as any).$refs.studentRegister.onResetFields()
|
|
|
- }
|
|
|
- }
|
|
|
+ // onReset(type: 'login' | 'register') {
|
|
|
+ // if (type === 'login') {
|
|
|
+ // ;(this as any).$refs.teacherLogin &&
|
|
|
+ // (this as any).$refs.teacherLogin.onResetFields()
|
|
|
+ // ;(this as any).$refs.studentLogin &&
|
|
|
+ // (this as any).$refs.studentLogin.onResetFields()
|
|
|
+ // } else if (type === 'register') {
|
|
|
+ // ;(this as any).$refs.teacherRegister &&
|
|
|
+ // (this as any).$refs.teacherRegister.onResetFields()
|
|
|
+ // ;(this as any).$refs.studentRegister &&
|
|
|
+ // (this as any).$refs.studentRegister.onResetFields()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
watch: {
|
|
|
type(val: string) {
|
|
@@ -62,213 +64,51 @@ export default defineComponent({
|
|
|
render() {
|
|
|
return (
|
|
|
<div class={[styles.loginSection, 'relative']}>
|
|
|
- <i
|
|
|
- class={[
|
|
|
- styles.iconClose,
|
|
|
- 'w-9 h-9 rounded-full flex absolute -top-1 -right-[18px]'
|
|
|
- ]}
|
|
|
+ <div
|
|
|
+ class={['rounded-full flex absolute top-[22px] right-[22px] z-10']}
|
|
|
onClick={() => {
|
|
|
this.onClose()
|
|
|
}}
|
|
|
- ></i>
|
|
|
- {this.type == 'teacher-auth' ? (
|
|
|
- <img
|
|
|
- src={getAssetsHomeFile('cert_bg.png')}
|
|
|
- class={[styles.loginBg, '-mt-[10px]']}
|
|
|
- />
|
|
|
- ) : (
|
|
|
- <img
|
|
|
- src={getAssetsHomeFile('register_bg.png')}
|
|
|
- class={[styles.loginBg, '-mt-[10px]']}
|
|
|
- />
|
|
|
- )}
|
|
|
+ >
|
|
|
+ <ElIcon size={16} color="#999999">
|
|
|
+ <CloseBold />
|
|
|
+ </ElIcon>
|
|
|
+ </div>
|
|
|
<div
|
|
|
class={[
|
|
|
styles.loginTabs,
|
|
|
- 'px-9 pt-5 pb-12 bg-white relative',
|
|
|
+ 'px-14 pt-9 pb-12 bg-white relative',
|
|
|
+ this.type === 'register-success' && styles.registerSuccessBg,
|
|
|
+ this.type === 'teacher-auth' && styles.teacherAuthBg,
|
|
|
this.type === 'qr-login' ? 'pb-4' : '',
|
|
|
this.type === 'teacher-auth' ? 'px-6 pb-8' : ''
|
|
|
]}
|
|
|
>
|
|
|
{this.type === 'login' && (
|
|
|
- <>
|
|
|
- <div class={'absolute top-2 right-2 z-10'}>
|
|
|
- <div class={styles.toolTips}>
|
|
|
- <span>扫码登录更方便</span>
|
|
|
- <span class={styles.toolTips_arrow}></span>
|
|
|
- </div>
|
|
|
- <img
|
|
|
- src={getAssetsHomeFile('icon_qrcode_login.png')}
|
|
|
- class="w-14 h-14 cursor-pointer"
|
|
|
- onClick={() => {
|
|
|
- this.type = 'qr-login'
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- <ElTabs v-model={this.loginType}>
|
|
|
- <ElTabPane label="老师登录" name="teacher">
|
|
|
- {this.loginType === 'teacher' && (
|
|
|
- <Form
|
|
|
- type="teacher-login"
|
|
|
- key="teacherLogin"
|
|
|
- ref="teacherLogin"
|
|
|
- onClose={() => {
|
|
|
- this.onClose()
|
|
|
- }}
|
|
|
- />
|
|
|
- )}
|
|
|
- </ElTabPane>
|
|
|
- <ElTabPane label="学员登录" name="student">
|
|
|
- {this.loginType === 'student' && (
|
|
|
- <Form
|
|
|
- type="student-login"
|
|
|
- key="studentLogin"
|
|
|
- ref="studentLogin"
|
|
|
- onClose={() => {
|
|
|
- this.onClose()
|
|
|
- }}
|
|
|
- />
|
|
|
- )}
|
|
|
- </ElTabPane>
|
|
|
- </ElTabs>
|
|
|
- <div class={[styles.scanTxt]}>
|
|
|
- 没有账号,
|
|
|
- <span
|
|
|
- class="cursor-pointer"
|
|
|
- onClick={() => {
|
|
|
- this.onReset('login')
|
|
|
- this.type = 'register'
|
|
|
- }}
|
|
|
- >
|
|
|
- 马上注册
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </>
|
|
|
- )}
|
|
|
-
|
|
|
- {this.type === 'qr-login' && (
|
|
|
- <>
|
|
|
- <QrLogin
|
|
|
- loginType={this.loginType}
|
|
|
- onChange={(type: any) => {
|
|
|
- this.type = type
|
|
|
- }}
|
|
|
- onClose={() => {
|
|
|
- this.onClose()
|
|
|
- }}
|
|
|
- />
|
|
|
- <div class={[styles.scanTxt, 'pt-14 text-center']}>
|
|
|
- 没有账号,
|
|
|
- <span
|
|
|
- class="cursor-pointer"
|
|
|
- onClick={() => {
|
|
|
- this.type = 'register'
|
|
|
- }}
|
|
|
- >
|
|
|
- 马上注册
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </>
|
|
|
+ <Login
|
|
|
+ onClose={this.onClose}
|
|
|
+ onTypeChange={(type: any) => {
|
|
|
+ this.type = type
|
|
|
+ }}
|
|
|
+ />
|
|
|
)}
|
|
|
|
|
|
{this.type === 'register' && (
|
|
|
- <>
|
|
|
- <ElTabs v-model={this.registerType}>
|
|
|
- <ElTabPane label="老师注册" name="teacher">
|
|
|
- {this.registerType === 'teacher' && (
|
|
|
- <Form
|
|
|
- type="teacher-register"
|
|
|
- key="teacher-register"
|
|
|
- ref="teacherRegister"
|
|
|
- onClose={() => {
|
|
|
- this.onClose()
|
|
|
- }}
|
|
|
- onChange={(type: any) => {
|
|
|
- this.type = type
|
|
|
- }}
|
|
|
- />
|
|
|
- )}
|
|
|
- </ElTabPane>
|
|
|
- <ElTabPane label="学员注册" name="student">
|
|
|
- {this.registerType === 'student' && (
|
|
|
- <Form
|
|
|
- type="student-register"
|
|
|
- key="student-register"
|
|
|
- ref="studentRegister"
|
|
|
- onClose={() => {
|
|
|
- this.onClose()
|
|
|
- }}
|
|
|
- onChange={(type: any) => {
|
|
|
- this.type = type
|
|
|
- }}
|
|
|
- />
|
|
|
- )}
|
|
|
- </ElTabPane>
|
|
|
- </ElTabs>
|
|
|
- <div class={[styles.scanTxt]}>
|
|
|
- 已有账号,
|
|
|
- <span
|
|
|
- class="cursor-pointer"
|
|
|
- onClick={() => {
|
|
|
- this.onReset('register')
|
|
|
- this.type = 'login'
|
|
|
- }}
|
|
|
- >
|
|
|
- 马上登录
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </>
|
|
|
+ <Register
|
|
|
+ onClose={this.onClose}
|
|
|
+ onTypeChange={(type: any) => {
|
|
|
+ this.type = type
|
|
|
+ }}
|
|
|
+ />
|
|
|
)}
|
|
|
|
|
|
{this.type === 'register-success' && (
|
|
|
- <div class={'text-center pt-4'}>
|
|
|
- {/* <QrcodeVue
|
|
|
- value={this.qrCodeDownLoad}
|
|
|
- size={178}
|
|
|
- class="mx-auto shadow-lg w-[178px] h-[178px] align-middle"
|
|
|
- /> */}
|
|
|
- {this.registerType === 'teacher' ? (
|
|
|
- <img
|
|
|
- src={teacherDownLoad}
|
|
|
- class="mx-auto shadow-lg w-[178px] h-[178px] align-middle"
|
|
|
- />
|
|
|
- ) : (
|
|
|
- <img
|
|
|
- src={sutdentDownLoad}
|
|
|
- class="mx-auto shadow-lg w-[178px] h-[178px] align-middle"
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- <h3 class="text-lg text=[#1a1a1a] pt-4 pb-2">注册成功</h3>
|
|
|
- <div class={[styles.scanTxt, 'leading-6']}>
|
|
|
- <p>
|
|
|
- 恭喜您已成功注册酷乐秀
|
|
|
- {this.registerType === 'teacher' ? '老师' : '学生'}账号!
|
|
|
- </p>
|
|
|
- <p>
|
|
|
- <span>
|
|
|
- 下载酷乐秀
|
|
|
- {this.registerType === 'teacher' ? '老师' : '学生'}端APP
|
|
|
- </span>
|
|
|
- 发现更大的世界
|
|
|
- </p>
|
|
|
- </div>
|
|
|
-
|
|
|
- <ElButton
|
|
|
- type="primary"
|
|
|
- class="w-full mt-4"
|
|
|
- style={{ height: '40px' }}
|
|
|
- onClick={() => {
|
|
|
- if (this.registerType == 'teacher') {
|
|
|
- this.type = 'teacher-auth'
|
|
|
- } else {
|
|
|
- this.onClose()
|
|
|
- }
|
|
|
- }}
|
|
|
- >
|
|
|
- 知道了
|
|
|
- </ElButton>
|
|
|
- </div>
|
|
|
+ <RegisterSuccess
|
|
|
+ onClose={this.onClose}
|
|
|
+ onTypeChange={(type: any) => {
|
|
|
+ this.type = type
|
|
|
+ }}
|
|
|
+ />
|
|
|
)}
|
|
|
|
|
|
{this.type === 'teacher-auth' && (
|