fix(frontend): 登录页改为纯 SVG 插画,并修正整页高度(去掉滚动条)

- 左侧插画改为 inline SVG 组件 LoginIllustration(货架/纸箱/摄像头/扫码枪/单据/数据流,
  虚线流动与光点呼吸动画,prefers-reduced-motion 时关闭),不再依赖任何 png/jpg
- 整页背景改为 CSS 径向渐变 + 网点纹理,删除 login-page-bg.jpg 依赖
- 微信登录按钮图标改为 inline SVG,删除 frontend/public/static/login 素材目录
- 修正滚动条:.login-page 用 box-sizing: border-box + height:100% 锁定一屏,
  卡片自身可内部滚动;新增矮屏(max-height:760px)紧凑规则;窄屏上下布局仍可滚动

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
liufumingren 2026-11-02 00:23:20 +08:00
parent d2fbd216e9
commit dc8f0dadf3
3 changed files with 309 additions and 111 deletions

View File

@ -1,13 +0,0 @@
登录页静态素材目录(设计交付件,放入即可自动生效,文件名不要改)
login-page-bg.jpg 1920×1080(可另出 2560×1440) JPG 品质 85 全局深蓝底图(含淡淡网点纹理),铺满整页背景
login-warehouse-illu.png 1100×820 PNG 透明 左侧主插画(货架、纸箱、摄像头、扫码枪、单据、数据流光点)
icon-camera.png 256×256 PNG 透明 摄像头图标(备用,系统菜单 / 大屏可复用)
icon-scanner.png 256×256 PNG 透明 扫码枪图标(备用)
icon-wechat-green.png 128×128 PNG 透明 微信登录按钮图标(只出图标,文字由页面渲染)
deco-line-dot.png 按需 PNG 透明 数据流光点连线(可选,一般用整图即可)
约定
- 表单、按钮、分割线、文字全部由代码实现,本目录只放插画 / 背景 / 图标
- 素材缺失不影响页面可用:背景退化为纯色 + CSS 网点,插画区退化为文案区,微信图标退化为内置 SVG
- 命名规范:小写 + 横杠分隔,不含中文

View File

@ -0,0 +1,227 @@
<script setup lang="ts">
/**
* 登录页左侧插画:纯 inline SVG 绘制(货架 + 纸箱 + 摄像头 + 扫码枪 + 单据 + 数据流),
* 不依赖任何图片素材,深浅色、缩放、暗色底都能自适应。
*/
</script>
<template>
<svg
class="login-illu"
viewBox="0 0 680 520"
role="img"
aria-label="仓储管理示意插画"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
<radialGradient id="lg-glow" cx="50%" cy="46%" r="54%">
<stop offset="0%" stop-color="#2f6bf6" stop-opacity=".40" />
<stop offset="100%" stop-color="#2f6bf6" stop-opacity="0" />
</radialGradient>
<linearGradient id="lg-post" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#4b83f0" />
<stop offset="100%" stop-color="#1d3f9e" />
</linearGradient>
<linearGradient id="lg-shelf" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#2b56b4" />
<stop offset="100%" stop-color="#3d76e0" />
</linearGradient>
<linearGradient id="lg-box" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#82b4ff" />
<stop offset="100%" stop-color="#3f6fd8" />
</linearGradient>
<linearGradient id="lg-doc" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#ffffff" stop-opacity=".94" />
<stop offset="100%" stop-color="#cfe3ff" stop-opacity=".62" />
</linearGradient>
<linearGradient id="lg-beam" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stop-color="#22d3ee" stop-opacity=".38" />
<stop offset="100%" stop-color="#22d3ee" stop-opacity="0" />
</linearGradient>
<linearGradient id="lg-floor" x1="0" y1="0" x2="1" y2="0">
<stop offset="0%" stop-color="#60a5fa" stop-opacity="0" />
<stop offset="50%" stop-color="#60a5fa" stop-opacity=".55" />
<stop offset="100%" stop-color="#60a5fa" stop-opacity="0" />
</linearGradient>
</defs>
<ellipse cx="330" cy="248" rx="300" ry="212" fill="url(#lg-glow)" />
<!-- 地面 -->
<ellipse cx="330" cy="452" rx="268" ry="26" fill="#081428" opacity=".85" />
<ellipse cx="330" cy="452" rx="268" ry="26" fill="none" stroke="url(#lg-floor)" />
<g stroke="rgba(96,165,250,.14)" stroke-width="1" stroke-linecap="round">
<path d="M150 484 H512" />
<path d="M206 502 H456" />
</g>
<!-- 货架 -->
<g>
<rect x="86" y="118" width="12" height="322" rx="6" fill="url(#lg-post)" />
<rect x="312" y="118" width="12" height="322" rx="6" fill="url(#lg-post)" />
<g fill="url(#lg-shelf)">
<rect x="76" y="176" width="258" height="10" rx="5" />
<rect x="76" y="282" width="258" height="10" rx="5" />
<rect x="76" y="388" width="258" height="10" rx="5" />
</g>
<g fill="rgba(147,197,253,.06)">
<rect x="86" y="186" width="238" height="96" />
<rect x="86" y="292" width="238" height="96" />
</g>
</g>
<!-- 纸箱:第一层 -->
<g>
<polygon points="100,132 110,122 174,122 164,132" fill="rgba(255,255,255,.28)" />
<rect x="100" y="132" width="64" height="44" rx="4" fill="url(#lg-box)" />
<rect x="108" y="150" width="48" height="6" rx="3" fill="rgba(11,26,51,.45)" />
<polygon points="176,140 184,132 236,132 228,140" fill="rgba(255,255,255,.24)" />
<rect x="176" y="140" width="52" height="36" rx="4" fill="url(#lg-box)" opacity=".9" />
<polygon points="238,128 248,118 308,118 298,128" fill="rgba(255,255,255,.28)" />
<rect x="238" y="128" width="60" height="48" rx="4" fill="url(#lg-box)" />
<rect x="246" y="146" width="44" height="6" rx="3" fill="rgba(11,26,51,.45)" />
</g>
<!-- 纸箱:第二层 -->
<g>
<polygon points="100,238 109,229 167,229 158,238" fill="rgba(255,255,255,.26)" />
<rect x="100" y="238" width="58" height="44" rx="4" fill="url(#lg-box)" />
<rect x="108" y="256" width="42" height="6" rx="3" fill="rgba(11,26,51,.45)" />
<polygon points="168,246 175,239 223,239 216,246" fill="rgba(255,255,255,.22)" />
<rect x="168" y="246" width="48" height="36" rx="4" fill="url(#lg-box)" opacity=".88" />
<polygon points="224,236 234,226 302,226 292,236" fill="rgba(255,255,255,.26)" />
<rect x="224" y="236" width="68" height="46" rx="4" fill="url(#lg-box)" />
<rect x="232" y="254" width="52" height="6" rx="3" fill="rgba(11,26,51,.45)" />
</g>
<!-- 纸箱:第三层 -->
<g>
<polygon points="100,344 108,336 160,336 152,344" fill="rgba(255,255,255,.24)" />
<rect x="100" y="344" width="52" height="44" rx="4" fill="url(#lg-box)" />
<polygon points="160,338 170,328 242,328 232,338" fill="rgba(255,255,255,.26)" />
<rect x="160" y="338" width="72" height="50" rx="4" fill="url(#lg-box)" />
<rect x="168" y="358" width="56" height="6" rx="3" fill="rgba(11,26,51,.45)" />
<rect x="168" y="370" width="32" height="5" rx="2.5" fill="rgba(11,26,51,.3)" />
</g>
<!-- 右下角纸箱堆 -->
<g>
<polygon points="392,382 402,372 468,372 458,382" fill="rgba(255,255,255,.24)" />
<rect x="392" y="382" width="66" height="48" rx="4" fill="url(#lg-box)" opacity=".92" />
<polygon points="406,330 415,321 463,321 454,330" fill="rgba(255,255,255,.24)" />
<rect x="406" y="330" width="48" height="42" rx="4" fill="url(#lg-box)" opacity=".8" />
</g>
<!-- 摄像头(含悬挂支架与光锥) -->
<g>
<rect x="470" y="88" width="88" height="10" rx="5" fill="url(#lg-shelf)" />
<rect x="510" y="88" width="10" height="26" rx="4" fill="#3d76e0" />
<path class="lg-pulse" d="M486 146 L332 448 L618 448 Z" fill="url(#lg-beam)" />
<rect x="470" y="112" width="74" height="44" rx="10" fill="#1e40af" stroke="rgba(147,197,253,.45)" />
<circle cx="489" cy="134" r="12" fill="#0b1a33" stroke="#22d3ee" stroke-width="2" />
<circle class="lg-pulse" cx="489" cy="134" r="5" fill="#22d3ee" />
<rect x="512" y="124" width="20" height="6" rx="3" fill="rgba(255,255,255,.35)" />
<rect x="512" y="136" width="12" height="6" rx="3" fill="rgba(255,255,255,.2)" />
</g>
<!-- 单据 -->
<g transform="rotate(-8 556 296)">
<rect x="500" y="232" width="112" height="130" rx="8" fill="url(#lg-doc)" />
<g fill="rgba(11,26,51,.35)">
<rect x="516" y="250" width="58" height="7" rx="3.5" />
<rect x="516" y="268" width="80" height="5" rx="2.5" />
<rect x="516" y="282" width="66" height="5" rx="2.5" />
<rect x="516" y="296" width="74" height="5" rx="2.5" />
</g>
<g fill="rgba(11,26,51,.6)">
<rect x="516" y="322" width="4" height="22" />
<rect x="524" y="322" width="2" height="22" />
<rect x="530" y="322" width="6" height="22" />
<rect x="540" y="322" width="2" height="22" />
<rect x="546" y="322" width="4" height="22" />
<rect x="554" y="322" width="2" height="22" />
<rect x="560" y="322" width="6" height="22" />
<rect x="570" y="322" width="3" height="22" />
<rect x="577" y="322" width="5" height="22" />
</g>
<circle cx="592" cy="250" r="12" fill="none" stroke="#2563eb" stroke-width="2" opacity=".55" />
<path d="M586 250 L591 255 L599 245" fill="none" stroke="#2563eb" stroke-width="2" opacity=".7" stroke-linecap="round" stroke-linejoin="round" />
</g>
<!-- 扫码枪 -->
<g transform="rotate(-16 170 410)">
<rect x="128" y="396" width="74" height="30" rx="9" fill="#1c3f92" stroke="rgba(147,197,253,.45)" />
<rect x="142" y="405" width="26" height="6" rx="3" fill="#22d3ee" />
<rect x="200" y="402" width="30" height="18" rx="5" fill="#3d76e0" />
<rect x="150" y="426" width="26" height="30" rx="8" fill="#17367e" stroke="rgba(147,197,253,.35)" />
</g>
<!-- 数据流 -->
<g fill="none" stroke="#38bdf8" stroke-width="1.8" stroke-linecap="round" opacity=".8">
<path class="lg-flow" d="M362 152 C 420 158, 436 190, 468 200" />
<path class="lg-flow" d="M362 268 C 424 262, 438 296, 498 300" />
<path class="lg-flow" d="M362 384 C 430 386, 452 348, 496 330" />
<path class="lg-flow" d="M232 396 C 268 372, 292 352, 330 338" />
</g>
<g fill="#67e8f9">
<circle class="lg-dot" cx="362" cy="152" r="4" />
<circle class="lg-dot" cx="362" cy="268" r="4" />
<circle class="lg-dot" cx="362" cy="384" r="4" />
<circle class="lg-dot" cx="232" cy="396" r="3.5" />
<circle class="lg-pulse" cx="489" cy="134" r="16" fill="none" stroke="#22d3ee" stroke-width="1.5" opacity=".5" />
</g>
</svg>
</template>
<style scoped>
.login-illu {
display: block;
width: 100%;
height: auto;
max-width: 660px;
filter: drop-shadow(0 24px 48px rgba(2, 8, 23, 0.5));
}
/* 数据流虚线滚动 + 光点呼吸,纯装饰,不参与交互 */
.lg-flow {
stroke-dasharray: 5 9;
animation: lg-flow-move 3.4s linear infinite;
}
.lg-dot {
animation: lg-dot-pulse 2.6s ease-in-out infinite;
}
.lg-pulse {
animation: lg-dot-pulse 3.2s ease-in-out infinite;
}
@keyframes lg-flow-move {
to {
stroke-dashoffset: -56;
}
}
@keyframes lg-dot-pulse {
0%,
100% {
opacity: 0.35;
}
50% {
opacity: 1;
}
}
@media (prefers-reduced-motion: reduce) {
.lg-flow,
.lg-dot,
.lg-pulse {
animation: none;
}
}
</style>

View File

@ -5,6 +5,7 @@ import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import { User, Lock, Message, Loading } from '@element-plus/icons-vue'
import { useAuthStore } from '@/store/auth'
import QrCode from '@/components/QrCode.vue'
import LoginIllustration from '@/components/LoginIllustration.vue'
import {
createWechatLoginCode,
getWechatEnabled,
@ -20,17 +21,6 @@ const router = useRouter()
const loginTab = ref<'account' | 'email'>('account')
const loading = ref(false)
/**
* 静态素材缺失时的降级开关
* 设计素材放在 frontend/public/static/login/,加载失败就退化为纯 CSS 视觉,避免页面破图。
* 素材地址用动态绑定:避免 Vite 构建期强制解析(素材还没到位时也能正常打包)。
*/
const ASSET_BASE = '/static/login'
const illuSrc = `${ASSET_BASE}/login-warehouse-illu.png`
const wechatIconSrc = `${ASSET_BASE}/icon-wechat-green.png`
const illuFailed = ref(false)
const wechatIconFailed = ref(false)
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
/** 微信扫码轮询间隔(毫秒) */
@ -431,25 +421,10 @@ onUnmounted(() => {
<template>
<div class="login-page">
<span class="login-page__texture" aria-hidden="true" />
<div class="login-shell">
<!-- 左侧视觉区:只放设计给的透明插画;素材缺失时退化为纯 CSS 文案,不留破图 -->
<!-- 左侧视觉区:纯 inline SVG 插画,不依赖任何图片素材 -->
<section class="login-visual">
<img
v-if="!illuFailed"
class="login-visual__illu"
:src="illuSrc"
alt=""
@error="illuFailed = true"
/>
<div v-else class="login-visual__fallback">
<p class="login-visual__eyebrow">TIANBAO OMS</p>
<h1 class="login-visual__headline">仓储 · 订单 · 库存<br />一体化管理</h1>
<p class="login-visual__desc">
订单拆分子单、库存实时同步、外部仓库对接<br />一个后台全部搞定
</p>
</div>
<LoginIllustration class="login-visual__illu" />
</section>
<!-- 右侧表单区:输入框 / 按钮 / 分割线 / 微信登录全部代码实现,不使用切图 -->
@ -517,23 +492,21 @@ onUnmounted(() => {
<div class="login-divider"><span>其他登录方式</span></div>
<button type="button" class="wechat-btn" @click="openWechatLogin">
<img
v-if="!wechatIconFailed"
<svg
class="wechat-btn__icon"
:src="wechatIconSrc"
alt=""
@error="wechatIconFailed = true"
/>
<span v-else class="wechat-btn__icon" aria-hidden="true">
<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor">
<path
d="M9.6 3C6 3 3 5.5 3 8.5c0 1.6.9 3.1 2.3 4.1L4.7 14.5l2.3-1.2c.8.2 1.7.3 2.6.3h.4a5.7 5.7 0 0 1-.2-1.4c0-3.1 2.9-5.6 6.5-5.6h.3C15.9 4.5 13 3 9.6 3Z"
/>
<path
d="M21 12.4c0-2.5-2.4-4.5-5.4-4.5s-5.4 2-5.4 4.5 2.4 4.5 5.4 4.5c.7 0 1.4-.1 2-.3l1.8.9-.5-1.5c1.3-.8 2.1-2.1 2.1-3.6Z"
/>
</svg>
</span>
viewBox="0 0 24 24"
width="20"
height="20"
fill="currentColor"
aria-hidden="true"
>
<path
d="M9.6 3C6 3 3 5.5 3 8.5c0 1.6.9 3.1 2.3 4.1L4.7 14.5l2.3-1.2c.8.2 1.7.3 2.6.3h.4a5.7 5.7 0 0 1-.2-1.4c0-3.1 2.9-5.6 6.5-5.6h.3C15.9 4.5 13 3 9.6 3Z"
/>
<path
d="M21 12.4c0-2.5-2.4-4.5-5.4-4.5s-5.4 2-5.4 4.5 2.4 4.5 5.4 4.5c.7 0 1.4-.1 2-.3l1.8.9-.5-1.5c1.3-.8 2.1-2.1 2.1-3.6Z"
/>
</svg>
微信登录
</button>
@ -672,42 +645,48 @@ onUnmounted(() => {
</template>
<style scoped>
/* 深蓝底图:素材为 /static/login/login-page-bg.jpg,缺失时由背景色 + 网点纹理兜底 */
/* 整页深蓝底:纯 CSS 渐变 + 网点纹理,零图片依赖;高度锁死在一屏内,不出现页面滚动条 */
.login-page {
box-sizing: border-box;
position: relative;
min-height: 100vh;
width: 100%;
height: 100%;
padding: 24px 40px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
padding: 48px 40px;
overflow: hidden;
background-color: #0a1730;
background-image: url('/static/login/login-page-bg.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-color: #071224;
background-image:
radial-gradient(900px 520px at 18% 12%, rgba(37, 99, 235, 0.3), transparent 62%),
radial-gradient(760px 460px at 88% 86%, rgba(14, 165, 233, 0.2), transparent 66%),
linear-gradient(160deg, #0a1a33 0%, #071427 52%, #050f1e 100%);
}
.login-page__texture {
/* 网点纹理:叠加层,不拦截鼠标 */
.login-page::before {
content: '';
position: absolute;
inset: 0;
pointer-events: none;
background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
background-image: radial-gradient(rgba(148, 197, 255, 0.16) 1px, transparent 1px);
background-size: 22px 22px;
opacity: 0.55;
-webkit-mask-image: radial-gradient(78% 72% at 50% 45%, #000 42%, transparent 100%);
mask-image: radial-gradient(78% 72% at 50% 45%, #000 42%, transparent 100%);
}
.login-shell {
position: relative;
z-index: 1;
width: min(1180px, 100%);
max-height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 48px;
}
/* 左侧插画 */
/* 左侧插画(inline SVG,按宽度等比缩放,不会把页面撑高) */
.login-visual {
flex: 1 1 auto;
min-width: 0;
@ -718,46 +697,22 @@ onUnmounted(() => {
.login-visual__illu {
width: 100%;
max-width: 660px;
height: auto;
opacity: 0.96;
filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}
.login-visual__fallback {
color: #e8f0ff;
}
.login-visual__eyebrow {
margin: 0 0 12px;
font-size: 13px;
letter-spacing: 3px;
color: #4d8df6;
}
.login-visual__headline {
margin: 0 0 16px;
font-size: 40px;
line-height: 1.35;
font-weight: 700;
}
.login-visual__desc {
margin: 0;
font-size: 15px;
line-height: 1.9;
color: rgba(232, 240, 255, 0.65);
max-width: 620px;
}
/* 右侧白色表单卡片 */
.login-panel {
flex: 0 0 400px;
display: flex;
max-height: 100%;
}
.login-card {
width: 100%;
border: none;
border-radius: 16px;
box-shadow: 0 30px 70px rgba(3, 12, 30, 0.55);
overflow: auto;
}
.login-card :deep(.el-card__body) {
@ -901,15 +856,47 @@ onUnmounted(() => {
}
/* 窄屏 / 移动端:上下布局,插画在上、表单卡片在下 */
/* 矮屏(笔记本 1366×768 / 系统缩放后):整体再收一收,保证一屏放得下、不出滚动条 */
@media (max-height: 760px) and (min-width: 961px) {
.login-page {
padding: 16px 32px;
}
.login-visual__illu {
max-width: 460px;
}
.login-brand {
margin-bottom: 12px;
}
.login-card :deep(.el-card__body) {
padding: 22px 26px 18px;
}
.login-divider {
margin: 14px 0 10px;
}
.link-row {
margin-top: 12px;
}
}
/* 窄屏 / 移动端:上下布局,插画在上、表单卡片在下;此时允许页面纵向滚动 */
@media (max-width: 960px) {
.login-page {
align-items: flex-start;
padding: 28px 18px;
height: auto;
min-height: 100%;
overflow: visible;
padding: 24px 18px 32px;
}
.login-shell {
flex-direction: column;
gap: 24px;
gap: 20px;
max-height: none;
}
.login-visual {
@ -918,15 +905,7 @@ onUnmounted(() => {
}
.login-visual__illu {
max-width: 420px;
}
.login-visual__fallback {
text-align: center;
}
.login-visual__headline {
font-size: 26px;
max-width: 360px;
}
.login-panel {
@ -934,12 +913,17 @@ onUnmounted(() => {
flex: 0 0 auto;
width: 100%;
max-width: 400px;
max-height: none;
}
.login-card {
overflow: visible;
}
}
@media (max-width: 480px) {
.login-visual__illu {
max-width: 300px;
max-width: 280px;
}
.login-card :deep(.el-card__body) {