feat ui设计稿bug修复
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { onBeforeUnmount, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { SmsCodeInput } from '@/components'
|
||||
import { PasswordStrength, SmsCodeInput } from '@/components'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { isPhone, isValidPassword } from '@/utils/validate'
|
||||
|
||||
@@ -71,62 +71,89 @@ onBeforeUnmount(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="auth-page">
|
||||
<div class="auth-page reset">
|
||||
<aside class="auth-page__brand">
|
||||
<div class="auth-page__brand-inner">
|
||||
<p class="auth-page__logo">
|
||||
虫子智造研发一体化平台
|
||||
</p>
|
||||
<p class="auth-page__slogan">
|
||||
安全 · 高效 · 可控
|
||||
</p>
|
||||
<RouterLink class="auth-page__guest" to="/">
|
||||
游客模式 →
|
||||
</RouterLink>
|
||||
</div>
|
||||
<h1 class="auth-page__logo">
|
||||
虫子智造研发<br>一体化平台
|
||||
</h1>
|
||||
<p class="auth-page__key">
|
||||
chongzizhizaoyanfayitihuaPINGTAI
|
||||
</p>
|
||||
<p class="auth-page__slogan">
|
||||
安全 · 高效 · 可控
|
||||
</p>
|
||||
</aside>
|
||||
|
||||
<RouterLink class="auth-page__guest" to="/">
|
||||
游客模式
|
||||
</RouterLink>
|
||||
|
||||
<main class="auth-page__main">
|
||||
<div class="auth-page__card">
|
||||
<h1 class="auth-page__title">
|
||||
<h2 class="auth-page__title">
|
||||
找回密码
|
||||
</h1>
|
||||
</h2>
|
||||
<p class="auth-page__subtitle">
|
||||
使用手机号重新设置您的密码
|
||||
</p>
|
||||
|
||||
<form class="auth-page__form" @submit.prevent="onReset">
|
||||
<input
|
||||
v-model="phone"
|
||||
class="auth-page__input"
|
||||
type="text"
|
||||
placeholder="请输入手机号"
|
||||
maxlength="11"
|
||||
autocomplete="tel"
|
||||
>
|
||||
<SmsCodeInput v-model:code="code" @get-code="onGetCode" />
|
||||
<input
|
||||
v-model="password"
|
||||
class="auth-page__input"
|
||||
type="password"
|
||||
placeholder="新密码(6-20位)"
|
||||
autocomplete="new-password"
|
||||
>
|
||||
<input
|
||||
v-model="confirmPassword"
|
||||
class="auth-page__input"
|
||||
type="password"
|
||||
placeholder="确认新密码"
|
||||
autocomplete="new-password"
|
||||
>
|
||||
<label class="auth-page__agree">
|
||||
<form class="reset__form" @submit.prevent="onReset">
|
||||
<div class="reset__field">
|
||||
<label class="reset__label" for="reset-phone">手机号</label>
|
||||
<input
|
||||
id="reset-phone"
|
||||
v-model="phone"
|
||||
class="reset__input"
|
||||
type="text"
|
||||
placeholder="请输入手机号"
|
||||
maxlength="11"
|
||||
autocomplete="tel"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="reset__field">
|
||||
<label class="reset__label" for="reset-code">验证码</label>
|
||||
<SmsCodeInput id="reset-code" v-model:code="code" @get-code="onGetCode" />
|
||||
</div>
|
||||
|
||||
<div class="reset__field">
|
||||
<label class="reset__label" for="reset-password">设置密码</label>
|
||||
<input
|
||||
id="reset-password"
|
||||
v-model="password"
|
||||
class="reset__input"
|
||||
type="password"
|
||||
placeholder="请设置6-20位密码"
|
||||
autocomplete="new-password"
|
||||
>
|
||||
<!-- 设计稿:密码框下 15 高密码强度条 + 15 高提示行 -->
|
||||
<PasswordStrength :password="password" />
|
||||
</div>
|
||||
|
||||
<div class="reset__field">
|
||||
<label class="reset__label" for="reset-confirm">确认密码</label>
|
||||
<input
|
||||
id="reset-confirm"
|
||||
v-model="confirmPassword"
|
||||
class="reset__input"
|
||||
type="password"
|
||||
placeholder="请设置6-20位密码"
|
||||
autocomplete="new-password"
|
||||
>
|
||||
</div>
|
||||
|
||||
<label class="reset__agree">
|
||||
<input v-model="agree" type="checkbox">
|
||||
<span>已阅读并同意<em>《用户协议》</em>和<em>《隐私政策》</em></span>
|
||||
</label>
|
||||
<button class="auth-page__submit" type="submit">
|
||||
|
||||
<button class="reset__submit" type="submit">
|
||||
确认修改
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<p class="auth-page__switch">
|
||||
想起密码了?<RouterLink class="auth-page__link" to="/login">返回登录</RouterLink>
|
||||
<p class="reset__switch">
|
||||
已有账号?<RouterLink class="auth-page__link" to="/login">立即登录</RouterLink>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
@@ -134,105 +161,45 @@ onBeforeUnmount(() => {
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.auth-page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
// 设计稿:右侧表单区为纯白底,无卡片描边/阴影
|
||||
background: @white;
|
||||
|
||||
&__brand {
|
||||
// 设计稿:左侧品牌渐变面板约占 786/1920 ≈ 41%
|
||||
flex: 0 0 41%;
|
||||
.flex(row, flex-start, stretch);
|
||||
background: linear-gradient(135deg, @auth-gradient-from 0%, @auth-gradient-to 100%);
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&__brand-inner {
|
||||
.flex(column, space-between, flex-start);
|
||||
width: 100%;
|
||||
// 设计稿:文字列起点 x=257 ≈ 面板宽 32.7%;主标距顶 ≈ 28%、标语底边距底 ≈ 30%
|
||||
padding: 26vh 48px 30vh 32%;
|
||||
}
|
||||
|
||||
&__logo {
|
||||
font-size: 31px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2px;
|
||||
line-height: 1.45;
|
||||
// 设计稿文本框 432 设计px:定宽让 11 字在「虫子智造研发 / 一体化平台」处折行
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 8px;
|
||||
}
|
||||
|
||||
// 设计稿:「游客模式」为右上角白底上的深色纯文本,无边框
|
||||
&__guest {
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
right: 16px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
color: @heading-color;
|
||||
font-size: 11px;
|
||||
text-decoration: none;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: transparent;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
&__main {
|
||||
flex: 1;
|
||||
.flex(row, center, center);
|
||||
padding: @spacing-xl;
|
||||
}
|
||||
|
||||
&__card {
|
||||
.flex(column, flex-start);
|
||||
// 设计稿:表单列宽 688 设计px ≈ 530px,标题/输入/按钮纵向节奏 ≈ 41px
|
||||
gap: 41px;
|
||||
width: 100%;
|
||||
max-width: 530px;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
// 设计稿:标题(34 设计px ≈ 26px)到首个输入框 ≈ 62px
|
||||
&__title {
|
||||
margin-bottom: 21px;
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
}
|
||||
// 设计稿(找回密码):表单列起点 x1040(--auth-form-x 1023 + 17)、垂直顶 261
|
||||
.reset {
|
||||
--auth-form-x: 1023px;
|
||||
--auth-form-y: 261px;
|
||||
|
||||
&__form {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-lg;
|
||||
width: 100%;
|
||||
.flex(column, flex-start, stretch);
|
||||
// 副标题底 335 → 首个标签 361 = 26(副标题行盒 17 + 外边距 12 → 实际需补 38)
|
||||
margin: 38px 0 0 17px;
|
||||
width: 680px;
|
||||
}
|
||||
|
||||
&__field {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 8px;
|
||||
width: 680px;
|
||||
}
|
||||
|
||||
// 设计稿:手机号框底 425 → 验证码标签 443 = 18
|
||||
&__field + &__field {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 13px; // 设计稿 13/500 #1F2937
|
||||
font-weight: 500;
|
||||
line-height: 17px;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
// 设计稿:输入框 40 设计px ≈ 32px 高、13 设计px 字号(可读下限 11px)、白底浅描边
|
||||
&__input {
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
height: 39px;
|
||||
padding: 0 12px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #dde1e7;
|
||||
border-radius: @radius-sm;
|
||||
background: @white;
|
||||
font-size: 11px;
|
||||
color: @heading-color;
|
||||
font-size: 13px;
|
||||
color: #1f2937;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
box-sizing: border-box;
|
||||
@@ -242,40 +209,46 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @heading-color;
|
||||
color: #1f2937;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿:协议行 @(1040,741)
|
||||
&__agree {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-xs;
|
||||
font-size: 11px;
|
||||
color: @text-color-secondary;
|
||||
.flex(row, flex-start, center);
|
||||
gap: 8px;
|
||||
margin-top: 22px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: #6b7280;
|
||||
cursor: pointer;
|
||||
|
||||
input {
|
||||
margin-top: 1px;
|
||||
flex-shrink: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin: 0;
|
||||
accent-color: @primary-strong;
|
||||
}
|
||||
|
||||
// 设计稿:《用户协议》《隐私政策》为强调蓝,其余为次级灰
|
||||
em {
|
||||
font-style: normal;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿:确认修改按钮 44 设计px ≈ 34px 高、#024FFF 实底
|
||||
// 设计稿:确认修改按钮 680×46 @y775、#024FFF 实底、文字 15/500
|
||||
&__submit {
|
||||
width: 100%;
|
||||
height: 34px;
|
||||
height: 46px;
|
||||
margin-top: 18px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
border-radius: @radius-sm;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 12px;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 2px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
|
||||
@@ -284,20 +257,22 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿:按钮 → 底部切换链接仅约 13px
|
||||
// 设计稿:按钮底 821 → 切换行 838 = 17
|
||||
&__switch {
|
||||
margin-top: -26px;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
color: @text-color-secondary;
|
||||
align-self: center;
|
||||
margin: 17px 0 0;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
&__link {
|
||||
color: @primary-strong;
|
||||
|
||||
&:hover {
|
||||
color: @primary-hover;
|
||||
}
|
||||
&__subtitle {
|
||||
margin: 12px 0 0;
|
||||
font-size: 13px; // 设计稿 13/400 #6B7280
|
||||
font-weight: 400;
|
||||
line-height: 17px;
|
||||
color: #6b7280;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user