feat 完善注释

This commit is contained in:
Ironsp
2026-10-01 17:24:57 +08:00
parent 2b59f68fd7
commit 9f4a5c7cda
183 changed files with 485 additions and 3615 deletions

View File

@@ -5,19 +5,11 @@ import { useHomeStore } from '@/stores/modules/home'
import type { PortalEntryCard, PortalEntryGroup } from '@/types/business/home'
import { toPortalEntryCards } from '@/utils/entryIcon'
/**
* 「更多应用」弹窗:快捷入口 / 其他入口 两组,图标角标可把入口在两组之间互转。
*
* 数据来自 store.quickEntries / store.otherEntries(← /vermins/portalEntryUser/list)。
* 接口不可用(游客、无权限)时回退到内置默认入口,保证弹窗不空。
*/
const visible = defineModel<boolean>('visible', { default: false })
const homeStore = useHomeStore()
const router = useRouter()
/** 接口不可用时的默认快捷入口(与首页卡片一致的固定模块) */
const FALLBACK_QUICK: Array<Pick<PortalEntryCard, 'label' | 'route' | 'icon' | 'tone'>> = [
{ label: '财务台账', route: '/finance/bills', icon: '💰', tone: 'amber' },
{ label: '合同台账', route: '/contract', icon: '📄', tone: 'blue' },
@@ -26,10 +18,8 @@ const FALLBACK_QUICK: Array<Pick<PortalEntryCard, 'label' | 'route' | 'icon' | '
{ label: '工单需求池', route: '/demand', icon: '📋', tone: 'cyan' },
]
/** 前端已注册的静态路由集合(用于判断入口 route 是否可跳转) */
const knownPaths = computed(() => new Set(router.getRoutes().map((item) => item.path)))
/** 快捷入口组 */
const quickCards = computed<PortalEntryCard[]>(() => {
const list = toPortalEntryCards(homeStore.quickEntries)
if (list.length > 0) return list
@@ -41,34 +31,28 @@ const quickCards = computed<PortalEntryCard[]>(() => {
}))
})
/** 其他入口组 */
const otherCards = computed<PortalEntryCard[]>(() => toPortalEntryCards(homeStore.otherEntries))
/** 入口是否可点击跳转(route 为空或未注册时不跳,避免落到 404) */
function canOpen(card: PortalEntryCard): boolean {
return card.route.length > 0 && knownPaths.value.has(card.route)
}
/** 是否是后端下发的入口(默认兜底入口 id 为 0,不可切换分组) */
function switchable(card: PortalEntryCard): boolean {
return card.id > 0
}
/** 点击图标:跳转对应路由 */
function onOpen(card: PortalEntryCard): void {
if (!canOpen(card)) return
visible.value = false
void router.push(card.route)
}
/** 点击角标:快捷 ⇄ 其他 互转 */
async function onToggle(card: PortalEntryCard): Promise<void> {
if (!switchable(card)) return
const target: PortalEntryGroup = card.groupType === '1' ? '0' : '1'
try {
await homeStore.switchEntryGroup(card.id, target)
} catch {
// 失败提示已由请求层统一弹出,这里只保证不产生未捕获的 rejection
}
}
@@ -249,7 +233,6 @@ function onClose(): void {
box-shadow: @shadow-base;
}
// tone 底色与首页快捷入口一致(按蓝湖设计稿采样)
&--purple {
background: @home-quick-purple;
}

View File

@@ -12,7 +12,6 @@ const router = useRouter()
const activeIndex = ref(0)
let timer: ReturnType<typeof setInterval> | null = null
/** 接口无图时用设计稿插画兜底,保证头图始终有一层视觉 */
const slides = computed(() => {
if (props.banners.length > 0) {
return props.banners.map((item) => item.imageUrl)
@@ -58,7 +57,6 @@ onBeforeUnmount(stopAutoplay)
<template>
<section class="home-banner">
<!-- 底层:图片轮播(文案层始终叠在其上) -->
<div class="home-banner__carousel" aria-hidden="true">
<div
v-for="(src, index) in slides"
@@ -70,7 +68,6 @@ onBeforeUnmount(stopAutoplay)
</div>
</div>
<!-- 顶层:标题 / 副标题 / 按钮,轮播切换时位置不变 -->
<div class="home-banner__inner">
<h1 class="home-banner__title">虫子智造研发一体化平台</h1>
<p class="home-banner__subtitle">一站式智能软硬件研发与量产综合服务商</p>
@@ -109,7 +106,6 @@ onBeforeUnmount(stopAutoplay)
width: 100%;
flex: 0 0 auto;
// 底层轮播:通栏铺满,文案层叠在上面
&__carousel {
position: absolute;
inset: 0;
@@ -134,7 +130,6 @@ onBeforeUnmount(stopAutoplay)
object-fit: cover;
}
// 顶层文案:相对内容区定位,不随轮播切换
&__inner {
position: relative;
z-index: 1;
@@ -145,7 +140,6 @@ onBeforeUnmount(stopAutoplay)
pointer-events: none;
}
// 设计稿标题 x150 y257(画板绝对)→ banner 内 y257−73=184
&__title {
position: absolute;
top: 184px;
@@ -158,7 +152,6 @@ onBeforeUnmount(stopAutoplay)
white-space: nowrap;
}
// 设计稿副标题 x150 y360 → banner 内 y287
&__subtitle {
position: absolute;
top: 287px;
@@ -171,7 +164,6 @@ onBeforeUnmount(stopAutoplay)
white-space: nowrap;
}
// 设计稿按钮组 x150 y465 → banner 内 y392;两钮 183×55,间距 20
&__actions {
position: absolute;
top: 392px;

View File

@@ -12,7 +12,6 @@ interface Props {
defineProps<Props>()
// 设计稿四张卡的插画图案(81×111,蓝湖整稿切图);接口 logoUrl 优先
const FALLBACK_ILL: Record<BusinessType, string> = {
internet: illInternet,
hardware: illHardware,
@@ -34,13 +33,11 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
class="home-business__card"
:class="`home-business__card--${line.id}`"
>
<!-- 设计稿:插画 81×111 @卡内(48,4);接口 logoUrl 优先,静态切图兜底 -->
<img
class="home-business__ill"
:src="line.icon || FALLBACK_ILL[line.id]"
:alt="line.name"
/>
<!-- 设计稿卡片右上角选择圆环(31×31) -->
<span class="home-business__check" aria-hidden="true" />
<h4 class="home-business__name">
{{ line.name }}
@@ -55,15 +52,13 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
<style lang="less" scoped>
.home-business {
// 设计稿区块卡 1680×400:白底 + #E2E2E2 描边,标题 @190,1062(卡顶 +44),卡区左右距 70
padding: 44px 70px 54px;
border: 1px solid @home-section-border;
border-radius: @radius-lg;
background: @white;
&__title {
margin: 0 0 47px; // 标题盒底 1114 → 卡顶 1161
// 设计稿栏目标题 36px / 700 / #121212
margin: 0 0 47px;
font-size: @font-size-xxl;
font-weight: 700;
color: @home-ink;
@@ -71,14 +66,12 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
&__grid {
display: flex;
// 一行固定四张,窄视口行内等比收缩(wrap 会因 1px 之差把第四张挤到第二行)
gap: 22px;
}
&__card {
position: relative;
.flex(column, flex-start, flex-start);
// 设计稿业务卡 368×206,一行固定四张(4×368 + 3×22 = 1538 ≤ 1560)
flex: 0 1 368px;
min-width: 0;
height: 206px;
@@ -97,7 +90,6 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
}
}
// 设计稿插画 81×111 @卡内 (48,4)
&__ill {
position: absolute;
top: 4px;
@@ -107,7 +99,6 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
object-fit: contain;
}
// 右上角选择圆环(31×31)
&__check {
position: absolute;
top: 24px;
@@ -131,10 +122,8 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
}
}
// 设计稿标题 @卡内 (20,106),描述 @ (20,151)
&__name {
margin: 106px 0 0;
// 设计稿卡片标题 28px / 500 / #121212
font-size: @font-size-title;
font-weight: 500;
line-height: 41px;
@@ -150,7 +139,6 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
.multi-ellipsis(1);
}
// 设计稿:首张「互联网软件」为 #024FFF 选中实底 + 白字白环;其余白底描边
&__card--internet {
border-color: @primary-strong;
background: @primary-strong;

View File

@@ -27,7 +27,6 @@ function switchCategory(value: BusinessType | 'all'): void {
emit('categoryChange', value)
}
// 设计稿一行固定四张 368×248,最多展示四张
const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
</script>
@@ -86,7 +85,6 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
<style lang="less" scoped>
.home-cases {
// 设计稿区块卡 1680×446:白底 + #E2E2E2 描边,标题 @1478(卡顶 +40),卡区左右距 66
padding: 40px 66px 60px;
border: 1px solid @home-section-border;
border-radius: @radius-lg;
@@ -95,11 +93,10 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
&__head {
.flex(row, flex-start);
gap: 24px;
margin-bottom: 47px; // 标题盒底 1530 → 卡顶 1577
margin-bottom: 47px;
}
&__title {
// 设计稿栏目标题 36px / 700 / #121212
font-size: @font-size-xxl;
font-weight: 700;
color: @home-ink;
@@ -107,7 +104,6 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
&__tabs {
.flex(row, center);
// 设计稿分类紧跟标题左侧排布(间距 36px)
gap: 36px;
}
@@ -117,7 +113,6 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
padding: 0;
border: 0;
background: transparent;
// 设计稿分类 16px / 500 / #121212(激活 #085DFF + 下划线)
color: @home-ink;
font-size: @font-size-md;
font-weight: 500;
@@ -127,7 +122,6 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
background: transparent;
color: @home-tab-active;
// 设计稿激活下划线 29×2(#1F67EF)
&::after {
content: '';
position: absolute;
@@ -147,18 +141,15 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
&__grid {
display: flex;
// 一行固定四张(4×368 + 3×24 = 1544),窄视口行内等比收缩
gap: 24px;
}
&__card {
overflow: hidden;
// 设计稿案例卡固定 368×248,一行四张(4×368 + 3×24 = 1544 ≤ 1560),不足四张不放大
flex: 0 1 368px;
min-width: 0;
height: 248px;
box-sizing: border-box;
// 设计稿案例卡 368×248:白底 + #E0DEDE 描边 + 0 4 10 黑 8% 投影
border: 1px solid @home-case-border;
border-radius: @radius-base;
background: @white;
@@ -178,7 +169,6 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
&__cover {
position: relative;
// 设计稿封面区 88px 高(卡 248:封面 0-88,标题 @109,属性行 @174/194,查看详情 @220)
height: 88px;
overflow: hidden;
}
@@ -199,7 +189,6 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
&__name {
margin: 21px 0 0;
// 设计稿案例名 16px / 500 / #333333
font-size: @font-size-md;
font-weight: 500;
line-height: 22px;
@@ -209,7 +198,6 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
&__meta {
display: grid;
// 设计稿属性行 13px 两行三列(行1 @174、行2 @194,行高 20)
grid-template-columns: 1fr 1fr 1fr;
gap: 0 @spacing-lg;
margin-top: 43px;
@@ -225,11 +213,9 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
&__view {
display: block;
width: fit-content;
// 设计稿「查看详情>」@卡内 y220(13px),右下角
margin: 6px 0 0 auto;
padding: 0;
border: 0;
// 设计稿「查看详情>」13px / #024FFF(无按钮描边)
color: @primary-strong;
font-size: 13px;
line-height: 15px;

View File

@@ -12,21 +12,12 @@ import tileService from '@/assets/home/entry-service.png'
import tileContract from '@/assets/home/entry-contract.png'
import tileFinance from '@/assets/home/entry-finance.png'
/**
* 首页右上「业务服务」入口卡(设计稿标题即「业务服务」,与下方栏位同名)。
*
* 数据来自 store.quickEntries(← /vermins/portalEntryUser/list 的 groupType=1 项),
* 接口不可用(游客 / 无权限)时回退到内置默认入口,保证卡片不空。
* 设计稿固定五个入口,接口返回的多余项(如硬件 / 互联 / 其他)不展示。
* 「>>」双箭头打开 HomeAppDialog,可在快捷 / 其他两组之间调整入口。
*/
const homeStore = useHomeStore()
const { quickEntries } = storeToRefs(homeStore)
const router = useRouter()
const dialogVisible = ref(false)
/** 设计稿固定入口名目(设计稿没有的接口入口不展示) */
const DESIGN_NAMES = [
'工单需求池',
'案例库管理',
@@ -35,7 +26,6 @@ const DESIGN_NAMES = [
'财务台账',
]
/** 接口不可用时的默认入口(与设计稿五项一致,tone 对应设计稿五色) */
const FALLBACK_QUICK: PortalEntryCard[] = [
{
id: 0,
@@ -84,7 +74,6 @@ const FALLBACK_QUICK: PortalEntryCard[] = [
},
]
/** 设计稿切图:蓝湖整稿 97×97 方块(含底色与白色图案),按入口名映射 */
const DESIGN_TILES: Record<string, string> = {
工单需求池: tileDemand,
案例库管理: tileCases,
@@ -93,10 +82,8 @@ const DESIGN_TILES: Record<string, string> = {
财务台账: tileFinance,
}
/** 前端已注册的静态路由(route 无效时不跳转,避免出现无匹配路由) */
const knownPaths = new Set(router.getRoutes().map((item) => item.path))
/** 卡片展示的入口:接口数据按设计稿名目过滤,最多 5 个 */
const entries = computed<PortalEntryCard[]>(() => {
const list = toPortalEntryCards(quickEntries.value).filter((card) =>
DESIGN_NAMES.includes(card.label),
@@ -104,14 +91,12 @@ const entries = computed<PortalEntryCard[]>(() => {
return (list.length > 0 ? list : FALLBACK_QUICK).slice(0, 5)
})
/** 入口图:接口 iconUrl 图案优先,否则设计稿切图 */
function tileSrc(card: PortalEntryCard): string {
return card.isImage && card.icon
? card.icon
: (DESIGN_TILES[card.label] ?? '')
}
/** 解析可跳转路径:优先后端 route,其次同名默认入口,最后回首页 */
function resolvePath(card: PortalEntryCard): string {
if (card.route && knownPaths.has(card.route)) return card.route
const fallback = FALLBACK_QUICK.find((item) => item.label === card.label)
@@ -120,7 +105,6 @@ function resolvePath(card: PortalEntryCard): string {
}
function onMore(): void {
// 打开时同步一次,确保分组是后端最新结果
void homeStore.fetchPortalEntries()
dialogVisible.value = true
}
@@ -139,7 +123,6 @@ function onMore(): void {
:to="resolvePath(entry)"
class="home-quick__item"
>
<!-- 设计稿:97×97 彩色方块 + 白色图案(蓝湖整稿切图),接口 iconUrl 图案优先 -->
<img
class="home-quick__tile"
:src="tileSrc(entry)"
@@ -148,7 +131,6 @@ function onMore(): void {
<span class="home-quick__label">{{ entry.label }}</span>
</RouterLink>
<!-- 设计稿:双箭头图标与入口方块行垂直居中(@y875, 32×32,距末位方块 20) -->
<button
class="home-quick__more"
type="button"
@@ -191,12 +173,9 @@ function onMore(): void {
position: relative;
.flex(column, flex-start, stretch);
flex-shrink: 0;
// 设计稿右卡 722 宽;白底 + 浅灰描边
// flex-basis 代替定宽:窄视口允许收缩,避免横向滚动条(1920 下仍为 722)
flex: 0 1 722px;
min-width: 0;
gap: 0;
// 设计稿:标题盒顶 y772 = 卡顶 +18,方块行顶 y841 = +87,卡高 264
padding: 18px 40px 28px;
border: 1px solid @home-card-border;
border-radius: @radius-lg;
@@ -207,7 +186,6 @@ function onMore(): void {
}
&__title {
// 设计稿卡内标题 36px / 700 / #121212,盒高 52(y772-824)
font-size: @font-size-xxl;
font-weight: 700;
line-height: 52px;
@@ -216,10 +194,9 @@ function onMore(): void {
&__list {
.flex(row, flex-start, flex-start);
// 设计稿入口图标间距(图标 97 + 间隙 30);方块行顶 y841 = 卡顶 +87
gap: 30px;
margin-top: 17px;
flex-wrap: wrap; // 卡片被收缩时换行,避免卡内溢出
flex-wrap: wrap;
}
&__item {
@@ -233,7 +210,6 @@ function onMore(): void {
}
}
// 设计稿:97×97 彩色方块切图(含底色与白色图案),整图渲染
&__tile {
display: block;
width: 97px;
@@ -243,7 +219,6 @@ function onMore(): void {
}
&__label {
// 设计稿入口文字 18px / 500 / #121212
font-size: @font-size-lg;
font-weight: 500;
color: @home-ink;
@@ -251,8 +226,6 @@ function onMore(): void {
}
&__more {
// 设计稿:» 32×32 @卡内 (665,121),与方块行(顶 y+87,高 97)垂直居中 → top 87+48.5-16 = 119.5
// 绝对定位脱离 flex 流:卡收缩(窄视口)时不参与折行
position: absolute;
top: 120px;
right: 25px;

View File

@@ -2,7 +2,6 @@
import type { ServiceContentBlock } from '@/types/business/home'
interface Props {
/** 服务内容区块列表:后端每条富文本目录一项 */
contents: ServiceContentBlock[]
}
@@ -10,7 +9,6 @@ defineProps<Props>()
</script>
<template>
<!-- 设计稿:一个「服务内容」区块 = 一条富文本目录(块内含媒体与要点列表,可多块) -->
<div v-if="contents.length" class="home-contents">
<section
v-for="(block, index) in contents"
@@ -20,7 +18,6 @@ defineProps<Props>()
<h3 class="home-contents__title">
服务内容
</h3>
<!-- 后端富文本原文(含内嵌图片/视频),取自后台维护内容 -->
<div class="home-contents__rich" v-html="block.content" />
</section>
</div>
@@ -29,9 +26,8 @@ defineProps<Props>()
<style lang="less" scoped>
.home-contents {
&__block {
// 设计稿区块卡 矩形 148286 @(70,736) 1780×593:白底、无描边投影
margin-bottom: @spacing-base;
padding: 40px 45px 0; // 正文 @(115,1090) → 卡内 x45(112−70=42 标题左,正文 115−70=45)
padding: 40px 45px 0;
border-radius: @radius-lg;
background: @white;
min-height: 593px;
@@ -43,8 +39,7 @@ defineProps<Props>()
}
&__title {
// 设计稿栏目标题 36px / 700 / #121212
margin: 0 0 301px; // 正文顶 1090 − 标题底(736+40+52) ≈ 262 → 取 261
margin: 0 0 301px;
font-size: 36px;
font-weight: 700;
line-height: 52px;
@@ -52,7 +47,6 @@ defineProps<Props>()
}
&__rich {
// 设计稿正文 @(115,1090) 1688×177 16px / #222222
font-size: 16px;
line-height: 1.75;
color: @home-paragraph;
@@ -76,7 +70,6 @@ defineProps<Props>()
:deep(video) {
display: block;
max-width: 100%;
// 设计稿视频/图片通栏贴卡内边距,圆角与卡片呼应
margin: 0 auto @spacing-lg;
border-radius: @radius-base;
}

View File

@@ -7,7 +7,6 @@ interface Props {
defineProps<Props>()
/** 后端 icon 可能是图片地址;不是地址(或为空)时用名称首字兜底展示 */
function isImageIcon(icon?: string): boolean {
if (!icon) return false
return /^(https?:)?\/\//.test(icon) || icon.startsWith('/')
@@ -44,17 +43,15 @@ function isImageIcon(icon?: string): boolean {
<style lang="less" scoped>
.home-service-types {
// 设计稿区块卡 矩形 197 @(70,429) 1780×287:白底、无描边投影
margin-bottom: 20px; // 下一卡 矩形 148286 y736 − 本卡底(429+287) = 20
padding: 24px 42px 0; // 标题 @(112,453) → 卡内 x42 / y24
margin-bottom: 20px;
padding: 24px 42px 0;
border-radius: @radius-lg;
background: @white;
height: 287px;
box-sizing: border-box;
&__title {
// 设计稿栏目标题 @(112,453) 36px / 700 / #121212
margin: 0 0 132px; // 圆底顶 550 − 标题底(453+52) 之间留白,服务项文字 @y665
margin: 0 0 132px;
font-size: 36px;
font-weight: 700;
line-height: 52px;
@@ -68,15 +65,12 @@ function isImageIcon(icon?: string): boolean {
&__item {
.flex(column, center);
// 设计稿服务项文字 x:146/333/530/695/876 → 间距约 187,取定宽 187 居中
width: 187px;
// 设计稿圆底(约 y550..618) 与文字(y665) 之间约 47
gap: 47px;
}
&__icon {
.flex(row, center);
// 设计稿圆底约 68px
width: 68px;
height: 68px;
border-radius: @radius-round;
@@ -86,7 +80,6 @@ function isImageIcon(icon?: string): boolean {
font-weight: 600;
overflow: hidden;
// 每类业务圆底色按设计稿采样(顺序:Web应用/小程序/APP/二次开发/桌面工具)
.home-service-types__item:nth-child(1) & {
background: @home-service-web;
}
@@ -115,7 +108,6 @@ function isImageIcon(icon?: string): boolean {
}
&__label {
// 设计稿服务项文字 @y665 16px / #333333
font-size: 16px;
line-height: 20px;
color: @home-body;

View File

@@ -7,7 +7,6 @@ interface Props {
defineProps<Props>()
/** 展示顺序与设计稿一致:累积项目 / 进行中 / 已提交 */
const items = [
{ key: 'total', label: '累积项目' },
{ key: 'inProgress', label: '进行中' },
@@ -31,13 +30,11 @@ const items = [
<style lang="less" scoped>
.home-stats {
.flex(row, flex-end);
// 设计稿方块间距 30px
gap: 30px;
&__item {
.flex(column, center, center);
gap: 0;
// 设计稿统计方块 112×112,#024FFF 实底
width: 112px;
height: 112px;
min-width: 112px;
@@ -47,7 +44,6 @@ const items = [
}
&__value {
// 设计稿数字 48px / 500 / 白
font-size: 48px;
font-weight: 500;
line-height: 1.2;

View File

@@ -37,7 +37,6 @@ const greeting = computed(() => {
&__greeting {
.flex(row, flex-start);
gap: @spacing-sm;
// 设计稿「中午好」52px / 700 / #2C2C2C
font-size: 52px;
font-weight: 700;
color: @home-welcome;
@@ -53,7 +52,6 @@ const greeting = computed(() => {
}
&__summary {
// 设计稿副文案 24px / 400 / #2C2C2C
font-size: 24px;
font-weight: 400;
color: @home-welcome;

View File

@@ -1,7 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, watch } from 'vue'
import { useRoute } from 'vue-router'
// 业务详情页:数据只经 useHomeStore,不直接 import api
import { useHomeStore } from '@/stores/modules/home'
import type { BusinessType } from '@/types/api'
import HomeServiceContents from './cpns/HomeServiceContents.vue'
@@ -23,7 +22,6 @@ onMounted(load)
</script>
<template>
<!-- 业务详情:设计实测内容区 x70→1850(宽 1780),故与其它常规页一致用 .container -->
<div class="business-detail">
<div class="container">
<nav class="business-detail__breadcrumb">
@@ -60,13 +58,11 @@ onMounted(load)
<style lang="less" scoped>
.business-detail {
// 设计实测:面包屑 y104、头图条 y190、白卡 y429/y736
padding-top: 32px; // 面包屑顶 = 104 − 顶栏 72
padding-top: 32px;
padding-bottom: @spacing-xxl;
&__breadcrumb {
// 设计稿面包屑 @(70,104) 24px/500 #666666
margin-bottom: 49px; // 头图条顶 190 − 面包屑底(104+37)
margin-bottom: 49px;
font-size: 24px;
font-weight: 500;
line-height: 37px;
@@ -77,11 +73,10 @@ onMounted(load)
}
}
// 设计稿头图条 矩形 195 @(70,190) 1780×219(浅蓝渐变底)
&__hero {
.flex(column, flex-start);
margin-bottom: @spacing-base;
padding: 129px 29px 0; // 业务名 @(99,319) → 卡内 x29 / y129
padding: 129px 29px 0;
border-radius: @radius-lg;
background: @home-detail-hero-bg;
height: 219px;
@@ -95,16 +90,15 @@ onMounted(load)
}
&__logo {
display: none; // 设计稿头图条内无独立 logo 块
display: none;
}
&__intro {
.flex(column, flex-start);
gap: 8px; // 名称底 319+33=352 → 副标题顶 360
gap: 8px;
}
&__name {
// 设计稿业务名 @(99,319) 26px / #333333
margin: 0;
font-size: 26px;
font-weight: 400;
@@ -113,7 +107,6 @@ onMounted(load)
}
&__slogan {
// 设计稿副标题 @(99,360) 14px/400 #333333
margin: 0;
font-size: 14px;
font-weight: 400;
@@ -122,7 +115,7 @@ onMounted(load)
}
&__cta {
display: none; // 设计稿无底部 CTA 块
display: none;
}
}
</style>

View File

@@ -2,7 +2,6 @@
<script setup lang="ts">
import { computed, onMounted } from 'vue'
import { storeToRefs } from 'pinia'
// 页面容器:只做组件引入、props 分发、事件中转,数据只经 store
import { useHomeStore } from '@/stores/modules/home'
import type { BusinessType } from '@/types/api'
import HomeBanner from './cpns/HomeBanner.vue'
@@ -28,10 +27,8 @@ onMounted(() => {
<template>
<div class="home">
<!-- 设计稿头图为通栏(0..1920),文案层固定叠在轮播图之上 -->
<HomeBanner :banners="banners" />
<!-- 首页设计稿单独基准:内容区 1680 / 留白 120,故用 container--home -->
<div class="container container--home home__dashboard">
<section class="home__dashboard-main">
<HomeWelcome :summary="todaySummary" />
@@ -56,23 +53,20 @@ onMounted(() => {
<style lang="less" scoped>
.home {
.flex(column, flex-start);
// 设计稿区块间距 ≈ 20px(内容区 1680,区块卡紧邻)
gap: 20px;
padding-top: 0;
padding-bottom: @spacing-xxl;
&__dashboard {
.flex(row, space-between, stretch);
// 设计稿左右卡间距 36px(左卡宽 922 / 右卡宽 722,内容区 1680)
gap: 36px;
}
&__dashboard-main {
.flex(row, space-between, center);
flex: 1;
min-width: 0; // 允许收缩,右侧快捷卡才能在窄视口让位
min-width: 0;
gap: @spacing-lg;
// 设计稿欢迎卡(120,754,922,245):白底 + 浅灰描边
padding: 0 73px 0 106px;
border: 1px solid @home-card-border;
border-radius: @radius-lg;