再次优化了登陆注册界面与跳转逻辑
This commit is contained in:
Vendored
-7
@@ -17,21 +17,14 @@ declare module 'vue' {
|
|||||||
VanCell: typeof import('vant/es')['Cell']
|
VanCell: typeof import('vant/es')['Cell']
|
||||||
VanCellGroup: typeof import('vant/es')['CellGroup']
|
VanCellGroup: typeof import('vant/es')['CellGroup']
|
||||||
VanCheckbox: typeof import('vant/es')['Checkbox']
|
VanCheckbox: typeof import('vant/es')['Checkbox']
|
||||||
VanDropdownItem: typeof import('vant/es')['DropdownItem']
|
|
||||||
VanDropdownMenu: typeof import('vant/es')['DropdownMenu']
|
|
||||||
VanEmpty: typeof import('vant/es')['Empty']
|
VanEmpty: typeof import('vant/es')['Empty']
|
||||||
VanField: typeof import('vant/es')['Field']
|
VanField: typeof import('vant/es')['Field']
|
||||||
VanGrid: typeof import('vant/es')['Grid']
|
|
||||||
VanGridItem: typeof import('vant/es')['GridItem']
|
|
||||||
VanIcon: typeof import('vant/es')['Icon']
|
VanIcon: typeof import('vant/es')['Icon']
|
||||||
VanImage: typeof import('vant/es')['Image']
|
|
||||||
VanLoading: typeof import('vant/es')['Loading']
|
VanLoading: typeof import('vant/es')['Loading']
|
||||||
VanNoticeBar: typeof import('vant/es')['NoticeBar']
|
VanNoticeBar: typeof import('vant/es')['NoticeBar']
|
||||||
VanPopup: typeof import('vant/es')['Popup']
|
VanPopup: typeof import('vant/es')['Popup']
|
||||||
VanPullRefresh: typeof import('vant/es')['PullRefresh']
|
VanPullRefresh: typeof import('vant/es')['PullRefresh']
|
||||||
VanSearch: typeof import('vant/es')['Search']
|
VanSearch: typeof import('vant/es')['Search']
|
||||||
VanTabbar: typeof import('vant/es')['Tabbar']
|
|
||||||
VanTabbarItem: typeof import('vant/es')['TabbarItem']
|
|
||||||
VanTag: typeof import('vant/es')['Tag']
|
VanTag: typeof import('vant/es')['Tag']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,3 +14,37 @@ apiClient.interceptors.request.use((config) => {
|
|||||||
}
|
}
|
||||||
return config
|
return config
|
||||||
})
|
})
|
||||||
|
|
||||||
|
apiClient.interceptors.response.use(
|
||||||
|
(response) => response,
|
||||||
|
(error) => {
|
||||||
|
if (error?.response?.status !== 401) {
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
const requestUrl = error.config?.url || ''
|
||||||
|
const isAdminRequest = requestUrl.startsWith('/admin')
|
||||||
|
const currentPath = window.location.pathname + window.location.search
|
||||||
|
|
||||||
|
if (isAdminRequest) {
|
||||||
|
localStorage.removeItem('admin_access_token')
|
||||||
|
localStorage.removeItem('admin_refresh_token')
|
||||||
|
if (!window.location.pathname.startsWith('/admin/login')) {
|
||||||
|
window.location.assign('/admin/login')
|
||||||
|
}
|
||||||
|
return Promise.reject(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
localStorage.removeItem('access_token')
|
||||||
|
localStorage.removeItem('refresh_token')
|
||||||
|
localStorage.removeItem('user_id')
|
||||||
|
|
||||||
|
if (!window.location.pathname.startsWith('/m/login') && !window.location.pathname.startsWith('/m/register')) {
|
||||||
|
const redirect = encodeURIComponent(currentPath)
|
||||||
|
const loginPath = window.location.pathname.startsWith('/m') ? '/m/login' : '/login'
|
||||||
|
window.location.assign(`${loginPath}?redirect=${redirect}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.reject(error)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|||||||
@@ -40,32 +40,32 @@ const router = createRouter({
|
|||||||
path: "/m/messages",
|
path: "/m/messages",
|
||||||
name: "mobile-messages",
|
name: "mobile-messages",
|
||||||
component: () => import("@/views/mobile/MobileMessagesView.vue"),
|
component: () => import("@/views/mobile/MobileMessagesView.vue"),
|
||||||
meta: { layout: "blank" },
|
meta: { layout: "blank", requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/m/realname",
|
path: "/m/realname",
|
||||||
name: "mobile-realname",
|
name: "mobile-realname",
|
||||||
component: () => import("@/views/mobile/MobileRealnameView.vue"),
|
component: () => import("@/views/mobile/MobileRealnameView.vue"),
|
||||||
meta: { layout: "blank" },
|
meta: { layout: "blank", requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/m/profile",
|
path: "/m/profile",
|
||||||
name: "mobile-profile",
|
name: "mobile-profile",
|
||||||
component: () => import("@/views/mobile/MobileProfileView.vue"),
|
component: () => import("@/views/mobile/MobileProfileView.vue"),
|
||||||
meta: { layout: "blank" },
|
meta: { layout: "blank", requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/m/orders",
|
path: "/m/orders",
|
||||||
name: "mobile-orders",
|
name: "mobile-orders",
|
||||||
component: () => import("@/views/mobile/MobileOrdersView.vue"),
|
component: () => import("@/views/mobile/MobileOrdersView.vue"),
|
||||||
meta: { layout: "blank" },
|
meta: { layout: "blank", requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/m/seller/listings/create",
|
path: "/m/seller/listings/create",
|
||||||
name: "mobile-seller-listing-create",
|
name: "mobile-seller-listing-create",
|
||||||
component: () =>
|
component: () =>
|
||||||
import("@/views/mobile/MobileSellerListingCreateView.vue"),
|
import("@/views/mobile/MobileSellerListingCreateView.vue"),
|
||||||
meta: { layout: "blank" },
|
meta: { layout: "blank", requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
@@ -217,6 +217,10 @@ router.beforeEach((to) => {
|
|||||||
return { path: toMobilePath(to.path), query: to.query, hash: to.hash };
|
return { path: toMobilePath(to.path), query: to.query, hash: to.hash };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (to.meta.requiresAuth && !localStorage.getItem("access_token")) {
|
||||||
|
return { path: "/m/login", query: { redirect: to.fullPath } };
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
to.path === "/admin/login" &&
|
to.path === "/admin/login" &&
|
||||||
localStorage.getItem("admin_access_token")
|
localStorage.getItem("admin_access_token")
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onUnmounted, reactive, ref } from "vue";
|
import { onUnmounted, reactive, ref } from "vue";
|
||||||
import { RouterLink, useRouter } from "vue-router";
|
import { RouterLink, useRoute, useRouter } from "vue-router";
|
||||||
import { showToast, showDialog } from "vant";
|
import { showToast, showDialog } from "vant";
|
||||||
|
|
||||||
import { sendSmsCode } from "@/api/auth";
|
import { sendSmsCode } from "@/api/auth";
|
||||||
import { useSessionStore } from "@/stores/session";
|
import { useSessionStore } from "@/stores/session";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
const session = useSessionStore();
|
const session = useSessionStore();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const sending = ref(false);
|
const sending = ref(false);
|
||||||
@@ -83,7 +84,8 @@ async function handleLogin() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
await session.login(form.phone, form.code);
|
await session.login(form.phone, form.code);
|
||||||
await router.push("/m/profile");
|
const redirect = typeof route.query.redirect === "string" ? route.query.redirect : "/m/profile";
|
||||||
|
await router.replace(redirect);
|
||||||
} catch {
|
} catch {
|
||||||
showToast({ message: "登录失败,请检查手机号和验证码", icon: "cross" });
|
showToast({ message: "登录失败,请检查手机号和验证码", icon: "cross" });
|
||||||
} finally {
|
} finally {
|
||||||
@@ -94,276 +96,278 @@ async function handleLogin() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="mobile-login-shell">
|
<main class="mobile-login-shell">
|
||||||
<section class="login-card">
|
<header class="page-header">
|
||||||
<!-- 品牌区域 -->
|
<button class="back-btn" type="button" @click="router.back()">
|
||||||
<div class="login-top">
|
<van-icon name="arrow-left" :size="20" />
|
||||||
<div class="monster-logo">锤</div>
|
</button>
|
||||||
|
<h1>登录</h1>
|
||||||
|
<span class="header-spacer"></span>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section class="auth-body">
|
||||||
|
<div class="brand-row">
|
||||||
|
<div class="brand-logo">锤</div>
|
||||||
<div>
|
<div>
|
||||||
<p>大锤商行</p>
|
<strong>大锤商行</strong>
|
||||||
<small>平台担保 · 安全租号</small>
|
<p>平台担保 · 安全租号</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 登录/注册 Tab 切换 -->
|
|
||||||
<div class="auth-switch" aria-label="登录注册切换">
|
<div class="auth-switch" aria-label="登录注册切换">
|
||||||
<RouterLink to="/m/login" class="active">登录</RouterLink>
|
<RouterLink to="/m/login" class="active">登录</RouterLink>
|
||||||
<RouterLink to="/m/register">注册</RouterLink>
|
<RouterLink to="/m/register">注册</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="login-eyebrow">SMS LOGIN</p>
|
<div class="form-section">
|
||||||
<h1>手机号登录</h1>
|
<div class="section-heading">
|
||||||
<p class="login-subtitle">验证码登录,开发环境验证码查看后端日志。</p>
|
<h2>手机号登录</h2>
|
||||||
|
<p>使用短信验证码登录,开发环境验证码查看后端日志。</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 手机号输入 -->
|
<label class="auth-input-row">
|
||||||
<van-field
|
<span class="input-label">手机号</span>
|
||||||
v-model="form.phone"
|
|
||||||
type="tel"
|
|
||||||
maxlength="11"
|
|
||||||
placeholder="请输入手机号"
|
|
||||||
clearable
|
|
||||||
class="login-field"
|
|
||||||
>
|
|
||||||
<template #left-icon>
|
|
||||||
<span class="field-prefix">+86</span>
|
<span class="field-prefix">+86</span>
|
||||||
</template>
|
<input
|
||||||
</van-field>
|
v-model="form.phone"
|
||||||
|
type="tel"
|
||||||
|
maxlength="11"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
|
||||||
<!-- 验证码输入 -->
|
<label class="auth-input-row code-row">
|
||||||
<van-field
|
<span class="input-label">验证码</span>
|
||||||
v-model="form.code"
|
<input
|
||||||
type="digit"
|
v-model="form.code"
|
||||||
maxlength="6"
|
type="text"
|
||||||
placeholder="6 位验证码"
|
inputmode="numeric"
|
||||||
class="login-field"
|
maxlength="6"
|
||||||
:left-icon="'shield-o'"
|
placeholder="6 位验证码"
|
||||||
>
|
/>
|
||||||
<template #button>
|
<span class="code-action">
|
||||||
<van-button
|
<van-button
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
round
|
:disabled="sending || countDown > 0"
|
||||||
:disabled="sending || countDown > 0"
|
:loading="sending"
|
||||||
:loading="sending"
|
class="code-btn"
|
||||||
@click="handleSendCode"
|
@click="handleSendCode"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
countDown > 0
|
countDown > 0
|
||||||
? `${countDown}s`
|
? `${countDown}s`
|
||||||
: sending
|
: sending
|
||||||
? "发送中"
|
? "发送中"
|
||||||
: "发送验证码"
|
: "发送验证码"
|
||||||
}}
|
}}
|
||||||
</van-button>
|
</van-button>
|
||||||
</template>
|
</span>
|
||||||
</van-field>
|
</label>
|
||||||
|
|
||||||
<!-- 底部链接行 -->
|
<div class="agreement-row">
|
||||||
<div class="login-links">
|
<van-checkbox v-model="agreed" shape="square" icon-size="16px">
|
||||||
<van-button size="mini" plain type="primary">忘记密码</van-button>
|
我已阅读并同意《<b>用户协议</b>》和《<b>隐私政策</b>》
|
||||||
</div>
|
</van-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 用户协议 -->
|
|
||||||
<div class="agreement-row">
|
|
||||||
<van-checkbox v-model="agreed" shape="square" icon-size="16px">
|
|
||||||
我已阅读并同意《<b>用户协议</b>》和《<b>隐私政策</b>》
|
|
||||||
</van-checkbox>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 登录按钮 -->
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
block
|
|
||||||
round
|
|
||||||
class="login-button"
|
|
||||||
:loading="loading"
|
|
||||||
loading-text="登录中..."
|
|
||||||
@click="handleLogin"
|
|
||||||
>
|
|
||||||
登录
|
|
||||||
</van-button>
|
|
||||||
|
|
||||||
<!-- 底部注册入口 -->
|
|
||||||
<RouterLink
|
|
||||||
to="/m/register"
|
|
||||||
class="register-entry"
|
|
||||||
custom
|
|
||||||
v-slot="{ navigate }"
|
|
||||||
>
|
|
||||||
<van-button
|
<van-button
|
||||||
plain
|
|
||||||
type="primary"
|
type="primary"
|
||||||
block
|
block
|
||||||
round
|
class="primary-button"
|
||||||
size="small"
|
:loading="loading"
|
||||||
class="register-button"
|
loading-text="登录中..."
|
||||||
@click="navigate"
|
@click="handleLogin"
|
||||||
>
|
>
|
||||||
没有账号?立即注册
|
登录
|
||||||
</van-button>
|
</van-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<RouterLink to="/m/register" class="secondary-entry">
|
||||||
|
没有账号?立即注册
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* ========== Vant 主题变量覆盖 ========== */
|
|
||||||
:root {
|
|
||||||
--van-primary-color: #1477ff;
|
|
||||||
--van-button-primary-background: #1477ff;
|
|
||||||
--van-button-primary-border-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== 页面容器 ========== */
|
|
||||||
.mobile-login-shell {
|
.mobile-login-shell {
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
box-sizing: border-box;
|
background: #f4f6f8;
|
||||||
overflow: hidden;
|
|
||||||
background: #f5f7fa;
|
|
||||||
color: #151c28;
|
color: #151c28;
|
||||||
padding: 40px 24px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-card {
|
.page-header {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: calc(100dvh - 80px);
|
align-items: center;
|
||||||
flex-direction: column;
|
height: 48px;
|
||||||
justify-content: center;
|
padding: 0 12px;
|
||||||
|
background: #fff;
|
||||||
|
border-bottom: 1px solid #eceff3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 品牌区域 ========== */
|
.page-header h1 {
|
||||||
.login-top {
|
flex: 1;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: grid;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
place-items: center;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
color: #25282d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-spacer {
|
||||||
|
width: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-body {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
margin-bottom: 14px;
|
padding: 8px 2px 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.monster-logo {
|
.brand-logo {
|
||||||
display: grid;
|
display: grid;
|
||||||
width: 48px;
|
width: 42px;
|
||||||
height: 48px;
|
height: 42px;
|
||||||
flex: 0 0 auto;
|
|
||||||
place-items: center;
|
place-items: center;
|
||||||
border-radius: 16px;
|
border-radius: 12px;
|
||||||
background: #1477ff;
|
background: #1477ff;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 21px;
|
font-size: 18px;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
box-shadow: 0 4px 12px rgba(20, 119, 255, 0.18);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-top p {
|
.brand-row strong {
|
||||||
|
display: block;
|
||||||
margin: 0 0 2px;
|
margin: 0 0 2px;
|
||||||
font-size: 20px;
|
color: #171a1f;
|
||||||
|
font-size: 18px;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-top small,
|
.brand-row p {
|
||||||
.login-subtitle {
|
margin: 0;
|
||||||
color: #667386;
|
color: #6b7280;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== Tab 切换 ========== */
|
|
||||||
.auth-switch {
|
.auth-switch {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 6px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 12px;
|
||||||
border-radius: 15px;
|
padding: 4px;
|
||||||
background: #eef4fb;
|
border-radius: 8px;
|
||||||
padding: 5px;
|
background: #eaf0f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-switch a {
|
.auth-switch a {
|
||||||
border-radius: 11px;
|
padding: 9px 0;
|
||||||
color: #667386;
|
border-radius: 7px;
|
||||||
padding: 10px 0;
|
color: #5f6875;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14px;
|
font-size: 13px;
|
||||||
font-weight: 900;
|
font-weight: 800;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-switch a.active {
|
.auth-switch a.active {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
color: #111827;
|
color: #1477ff;
|
||||||
box-shadow: 0 8px 18px rgba(23, 35, 61, 0.08);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 标题区 ========== */
|
.form-section {
|
||||||
.login-eyebrow {
|
padding: 14px;
|
||||||
margin: 0 0 5px;
|
background: #fff;
|
||||||
color: #02846e;
|
border: 1px solid #edf0f4;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
font-size: 12px;
|
||||||
font-weight: 900;
|
line-height: 1.5;
|
||||||
letter-spacing: 0.04em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-card h1 {
|
.auth-input-row {
|
||||||
margin: 0;
|
display: grid;
|
||||||
font-size: 28px;
|
grid-template-columns: 58px 38px minmax(0, 1fr);
|
||||||
line-height: 1.15;
|
align-items: center;
|
||||||
|
min-height: 44px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
padding: 0 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #f8fafc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-subtitle {
|
.auth-input-row.code-row {
|
||||||
margin: 7px 0 14px;
|
grid-template-columns: 58px minmax(0, 1fr) 92px;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-label {
|
||||||
|
color: #30343a;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.45;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== Vant Field 覆盖样式 ========== */
|
|
||||||
.login-field {
|
|
||||||
margin-top: 12px;
|
|
||||||
border-radius: 12px;
|
|
||||||
background: rgba(255, 255, 255, 0.92);
|
|
||||||
box-shadow: inset 0 1px 3px rgba(23, 35, 61, 0.04);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-field :deep(.van-field__control) {
|
|
||||||
font-size: 15px;
|
|
||||||
color: #151c28;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-field :deep(.van-field__label) {
|
|
||||||
width: auto;
|
|
||||||
margin-right: 8px;
|
|
||||||
color: #333b48;
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.login-field :deep(.van-field__left-icon) {
|
|
||||||
color: #1777ff;
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-field :deep(.van-field__right-icon) {
|
.auth-input-row input {
|
||||||
color: #999;
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: #20242a;
|
||||||
|
font-size: 14px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-input-row input::placeholder {
|
||||||
|
color: #c0c4cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-prefix {
|
.field-prefix {
|
||||||
color: #1777ff;
|
color: #1477ff;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
font-size: 14px;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 底部链接行 ========== */
|
.code-action {
|
||||||
.login-links {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
justify-content: flex-end;
|
||||||
justify-content: space-between;
|
}
|
||||||
margin: 10px 0 12px;
|
|
||||||
color: #566274;
|
.code-btn {
|
||||||
font-size: 12px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 协议行 ========== */
|
|
||||||
.agreement-row {
|
.agreement-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 16px;
|
margin: 10px 0 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-row :deep(.van-checkbox__label) {
|
.agreement-row :deep(.van-checkbox__label) {
|
||||||
@@ -378,72 +382,26 @@ async function handleLogin() {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 登录按钮 ========== */
|
.primary-button {
|
||||||
.login-button {
|
height: 42px;
|
||||||
margin-top: 6px;
|
|
||||||
height: 46px;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 800;
|
|
||||||
background: #1477ff !important;
|
|
||||||
border: none !important;
|
border: none !important;
|
||||||
box-shadow: 0 4px 12px rgba(20, 119, 255, 0.18);
|
border-radius: 8px !important;
|
||||||
|
background: #1477ff !important;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 注册入口按钮 ========== */
|
.secondary-entry {
|
||||||
.register-button {
|
display: block;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #d7dce3;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
color: #1477ff;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
text-align: center;
|
||||||
|
|
||||||
.register-entry {
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 响应式 ========== */
|
|
||||||
@media (max-height: 620px) {
|
|
||||||
.mobile-login-shell {
|
|
||||||
padding-top: 10px;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-card {
|
|
||||||
min-height: calc(100dvh - 20px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-top {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monster-logo {
|
|
||||||
width: 42px;
|
|
||||||
height: 42px;
|
|
||||||
border-radius: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-switch {
|
|
||||||
margin-bottom: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-card h1 {
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-field {
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-button {
|
|
||||||
height: 42px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 520px) {
|
|
||||||
.mobile-login-shell {
|
|
||||||
max-width: 430px;
|
|
||||||
margin: 0 auto;
|
|
||||||
box-shadow: 0 0 0 1px rgba(23, 35, 61, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from "vue";
|
import { computed, onMounted, ref } from "vue";
|
||||||
import { useRouter, useRoute } from "vue-router";
|
import { useRouter, useRoute } from "vue-router";
|
||||||
import { useSessionStore } from "@/stores/session";
|
import { useSessionStore } from "@/stores/session";
|
||||||
import { showDialog, showToast } from "vant";
|
import { showDialog, showToast } from "vant";
|
||||||
@@ -88,6 +88,13 @@ function isNavActive(path: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isLoggedIn = computed(() => Boolean(session.token));
|
const isLoggedIn = computed(() => Boolean(session.token));
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (!isLoggedIn.value) {
|
||||||
|
router.replace({ path: "/m/login", query: { redirect: route.fullPath } });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const displayName = computed(() =>
|
const displayName = computed(() =>
|
||||||
session.phone
|
session.phone
|
||||||
? `用户${session.phone.slice(-6)}`
|
? `用户${session.phone.slice(-6)}`
|
||||||
@@ -99,39 +106,12 @@ const maskedPhone = computed(() =>
|
|||||||
? `${session.phone.slice(0, 3)}****${session.phone.slice(-4)}`
|
? `${session.phone.slice(0, 3)}****${session.phone.slice(-4)}`
|
||||||
: "登录后查看手机号"
|
: "登录后查看手机号"
|
||||||
);
|
);
|
||||||
|
|
||||||
function goToLogin() {
|
|
||||||
router.push("/m/login");
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="mobile-profile-shell">
|
<main class="mobile-profile-shell">
|
||||||
<!-- 未登录区 - 自定义卡片布局 -->
|
|
||||||
<template v-if="!isLoggedIn">
|
|
||||||
<section class="guest-card">
|
|
||||||
<div class="guest-logo">锤</div>
|
|
||||||
<h1>登录大锤商行</h1>
|
|
||||||
<p>登录后查看订单、管理发布、提现余额,并享受平台担保交易服务。</p>
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
block
|
|
||||||
round
|
|
||||||
class="guest-login-btn"
|
|
||||||
@click="goToLogin"
|
|
||||||
>
|
|
||||||
立即登录
|
|
||||||
</van-button>
|
|
||||||
<div class="guest-benefits">
|
|
||||||
<van-tag type="primary" plain size="medium" round>担保交易</van-tag>
|
|
||||||
<van-tag type="primary" plain size="medium" round>订单留痕</van-tag>
|
|
||||||
<van-tag type="primary" plain size="medium" round>安全交接</van-tag>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<!-- 已登录区 -->
|
<!-- 已登录区 -->
|
||||||
<template v-else>
|
<template v-if="isLoggedIn">
|
||||||
<!-- Hero 顶部蓝色横幅 -->
|
<!-- Hero 顶部蓝色横幅 -->
|
||||||
<section class="profile-hero">
|
<section class="profile-hero">
|
||||||
<div class="hero-bg"></div>
|
<div class="hero-bg"></div>
|
||||||
@@ -267,64 +247,6 @@ function goToLogin() {
|
|||||||
padding: 0 0 60px;
|
padding: 0 0 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 未登录区 - 自定义卡片 ========== */
|
|
||||||
.guest-card {
|
|
||||||
text-align: center;
|
|
||||||
padding: 34px 26px;
|
|
||||||
margin: 12px;
|
|
||||||
border-radius: 16px;
|
|
||||||
background: #fff;
|
|
||||||
box-shadow: 0 8px 26px rgba(24, 30, 45, 0.06);
|
|
||||||
}
|
|
||||||
|
|
||||||
.guest-card h1 {
|
|
||||||
margin: 18px 0 0;
|
|
||||||
font-size: 22px;
|
|
||||||
font-weight: 900;
|
|
||||||
color: #1a202c;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guest-card p {
|
|
||||||
margin: 10px 0 0;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #667386;
|
|
||||||
line-height: 1.7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guest-logo {
|
|
||||||
display: grid;
|
|
||||||
width: 74px;
|
|
||||||
height: 74px;
|
|
||||||
margin: 0 auto;
|
|
||||||
place-items: center;
|
|
||||||
border-radius: 22px;
|
|
||||||
background: #1477ff;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30px;
|
|
||||||
font-weight: 900;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guest-login-btn {
|
|
||||||
margin-top: 20px;
|
|
||||||
border-radius: 13px;
|
|
||||||
background: #1477ff;
|
|
||||||
border-color: transparent;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 900;
|
|
||||||
height: 48px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guest-benefits {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 8px;
|
|
||||||
margin-top: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.guest-benefits :deep(.van-tag) {
|
|
||||||
font-weight: 800;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== 已登录区 - Hero蓝色横幅 ========== */
|
/* ========== 已登录区 - Hero蓝色横幅 ========== */
|
||||||
.profile-hero {
|
.profile-hero {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onUnmounted, reactive, ref } from "vue";
|
import { onUnmounted, reactive, ref } from "vue";
|
||||||
import { RouterLink, useRouter } from "vue-router";
|
import { RouterLink, useRoute, useRouter } from "vue-router";
|
||||||
import { showToast } from "vant";
|
import { showToast } from "vant";
|
||||||
|
|
||||||
import { sendSmsCode } from "@/api/auth";
|
import { sendSmsCode } from "@/api/auth";
|
||||||
import { useSessionStore } from "@/stores/session";
|
import { useSessionStore } from "@/stores/session";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
const session = useSessionStore();
|
const session = useSessionStore();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const sending = ref(false);
|
const sending = ref(false);
|
||||||
@@ -85,7 +86,8 @@ async function handleRegister() {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
await session.login(form.phone, form.code);
|
await session.login(form.phone, form.code);
|
||||||
await router.push("/m/profile");
|
const redirect = typeof route.query.redirect === "string" ? route.query.redirect : "/m/profile";
|
||||||
|
await router.replace(redirect);
|
||||||
} catch {
|
} catch {
|
||||||
showToast({ message: "注册失败,请检查手机号和验证码", icon: "cross" });
|
showToast({ message: "注册失败,请检查手机号和验证码", icon: "cross" });
|
||||||
} finally {
|
} finally {
|
||||||
@@ -96,275 +98,288 @@ async function handleRegister() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<main class="mobile-register-shell">
|
<main class="mobile-register-shell">
|
||||||
<section class="register-card">
|
<header class="page-header">
|
||||||
<!-- 品牌区域 -->
|
<button class="back-btn" type="button" @click="router.back()">
|
||||||
<div class="register-top">
|
<van-icon name="arrow-left" :size="20" />
|
||||||
<div class="monster-logo">锤</div>
|
</button>
|
||||||
|
<h1>注册</h1>
|
||||||
|
<span class="header-spacer"></span>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<section class="auth-body">
|
||||||
|
<div class="brand-row">
|
||||||
|
<div class="brand-logo">锤</div>
|
||||||
<div>
|
<div>
|
||||||
<p>加入大锤商行</p>
|
<strong>加入大锤商行</strong>
|
||||||
<small>注册后即可租号、下单、发布账号</small>
|
<p>注册后即可租号、下单、发布账号</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 登录/注册 Tab 切换 -->
|
|
||||||
<div class="auth-switch" aria-label="登录注册切换">
|
<div class="auth-switch" aria-label="登录注册切换">
|
||||||
<RouterLink to="/m/login">登录</RouterLink>
|
<RouterLink to="/m/login">登录</RouterLink>
|
||||||
<RouterLink to="/m/register" class="active">注册</RouterLink>
|
<RouterLink to="/m/register" class="active">注册</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="register-eyebrow">CREATE ACCOUNT</p>
|
<div class="form-section">
|
||||||
<h1>手机号注册</h1>
|
<div class="section-heading">
|
||||||
<p class="register-subtitle">
|
<h2>手机号注册</h2>
|
||||||
先用短信验证码创建账号,后续再补充实名和收款信息。
|
<p>先用短信验证码创建账号,后续再补充实名和收款信息。</p>
|
||||||
</p>
|
</div>
|
||||||
|
|
||||||
<!-- 手机号输入 -->
|
<label class="auth-input-row">
|
||||||
<van-field
|
<span class="input-label">手机号</span>
|
||||||
v-model="form.phone"
|
|
||||||
type="tel"
|
|
||||||
maxlength="11"
|
|
||||||
inputmode="tel"
|
|
||||||
placeholder="请输入手机号"
|
|
||||||
clearable
|
|
||||||
class="register-field"
|
|
||||||
>
|
|
||||||
<template #left-icon>
|
|
||||||
<span class="field-prefix">+86</span>
|
<span class="field-prefix">+86</span>
|
||||||
</template>
|
<input
|
||||||
</van-field>
|
v-model="form.phone"
|
||||||
|
type="tel"
|
||||||
|
maxlength="11"
|
||||||
|
inputmode="tel"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
|
||||||
<!-- 验证码输入 -->
|
<label class="auth-input-row code-row">
|
||||||
<van-field
|
<span class="input-label">验证码</span>
|
||||||
v-model="form.code"
|
<input
|
||||||
type="digit"
|
v-model="form.code"
|
||||||
maxlength="6"
|
type="text"
|
||||||
placeholder="6 位验证码"
|
inputmode="numeric"
|
||||||
class="register-field"
|
maxlength="6"
|
||||||
:left-icon="'shield-o'"
|
placeholder="6 位验证码"
|
||||||
>
|
/>
|
||||||
<template #button>
|
<span class="code-action">
|
||||||
<van-button
|
<van-button
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
round
|
:disabled="sending || countDown > 0"
|
||||||
:disabled="sending || countDown > 0"
|
:loading="sending"
|
||||||
:loading="sending"
|
class="code-btn"
|
||||||
@click="handleSendCode"
|
@click="handleSendCode"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
countDown > 0
|
countDown > 0
|
||||||
? `${countDown}s`
|
? `${countDown}s`
|
||||||
: sending
|
: sending
|
||||||
? "发送中"
|
? "发送中"
|
||||||
: "发送验证码"
|
: "发送验证码"
|
||||||
}}
|
}}
|
||||||
</van-button>
|
</van-button>
|
||||||
</template>
|
</span>
|
||||||
</van-field>
|
</label>
|
||||||
|
|
||||||
<!-- 邀请码输入 -->
|
<label class="auth-input-row">
|
||||||
<van-field
|
<span class="input-label">邀请码</span>
|
||||||
v-model="form.inviteCode"
|
<input
|
||||||
maxlength="16"
|
v-model="form.inviteCode"
|
||||||
placeholder="选填,有邀请码填入"
|
maxlength="16"
|
||||||
clearable
|
placeholder="选填,有邀请码填入"
|
||||||
class="register-field"
|
/>
|
||||||
:left-icon="'friends-o'"
|
</label>
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 用户协议 -->
|
<div class="agreement-row">
|
||||||
<div class="agreement-row">
|
<van-checkbox v-model="agreed" shape="square" icon-size="16px">
|
||||||
<van-checkbox v-model="agreed" shape="square" icon-size="16px">
|
我已阅读并同意《<b>用户协议</b>》和《<b>隐私政策</b>》
|
||||||
我已阅读并同意《<b>用户协议</b>》和《<b>隐私政策</b>》
|
</van-checkbox>
|
||||||
</van-checkbox>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 注册按钮 -->
|
|
||||||
<van-button
|
|
||||||
type="primary"
|
|
||||||
block
|
|
||||||
round
|
|
||||||
class="register-button"
|
|
||||||
:loading="loading"
|
|
||||||
loading-text="注册中..."
|
|
||||||
@click="handleRegister"
|
|
||||||
>
|
|
||||||
注册并登录
|
|
||||||
</van-button>
|
|
||||||
|
|
||||||
<!-- 底部登录入口 -->
|
|
||||||
<RouterLink
|
|
||||||
to="/m/login"
|
|
||||||
class="login-entry"
|
|
||||||
custom
|
|
||||||
v-slot="{ navigate }"
|
|
||||||
>
|
|
||||||
<van-button
|
<van-button
|
||||||
plain
|
|
||||||
type="primary"
|
type="primary"
|
||||||
block
|
block
|
||||||
round
|
class="primary-button"
|
||||||
size="small"
|
:loading="loading"
|
||||||
class="login-link-button"
|
loading-text="注册中..."
|
||||||
@click="navigate"
|
@click="handleRegister"
|
||||||
>
|
>
|
||||||
已有账号?去登录
|
注册并登录
|
||||||
</van-button>
|
</van-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<RouterLink to="/m/login" class="secondary-entry">
|
||||||
|
已有账号?去登录
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* ========== Vant 主题变量覆盖 ========== */
|
|
||||||
:root {
|
|
||||||
--van-primary-color: #5b6ee1;
|
|
||||||
--van-button-primary-background: #5b6ee1;
|
|
||||||
--van-button-primary-border-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== 页面容器 ========== */
|
|
||||||
.mobile-register-shell {
|
.mobile-register-shell {
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
box-sizing: border-box;
|
background: #f4f6f8;
|
||||||
overflow: hidden;
|
|
||||||
background: #f5f6f8;
|
|
||||||
color: #151c28;
|
color: #151c28;
|
||||||
padding: 40px 24px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-card {
|
.page-header {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 10;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: calc(100dvh - 80px);
|
align-items: center;
|
||||||
flex-direction: column;
|
height: 48px;
|
||||||
justify-content: center;
|
padding: 0 12px;
|
||||||
|
background: #fff;
|
||||||
|
border-bottom: 1px solid #eceff3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 品牌区域 ========== */
|
.page-header h1 {
|
||||||
.register-top {
|
flex: 1;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 17px;
|
||||||
|
font-weight: 700;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: grid;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
place-items: center;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
color: #25282d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-spacer {
|
||||||
|
width: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-body {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
margin-bottom: 14px;
|
padding: 8px 2px 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.monster-logo {
|
.brand-logo {
|
||||||
display: grid;
|
display: grid;
|
||||||
width: 48px;
|
width: 42px;
|
||||||
height: 48px;
|
height: 42px;
|
||||||
flex: 0 0 auto;
|
|
||||||
place-items: center;
|
place-items: center;
|
||||||
border-radius: 16px;
|
border-radius: 12px;
|
||||||
background: #5b6ee1;
|
background: #1477ff;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 21px;
|
font-size: 18px;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
box-shadow: 0 4px 12px rgba(91, 110, 225, 0.18);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-top p {
|
.brand-row strong {
|
||||||
|
display: block;
|
||||||
margin: 0 0 2px;
|
margin: 0 0 2px;
|
||||||
font-size: 20px;
|
color: #171a1f;
|
||||||
|
font-size: 18px;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-top small,
|
.brand-row p {
|
||||||
.register-subtitle {
|
margin: 0;
|
||||||
color: #667386;
|
color: #6b7280;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== Tab 切换 ========== */
|
|
||||||
.auth-switch {
|
.auth-switch {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 6px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 12px;
|
||||||
border-radius: 15px;
|
padding: 4px;
|
||||||
background: #eef4fb;
|
border-radius: 8px;
|
||||||
padding: 5px;
|
background: #eaf0f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-switch a {
|
.auth-switch a {
|
||||||
border-radius: 11px;
|
padding: 9px 0;
|
||||||
color: #667386;
|
border-radius: 7px;
|
||||||
padding: 10px 0;
|
color: #5f6875;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14px;
|
font-size: 13px;
|
||||||
font-weight: 900;
|
font-weight: 800;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.auth-switch a.active {
|
.auth-switch a.active {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
color: #111827;
|
color: #1477ff;
|
||||||
box-shadow: 0 8px 18px rgba(23, 35, 61, 0.08);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 标题区 ========== */
|
.form-section {
|
||||||
.register-eyebrow {
|
padding: 14px;
|
||||||
margin: 0 0 5px;
|
background: #fff;
|
||||||
color: #02846e;
|
border: 1px solid #edf0f4;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
font-size: 12px;
|
||||||
font-weight: 900;
|
line-height: 1.5;
|
||||||
letter-spacing: 0.04em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-card h1 {
|
.auth-input-row {
|
||||||
margin: 0;
|
display: grid;
|
||||||
font-size: 28px;
|
grid-template-columns: 58px 38px minmax(0, 1fr);
|
||||||
line-height: 1.15;
|
align-items: center;
|
||||||
|
min-height: 44px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
padding: 0 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #f8fafc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-subtitle {
|
.auth-input-row.code-row {
|
||||||
margin: 7px 0 14px;
|
grid-template-columns: 58px minmax(0, 1fr) 92px;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-label {
|
||||||
|
color: #30343a;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.45;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ========== Vant Field 覆盖样式 ========== */
|
|
||||||
.register-field {
|
|
||||||
margin-top: 12px;
|
|
||||||
border-radius: 12px;
|
|
||||||
background: rgba(255, 255, 255, 0.92);
|
|
||||||
box-shadow: inset 0 1px 3px rgba(23, 35, 61, 0.04);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-field :deep(.van-field__control) {
|
|
||||||
font-size: 15px;
|
|
||||||
color: #151c28;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-field :deep(.van-field__label) {
|
|
||||||
width: auto;
|
|
||||||
margin-right: 8px;
|
|
||||||
color: #333b48;
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
.register-field :deep(.van-field__left-icon) {
|
|
||||||
color: #1777ff;
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-field :deep(.van-field__right-icon) {
|
.auth-input-row input {
|
||||||
color: #999;
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
color: #20242a;
|
||||||
|
font-size: 14px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-input-row input::placeholder {
|
||||||
|
color: #c0c4cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.field-prefix {
|
.field-prefix {
|
||||||
color: #1777ff;
|
color: #1477ff;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
font-size: 14px;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 协议行 ========== */
|
.code-action {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-btn {
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.agreement-row {
|
.agreement-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 16px;
|
margin: 10px 0 14px;
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.agreement-row :deep(.van-checkbox__label) {
|
.agreement-row :deep(.van-checkbox__label) {
|
||||||
@@ -379,72 +394,26 @@ async function handleRegister() {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 注册按钮 ========== */
|
.primary-button {
|
||||||
.register-button {
|
height: 42px;
|
||||||
margin-top: 6px;
|
|
||||||
height: 46px;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 800;
|
|
||||||
background: #5b6ee1 !important;
|
|
||||||
border: none !important;
|
border: none !important;
|
||||||
box-shadow: 0 4px 12px rgba(91, 110, 225, 0.18);
|
border-radius: 8px !important;
|
||||||
|
background: #1477ff !important;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 登录入口按钮 ========== */
|
.secondary-entry {
|
||||||
.login-link-button {
|
display: block;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #d7dce3;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
color: #1477ff;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
text-align: center;
|
||||||
|
|
||||||
.login-entry {
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========== 响应式 ========== */
|
|
||||||
@media (max-height: 620px) {
|
|
||||||
.mobile-register-shell {
|
|
||||||
padding-top: 10px;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-card {
|
|
||||||
min-height: calc(100dvh - 20px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-top {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.monster-logo {
|
|
||||||
width: 42px;
|
|
||||||
height: 42px;
|
|
||||||
border-radius: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.auth-switch {
|
|
||||||
margin-bottom: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-card h1 {
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-field {
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.register-button {
|
|
||||||
height: 42px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 520px) {
|
|
||||||
.mobile-register-shell {
|
|
||||||
max-width: 430px;
|
|
||||||
margin: 0 auto;
|
|
||||||
box-shadow: 0 0 0 1px rgba(23, 35, 61, 0.08);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user