再次优化登陆注册界面

This commit is contained in:
yml2213
2026-05-23 08:30:45 +08:00
parent aa522936c3
commit 83b55fa911
2 changed files with 276 additions and 297 deletions
+137 -147
View File
@@ -100,54 +100,37 @@ async function handleLogin() {
<button class="back-btn" type="button" @click="router.back()">
<van-icon name="arrow-left" :size="20" />
</button>
<h1>登录</h1>
<span class="header-spacer"></span>
</header>
<section class="auth-body">
<div class="brand-row">
<div class="brand-lockup">
<div class="brand-logo"></div>
<div>
<strong>大锤商行</strong>
<p>平台担保 · 安全租号</p>
</div>
</div>
<div class="auth-switch" aria-label="登录注册切换">
<RouterLink to="/m/login" class="active">登录</RouterLink>
<RouterLink to="/m/register">注册</RouterLink>
<strong>大锤商行</strong>
</div>
<div class="form-section">
<div class="section-heading">
<h2>手机号登录</h2>
<p>使用短信验证码登录开发环境验证码查看后端日志</p>
</div>
<h1>登录</h1>
<label class="auth-input-row">
<span class="input-label">手机号</span>
<span class="field-prefix">+86</span>
<input
v-model="form.phone"
type="tel"
maxlength="11"
placeholder="请输入手机号"
placeholder="手机号"
/>
</label>
<label class="auth-input-row code-row">
<span class="input-label">验证码</span>
<input
v-model="form.code"
type="text"
inputmode="numeric"
maxlength="6"
placeholder="6 位验证码"
placeholder="验证码"
/>
<span class="code-action">
<van-button
size="small"
type="primary"
plain
:disabled="sending || countDown > 0"
:loading="sending"
@@ -165,6 +148,11 @@ async function handleLogin() {
</span>
</label>
<div class="assist-row">
<span>验证码登录</span>
<RouterLink to="/m/register">没有账号<b>立即注册</b></RouterLink>
</div>
<div class="agreement-row">
<van-checkbox v-model="agreed" shape="square" icon-size="16px">
我已阅读并同意<b>用户协议</b><b>隐私政策</b>
@@ -181,11 +169,11 @@ async function handleLogin() {
>
登录
</van-button>
</div>
<RouterLink to="/m/register" class="secondary-entry">
没有账号立即注册
</RouterLink>
<RouterLink to="/m/register" class="secondary-entry">
没有账号创建一个
</RouterLink>
</div>
</section>
</main>
</template>
@@ -193,166 +181,116 @@ async function handleLogin() {
<style scoped>
.mobile-login-shell {
min-height: 100dvh;
background: #f4f6f8;
color: #151c28;
background:
radial-gradient(circle at 50% 12%, rgba(20, 119, 255, 0.1), transparent 34%),
linear-gradient(180deg, #f8fbff 0%, #ffffff 70%, #f7fafc 100%);
color: #111827;
}
.page-header {
position: sticky;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10;
display: flex;
align-items: center;
height: 48px;
padding: 0 12px;
background: #fff;
border-bottom: 1px solid #eceff3;
}
.page-header h1 {
flex: 1;
margin: 0;
font-size: 17px;
font-weight: 700;
text-align: center;
padding: 0 18px;
background: transparent;
}
.back-btn {
display: grid;
width: 36px;
height: 36px;
width: 34px;
height: 34px;
place-items: center;
border: none;
border-radius: 999px;
background: none;
color: #25282d;
}
.header-spacer {
width: 36px;
color: #111827;
}
.auth-body {
padding: 14px;
box-sizing: border-box;
display: flex;
min-height: 100dvh;
flex-direction: column;
justify-content: center;
padding: 54px 34px 28px;
}
.brand-row {
.brand-lockup {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
padding: 8px 2px 14px;
gap: 8px;
margin: 0 auto clamp(34px, 6vh, 54px);
}
.brand-logo {
display: grid;
width: 42px;
height: 42px;
width: 46px;
height: 46px;
place-items: center;
border-radius: 12px;
background: #1477ff;
border-radius: 14px;
background: linear-gradient(135deg, #1477ff, #2f8dff);
box-shadow: 0 14px 32px rgba(20, 119, 255, 0.18);
color: #ffffff;
font-size: 18px;
font-size: 19px;
font-weight: 900;
}
.brand-row strong {
.brand-lockup strong {
display: block;
margin: 0 0 2px;
color: #171a1f;
color: #111827;
font-size: 18px;
font-weight: 900;
}
.brand-row p {
margin: 0;
color: #6b7280;
font-size: 12px;
}
.auth-switch {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 6px;
margin-bottom: 12px;
padding: 4px;
border-radius: 8px;
background: #eaf0f8;
}
.auth-switch a {
padding: 9px 0;
border-radius: 7px;
color: #5f6875;
text-align: center;
font-size: 13px;
font-weight: 800;
text-decoration: none;
}
.auth-switch a.active {
background: #ffffff;
color: #1477ff;
letter-spacing: 0;
}
.form-section {
padding: 14px;
background: #fff;
border: 1px solid #edf0f4;
border-radius: 8px;
width: min(100%, 420px);
margin: 0 auto;
}
.section-heading h2 {
margin: 0 0 4px;
color: #171a1f;
font-size: 18px;
font-weight: 800;
}
.section-heading p {
margin: 0 0 12px;
color: #858c96;
font-size: 12px;
line-height: 1.5;
.form-section h1 {
margin: 0 0 22px;
color: #05070a;
font-size: 22px;
font-weight: 900;
line-height: 1.2;
}
.auth-input-row {
display: grid;
grid-template-columns: 58px 38px minmax(0, 1fr);
display: flex;
align-items: center;
min-height: 44px;
margin-bottom: 8px;
padding: 0 12px;
border-radius: 8px;
background: #f8fafc;
min-height: 48px;
margin-bottom: 10px;
padding: 0 16px;
border: 1px solid #e1e5eb;
border-radius: 10px;
background: rgba(255, 255, 255, 0.88);
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.03);
}
.auth-input-row.code-row {
grid-template-columns: 58px minmax(0, 1fr) 92px;
gap: 8px;
}
.input-label {
color: #30343a;
font-size: 13px;
font-weight: 700;
}
.auth-input-row input {
width: 100%;
min-width: 0;
border: none;
background: transparent;
color: #20242a;
font-size: 14px;
color: #0f172a;
font-size: 16px;
outline: none;
}
.auth-input-row input::placeholder {
color: #c0c4cc;
}
.field-prefix {
color: #1477ff;
font-weight: 800;
color: #b6beca;
}
.code-action {
@@ -361,47 +299,99 @@ async function handleLogin() {
}
.code-btn {
min-width: 82px;
height: 32px;
border-color: #1477ff !important;
border-radius: 8px;
color: #1477ff !important;
font-weight: 700;
}
.assist-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
margin: 14px 0 24px;
color: #111827;
font-size: 13px;
}
.assist-row span {
min-width: 0;
color: #1477ff;
}
.assist-row a {
flex-shrink: 0;
color: #22252b;
text-decoration: none;
}
.assist-row b {
color: #05070a;
font-weight: 900;
}
.agreement-row {
display: flex;
align-items: center;
margin: 10px 0 14px;
margin: 0 0 20px;
}
.agreement-row :deep(.van-checkbox__label) {
margin-left: 6px;
color: #333b48;
margin-left: 8px;
color: #252b36;
font-size: 12px;
line-height: 1.4;
}
.agreement-row :deep(.van-checkbox__label b) {
color: #1777ff;
font-weight: 600;
}
.primary-button {
height: 42px;
border: none !important;
border-radius: 8px !important;
background: #1477ff !important;
font-size: 15px;
color: #1477ff;
font-weight: 700;
}
.primary-button {
height: 48px;
border: none !important;
border-radius: 10px !important;
background: #1477ff !important;
box-shadow: 0 12px 24px rgba(20, 119, 255, 0.18);
font-size: 17px;
font-weight: 900;
}
.secondary-entry {
display: block;
display: grid;
min-height: 46px;
margin-top: 12px;
padding: 12px;
border: 1px solid #d7dce3;
border-radius: 8px;
background: #fff;
place-items: center;
border: 1px solid #e4e8ee;
border-radius: 10px;
background: rgba(255, 255, 255, 0.82);
color: #1477ff;
font-size: 13px;
font-weight: 800;
font-size: 15px;
font-weight: 900;
text-align: center;
text-decoration: none;
}
@media (max-height: 700px) {
.auth-body {
justify-content: flex-start;
padding-top: 52px;
}
.brand-lockup {
margin-bottom: 26px;
}
.form-section h1 {
margin-bottom: 18px;
}
.assist-row {
margin-bottom: 18px;
}
}
</style>
+139 -150
View File
@@ -102,55 +102,38 @@ async function handleRegister() {
<button class="back-btn" type="button" @click="router.back()">
<van-icon name="arrow-left" :size="20" />
</button>
<h1>注册</h1>
<span class="header-spacer"></span>
</header>
<section class="auth-body">
<div class="brand-row">
<div class="brand-lockup">
<div class="brand-logo"></div>
<div>
<strong>加入大锤商行</strong>
<p>注册后即可租号下单发布账号</p>
</div>
</div>
<div class="auth-switch" aria-label="登录注册切换">
<RouterLink to="/m/login">登录</RouterLink>
<RouterLink to="/m/register" class="active">注册</RouterLink>
<strong>大锤商行</strong>
</div>
<div class="form-section">
<div class="section-heading">
<h2>手机号注册</h2>
<p>先用短信验证码创建账号后续再补充实名和收款信息</p>
</div>
<h1>注册</h1>
<label class="auth-input-row">
<span class="input-label">手机号</span>
<span class="field-prefix">+86</span>
<input
v-model="form.phone"
type="tel"
maxlength="11"
inputmode="tel"
placeholder="请输入手机号"
placeholder="手机号"
/>
</label>
<label class="auth-input-row code-row">
<span class="input-label">验证码</span>
<input
v-model="form.code"
type="text"
inputmode="numeric"
maxlength="6"
placeholder="6 位验证码"
placeholder="验证码"
/>
<span class="code-action">
<van-button
size="small"
type="primary"
plain
:disabled="sending || countDown > 0"
:loading="sending"
@@ -169,14 +152,18 @@ async function handleRegister() {
</label>
<label class="auth-input-row">
<span class="input-label">邀请码</span>
<input
v-model="form.inviteCode"
maxlength="16"
placeholder="选填,有邀请码填入"
placeholder="邀请码(选填)"
/>
</label>
<div class="assist-row">
<span>验证码注册</span>
<RouterLink to="/m/login">已有账号<b>去登录</b></RouterLink>
</div>
<div class="agreement-row">
<van-checkbox v-model="agreed" shape="square" icon-size="16px">
我已阅读并同意<b>用户协议</b><b>隐私政策</b>
@@ -193,11 +180,11 @@ async function handleRegister() {
>
注册并登录
</van-button>
</div>
<RouterLink to="/m/login" class="secondary-entry">
已有账号登录
</RouterLink>
<RouterLink to="/m/login" class="secondary-entry">
返回登录
</RouterLink>
</div>
</section>
</main>
</template>
@@ -205,166 +192,116 @@ async function handleRegister() {
<style scoped>
.mobile-register-shell {
min-height: 100dvh;
background: #f4f6f8;
color: #151c28;
background:
radial-gradient(circle at 50% 12%, rgba(20, 119, 255, 0.1), transparent 34%),
linear-gradient(180deg, #f8fbff 0%, #ffffff 70%, #f7fafc 100%);
color: #111827;
}
.page-header {
position: sticky;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10;
display: flex;
align-items: center;
height: 48px;
padding: 0 12px;
background: #fff;
border-bottom: 1px solid #eceff3;
}
.page-header h1 {
flex: 1;
margin: 0;
font-size: 17px;
font-weight: 700;
text-align: center;
padding: 0 18px;
background: transparent;
}
.back-btn {
display: grid;
width: 36px;
height: 36px;
width: 34px;
height: 34px;
place-items: center;
border: none;
border-radius: 999px;
background: none;
color: #25282d;
}
.header-spacer {
width: 36px;
color: #111827;
}
.auth-body {
padding: 14px;
box-sizing: border-box;
display: flex;
min-height: 100dvh;
flex-direction: column;
justify-content: center;
padding: 50px 34px 22px;
}
.brand-row {
.brand-lockup {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
padding: 8px 2px 14px;
gap: 8px;
margin: 0 auto clamp(24px, 4vh, 38px);
}
.brand-logo {
display: grid;
width: 42px;
height: 42px;
width: 46px;
height: 46px;
place-items: center;
border-radius: 12px;
background: #1477ff;
border-radius: 14px;
background: linear-gradient(135deg, #1477ff, #2f8dff);
box-shadow: 0 14px 32px rgba(20, 119, 255, 0.18);
color: #ffffff;
font-size: 18px;
font-size: 19px;
font-weight: 900;
}
.brand-row strong {
.brand-lockup strong {
display: block;
margin: 0 0 2px;
color: #171a1f;
color: #111827;
font-size: 18px;
font-weight: 900;
}
.brand-row p {
margin: 0;
color: #6b7280;
font-size: 12px;
}
.auth-switch {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 6px;
margin-bottom: 12px;
padding: 4px;
border-radius: 8px;
background: #eaf0f8;
}
.auth-switch a {
padding: 9px 0;
border-radius: 7px;
color: #5f6875;
text-align: center;
font-size: 13px;
font-weight: 800;
text-decoration: none;
}
.auth-switch a.active {
background: #ffffff;
color: #1477ff;
letter-spacing: 0;
}
.form-section {
padding: 14px;
background: #fff;
border: 1px solid #edf0f4;
border-radius: 8px;
width: min(100%, 420px);
margin: 0 auto;
}
.section-heading h2 {
margin: 0 0 4px;
color: #171a1f;
font-size: 18px;
font-weight: 800;
}
.section-heading p {
margin: 0 0 12px;
color: #858c96;
font-size: 12px;
line-height: 1.5;
.form-section h1 {
margin: 0 0 20px;
color: #05070a;
font-size: 22px;
font-weight: 900;
line-height: 1.2;
}
.auth-input-row {
display: grid;
grid-template-columns: 58px 38px minmax(0, 1fr);
display: flex;
align-items: center;
min-height: 44px;
margin-bottom: 8px;
padding: 0 12px;
border-radius: 8px;
background: #f8fafc;
min-height: 48px;
margin-bottom: 10px;
padding: 0 16px;
border: 1px solid #e1e5eb;
border-radius: 10px;
background: rgba(255, 255, 255, 0.88);
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.03);
}
.auth-input-row.code-row {
grid-template-columns: 58px minmax(0, 1fr) 92px;
gap: 8px;
}
.input-label {
color: #30343a;
font-size: 13px;
font-weight: 700;
}
.auth-input-row input {
width: 100%;
min-width: 0;
border: none;
background: transparent;
color: #20242a;
font-size: 14px;
color: #0f172a;
font-size: 16px;
outline: none;
}
.auth-input-row input::placeholder {
color: #c0c4cc;
}
.field-prefix {
color: #1477ff;
font-weight: 800;
color: #b6beca;
}
.code-action {
@@ -373,47 +310,99 @@ async function handleRegister() {
}
.code-btn {
min-width: 82px;
height: 32px;
border-color: #1477ff !important;
border-radius: 8px;
color: #1477ff !important;
font-weight: 700;
}
.assist-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
margin: 12px 0 18px;
color: #111827;
font-size: 13px;
}
.assist-row span {
min-width: 0;
color: #1477ff;
}
.assist-row a {
flex-shrink: 0;
color: #22252b;
text-decoration: none;
}
.assist-row b {
color: #05070a;
font-weight: 900;
}
.agreement-row {
display: flex;
align-items: center;
margin: 10px 0 14px;
margin: 0 0 18px;
}
.agreement-row :deep(.van-checkbox__label) {
margin-left: 6px;
color: #333b48;
margin-left: 8px;
color: #252b36;
font-size: 12px;
line-height: 1.4;
}
.agreement-row :deep(.van-checkbox__label b) {
color: #1777ff;
font-weight: 600;
}
.primary-button {
height: 42px;
border: none !important;
border-radius: 8px !important;
background: #1477ff !important;
font-size: 15px;
color: #1477ff;
font-weight: 700;
}
.primary-button {
height: 48px;
border: none !important;
border-radius: 10px !important;
background: #1477ff !important;
box-shadow: 0 12px 24px rgba(20, 119, 255, 0.18);
font-size: 17px;
font-weight: 900;
}
.secondary-entry {
display: block;
margin-top: 12px;
padding: 12px;
border: 1px solid #d7dce3;
border-radius: 8px;
background: #fff;
display: grid;
min-height: 44px;
margin-top: 10px;
place-items: center;
border: 1px solid #e4e8ee;
border-radius: 10px;
background: rgba(255, 255, 255, 0.82);
color: #1477ff;
font-size: 13px;
font-weight: 800;
font-size: 15px;
font-weight: 900;
text-align: center;
text-decoration: none;
}
@media (max-height: 760px) {
.auth-body {
justify-content: flex-start;
padding-top: 48px;
}
.brand-lockup {
margin-bottom: 20px;
}
.form-section h1 {
margin-bottom: 16px;
}
.assist-row {
margin-bottom: 14px;
}
}
</style>