Commit 1d423a43 authored by tyyin lan's avatar tyyin lan

chore(个人设置): ui调整

parent 2af3a1f1
...@@ -40,6 +40,11 @@ export const useSystemLanguageStore = defineStore('system-language-store', { ...@@ -40,6 +40,11 @@ export const useSystemLanguageStore = defineStore('system-language-store', {
languageOptions: defaultLanguageOptions, languageOptions: defaultLanguageOptions,
}), }),
getters: {
currentLanguage(state): I18n.LangType {
return state.currentLanguageInfo.key
},
},
actions: { actions: {
updateCurrentLanguageInfo(key: I18n.LangType) { updateCurrentLanguageInfo(key: I18n.LangType) {
if (this.currentLanguageInfo.key === key) return '' if (this.currentLanguageInfo.key === key) return ''
......
<script setup lang="ts"> <script setup lang="ts">
import { fetchEmailCode, fetchUserInfoUpdate, fetchVerifyCode } from '@/apis/user'
import { useUserStore } from '@/store/modules/user'
import { ss } from '@/utils/storage'
import type { CountdownInst, FormInst, FormItemRule } from 'naive-ui' import type { CountdownInst, FormInst, FormItemRule } from 'naive-ui'
import isEmail from 'validator/es/lib/isEmail'
import { onMounted, ref, shallowReadonly, useTemplateRef } from 'vue' import { onMounted, ref, shallowReadonly, useTemplateRef } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useUserStore } from '@/store/modules/user'
import isEmail from 'validator/es/lib/isEmail'
import { fetchEmailCode, fetchUserInfoUpdate, fetchVerifyCode } from '@/apis/user'
import { ss } from '@/utils/storage'
const { t } = useI18n() const { t } = useI18n()
const userStore = useUserStore() const userStore = useUserStore()
const emailInfoFormRef = useTemplateRef<FormInst>('emailInfoFormRef') const emailInfoFormRef = useTemplateRef<FormInst>('emailInfoFormRef')
const countdownRef = useTemplateRef<CountdownInst>('countdownRef') const countdownRef = useTemplateRef<CountdownInst>('countdownRef')
...@@ -145,6 +146,7 @@ function handleSMSCodeGain() { ...@@ -145,6 +146,7 @@ function handleSMSCodeGain() {
:bordered="false" :bordered="false"
size="medium" size="medium"
closable closable
content-style="margin-top: 20px;"
@close="() => (isShowMailboxBindingModal = false)" @close="() => (isShowMailboxBindingModal = false)"
> >
<n-form <n-form
...@@ -153,16 +155,13 @@ function handleSMSCodeGain() { ...@@ -153,16 +155,13 @@ function handleSMSCodeGain() {
label-width="auto" label-width="auto"
:model="emailInfoForm" :model="emailInfoForm"
:rules="emailInfoFormRules" :rules="emailInfoFormRules"
size="large"
> >
<n-form-item :label="t('common_module.email')" path="email"> <n-form-item :label="t('common_module.email')" path="email">
<n-input v-model:value="emailInfoForm.email" :placeholder="t('login_module.please_enter_your_email_address')"> <n-input v-model:value="emailInfoForm.email" :placeholder="t('login_module.please_enter_your_email_address')">
<template #suffix> <template #suffix>
<span class="mx-[10px] inline-block h-[50%] w-[2px] bg-[#e0e0e6]"></span> <span class="mx-[10px] inline-block h-[50%] w-[2px] bg-[#e0e0e6]"></span>
<span <span v-show="!isShowCountdown" class="cursor-pointer text-[12px] text-[#333]" @click="handleSMSCodeGain">
v-show="!isShowCountdown"
class="text-theme-color cursor-pointer text-[12px]"
@click="handleSMSCodeGain"
>
{{ t('login_module.get_verification_code') }} {{ t('login_module.get_verification_code') }}
</span> </span>
...@@ -190,10 +189,16 @@ function handleSMSCodeGain() { ...@@ -190,10 +189,16 @@ function handleSMSCodeGain() {
<template #footer> <template #footer>
<div class="text-end"> <div class="text-end">
<n-space justify="end"> <n-space justify="end">
<n-button @click="() => (isShowMailboxBindingModal = false)"> <n-button class="!h-[34px] !w-[96px]" round @click="() => (isShowMailboxBindingModal = false)">
{{ t('common_module.cancel_btn_text') }} {{ t('common_module.cancel_btn_text') }}
</n-button> </n-button>
<n-button type="primary" :loading="mailboxBindingSubmitBtnLoading" @click="handleMailboxBindingSubmit"> <n-button
class="!h-[34px] !w-[96px]"
color="#6F77FF"
round
:loading="mailboxBindingSubmitBtnLoading"
@click="handleMailboxBindingSubmit"
>
{{ t('common_module.confirm_btn_text') }} {{ t('common_module.confirm_btn_text') }}
</n-button> </n-button>
</n-space> </n-space>
......
<script setup lang="ts"> <script setup lang="ts">
import { fetchEmailCode, fetchSMSCode, fetchUserPasswordUpdate, fetchVerifyCode } from '@/apis/user' import { fetchEmailCode, fetchSMSCode, fetchUserPasswordUpdate, fetchVerifyCode } from '@/apis/user'
import { useSystemLanguageStore } from '@/store/modules/system-language'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { ss } from '@/utils/storage' import { ss } from '@/utils/storage'
import type { CountdownInst, FormInst, FormItemRule } from 'naive-ui' import type { CountdownInst, FormInst, FormItemRule } from 'naive-ui'
...@@ -8,9 +9,11 @@ import { onMounted, ref, shallowReadonly, useTemplateRef, watchEffect } from 'vu ...@@ -8,9 +9,11 @@ import { onMounted, ref, shallowReadonly, useTemplateRef, watchEffect } from 'vu
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
const { t } = useI18n() const { t } = useI18n()
const userStore = useUserStore()
const systemLanguageStore = useSystemLanguageStore()
const passwordInfoFormRef = useTemplateRef<FormInst>('passwordInfoFormRef') const passwordInfoFormRef = useTemplateRef<FormInst>('passwordInfoFormRef')
const countdownRef = useTemplateRef<CountdownInst>('countdownRef') const countdownRef = useTemplateRef<CountdownInst>('countdownRef')
const userStore = useUserStore()
const isShowPasswordChangeModal = defineModel<boolean>('isShowPasswordChangeModal', { default: false }) const isShowPasswordChangeModal = defineModel<boolean>('isShowPasswordChangeModal', { default: false })
...@@ -186,11 +189,12 @@ function handleSMSCodeGain() { ...@@ -186,11 +189,12 @@ function handleSMSCodeGain() {
<template> <template>
<n-modal v-model:show="isShowPasswordChangeModal" :mask-closable="false" :on-after-leave="onModalAfterLeave"> <n-modal v-model:show="isShowPasswordChangeModal" :mask-closable="false" :on-after-leave="onModalAfterLeave">
<n-card <n-card
class="!w-[600px]" :class="systemLanguageStore.currentLanguage === 'en' ? '!w-[700px]' : '!w-[600px]'"
:title="t('personal_settings_module.password_change')" :title="t('personal_settings_module.password_change')"
:bordered="false" :bordered="false"
size="medium" size="medium"
closable closable
content-style="margin-top: 20px;"
@close="() => (isShowPasswordChangeModal = false)" @close="() => (isShowPasswordChangeModal = false)"
> >
<n-form <n-form
...@@ -199,6 +203,7 @@ function handleSMSCodeGain() { ...@@ -199,6 +203,7 @@ function handleSMSCodeGain() {
label-width="auto" label-width="auto"
:model="passwordInfoForm" :model="passwordInfoForm"
:rules="passwordFormRules" :rules="passwordFormRules"
size="large"
> >
<n-form-item :label="t('personal_settings_module.obtaining_the_verification_code')"> <n-form-item :label="t('personal_settings_module.obtaining_the_verification_code')">
<div> <div>
...@@ -265,10 +270,16 @@ function handleSMSCodeGain() { ...@@ -265,10 +270,16 @@ function handleSMSCodeGain() {
<template #footer> <template #footer>
<div class="text-end"> <div class="text-end">
<n-space justify="end"> <n-space justify="end">
<n-button @click="() => (isShowPasswordChangeModal = false)"> <n-button class="!h-[34px] !w-[96px]" round @click="() => (isShowPasswordChangeModal = false)">
{{ t('common_module.cancel_btn_text') }} {{ t('common_module.cancel_btn_text') }}
</n-button> </n-button>
<n-button type="primary" :loading="passwordChangeSubmitBtnLoading" @click="handlePasswordChangeSubmit"> <n-button
class="!h-[34px] !w-[96px]"
color="#6F77FF"
round
:loading="passwordChangeSubmitBtnLoading"
@click="handlePasswordChangeSubmit"
>
{{ t('common_module.confirm_btn_text') }} {{ t('common_module.confirm_btn_text') }}
</n-button> </n-button>
</n-space> </n-space>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment