fix(welcome): 欢迎页深色模式适配

将深色模式样式从 scoped 移到非 scoped style 块,使用 html.dark 选择器,
与 Vben 框架的 dark class 机制保持一致
This commit is contained in:
小蟑螂
2026-04-22 16:26:20 +08:00
parent 368e727cc9
commit e615130e7d
@@ -1,15 +1,547 @@
<script setup lang="ts">
import { Page } from '@vben/common-ui';
import { useRouter } from 'vue-router';
import { Flex } from 'ant-design-vue';
import { Page } from '@vben/common-ui';
import { createIconifyIcon } from '@vben/icons';
defineOptions({ name: 'WelcomePage' });
const router = useRouter();
const CheckIcon = createIconifyIcon('lucide:check');
const ShopIcon = createIconifyIcon('solar:shop-2-linear');
const DocumentSyncIcon = createIconifyIcon('fluent:document-sync-24-regular');
const FlowIcon = createIconifyIcon('carbon:flow-stream');
const RocketIcon = createIconifyIcon('solar:rocket-2-linear');
const LoadingIcon = createIconifyIcon('line-md:loading-twotone-loop');
const ChartIcon = createIconifyIcon('solar:chart-2-linear');
const DownloadIcon = createIconifyIcon('solar:file-download-linear');
const goOverview = () => {
router.push('/company-overview');
};
const goImportTask = () => {
router.push('/import');
};
</script>
<template>
<Page :auto-content-height="true">
<Flex align="center" justify="center" class="h-full">
<img src="/cd-logo.png" alt="Logo" style="max-width: 200px; height: auto;" />
</Flex>
<Page
:auto-content-height="true"
class="welcome-page"
>
<div class="bg-blur blur-top"></div>
<div class="bg-blur blur-bottom"></div>
<div class="welcome-container">
<div class="content-left">
<h1>电商经营数据中台</h1>
<div class="subtitle">多平台订单集成与经营分析一体化平台</div>
<div class="feature-item">
<div class="icon-box">
<CheckIcon />
</div>
<div>
<b>多平台智能集成:</b>
<p>
统一接入多平台订单数据,集中完成采集、清洗与标准化,打破平台间数据孤岛。
</p>
</div>
</div>
<div class="feature-item">
<div class="icon-box">
<CheckIcon />
</div>
<div>
<b>高度自定义映射:</b>
<p>
通过字段映射和订单状态映射,快速对齐企业既有业务口径与订单生命周期管理规则。
</p>
</div>
</div>
<div class="feature-item">
<div class="icon-box">
<CheckIcon />
</div>
<div>
<b>高效数据洞察:</b>
<p>
从订单到利润的全链路分析,沉淀店铺经营看板、目标达成与报表导出能力。
</p>
</div>
</div>
<div class="btn-group">
<button class="btn-primary" @click="goOverview">全店概览</button>
<button class="btn-secondary" type="button" @click="goImportTask">
导入订单
</button>
</div>
</div>
<div class="flowchart-right">
<div class="group-label g-1"><b>接入配置</b><span>店铺与规则</span></div>
<div class="group-label g-2"><b>任务执行</b><span>自动化处理</span></div>
<div class="group-label g-3"><b>经营分析</b><span>指标应用</span></div>
<div class="card pos-1">
<div class="step-tag">Step 1</div>
<ShopIcon class="card-icon text-blue" />
<h4>选择店铺</h4>
<p>多平台API授权</p>
</div>
<div class="card pos-2">
<div class="step-tag">Step 2</div>
<DocumentSyncIcon class="card-icon text-purple" />
<h4>映射字段</h4>
<p>自定义表头对应</p>
</div>
<div class="card pos-3">
<div class="step-tag">Step 3</div>
<FlowIcon class="card-icon text-purple" />
<h4>映射状态</h4>
<p>统一订单生命周期</p>
</div>
<div class="card pos-4">
<div class="step-tag">Step 4</div>
<RocketIcon class="card-icon text-orange" />
<h4>创建导入任务</h4>
<p>设置同步频率</p>
</div>
<div class="card pos-5 processing-card">
<LoadingIcon class="card-icon text-blue" />
<h4>系统处理中</h4>
<p>数据清洗与校验</p>
</div>
<div class="card pos-6">
<ChartIcon class="card-icon text-green" />
<h4>数据面板</h4>
<p>可视化实时概览</p>
</div>
<div class="card pos-7">
<DownloadIcon class="card-icon text-green" />
<h4>导出报表</h4>
<p>支持Excel/PDF</p>
</div>
<div class="line active" style="width: 55px; top: 95px; left: 205px"></div>
<div class="line active" style="width: 55px; top: 95px; left: 405px"></div>
<div
class="line"
style="width: 200px; height: 100px; top: 120px; left: 335px; border-width: 0 1px 1px 0; border-radius: 0 0 15px 0"
></div>
<div class="badge" style="top: 175px; left: 470px">配置完成</div>
<div class="line active" style="width: 55px; top: 275px; left: 405px"></div>
<div
class="line"
style="height: 60px; top: 320px; left: 532px; border-width: 0 1px 0 0"
></div>
<div
class="line"
style="width: 300px; top: 380px; left: 232px; border-width: 1px 0 0 0"
></div>
<div
class="line"
style="height: 60px; top: 380px; left: 232px; border-width: 0 0 0 1px"
></div>
<div
class="line"
style="height: 60px; top: 380px; left: 432px; border-width: 0 0 0 1px"
></div>
<div class="badge" style="top: 370px; left: 325px">导入成功</div>
</div>
</div>
</Page>
</template>
<style scoped>
.welcome-page {
--primary-blue: #3b82f6;
--accent-green: #22c55e;
--accent-orange: #f59e0b;
--accent-purple: #8b5cf6;
--line-color: #cbd5e1;
--text-dark: #0f172a;
--text-gray: #64748b;
--surface: rgb(255 255 255 / 88%);
--surface-strong: #ffffff;
--surface-muted: #f8fafc;
--border-color: #e2e8f0;
--badge-bg: #eff6ff;
--badge-border: #dbeafe;
min-height: 100%;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(
145deg,
#f8fafc 0%,
#f1f5f9 40%,
#eef2ff 100%
);
}
.welcome-container {
width: min(1250px, 100%);
margin: 0 auto;
padding: 40px;
display: flex;
justify-content: center;
gap: 56px;
align-items: center;
position: relative;
z-index: 2;
}
.bg-blur {
position: absolute;
width: 300px;
height: 300px;
background: rgb(59 130 246 / 10%);
filter: blur(80px);
border-radius: 9999px;
z-index: 0;
}
.blur-top {
top: 10%;
right: 10%;
}
.blur-bottom {
bottom: 10%;
left: 5%;
}
.content-left {
width: 430px;
flex-shrink: 0;
}
.content-left h1 {
margin-bottom: 12px;
color: var(--text-dark);
font-size: 36px;
letter-spacing: -1px;
}
.subtitle {
margin-bottom: 45px;
color: rgb(59 130 246 / 90%);
font-size: 22px;
font-weight: 600;
}
.feature-item {
display: flex;
margin-bottom: 28px;
}
.icon-box {
width: 24px;
height: 24px;
margin-top: 3px;
margin-right: 15px;
border-radius: 9999px;
background: color-mix(in srgb, var(--primary-blue) 14%, #fff);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
color: var(--primary-blue);
font-size: 14px;
}
.feature-item b {
display: block;
margin-bottom: 5px;
color: var(--text-dark);
font-size: 17px;
}
.feature-item p {
color: var(--text-gray);
font-size: 14px;
line-height: 1.6;
}
.btn-group {
display: flex;
gap: 15px;
margin-top: 30px;
}
.btn-primary,
.btn-secondary {
border-radius: 8px;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
}
.btn-primary {
padding: 12px 30px;
border: none;
color: #fff;
background: linear-gradient(
135deg,
color-mix(in srgb, var(--primary-blue) 90%, #fff),
color-mix(in srgb, var(--primary-blue) 70%, #1d4ed8)
);
box-shadow: 0 8px 18px rgb(37 99 235 / 22%);
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 24px rgb(37 99 235 / 30%);
}
.btn-secondary {
padding: 12px 25px;
border: 1px solid var(--border-color);
color: var(--text-dark);
background: var(--surface-strong);
}
.flowchart-right {
width: 840px;
height: 600px;
position: relative;
flex-shrink: 0;
}
.group-label {
position: absolute;
left: 12px;
width: 88px;
text-align: right;
z-index: 8;
pointer-events: none;
}
.flowchart-right .card,
.flowchart-right .line,
.flowchart-right .badge {
margin-left: 120px;
}
.group-label b {
display: block;
color: var(--text-dark);
font-size: 15px;
background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
border-radius: 6px;
padding: 1px 4px;
}
.group-label span {
color: var(--text-gray);
font-size: 12px;
background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
border-radius: 6px;
padding: 1px 4px;
}
.card {
position: absolute;
z-index: 5;
width: 145px;
padding: 22px 12px;
border: 1px solid var(--border-color);
border-radius: 16px;
text-align: center;
background: var(--surface);
backdrop-filter: blur(8px);
box-shadow: 0 8px 24px rgb(15 23 42 / 6%);
transition: all 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 16px 34px rgb(15 23 42 / 10%);
}
.processing-card {
border-color: var(--badge-border);
background: color-mix(in srgb, var(--primary-blue) 6%, #fff);
}
.step-tag {
position: absolute;
top: -10px;
left: 15px;
padding: 2px 8px;
border-radius: 10px;
color: #475569;
font-size: 10px;
font-weight: 700;
background: #e2e8f0;
}
.card-icon {
margin: 0 auto 12px;
font-size: 32px;
}
.card h4 {
margin-bottom: 4px;
color: var(--text-dark);
font-size: 14px;
}
.card p {
color: var(--text-gray);
font-size: 11px;
}
.text-blue {
color: var(--primary-blue);
}
.text-purple {
color: var(--accent-purple);
}
.text-orange {
color: var(--accent-orange);
}
.text-green {
color: var(--accent-green);
}
.line {
position: absolute;
z-index: 1;
border: 1px dashed var(--line-color);
}
.line.active {
border-style: solid;
border-color: var(--primary-blue);
opacity: 0.7;
}
.badge {
position: absolute;
z-index: 6;
padding: 3px 8px;
border: 1px solid var(--badge-border);
border-radius: 20px;
color: var(--primary-blue);
font-size: 10px;
font-weight: 500;
white-space: nowrap;
background: var(--badge-bg);
}
.pos-1 {
top: 40px;
left: 60px;
}
.pos-2 {
top: 40px;
left: 260px;
}
.pos-3 {
top: 40px;
left: 460px;
}
.pos-4 {
top: 220px;
left: 260px;
}
.pos-5 {
top: 220px;
left: 460px;
}
.pos-6 {
top: 440px;
left: 160px;
}
.pos-7 {
top: 440px;
left: 360px;
}
.g-1 {
top: 85px;
}
.g-2 {
top: 265px;
}
.g-3 {
top: 485px;
}
</style>
<style>
/* 深色模式:不使用 scoped,确保选择器能正确命中 html.dark */
html.dark .welcome-page {
--primary-blue: #60a5fa;
--accent-green: #34d399;
--accent-orange: #fbbf24;
--accent-purple: #a78bfa;
--line-color: hsl(240deg 3.7% 22%);
--text-dark: hsl(0deg 0% 95%);
--text-gray: hsl(240deg 5% 64.9%);
--surface: hsl(222.34deg 10.43% 12.27% / 86%);
--surface-strong: hsl(240deg 3.7% 15.9%);
--surface-muted: hsl(240deg 3.7% 15.9% / 88%);
--border-color: hsl(240deg 3.7% 22%);
--badge-bg: hsl(217deg 91% 60% / 14%);
--badge-border: hsl(217deg 91% 60% / 28%);
background: linear-gradient(
145deg,
hsl(222.34deg 10.43% 12.27%) 0%,
hsl(240deg 3.7% 15.9%) 48%,
hsl(234deg 35% 18%) 100%
) !important;
}
html.dark .welcome-page .bg-blur {
background: rgb(96 165 250 / 18%);
}
html.dark .welcome-page .line {
border-color: hsl(240deg 3.7% 22%);
}
html.dark .welcome-page .badge {
background: hsl(217deg 91% 60% / 14%);
border-color: hsl(217deg 91% 60% / 28%);
color: #60a5fa;
}
html.dark .welcome-page .step-tag {
background: hsl(240deg 3.7% 22%);
color: hsl(240deg 5% 64.9%);
}
html.dark .welcome-page .processing-card {
border-color: hsl(217deg 91% 60% / 28%);
background: hsl(222.34deg 10.43% 12.27% / 60%);
}
</style>