2
0

fix:样式修复以及提示修复

This commit is contained in:
zhongzm
2024-12-11 15:32:04 +08:00
parent 9105c533be
commit 25f4a2c290
5 changed files with 354 additions and 30 deletions

View File

@@ -90,9 +90,7 @@ const rules = computed<{ [k: string]: RuleObject | RuleObject[] }>(() => {
{ required: true, message: t('page.login.register.usernameRequired'), trigger: 'change' },
{ validator: validateUsername, trigger: 'blur' }
],
fullname: [
{ required: true, message: t('page.login.register.fullNameRequired'), trigger: 'blur' }
],
fullname: [],
email: [
{ required: true, message: t('page.login.register.emailRequired'), trigger: 'change' },
{ validator: validateEmail, trigger: 'blur' }
@@ -209,14 +207,14 @@ const handleBack = () => {
<a-form-item :label="t('page.login.register.email')" name="email">
<a-input
v-model:value="formState.email"
:placeholder="t('page.login.register.emailPlaceholder')"
:placeholder="t('page.login.common.emailPlaceholder')"
/>
</a-form-item>
<a-form-item :label="t('page.login.register.phone')" name="phonenumber">
<a-input
v-model:value="formState.phonenumber"
:placeholder="t('page.login.register.phonePlaceholder')"
:placeholder="t('page.login.common.phonePlaceholder')"
/>
</a-form-item>

View File

@@ -59,59 +59,131 @@ const handleBack = () => {
<template>
<div class="reset-password-container">
<ACard :title="t('page.login.resetPwd.title')" :bordered="false">
<a-card :title="t('page.login.resetPwd.title')" :bordered="false">
<template #extra>
<AButton @click="handleBack">
<a-button @click="handleBack">
{{ t('page.login.common.back') }}
</AButton>
</a-button>
</template>
<AForm
<a-form
ref="formRef"
:model="formModel"
:rules="formRules"
:label-col="{ span: 6 }"
:wrapper-col="{ span: 18 }"
:label-col="{
xs: { span: 24 }, // 移动端占满宽度
sm: { span: 8 }, // 小屏幕占8格
md: { span: 6 } // 中等及以上屏幕占6格
}"
:wrapper-col="{
xs: { span: 24 }, // 移动端占满宽度
sm: { span: 16 }, // 小屏幕占16格
md: { span: 18 } // 中等及以上屏幕占18格
}"
>
<AFormItem name="password" :label="t('page.login.register.password')">
<AInputPassword
<a-form-item name="password" :label="t('page.login.register.password')">
<a-input-password
v-model:value="formModel.password"
:placeholder="t('page.login.common.passwordPlaceholder')"
/>
</AFormItem>
<AFormItem name="confirmPassword" :label="t('page.login.register.confirmPassword')">
<AInputPassword
</a-form-item>
<a-form-item name="confirmPassword" :label="t('page.login.register.confirmPassword')">
<a-input-password
v-model:value="formModel.confirmPassword"
:placeholder="t('page.login.common.confirmPasswordPlaceholder')"
/>
</AFormItem>
<AFormItem :wrapper-col="{ span: 24 }">
<AButton type="primary" block @click="handleSubmit">
</a-form-item>
<a-form-item
:wrapper-col="{
xs: { span: 24, offset: 0 },
sm: { span: 16, offset: 8 },
md: { span: 18, offset: 6 }
}"
>
<a-button type="primary" block @click="handleSubmit">
{{ t('common.confirm') }}
</AButton>
</AFormItem>
</AForm>
</ACard>
</a-button>
</a-form-item>
</a-form>
</a-card>
</div>
</template>
<style scoped>
.reset-password-container {
max-width: 480px;
margin: 0 auto;
padding: 24px;
background-color: #f5f5f7;
min-height: 100vh;
}
:deep(.ant-card) {
max-width: 800px;
margin: 0 auto;
border-radius: 8px;
}
:deep(.ant-card-head-title) {
text-align: center;
font-size: 18px;
font-weight: 600;
}
@media (max-width: 640px) {
:deep(.ant-form-item-label) {
white-space: normal; /* 允许标签文字换行 */
height: auto;
line-height: 1.5;
padding-bottom: 8px;
}
/* PC端断点 */
@media (min-width: 1200px) {
:deep(.ant-card) {
max-width: 800px;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
:deep(.ant-card) {
max-width: 700px;
}
}
@media (min-width: 768px) and (max-width: 991px) {
:deep(.ant-card) {
max-width: 600px;
}
}
/* 平板和移动端断点 */
@media (max-width: 767px) {
.reset-password-container {
padding: 16px;
}
:deep(.ant-card) {
max-width: 100%;
}
:deep(.ant-form) {
:deep(.ant-form-item-label) {
flex: 0 0 100%;
max-width: 100%;
text-align: left;
padding: 0 0 8px;
}
:deep(.ant-form-item-control) {
flex: 0 0 100%;
max-width: 100%;
}
}
:deep(.ant-form-item) {
margin-bottom: 16px;
}
}
@media (max-width: 480px) {
.reset-password-container {
padding: 12px;
}
}
</style>