first commit

first commit
This commit is contained in:
zhouchengrong
2023-07-26 15:54:34 +08:00
parent 8372f4485f
commit 913b100ac9
22 changed files with 3287 additions and 1377 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -7,115 +7,141 @@
/>
<!-- 账号密码和邮箱登录 start-->
<div class="login_content" v-if="isLogin === 1">
<div class="login_type_list">
<div
:class="[
'login_type_item','username_login_item',
'login_active',
]"
>
Log on to AiDA
</div>
</div>
<!-- 账号密码登录 start -->
<div v-show="loginType == 'username'">
<div class="login_form_content">
<div class="login_form_title">Username</div>
<input
class="login_form_input"
placeholder="Enter your username"
v-model="username"
/>
<div class="login_form_title marign_top30">
<div>Password</div>
<!-- <div class="tip_content" @click="changeIsLogin(2)">
Forgot password
</div> -->
</div>
<div class="password_input_block">
<input
class="login_form_input"
:type="passwordType"
placeholder="Enter your password"
v-model="password"
@keydown.enter="submitPerLogin()"
/>
<div class="icon iconfont icon-yanjing_yincang_o password_show_icon" @click="changePasswordType()"></div>
</div>
</div>
<div
class="login_submit_button marign_top40"
@click="submitPerLogin()"
>
Continue
</div>
<div class="login_text" >
<div class="forget_password_text" @click="changeIsLogin(2)">Forgot your password</div>
</div>
<div class="login_content_left">
<div class="login_type_list">
<div
:class="[
'login_type_item','username_login_item',
'login_active',
]"
>
Log on to AiDA
</div>
</div>
<!-- 账号密码登录 start -->
<!-- v-show="loginType == 'username'" -->
<div >
<div class="login_form_content" :state="emailStap">
<div class="login_form_title">Name</div>
<input
class="login_form_input"
placeholder="Enter your username"
v-model="username"
/>
<div class="login_form_title marign_top30">
<div>Password</div>
<!-- <div class="tip_content" @click="changeIsLogin(2)">
Forgot password
</div> -->
</div>
<div class="password_input_block">
<input
class="login_form_input"
:type="passwordType"
placeholder="Enter your password"
v-model="password"
@keydown.enter="submitPerLogin()"
/>
<div class="icon iconfont icon-yanjing_yincang_o password_show_icon" @click="changePasswordType()"></div>
</div>
<div class="login_form_title marign_top30">Email</div>
<input
class="login_form_input"
placeholder="Enter your email address"
v-model="email"
@keydown.enter="emailNextStepFun()"
/>
</div>
<!-- 账号密码登录 end -->
<!-- 邮箱登录 start -->
<div class="login_form_email" :class="{active:emailStap===2}">
<!-- <div v-show="loginType == 'email'" class="login_form_email"> -->
<!-- <div v-show="emailStap === 1" class="forget_password_content">
<div class="forget_password_content_block" @click="changeLoginType('username')">
<span class="icon iconfont icon--shangyibu"></span
><span class="forget_password_content_title"
>Log on to AiDA</span
>
</div>
<div class="login_form_content">
<div class="login_form_title">Email</div>
<input
class="login_form_input"
placeholder="Enter your email address"
v-model="email"
@keydown.enter="emailNextStepFun()"
/>
</div>
<div
class="login_submit_button marign_top40"
@click="emailNextStepFun()"
>
Sign In
</div>
</div> -->
<!-- 邮箱登录 start -->
<div v-show="loginType == 'email'">
<div v-show="emailStap === 1" class="forget_password_content">
<div class="forget_password_content_block" @click="changeLoginType('username')">
<span class="icon iconfont icon--shangyibu"></span
><span class="forget_password_content_title"
>Log on to AiDA</span
>
</div>
<div class="login_form_content">
<div class="login_form_title">Email</div>
<input
class="login_form_input"
placeholder="Enter your email address"
v-model="email"
@keydown.enter="emailNextStepFun()"
/>
</div>
<div
class="login_submit_button marign_top40"
@click="emailNextStepFun()"
>
Continue
</div>
</div>
<div v-show="emailStap === 2" class="email_last_step">
<div class="email_last_step_block" >
<span class="email_last_step_content"
>Verify with one-time verification code</span
>
<i class="fi fi-br-cross email_last_step_block_icon" @click="emailLastStepFun()"></i>
</div>
<div class="email_last_step_bottom">
<div class="email_last_step_des">
<div class="sent_email_content">
Sent to {{ email }}
</div>
<div class="tip_content">
<span v-show="time">{{ time }}s</span>
<span v-show="!time" @click="emailNextStepFun()"
>Resend</span
>
</div>
</div>
<VerificationCodeInput
:ct="emailCode"
@sendCaptcha="submitEmailLogin($event)"
></VerificationCodeInput>
<div v-show="emailStap === 2" class="email_last_step">
<div class="email_last_step_block" @click="emailLastStepFun()">
<span class="icon iconfont icon--shangyibu"></span
><span class="email_last_step_content"
>Verify with one-time verification code</span
>
</div>
<div class="email_last_step_des">
<div class="sent_email_content">
Sent to {{ email }}
</div>
<div class="tip_content">
<span v-show="time">{{ time }}s</span>
<span v-show="!time" @click="emailNextStepFun()"
>Resend</span
>
</div>
</div>
<VerificationCodeInput
:ct="emailCode"
@sendCaptcha="submitEmailLogin($event)"
></VerificationCodeInput>
<div class="email_last_step_des">
<div class="sent_email_content email_tip_content">
Please check the junk box if you haven't received verification code
</div>
</div>
</div>
</div>
</div>
</div>
<div class="email_last_step_des">
<div class="sent_email_content email_tip_content">
Please check the junk box if you haven't received verification code
</div>
</div>
</div>
</div>
<div class="login_form_title marign_top30">
<label>
<input type="checkbox" v-model="checked">
<span>I agree to all Term, Privacy Policy and Fees</span>
</label>
</div>
<div
class="login_submit_button marign_top40" :state="emailStap"
@click="submitPerLogin()"
>
Sign In
</div>
<div class="login_text" >
<div class="forget_password_text" @click="changeIsLogin(2)">Forgot your password</div>
</div>
</div>
<!-- 账号密码登录 end -->
</div>
<!-- 邮箱登录 end -->
<div class="login_content_right">
<img src="https://www.aida.com.hk/download/aida_V2_images/image/login-right-image.jpg" alt="">
</div>
</div>
<!-- 忘记密码 start -->
@@ -199,7 +225,7 @@
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { defineComponent,ref ,onMounted} from "vue";
import { Https } from "@/tool/https";
import { isEmail } from "@/tool/util";
import { setCookie } from "@/tool/cookie";
@@ -207,19 +233,21 @@ import { message } from "ant-design-vue";
import VerificationCodeInput from "@/component/LoginPage/verificationCodeInput.vue";
const md5 = require("md5");
export default defineComponent({
components: {
VerificationCodeInput,
},
setup(){
let timer:any = 0
let timer:any = 0;
return{
timer
}
},
data() {
return {
checked:false,
isLogin: 1, //是否为登录 1-登录, 2-忘记密码
loginType: "username",
emailStap: 1, // 邮箱登录步骤
@@ -285,7 +313,11 @@ export default defineComponent({
//邮箱登录的上一步
emailLastStepFun() {
this.emailStap = 1;
this.username = "",
this.password = "",
this.email = "";
this.checked=false,
this.loginType = "username",
(this.emailCode = ["", "", "", "", "", ""]), this.clearTimer();
},
@@ -309,7 +341,6 @@ export default defineComponent({
}
);
},
//忘记密码的上一步
forgetPasswordLastStepFun() {
if (this.frogetPasswordStep === 1) {
@@ -336,22 +367,56 @@ export default defineComponent({
//提交账号密码预先登录
submitPerLogin() {
if (!this.username || !this.password) {
//输入账号密码
if(this.emailStap>=2){
return;
}else{
if (!this.username || !this.password || !this.email) {
message.error("Please enter your password");
return;
}
//输入邮箱
if (!this.email) {
message.error("Please enter your email address");
return;
}
//判断邮箱格式是否正确
if (!isEmail(this.email)) {
message.error("The email format is incorrect");
return;
}
//判断是否同意隐私政策
if (!this.checked) {
message.error("Agree to all terms, privacy fees and policies");
return;
}
let data = {
password: md5(this.password + "abc"),
userName: this.username,
email: this.email,
operationType:"LOGIN",
ip:"",
};
Https.axiosPost(Https.httpUrls.preLogin, data).then(
// this.loginType = 'email'
// this.emailStap = 2;
Https.axiosPost(Https.httpUrls.preLogin, data).then(
(rv: any) => {
if (rv) {
// if (rv) {
// this.loginType = 'email'
// }
if (rv) {
this.userId = rv.userId
this.loginType = 'email'
this.emailStap = 2;
this.time = 60;
this.emailCode = ["", "", "", "", "", ""]
this.createTimer();
}
}
);
}
},
changePasswordType(){
@@ -440,17 +505,53 @@ export default defineComponent({
}
.login_content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 60rem;
// width: 60rem;
width: 120rem;
background: #FFFFFF;
box-shadow: -0.3rem 2rem 5.9rem 0px rgba(200,200,200,0.3);
// box-shadow: -0.3rem 2rem 5.9rem 0px rgba(200,200,200,0.3);
border-radius: 1rem;
padding: 3rem 6rem 6.5rem;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
.login_content_left{
width: 45%;
.login_form_email{
position: absolute;
left: 0;
width: 100%;
height: 100%;
top: 0;
background: #fff;
transform: scale(0);
transition: .3s all;
border: 2px solid;
border-radius: 20px;
.email_last_step{
width: 100%;
height: 100%;
#app{
height: auto;
}
}
}
.active{
transform: scale(1);
}
}
.login_content_right{
width: 40%;
img{
width: 100%;
}
}
.login_type_list {
width: 100%;
display: flex;
@@ -469,18 +570,35 @@ export default defineComponent({
}
}
}
.login_form_content {
margin-top: 4rem;
.login_form_title {
.login_form_title {
font-size: 1.6rem;
color: #666666;
// color: #666666;
font-weight: 900;
color: #000;
display: flex;
justify-content: space-between;
box-sizing: border-box;
label{
display: flex;
span{
font-size: 1.6rem;
margin-left: 10px;
font-weight: normal;
}
}
}
.login_form_content {
margin-top: 4rem;
position: relative;
&[state="2"]{
>*{
opacity: 0;
}
.login_form_email{
opacity: 1;
}
}
.password_input_block{
position: relative;
@@ -513,10 +631,28 @@ export default defineComponent({
}
.email_last_step {
margin-top: 4rem;
// margin-top: 4rem;
.email_last_step_bottom{
padding: 0 40px;
}
.email_last_step_block{
cursor: pointer;
padding: 10px;
border-bottom: 2px solid;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
.email_last_step_content {
margin-left: 1rem;
font-size: 2.2rem;
font-weight: bold;
color: #030303;
}
.email_last_step_block_icon{
cursor: pointer;
margin-right: 1rem;
height: 20px;
}
}
.icon--shangyibu {
@@ -525,17 +661,12 @@ export default defineComponent({
color: #030303;
}
.email_last_step_content {
margin-left: 1rem;
font-size: 2.2rem;
font-weight: bold;
color: #030303;
}
}
.login_submit_button {
height: 5rem;
background: #343579;
background: #000;
border-radius: 2.5rem;
line-height: 5rem;
text-align: center;
@@ -543,6 +674,9 @@ export default defineComponent({
font-weight: 500;
color: #ffffff;
cursor: pointer;
&[state="2"]{
cursor: not-allowed;
}
}
.login_text {
font-size: 1.6rem;
@@ -624,7 +758,7 @@ export default defineComponent({
.forget_submit_button {
height: 5rem;
background: #343579;
background: #000;
border-radius: 2.5rem;
line-height: 5rem;
text-align: center;