feat: i18n
This commit is contained in:
@@ -14,21 +14,21 @@
|
||||
v-model="username"
|
||||
/> -->
|
||||
<div v-show="emailStap === 1">
|
||||
<div class="login_form_title marign_top30">Email</div>
|
||||
<div class="login_form_title marign_top30">{{ t('LoginPersonal.Email') }}</div>
|
||||
<input
|
||||
class="login_form_input"
|
||||
placeholder="Enter your email address"
|
||||
:placeholder="t('LoginPersonal.EnterEmail')"
|
||||
v-model="email"
|
||||
@keydown.enter="submitPerLogin()"
|
||||
/>
|
||||
<div class="login_form_title marign_top30">
|
||||
<div>Password</div>
|
||||
<div>{{ t('LoginPersonal.Password') }}</div>
|
||||
</div>
|
||||
<div class="password_input_block">
|
||||
<input
|
||||
class="login_form_input"
|
||||
:type="passwordType"
|
||||
placeholder="Enter your password"
|
||||
:placeholder="t('LoginPersonal.EnterPassword')"
|
||||
v-model="password"
|
||||
@keydown.enter="submitPerLogin()"
|
||||
/>
|
||||
@@ -57,15 +57,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('LoginPersonal.EnterCode') }}</div>
|
||||
<div class="tip_content">
|
||||
<span v-show="time">{{ time }}s</span>
|
||||
<span v-show="!time" @click="emailNextStepFun()"
|
||||
>Resend</span
|
||||
>{{ t('LoginPersonal.Resend') }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="codeEmail">We’ve sent an code to your email <span>{{ email }}</span></div>
|
||||
<div class="codeEmail">{{ t('LoginPersonal.SentCodeToEmail') }} <span>{{ email }}</span></div>
|
||||
<div class="codeEmailInput">
|
||||
<VerificationCodeInput
|
||||
ref="verificationCodeInputDom"
|
||||
@@ -80,17 +80,17 @@
|
||||
<div class="login_text" v-show="emailStap !== 2">
|
||||
|
||||
<div class="forget_password_text" @click="changeIsLogin(2)">
|
||||
Forgot your password
|
||||
{{ t('LoginPersonal.ForgotPassword') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="login_form_title marign_top40">
|
||||
<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('LoginPersonal.AgreeTo') }}
|
||||
<a href="https://code-create.com.hk/aida-terms-and-conditions/" style="text-decoration: underline;color: #000;">{{ t('LoginPersonal.Terms') }}</a>,
|
||||
<a href="https://aida.com.hk/privacy-policy.html" target="_blank" style="text-decoration: underline;color: #000;">{{ t('LoginPersonal.PrivacyPolicy') }}</a>,
|
||||
{{ t('LoginPersonal.AndFees') }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -102,12 +102,12 @@
|
||||
@click="submitPerLogin()"
|
||||
@mousedown="loginBtnMousedown"
|
||||
>
|
||||
Sign in
|
||||
{{ t('LoginPersonal.SignIn') }}
|
||||
</div>
|
||||
<div class="NewAccount" @click="newAccount()">Create New Account</div>
|
||||
<div class="NewAccount" @click="newAccount()">{{ t('LoginPersonal.CreateNewAccount') }}</div>
|
||||
<div class="segmentation">
|
||||
<div class="wire"></div>
|
||||
<div class="text">or</div>
|
||||
<div class="text">{{ t('LoginPersonal.Or') }}</div>
|
||||
<div class="wire"></div>
|
||||
</div>
|
||||
<div class="thirdPartyLogin marign_top30">
|
||||
@@ -147,14 +147,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('LoginPersonal.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('LoginPersonal.Email') }}</div>
|
||||
<input
|
||||
class="forget_passored_form_input"
|
||||
placeholder="Enter your email"
|
||||
:placeholder="t('LoginPersonal.EnterEmail')"
|
||||
v-model="forgetPasswordEmail"
|
||||
@keydown.enter="forgetPasswordNextStepFun()"
|
||||
/>
|
||||
@@ -163,20 +163,20 @@
|
||||
class="forget_submit_button marign_top40"
|
||||
@click="forgetPasswordNextStepFun()"
|
||||
>
|
||||
Next step
|
||||
{{ t('LoginPersonal.NextStep') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="frogetPasswordStep === 2">
|
||||
<div class="forget_verif_code_des">Verification Code</div>
|
||||
<div class="forget_verif_code_des">{{ t('LoginPersonal.VerificationCode') }}</div>
|
||||
<div class="email_last_step_des">
|
||||
<div class="sent_email_content">
|
||||
Sent to {{ forgetPasswordEmail }}
|
||||
{{ t('LoginPersonal.SentTo') }} {{ forgetPasswordEmail }}
|
||||
</div>
|
||||
<div class="tip_content">
|
||||
<span v-show="time">{{ time }}s</span>
|
||||
<span v-show="!time" @click="forgetPasswordNextStepFun()"
|
||||
>Resend</span
|
||||
>{{ t('LoginPersonal.Resend') }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -188,7 +188,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('LoginPersonal.Password') }}</div>
|
||||
<div v-show="passwordConditionShow" class="conditionShow">
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -201,7 +201,7 @@
|
||||
class="fi fi-br-check"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">At least 8 characters long</div>
|
||||
<div class="text">{{ t('LoginPersonal.AtLeast8Chars') }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -214,7 +214,7 @@
|
||||
class="fi fi-br-check"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">Must contain special characters</div>
|
||||
<div class="text">{{ t('LoginPersonal.MustContainSpecial') }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -228,13 +228,13 @@
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">
|
||||
Mix of uppercase, lowercase and numbers
|
||||
{{ t('LoginPersonal.MixUpperLowerNumbers') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
class="forget_passored_form_input"
|
||||
placeholder="Enter a new password"
|
||||
:placeholder="t('LoginPersonal.EnterNewPassword')"
|
||||
v-model="newPassword"
|
||||
@focus="() => (passwordConditionShow = true)"
|
||||
@blur="() => (passwordConditionShow = false)"
|
||||
@@ -246,7 +246,7 @@
|
||||
class="forget_submit_button marign_top40"
|
||||
@click="submitResetPassword()"
|
||||
>
|
||||
Submit
|
||||
{{ t('LoginPersonal.Submit') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -290,7 +290,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, onMounted } from "vue";
|
||||
import { defineComponent, ref, onMounted, inject } from "vue";
|
||||
import { Https } from "@/tool/https";
|
||||
import { isEmail } from "@/tool/util";
|
||||
import { setCookie, WriteCookie } from "@/tool/cookie";
|
||||
@@ -300,11 +300,9 @@ 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 { useRouter } from "vue-router";
|
||||
import { setLang } from "@/tool/guide";
|
||||
import md5 from "md5";
|
||||
import router from "@/router";
|
||||
import { pass } from "three/tsl";
|
||||
export default defineComponent({
|
||||
components: {
|
||||
VerificationCodeInput,
|
||||
@@ -316,17 +314,18 @@ export default defineComponent({
|
||||
let timer: any = 0;
|
||||
let router = useRouter()
|
||||
|
||||
const { locale } = useI18n();
|
||||
// 从父组件注入 i18n
|
||||
const i18n = inject('i18n') as { t: any, locale: any };
|
||||
const store = useStore();
|
||||
let loadingShow = ref(false);
|
||||
const newAccount = ()=>{
|
||||
// router.spuh({path:'/register'})
|
||||
router.push({path:'/register'})
|
||||
}
|
||||
return {
|
||||
store,
|
||||
timer,
|
||||
locale,
|
||||
locale: i18n?.locale,
|
||||
t: i18n?.t,
|
||||
loadingShow,
|
||||
newAccount,
|
||||
};
|
||||
@@ -389,7 +388,7 @@ export default defineComponent({
|
||||
//邮箱登录的下一步
|
||||
emailNextStepFun() {
|
||||
if (!isEmail(this.email)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.$t('LoginPersonal.IncorrectEmailFormat'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -419,7 +418,7 @@ export default defineComponent({
|
||||
//忘记密码的下一步
|
||||
forgetPasswordNextStepFun() {
|
||||
if (!isEmail(this.forgetPasswordEmail)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginPersonal.IncorrectEmail'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -473,7 +472,7 @@ export default defineComponent({
|
||||
let verificationCodeInputDom:any = this.$refs.verificationCodeInputDom
|
||||
let code = verificationCodeInputDom.getCtData.map(item => item).join('');
|
||||
if(code.length !== this.emailCode.length){
|
||||
message.info("Please enter the complete verification code.");
|
||||
message.info(this.t('LoginPersonal.CompleteVerificationCode'));
|
||||
}else{
|
||||
this.submitEmailLogin(code)
|
||||
}
|
||||
@@ -482,22 +481,22 @@ export default defineComponent({
|
||||
return;
|
||||
} else {
|
||||
if (!this.password) {
|
||||
message.info("Please enter your account number or password");
|
||||
message.info(this.t('LoginPersonal.PleaseEnterYourAccountNumberOrPassword'));
|
||||
return;
|
||||
}
|
||||
//输入邮箱
|
||||
if (!this.email) {
|
||||
message.info("Please enter your email address");
|
||||
message.info(this.t('LoginPersonal.NeedEmail'));
|
||||
return;
|
||||
}
|
||||
//判断邮箱格式是否正确
|
||||
if (!isEmail(this.email)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginPersonal.IncorrectEmailFormat'));
|
||||
return;
|
||||
}
|
||||
//判断是否同意隐私政策
|
||||
if (!this.checked) {
|
||||
message.info("Agree to all terms, privacy fees and policies");
|
||||
message.info(this.t('Login.AgreePolicies'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -565,7 +564,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) {
|
||||
@@ -601,7 +600,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 {
|
||||
@@ -630,7 +629,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