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">Enterprise</div>
|
||||
<div class="login_form_title marign_top30">{{ t('LoginEnterprise.Enterprise') }}</div>
|
||||
<div class="generalModel_state">
|
||||
<div
|
||||
class="generalModel_state_item"
|
||||
style="width: 100%; margin: 0"
|
||||
>
|
||||
<a-select
|
||||
placeholder="Select a school"
|
||||
:placeholder="t('LoginEnterprise.SelectEnterprise')"
|
||||
v-model:value="selectEnterprise"
|
||||
: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('LoginEnterprise.Email') }}</div>
|
||||
<input
|
||||
class="login_form_input"
|
||||
placeholder="Enter your email address"
|
||||
:placeholder="t('LoginEnterprise.EnterEmail')"
|
||||
v-model="email"
|
||||
@keydown.enter="submitPerLogin()"
|
||||
/>
|
||||
<div class="login_form_title marign_top30">
|
||||
<div>Password</div>
|
||||
<div>{{ t('LoginEnterprise.Password') }}</div>
|
||||
</div>
|
||||
<div class="password_input_block">
|
||||
<input
|
||||
class="login_form_input"
|
||||
:type="passwordType"
|
||||
placeholder="Enter your password"
|
||||
:placeholder="t('LoginEnterprise.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('LoginEnterprise.EnterCode') }}</div>
|
||||
<div class="tip_content">
|
||||
<span v-show="time">{{ time }}s</span>
|
||||
<span v-show="!time" @click="emailNextStepFun()"
|
||||
>Resend</span
|
||||
>{{ t('LoginEnterprise.Resend') }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="codeEmail">We’ve sent an code to your email <span>{{ email }}</span></div>
|
||||
<div class="codeEmail">{{ t('LoginEnterprise.SentCodeToEmail') }} <span>{{ email }}</span></div>
|
||||
<div class="codeEmailInput">
|
||||
<VerificationCodeInput
|
||||
:ct="emailCode"
|
||||
@@ -103,10 +103,10 @@
|
||||
<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('LoginEnterprise.AgreeTo') }}
|
||||
<a href="https://code-create.com.hk/aida-terms-and-conditions/" style="text-decoration: underline;color: #000;">{{ t('LoginEnterprise.Terms') }}</a>,
|
||||
<a href="https://aida.com.hk/privacy-policy.html" target="_blank" style="text-decoration: underline;color: #000;">{{ t('LoginEnterprise.PrivacyPolicy') }}</a>,
|
||||
{{ t('LoginEnterprise.AndFees') }}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -125,7 +125,7 @@
|
||||
:state="emailStap"
|
||||
@click="submitPerLogin()"
|
||||
>
|
||||
Sign in
|
||||
{{ t('LoginEnterprise.SignIn') }}
|
||||
</div>
|
||||
|
||||
<!-- <div class="login_text">
|
||||
@@ -151,14 +151,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('LoginEnterprise.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('LoginEnterprise.Email') }}</div>
|
||||
<input
|
||||
class="forget_passored_form_input"
|
||||
placeholder="Enter your email"
|
||||
:placeholder="t('LoginEnterprise.EnterEmail')"
|
||||
v-model="forgetPasswordEmail"
|
||||
@keydown.enter="forgetPasswordNextStepFun()"
|
||||
/>
|
||||
@@ -167,20 +167,20 @@
|
||||
class="forget_submit_button marign_top40"
|
||||
@click="forgetPasswordNextStepFun()"
|
||||
>
|
||||
Next step
|
||||
{{ t('LoginEnterprise.NextStep') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-show="frogetPasswordStep === 2">
|
||||
<div class="forget_verif_code_des">Verification Code</div>
|
||||
<div class="forget_verif_code_des">{{ t('LoginEnterprise.VerificationCode') }}</div>
|
||||
<div class="email_last_step_des">
|
||||
<div class="sent_email_content">
|
||||
Sent to {{ forgetPasswordEmail }}
|
||||
{{ t('LoginEnterprise.SentTo') }} {{ forgetPasswordEmail }}
|
||||
</div>
|
||||
<div class="tip_content">
|
||||
<span v-show="time">{{ time }}s</span>
|
||||
<span v-show="!time" @click="forgetPasswordNextStepFun()"
|
||||
>Resend</span
|
||||
>{{ t('LoginEnterprise.Resend') }}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@@ -192,7 +192,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('LoginEnterprise.Password') }}</div>
|
||||
<div v-show="passwordConditionShow" class="conditionShow">
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -205,7 +205,7 @@
|
||||
class="fi fi-br-check"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">At least 8 characters long</div>
|
||||
<div class="text">{{ t('LoginEnterprise.AtLeast8Chars') }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -218,7 +218,7 @@
|
||||
class="fi fi-br-check"
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">Must contain special characters</div>
|
||||
<div class="text">{{ t('LoginEnterprise.MustContainSpecial') }}</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="icon">
|
||||
@@ -232,13 +232,13 @@
|
||||
></i>
|
||||
</div>
|
||||
<div class="text">
|
||||
Mix of uppercase, lowercase and numbers
|
||||
{{ t('LoginEnterprise.MixUpperLowerNumbers') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input
|
||||
class="forget_passored_form_input"
|
||||
placeholder="Enter a new password"
|
||||
:placeholder="t('LoginEnterprise.EnterNewPassword')"
|
||||
v-model="newPassword"
|
||||
@focus="() => (passwordConditionShow = true)"
|
||||
@blur="() => (passwordConditionShow = false)"
|
||||
@@ -250,7 +250,7 @@
|
||||
class="forget_submit_button marign_top40"
|
||||
@click="submitResetPassword()"
|
||||
>
|
||||
Submit
|
||||
{{ t('LoginEnterprise.Submit') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -263,7 +263,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";
|
||||
@@ -273,7 +273,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({
|
||||
@@ -285,7 +284,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({
|
||||
@@ -320,7 +320,8 @@ export default defineComponent({
|
||||
...toRefs(data),
|
||||
store,
|
||||
timer,
|
||||
locale,
|
||||
locale: i18n?.locale,
|
||||
t: i18n?.t,
|
||||
loadingShow,
|
||||
schoolListChange,
|
||||
filterOption,
|
||||
@@ -383,7 +384,7 @@ export default defineComponent({
|
||||
//邮箱登录的下一步
|
||||
emailNextStepFun() {
|
||||
if (!isEmail(this.email)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginEnterprise.IncorrectEmailFormat'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -413,7 +414,7 @@ export default defineComponent({
|
||||
//忘记密码的下一步
|
||||
forgetPasswordNextStepFun() {
|
||||
if (!isEmail(this.forgetPasswordEmail)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginEnterprise.IncorrectEmail'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -468,26 +469,26 @@ export default defineComponent({
|
||||
return;
|
||||
} else {
|
||||
if (!this.password) {
|
||||
message.info("Please enter your account number or password");
|
||||
message.info(this.t('LoginEnterprise.PleaseEnterYourAccountNumberOrPassword'));
|
||||
return;
|
||||
}
|
||||
//输入邮箱
|
||||
if (!this.email) {
|
||||
message.info("Please enter your email address");
|
||||
message.info(this.t('LoginEnterprise.NeedEmail'));
|
||||
return;
|
||||
}
|
||||
if (!this.selectEnterprise) {
|
||||
message.info("Please select a school");
|
||||
message.info(this.t('LoginEnterprise.SelectEnterprise'));
|
||||
return;
|
||||
}
|
||||
//判断邮箱格式是否正确
|
||||
if (!isEmail(this.email)) {
|
||||
message.info("The email format is incorrect");
|
||||
message.info(this.t('LoginEnterprise.IncorrectEmailFormat'));
|
||||
return;
|
||||
}
|
||||
//判断是否同意隐私政策
|
||||
if (!this.checked) {
|
||||
message.info("Agree to all terms, privacy fees and policies");
|
||||
message.info(this.t('Login.AgreePolicies'));
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
@@ -547,7 +548,7 @@ export default defineComponent({
|
||||
});
|
||||
},
|
||||
isCheckAgreement() {
|
||||
message.info("Agree to all terms, privacy fees and policies");
|
||||
message.info(this.t('Login.AgreePolicies'));
|
||||
},
|
||||
|
||||
//谷歌登录
|
||||
@@ -584,7 +585,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 {
|
||||
@@ -613,7 +614,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