feat: i18n
This commit is contained in:
@@ -9,14 +9,14 @@
|
||||
<div>
|
||||
<div class="login_form_content" :state="emailStap">
|
||||
<div v-show="emailStap === 1">
|
||||
<div class="login_form_title marign_top30">School</div>
|
||||
<div class="login_form_title marign_top30">{{ t('LoginSchool.School') }}</div>
|
||||
<div class="generalModel_state">
|
||||
<div
|
||||
class="generalModel_state_item"
|
||||
style="width: 100%; margin: 0"
|
||||
>
|
||||
<a-select
|
||||
placeholder="Select a school"
|
||||
:placeholder="t('LoginSchool.SelectSchool')"
|
||||
v-model:value="selectSchool"
|
||||
:options="schoolList"
|
||||
@change="schoolListChange"
|
||||
@@ -36,21 +36,21 @@
|
||||
</a-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="login_form_title marign_top30">Email</div>
|
||||
<div class="login_form_title marign_top30">{{ t('LoginSchool.Email') }}</div>
|
||||
<input
|
||||
class="login_form_input"
|
||||
placeholder="Enter your email address"
|
||||
:placeholder="t('LoginSchool.EnterEmail')"
|
||||
v-model="email"
|
||||
@keydown.enter="submitPerLogin()"
|
||||
/>
|
||||
<div class="login_form_title marign_top30">
|
||||
<div>Password</div>
|
||||
<div>{{ t('LoginSchool.Password') }}</div>
|
||||
</div>
|
||||
<div class="password_input_block">
|
||||
<input
|
||||
class="login_form_input"
|
||||
:type="passwordType"
|
||||
placeholder="Enter your password"
|
||||
:placeholder="t('LoginSchool.EnterPassword')"
|
||||
v-model="password"
|
||||
@keydown.enter="submitPerLogin()"
|
||||
/>
|
||||
@@ -79,15 +79,15 @@
|
||||
</div> -->
|
||||
<div class="email_last_step_bottom">
|
||||
<div class="email_last_step_des">
|
||||
<div class="sent_email_content">Enter Code</div>
|
||||
<div class="sent_email_content">{{ t('LoginSchool.EnterCode') }}</div>
|
||||
<div class="tip_content">
|
||||
<span v-show="time">{{ time }}s</span>
|
||||
<span v-show="!time" @click="emailNextStepFun()"
|
||||
>Resend</span
|
||||
>{{ t('LoginSchool.Resend') }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="codeEmail">We’ve sent an code to your email <span>{{ email }}</span></div>
|
||||
<div class="codeEmail">{{ t('LoginSchool.SentCodeToEmail') }} <span>{{ email }}</span></div>
|
||||
<div class="codeEmailInput">
|
||||
<VerificationCodeInput
|
||||
ref="verificationCodeInputDom"
|
||||
@@ -101,17 +101,17 @@
|
||||
</div>
|
||||
<div class="login_text" v-show="emailStap !== 2">
|
||||
<div class="forget_password_text" @click="changeIsLogin(2)">
|
||||
Forgot your password
|
||||
{{ t('LoginSchool.ForgotPassword') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="login_form_title marign_top30">
|
||||
<label :class="{ active: emailStap == 2 }">
|
||||
<input :state="emailStap" type="checkbox" v-model="checked" />
|
||||
<span>
|
||||
I agree to the
|
||||
<a href="https://code-create.com.hk/aida-terms-and-conditions/" style="text-decoration: underline;color: #000;">Terms</a>,
|
||||
<a href="https://aida.com.hk/privacy-policy.html" target="_blank" style="text-decoration: underline;color: #000;">Privacy Policy</a>,
|
||||
and Fees.
|
||||
{{ t('LoginSchool.AgreeTo') }}
|
||||
<a href="https://code-create.com.hk/aida-terms-and-conditions/" style="text-decoration: underline;color: #000;">{{ t('LoginSchool.Terms') }}</a>,
|
||||
<a href="https://aida.com.hk/privacy-policy.html" target="_blank" style="text-decoration: underline;color: #000;">{{ t('LoginSchool.PrivacyPolicy') }}</a>,
|
||||
{{ t('LoginSchool.AndFees') }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -132,7 +132,7 @@
|
||||
@click="submitPerLogin()"
|
||||
@mousedown="loginBtnMousedown"
|
||||
>
|
||||
Sign in
|
||||
{{ t('LoginSchool.SignIn') }}
|
||||
</div>
|
||||
|
||||
<!-- <div class="login_text">
|
||||
@@ -158,14 +158,14 @@
|
||||
>
|
||||
<!-- <i class="fi fi-br-arrow-left"></i> -->
|
||||
<i class="fi fi-br-angle-left"></i>
|
||||
<span class="forget_password_content_title">Retrieve password</span>
|
||||
<span class="forget_password_content_title">{{ t('LoginSchool.RetrievePassword') }}</span>
|
||||
</div>
|
||||
<div v-show="frogetPasswordStep === 1">
|
||||
<div class="forget_passored_form_content">
|
||||
<div class="forget_passored_form_title">Email</div>
|
||||
<div class="forget_passored_form_title">{{ t('LoginSchool.Email') }}</div>
|
||||
<input
|
||||
class="forget_passored_form_input"
|
||||
placeholder="Enter your email"
|
||||
:placeholder="t('LoginSchool.EnterEmail')"
|
||||
v-model="forgetPasswordEmail"
|
||||
@keydown.enter="forgetPasswordNextStepFun()"
|
||||
/>
|
||||
@@ -174,20 +174,20 @@
|
||||
class="forget_submit_button marign_top40"
|
||||
@click="forgetPasswordNextStepFun()"
|
||||
>
|
||||
Next step
|
||||
{{ t('LoginSchool.NextStep') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="frogetPasswordStep === 2">
|
||||
<div class="forget_verif_code_des">Verification Code</div>
|
||||
<div class="forget_verif_code_des">{{ t('LoginSchool.VerificationCode') }}</div>
|
||||
<div class="email_last_step_des">
|
||||
<div class="sent_email_content">
|
||||
Sent to {{ forgetPasswordEmail }}
|
||||
{{ t('LoginSchool.SentTo') }} {{ forgetPasswordEmail }}
|
||||
</div>
|
||||
<div class="tip_content">
|
||||
<span v-show="time">{{ time }}s</span>
|
||||
<span v-show="!time" @click="forgetPasswordNextStepFun()"
|
||||
>Resend</span
|
||||
>{{ t('LoginSchool.Resend') }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -199,7 +199,7 @@
|
||||
|
||||
<div v-show="frogetPasswordStep === 3">
|
||||
<div class="forget_passored_form_content">
|
||||
<div class="forget_passored_form_title">Password</div>
|
||||
<div class="forget_passored_form_title">{{ t('LoginSchool.Password') }}</div>
|
||||
<div v-show="passwordConditionShow" class="conditionShow">
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -212,7 +212,7 @@
|
||||
class="fi fi-br-check"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">At least 8 characters long</div>
|
||||
<div class="text">{{ t('LoginSchool.AtLeast8Chars') }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -225,7 +225,7 @@
|
||||
class="fi fi-br-check"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">Must contain special characters</div>
|
||||
<div class="text">{{ t('LoginSchool.MustContainSpecial') }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -239,13 +239,13 @@
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">
|
||||
Mix of uppercase, lowercase and numbers
|
||||
{{ t('LoginSchool.MixUpperLowerNumbers') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
class="forget_passored_form_input"
|
||||
placeholder="Enter a new password"
|
||||
:placeholder="t('LoginSchool.EnterNewPassword')"
|
||||
v-model="newPassword"
|
||||
@focus="() => (passwordConditionShow = true)"
|
||||
@blur="() => (passwordConditionShow = false)"
|
||||
@@ -257,7 +257,7 @@
|
||||
class="forget_submit_button marign_top40"
|
||||
@click="submitResetPassword()"
|
||||
>
|
||||
Submit
|
||||
{{ t('LoginSchool.Submit') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -270,7 +270,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, onMounted, reactive, toRefs } from "vue";
|
||||
import { defineComponent, ref, onMounted, reactive, toRefs, inject } from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { isEmail } from "@/tool/util";
|
||||
import { setCookie, WriteCookie } from "@/tool/cookie";
|
||||
@@ -280,7 +280,6 @@ import googleLogin from "@/component/LoginPage/googleLogin.vue";
|
||||
import weiXinLogin from "@/component/LoginPage/weiXinLogin.vue";
|
||||
import phoneLogin from "@/component/LoginPage/phoneLogin.vue";
|
||||
import { useStore } from "vuex";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { setLang } from "@/tool/guide";
|
||||
import md5 from "md5";
|
||||
export default defineComponent({
|
||||
@@ -292,7 +291,8 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
let timer: any = 0;
|
||||
const { locale } = useI18n();
|
||||
// 从父组件注入 i18n
|
||||
const i18n = inject('i18n') as { t: any, locale: any };
|
||||
const store = useStore();
|
||||
let loadingShow = ref(false);
|
||||
const data = reactive({
|
||||
@@ -331,7 +331,8 @@ export default defineComponent({
|
||||
...toRefs(data),
|
||||
store,
|
||||
timer,
|
||||
locale,
|
||||
locale: i18n?.locale,
|
||||
t: i18n?.t,
|
||||
loadingShow,
|
||||
schoolListChange,
|
||||
filterOption,
|
||||
@@ -396,7 +397,7 @@ export default defineComponent({
|
||||
//邮箱登录的下一步
|
||||
emailNextStepFun() {
|
||||
if (!isEmail(this.email)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginSchool.IncorrectEmailFormat'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -426,7 +427,7 @@ export default defineComponent({
|
||||
//忘记密码的下一步
|
||||
forgetPasswordNextStepFun() {
|
||||
if (!isEmail(this.forgetPasswordEmail)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginSchool.IncorrectEmail'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -482,7 +483,7 @@ export default defineComponent({
|
||||
let code = verificationCodeInputDom.getCtData.map(item => item).join('');
|
||||
console.log(code)
|
||||
if(code.length !== this.emailCode.length){
|
||||
message.info("Please enter the complete verification code.");
|
||||
message.info(this.t('LoginSchool.CompleteVerificationCode'));
|
||||
}else{
|
||||
this.submitEmailLogin(code)
|
||||
}
|
||||
@@ -491,26 +492,26 @@ export default defineComponent({
|
||||
return;
|
||||
} else {
|
||||
if (!this.password) {
|
||||
message.info("Please enter your account number or password");
|
||||
message.info(this.t('LoginSchool.PleaseEnterYourAccountNumberOrPassword'));
|
||||
return;
|
||||
}
|
||||
//输入邮箱
|
||||
if (!this.email) {
|
||||
message.info("Please enter your email address");
|
||||
message.info(this.t('LoginSchool.NeedEmail'));
|
||||
return;
|
||||
}
|
||||
if (!this.selectSchool) {
|
||||
message.info("Please select a school");
|
||||
message.info(this.t('LoginSchool.SelectSchool'));
|
||||
return;
|
||||
}
|
||||
//判断邮箱格式是否正确
|
||||
if (!isEmail(this.email)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginSchool.IncorrectEmailFormat'));
|
||||
return;
|
||||
}
|
||||
//判断是否同意隐私政策
|
||||
if (!this.checked) {
|
||||
message.info("Agree to all terms, privacy fees and policies");
|
||||
message.info(this.t('Login.AgreePolicies'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -576,7 +577,7 @@ export default defineComponent({
|
||||
},1000)
|
||||
},
|
||||
isCheckAgreement() {
|
||||
message.info("Agree to all terms, privacy fees and policies");
|
||||
message.info(this.t('Login.AgreePolicies'));
|
||||
},
|
||||
//谷歌登录
|
||||
googelLogin(value: any) {
|
||||
@@ -612,7 +613,7 @@ export default defineComponent({
|
||||
|
||||
if (window.innerWidth < 768) {
|
||||
message.info(
|
||||
"If you need to design, please log in using an iPad or computer."
|
||||
this.t('Login.Device')
|
||||
);
|
||||
this.turnToHomePage("/Square");
|
||||
} else {
|
||||
@@ -641,7 +642,7 @@ export default defineComponent({
|
||||
//修改密码提交
|
||||
submitResetPassword() {
|
||||
if (this.isPassword(this.newPassword) < 3) {
|
||||
message.info("You must satisfy ALL password conditions to register.");
|
||||
message.info(this.t('Login.PasswordConditions'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
|
||||
Reference in New Issue
Block a user