feat ui设计稿bug修复
This commit is contained in:
@@ -1,161 +1,157 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
import type { BannerVo } from '@/types/business/home'
|
||||
import { useRouter } from 'vue-router'
|
||||
import bannerIllustration from '@/assets/home/banner-illustration.png'
|
||||
|
||||
interface Props {
|
||||
banners: BannerVo[]
|
||||
// 设计稿顶部为静态头图(非轮播、不走接口):底 #F3F4F8 渐变,
|
||||
// 左侧标题 60px + 副标题 24px + 双按钮 183×55,右侧插画 723×598(蓝湖设计稿切图)
|
||||
const router = useRouter()
|
||||
|
||||
function goDemand(): void {
|
||||
router.push('/demand')
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
|
||||
/** 仅保留启用且带图的轮播项,按后端 sort 升序 */
|
||||
const slides = computed(() =>
|
||||
props.banners
|
||||
.filter((item) => item.enabled !== false && !!item.imageUrl)
|
||||
.slice()
|
||||
.sort((prev, next) => (prev.sort ?? 0) - (next.sort ?? 0)),
|
||||
)
|
||||
|
||||
const current = ref(0)
|
||||
let timer: number | undefined
|
||||
|
||||
function stop(): void {
|
||||
if (timer !== undefined) {
|
||||
window.clearInterval(timer)
|
||||
timer = undefined
|
||||
}
|
||||
function goCases(): void {
|
||||
router.push('/cases')
|
||||
}
|
||||
|
||||
function go(index: number): void {
|
||||
const total = slides.value.length
|
||||
if (total === 0) return
|
||||
current.value = (index + total) % total
|
||||
}
|
||||
|
||||
function start(): void {
|
||||
stop()
|
||||
if (slides.value.length <= 1) return
|
||||
timer = window.setInterval(() => go(current.value + 1), 5000)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => slides.value.length,
|
||||
() => {
|
||||
current.value = 0
|
||||
start()
|
||||
},
|
||||
)
|
||||
|
||||
onMounted(start)
|
||||
onBeforeUnmount(stop)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section v-if="slides.length" class="home-banner">
|
||||
<img
|
||||
v-for="(slide, index) in slides"
|
||||
v-show="index === current"
|
||||
:key="slide.id ?? index"
|
||||
class="home-banner__img"
|
||||
:src="slide.imageUrl ?? ''"
|
||||
:alt="`轮播图 ${index + 1}`"
|
||||
>
|
||||
<section class="home-banner">
|
||||
<div class="home-banner__inner">
|
||||
<h1 class="home-banner__title">虫子智造研发一体化平台</h1>
|
||||
<p class="home-banner__subtitle">一站式智能软硬件研发与量产综合服务商</p>
|
||||
|
||||
<template v-if="slides.length > 1">
|
||||
<button
|
||||
class="home-banner__arrow home-banner__arrow--prev"
|
||||
type="button"
|
||||
aria-label="上一张"
|
||||
@click="go(current - 1)"
|
||||
>
|
||||
‹
|
||||
</button>
|
||||
<button
|
||||
class="home-banner__arrow home-banner__arrow--next"
|
||||
type="button"
|
||||
aria-label="下一张"
|
||||
@click="go(current + 1)"
|
||||
>
|
||||
›
|
||||
</button>
|
||||
|
||||
<!-- 设计稿底部居中的指示条(长条=当前,圆点=其余) -->
|
||||
<div class="home-banner__dots">
|
||||
<span
|
||||
v-for="(slide, index) in slides"
|
||||
:key="`dot-${slide.id ?? index}`"
|
||||
class="home-banner__dot"
|
||||
:class="{ 'is-active': index === current }"
|
||||
/>
|
||||
<div class="home-banner__actions">
|
||||
<button class="home-banner__btn home-banner__btn--primary" type="button" @click="goDemand">
|
||||
需求提报
|
||||
</button>
|
||||
<button class="home-banner__btn home-banner__btn--ghost" type="button" @click="goCases">
|
||||
案例中心
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="home-banner__visual">
|
||||
<img
|
||||
class="home-banner__illustration"
|
||||
:src="bannerIllustration"
|
||||
alt="虫子智造研发一体化平台"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-banner {
|
||||
// 设计稿头图通栏 1920×661(画板 y73,位于顶栏 72 之下)
|
||||
position: relative;
|
||||
// 设计稿头图通栏 1920×661 设计px → 高 509 CSS,紧贴顶栏无圆角
|
||||
height: 509px;
|
||||
height: 661px;
|
||||
overflow: hidden;
|
||||
background: @home-banner-bg;
|
||||
// .home 是 column flex 容器,需显式占满整行,否则被内容宽度收缩
|
||||
width: 100%;
|
||||
flex: 0 0 auto;
|
||||
|
||||
&__img {
|
||||
// 内容区按设计稿 1920 画布居中;两侧内容一律相对它定位,保证 1:1
|
||||
&__inner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: @container-width;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
// 设计稿标题 x150 y257(画板绝对)→ banner 内 y257−73=184
|
||||
&__title {
|
||||
position: absolute;
|
||||
top: 184px;
|
||||
left: 150px;
|
||||
margin: 0;
|
||||
color: @banner-title-color;
|
||||
font-size: @font-size-hero-lg;
|
||||
font-weight: 700;
|
||||
line-height: 87px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
// 设计稿副标题 x150 y360 → banner 内 y287
|
||||
&__subtitle {
|
||||
position: absolute;
|
||||
top: 287px;
|
||||
left: 150px;
|
||||
margin: 0;
|
||||
color: @banner-title-color;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 35px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
// 设计稿按钮组 x150 y465 → banner 内 y392;两钮 183×55,间距 20(150+183=333 → 353)
|
||||
&__actions {
|
||||
position: absolute;
|
||||
top: 392px;
|
||||
left: 150px;
|
||||
.flex(row, flex-start, center);
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
width: 183px;
|
||||
height: 55px;
|
||||
border-radius: 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
|
||||
&--primary {
|
||||
background: linear-gradient(135deg, @btn-gradient-from 0%, @btn-gradient-to 100%);
|
||||
border: none;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
// 设计稿:2px 渐变描边 + 白底 + 蓝色文字(实测 #2B5FF0)
|
||||
&--ghost {
|
||||
position: relative;
|
||||
background: @white;
|
||||
border: none;
|
||||
color: @btn-ghost-color;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 8px;
|
||||
padding: 2px;
|
||||
background: linear-gradient(135deg, @btn-gradient-from 0%, @btn-gradient-to 100%);
|
||||
-webkit-mask:
|
||||
linear-gradient(#fff 0 0) content-box,
|
||||
linear-gradient(#fff 0 0);
|
||||
mask:
|
||||
linear-gradient(#fff 0 0) content-box,
|
||||
linear-gradient(#fff 0 0);
|
||||
-webkit-mask-composite: xor;
|
||||
mask-composite: exclude;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿插画 723×598 @ canvas (928,104) → banner 内 y104−73=31
|
||||
&__visual {
|
||||
position: absolute;
|
||||
top: 31px;
|
||||
left: 928px;
|
||||
width: 723px;
|
||||
height: 598px;
|
||||
}
|
||||
|
||||
&__illustration {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
&__arrow {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
transform: translateY(-50%);
|
||||
border-radius: @radius-round;
|
||||
background: fade(@black, 35%);
|
||||
color: @white;
|
||||
font-size: @font-size-xl;
|
||||
line-height: 1;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
|
||||
&--prev {
|
||||
left: @spacing-base;
|
||||
}
|
||||
|
||||
&--next {
|
||||
right: @spacing-base;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover &__arrow {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&__dots {
|
||||
position: absolute;
|
||||
bottom: 48px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
.flex(row, center, center);
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
&__dot {
|
||||
width: 4px;
|
||||
height: 4px;
|
||||
border-radius: @radius-round;
|
||||
background: @home-banner-dot;
|
||||
transition: width 0.2s;
|
||||
|
||||
// 当前页:设计稿 44×5 设计px 长条
|
||||
&.is-active {
|
||||
width: 34px;
|
||||
height: 4px;
|
||||
border-radius: @radius-round;
|
||||
}
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,21 +1,32 @@
|
||||
<script setup lang="ts">
|
||||
import type { BusinessType } from '@/types/api'
|
||||
import type { BusinessLine } from '@/types/business/home'
|
||||
import illInternet from '@/assets/home/business-internet.png'
|
||||
import illHardware from '@/assets/home/business-hardware.png'
|
||||
import illIot from '@/assets/home/business-iot.png'
|
||||
import illManufacturing from '@/assets/home/business-manufacturing.png'
|
||||
|
||||
interface Props {
|
||||
lines: BusinessLine[]
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
|
||||
// 设计稿四张卡的插画图案(81×111,蓝湖整稿切图);接口 logoUrl 优先
|
||||
const FALLBACK_ILL: Record<BusinessType, string> = {
|
||||
internet: illInternet,
|
||||
hardware: illHardware,
|
||||
iot: illIot,
|
||||
manufacturing: illManufacturing,
|
||||
other: illIot,
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="home-business">
|
||||
<div class="home-business__head">
|
||||
<h3 class="home-business__title">
|
||||
业务服务
|
||||
</h3>
|
||||
<span class="home-business__slogan text-secondary">研发智造一体化自营平台,全链路质量兜底</span>
|
||||
</div>
|
||||
<h3 class="home-business__title">
|
||||
业务服务
|
||||
</h3>
|
||||
|
||||
<div class="home-business__grid">
|
||||
<RouterLink
|
||||
@@ -25,21 +36,20 @@ defineProps<Props>()
|
||||
class="home-business__card"
|
||||
:class="`home-business__card--${line.id}`"
|
||||
>
|
||||
<div class="home-business__card-head">
|
||||
<span class="home-business__icon">
|
||||
<!-- TODO(蓝湖): 替换业务图标切图 -->
|
||||
{{ line.name.slice(0, 2) }}
|
||||
</span>
|
||||
<!-- 设计稿卡片右上角选择圆环 -->
|
||||
<span class="home-business__check" aria-hidden="true" />
|
||||
</div>
|
||||
<!-- 设计稿:插画 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 }}
|
||||
</h4>
|
||||
<p class="home-business__desc">
|
||||
{{ line.desc }}
|
||||
</p>
|
||||
<span class="home-business__more">了解详情 ></span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
</section>
|
||||
@@ -47,43 +57,35 @@ defineProps<Props>()
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-business {
|
||||
// 设计稿区块卡 1680×400 设计px:白底 + #E2E2E2 描边(内容区内左右缩 50 设计px)
|
||||
max-width: 1294px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
padding: 34px 54px 40px;
|
||||
// 设计稿区块卡 1680×400:白底 + #E2E2E2 描边,标题 @190,1062(卡顶 +44),卡区左右距 70
|
||||
padding: 44px 70px 54px;
|
||||
border: 1px solid @home-section-border;
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
|
||||
&__head {
|
||||
.flex(row, space-between);
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
|
||||
&__title {
|
||||
// 设计稿栏目标题 36 设计px / 700 / #121212
|
||||
margin: 0 0 47px; // 标题盒底 1114 → 卡顶 1161
|
||||
// 设计稿栏目标题 36px / 700 / #121212
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 700;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
font-size: @font-size-sm;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
// 设计稿卡片间距 22 设计px ≈ 17 CSS
|
||||
gap: 17px;
|
||||
display: flex;
|
||||
// 一行固定四张,窄视口行内等比收缩(wrap 会因 1px 之差把第四张挤到第二行)
|
||||
gap: 22px;
|
||||
}
|
||||
|
||||
&__card {
|
||||
.flex(column, flex-start);
|
||||
gap: 0;
|
||||
// 设计稿业务卡 368×206 设计px:白底 / #999 描边 / 小圆角
|
||||
padding: 22px 16px 6px;
|
||||
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;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
border: 1px solid @home-business-border;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
@@ -95,29 +97,24 @@ defineProps<Props>()
|
||||
}
|
||||
}
|
||||
|
||||
&__card-head {
|
||||
.flex(row, space-between, flex-start);
|
||||
width: 100%;
|
||||
// 设计稿插画 81×111 @卡内 (48,4)
|
||||
&__ill {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 48px;
|
||||
width: 81px;
|
||||
height: 111px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
flex-shrink: 0;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: @radius-base;
|
||||
background: transparent;
|
||||
color: @primary-strong;
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
// 右上角选择圆环(31 设计px ≈ 24 CSS)
|
||||
// 右上角选择圆环(31×31)
|
||||
&__check {
|
||||
position: relative;
|
||||
position: absolute;
|
||||
top: 24px;
|
||||
right: 20px;
|
||||
flex-shrink: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
width: 31px;
|
||||
height: 31px;
|
||||
border: 1px solid @home-ring;
|
||||
border-radius: @radius-round;
|
||||
|
||||
@@ -125,8 +122,8 @@ defineProps<Props>()
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin: auto;
|
||||
border-radius: @radius-round;
|
||||
background: @white;
|
||||
@@ -134,28 +131,23 @@ defineProps<Props>()
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿标题 @卡内 (20,106),描述 @ (20,151)
|
||||
&__name {
|
||||
margin-top: 16px;
|
||||
// 设计稿卡片标题 28 设计px / 500 / #121212
|
||||
margin: 106px 0 0;
|
||||
// 设计稿卡片标题 28px / 500 / #121212
|
||||
font-size: @font-size-title;
|
||||
font-weight: 500;
|
||||
line-height: 41px;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__desc {
|
||||
margin-top: 4px;
|
||||
font-size: @font-size-sm;
|
||||
margin: 4px 0 0;
|
||||
font-size: @font-size-md;
|
||||
font-weight: 500;
|
||||
line-height: 23px;
|
||||
color: @home-ink;
|
||||
.multi-ellipsis(2);
|
||||
}
|
||||
|
||||
&__more {
|
||||
align-self: flex-end;
|
||||
margin-top: auto;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-secondary;
|
||||
transition: color 0.2s;
|
||||
.multi-ellipsis(1);
|
||||
}
|
||||
|
||||
// 设计稿:首张「互联网软件」为 #024FFF 选中实底 + 白字白环;其余白底描边
|
||||
@@ -163,10 +155,6 @@ defineProps<Props>()
|
||||
border-color: @primary-strong;
|
||||
background: @primary-strong;
|
||||
|
||||
.home-business__icon {
|
||||
color: @white;
|
||||
}
|
||||
|
||||
.home-business__check {
|
||||
border-color: @white;
|
||||
|
||||
@@ -176,28 +164,9 @@ defineProps<Props>()
|
||||
}
|
||||
|
||||
.home-business__name,
|
||||
.home-business__desc,
|
||||
.home-business__more {
|
||||
.home-business__desc {
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
&__card--hardware {
|
||||
.home-business__icon {
|
||||
color: @tag-hardware;
|
||||
}
|
||||
}
|
||||
|
||||
&__card--iot {
|
||||
.home-business__icon {
|
||||
color: @tag-iot;
|
||||
}
|
||||
}
|
||||
|
||||
&__card--manufacturing {
|
||||
.home-business__icon {
|
||||
color: @tag-manufacturing;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { formatBusinessType } from '@/utils/format'
|
||||
import type { BusinessType } from '@/types/api'
|
||||
import type { Case } from '@/types/business/cases'
|
||||
|
||||
@@ -8,7 +8,7 @@ interface Props {
|
||||
cases: Case[]
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
const props = defineProps<Props>()
|
||||
|
||||
const emit = defineEmits<{ categoryChange: [category: BusinessType | 'all'] }>()
|
||||
|
||||
@@ -26,6 +26,9 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
activeCategory.value = value
|
||||
emit('categoryChange', value)
|
||||
}
|
||||
|
||||
// 设计稿一行固定四张 368×248,最多展示四张
|
||||
const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -52,18 +55,14 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
|
||||
<div class="home-cases__grid">
|
||||
<article
|
||||
v-for="item in cases"
|
||||
v-for="item in visibleCases"
|
||||
:key="item.id"
|
||||
class="home-cases__card"
|
||||
@click="$router.push(`/cases/${item.id}`)"
|
||||
>
|
||||
<div class="home-cases__cover">
|
||||
<!-- TODO(蓝湖): 替换案例封面切图 -->
|
||||
<img v-if="item.cover" v-lazy="item.cover" class="home-cases__img" :alt="item.title">
|
||||
<div v-else class="home-cases__img home-cases__img--placeholder" />
|
||||
<span class="home-cases__tag" :class="`home-cases__tag--${item.category}`">
|
||||
{{ formatBusinessType(item.category) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="home-cases__body">
|
||||
@@ -71,12 +70,14 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
{{ item.title }}
|
||||
</h4>
|
||||
<ul class="home-cases__meta">
|
||||
<li>客户对象:{{ item.clientType }}</li>
|
||||
<li>研发周期:{{ item.duration }}</li>
|
||||
<li>团队规模:{{ item.teamSize }}人</li>
|
||||
<li>客户类型:{{ item.clientType }}</li>
|
||||
<li>所属行业:{{ item.industry }}</li>
|
||||
<li>规模:{{ item.scale }}</li>
|
||||
<li>项目周期:{{ item.duration }}</li>
|
||||
<li>服务团队:{{ item.teamSize }}人</li>
|
||||
<li>完成时间:{{ item.finishDate }}</li>
|
||||
</ul>
|
||||
<span class="home-cases__view">查看详情</span>
|
||||
<span class="home-cases__view">查看详情></span>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
@@ -85,23 +86,20 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-cases {
|
||||
// 设计稿区块卡 1680×446 设计px:白底 + #E2E2E2 描边(内容区内左右缩 50 设计px)
|
||||
max-width: 1294px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
padding: 32px 54px 44px;
|
||||
// 设计稿区块卡 1680×446:白底 + #E2E2E2 描边,标题 @1478(卡顶 +40),卡区左右距 66
|
||||
padding: 40px 66px 60px;
|
||||
border: 1px solid @home-section-border;
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
|
||||
&__head {
|
||||
.flex(row, flex-start);
|
||||
gap: 20px;
|
||||
margin-bottom: 36px;
|
||||
gap: 24px;
|
||||
margin-bottom: 47px; // 标题盒底 1530 → 卡顶 1577
|
||||
}
|
||||
|
||||
&__title {
|
||||
// 设计稿栏目标题 36 设计px / 700 / #121212
|
||||
// 设计稿栏目标题 36px / 700 / #121212
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 700;
|
||||
color: @home-ink;
|
||||
@@ -109,8 +107,8 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
|
||||
&__tabs {
|
||||
.flex(row, center);
|
||||
// 设计稿分类紧跟标题左侧排布(间距 36 设计px ≈ 28)
|
||||
gap: 28px;
|
||||
// 设计稿分类紧跟标题左侧排布(间距 36px)
|
||||
gap: 36px;
|
||||
}
|
||||
|
||||
&__tab {
|
||||
@@ -119,9 +117,9 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
// 设计稿分类 16 设计px / 500 / #121212(激活 #085DFF + 下划线)
|
||||
// 设计稿分类 16px / 500 / #121212(激活 #085DFF + 下划线)
|
||||
color: @home-ink;
|
||||
font-size: @font-size-sm;
|
||||
font-size: @font-size-md;
|
||||
font-weight: 500;
|
||||
transition: color 0.2s;
|
||||
|
||||
@@ -129,12 +127,12 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
background: transparent;
|
||||
color: @home-tab-active;
|
||||
|
||||
// 设计稿激活下划线 29×2 设计px(#1F67EF)
|
||||
// 设计稿激活下划线 29×2(#1F67EF)
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: -6px;
|
||||
bottom: -8px;
|
||||
left: 0;
|
||||
height: 2px;
|
||||
background: @primary-color;
|
||||
@@ -144,19 +142,23 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
|
||||
&__more {
|
||||
margin-left: auto;
|
||||
font-size: @font-size-sm;
|
||||
font-size: @font-size-md;
|
||||
}
|
||||
|
||||
&__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
// 设计稿案例卡间距 24 设计px ≈ 18 CSS
|
||||
gap: 18px;
|
||||
display: flex;
|
||||
// 一行固定四张(4×368 + 3×24 = 1544),窄视口行内等比收缩
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
&__card {
|
||||
overflow: hidden;
|
||||
// 设计稿案例卡 368×248 设计px:白底 + #E0DEDE 描边 + 0 4 10 黑 8% 投影
|
||||
// 设计稿案例卡固定 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;
|
||||
@@ -176,8 +178,8 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
|
||||
&__cover {
|
||||
position: relative;
|
||||
// 设计稿封面区 128 设计px 高 ≈ 99 CSS
|
||||
height: 100px;
|
||||
// 设计稿封面区 88px 高(卡 248:封面 0-88,标题 @109,属性行 @174/194,查看详情 @220)
|
||||
height: 88px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -191,53 +193,28 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
}
|
||||
}
|
||||
|
||||
&__tag {
|
||||
position: absolute;
|
||||
top: @spacing-sm;
|
||||
left: @spacing-sm;
|
||||
padding: 2px @spacing-sm;
|
||||
border-radius: @radius-sm;
|
||||
background: @primary-color;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
|
||||
&--hardware {
|
||||
background: @tag-hardware;
|
||||
}
|
||||
|
||||
&--iot {
|
||||
background: @tag-iot;
|
||||
}
|
||||
|
||||
&--manufacturing {
|
||||
background: @tag-manufacturing;
|
||||
}
|
||||
|
||||
&--other {
|
||||
background: @tag-other;
|
||||
}
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding: 12px 15px 6px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
&__name {
|
||||
margin-bottom: 8px;
|
||||
// 设计稿案例名 16 设计px / 500 / #333333
|
||||
font-size: @font-size-sm;
|
||||
margin: 21px 0 0;
|
||||
// 设计稿案例名 16px / 500 / #333333
|
||||
font-size: @font-size-md;
|
||||
font-weight: 500;
|
||||
line-height: 22px;
|
||||
color: @home-body;
|
||||
.multi-ellipsis(1);
|
||||
}
|
||||
|
||||
&__meta {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
// 设计稿元信息 10 设计px → 可读下限 11px / #333333
|
||||
gap: 3px @spacing-sm;
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
// 设计稿属性行 13px 两行三列(行1 @174、行2 @194,行高 20)
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 0 @spacing-lg;
|
||||
margin-top: 43px;
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
color: @home-body;
|
||||
|
||||
li {
|
||||
@@ -248,12 +225,14 @@ function switchCategory(value: BusinessType | 'all'): void {
|
||||
&__view {
|
||||
display: block;
|
||||
width: fit-content;
|
||||
margin: 10px 0 0 auto;
|
||||
// 设计稿「查看详情>」@卡内 y220(13px),右下角
|
||||
margin: 6px 0 0 auto;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
// 设计稿「查看详情>」12 设计px / #024FFF(无按钮描边)
|
||||
// 设计稿「查看详情>」13px / #024FFF(无按钮描边)
|
||||
color: @primary-strong;
|
||||
font-size: @font-size-sm;
|
||||
font-size: 13px;
|
||||
line-height: 15px;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,19 @@ import { useHomeStore } from '@/stores/modules/home'
|
||||
import type { PortalEntryCard } from '@/types/business/home'
|
||||
import { toPortalEntryCards } from '@/utils/entryIcon'
|
||||
import HomeAppDialog from './HomeAppDialog.vue'
|
||||
import tileDemand from '@/assets/home/entry-demand.png'
|
||||
import tileCases from '@/assets/home/entry-cases.png'
|
||||
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,可在快捷 / 其他两组之间调整入口。
|
||||
* 设计稿固定五个入口,接口返回的多余项(如硬件 / 互联 / 其他)不展示。
|
||||
* 「>>」双箭头打开 HomeAppDialog,可在快捷 / 其他两组之间调整入口。
|
||||
*/
|
||||
const homeStore = useHomeStore()
|
||||
const { quickEntries } = storeToRefs(homeStore)
|
||||
@@ -20,24 +26,42 @@ const router = useRouter()
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
/** 接口不可用时的默认入口(与改造前的静态入口保持一致) */
|
||||
/** 设计稿固定入口名目(设计稿没有的接口入口不展示) */
|
||||
const DESIGN_NAMES = ['工单需求池', '案例库管理', '客服工作台', '合同台账', '财务台账']
|
||||
|
||||
/** 接口不可用时的默认入口(与设计稿五项一致,tone 对应设计稿五色) */
|
||||
const FALLBACK_QUICK: PortalEntryCard[] = [
|
||||
{ id: 0, label: '财务台账', route: '/finance/bills', groupType: '1', icon: '💰', isImage: false, tone: 'amber' },
|
||||
{ id: 0, label: '合同台账', route: '/contract', groupType: '1', icon: '📄', isImage: false, tone: 'blue' },
|
||||
{ id: 0, label: '客服工作台', route: '/service', groupType: '1', icon: '💬', isImage: false, tone: 'green' },
|
||||
{ id: 0, label: '案例库管理', route: '/cases', groupType: '1', icon: '📁', isImage: false, tone: 'purple' },
|
||||
{ id: 0, label: '工单需求池', route: '/demand', groupType: '1', icon: '📋', isImage: false, tone: 'cyan' },
|
||||
{ id: 0, label: '工单需求池', route: '/demand', groupType: '1', icon: '', isImage: false, tone: 'cyan' },
|
||||
{ id: 0, label: '案例库管理', route: '/cases', groupType: '1', icon: '', isImage: false, tone: 'purple' },
|
||||
{ id: 0, label: '客服工作台', route: '/service', groupType: '1', icon: '', isImage: false, tone: 'green' },
|
||||
{ id: 0, label: '合同台账', route: '/contract', groupType: '1', icon: '', isImage: false, tone: 'blue' },
|
||||
{ id: 0, label: '财务台账', route: '/finance/bills', groupType: '1', icon: '', isImage: false, tone: 'amber' },
|
||||
]
|
||||
|
||||
/** 设计稿切图:蓝湖整稿 97×97 方块(含底色与白色图案),按入口名映射 */
|
||||
const DESIGN_TILES: Record<string, string> = {
|
||||
工单需求池: tileDemand,
|
||||
案例库管理: tileCases,
|
||||
客服工作台: tileService,
|
||||
合同台账: tileContract,
|
||||
财务台账: tileFinance,
|
||||
}
|
||||
|
||||
/** 前端已注册的静态路由(route 无效时不跳转,避免出现无匹配路由) */
|
||||
const knownPaths = new Set(router.getRoutes().map((item) => item.path))
|
||||
|
||||
/** 卡片展示的入口(最多 5 个) */
|
||||
/** 卡片展示的入口:接口数据按设计稿名目过滤,最多 5 个 */
|
||||
const entries = computed<PortalEntryCard[]>(() => {
|
||||
const list = toPortalEntryCards(quickEntries.value)
|
||||
.filter((card) => DESIGN_NAMES.includes(card.label))
|
||||
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
|
||||
@@ -56,9 +80,8 @@ function onMore(): void {
|
||||
<template>
|
||||
<section class="home-quick">
|
||||
<div class="home-quick__head">
|
||||
<span class="home-quick__head-icon">⊞</span>
|
||||
<h3 class="home-quick__title">
|
||||
快捷入口
|
||||
业务服务
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@@ -69,17 +92,19 @@ function onMore(): void {
|
||||
:to="resolvePath(entry)"
|
||||
class="home-quick__item"
|
||||
>
|
||||
<span class="home-quick__icon" :class="`home-quick__icon--${entry.tone}`">
|
||||
<img v-if="entry.isImage" :src="entry.icon" :alt="entry.label" class="home-quick__img">
|
||||
<template v-else>{{ entry.icon }}</template>
|
||||
</span>
|
||||
<!-- 设计稿:97×97 彩色方块 + 白色图案(蓝湖整稿切图),接口 iconUrl 图案优先 -->
|
||||
<img class="home-quick__tile" :src="tileSrc(entry)" :alt="entry.label">
|
||||
<span class="home-quick__label">{{ entry.label }}</span>
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
<button class="home-quick__more link" type="button" @click="onMore">
|
||||
更多应用 >
|
||||
</button>
|
||||
<!-- 设计稿:双箭头图标与入口方块行垂直居中(@y875, 32×32,距末位方块 20) -->
|
||||
<button class="home-quick__more" type="button" aria-label="更多应用" @click="onMore">
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8 6 L18 16 L8 26" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" fill="none" />
|
||||
<path d="M17 6 L27 16 L17 26" stroke="currentColor" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" fill="none" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<HomeAppDialog v-model:visible="dialogVisible" />
|
||||
</section>
|
||||
@@ -90,36 +115,35 @@ function onMore(): void {
|
||||
position: relative;
|
||||
.flex(column, flex-start, stretch);
|
||||
flex-shrink: 0;
|
||||
// 设计稿右卡 722×245 设计px → 556 宽;白底 + 浅灰描边
|
||||
width: 556px;
|
||||
// 设计稿右卡 722 宽;白底 + 浅灰描边
|
||||
// flex-basis 代替定宽:窄视口允许收缩,避免横向滚动条(1920 下仍为 722)
|
||||
flex: 0 1 722px;
|
||||
min-width: 0;
|
||||
gap: 0;
|
||||
padding: 14px 31px 21px;
|
||||
// 设计稿:标题盒顶 y772 = 卡顶 +18,方块行顶 y841 = +87,卡高 264
|
||||
padding: 18px 40px 28px;
|
||||
border: 1px solid @home-card-border;
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
|
||||
&__head {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
}
|
||||
|
||||
&__head-icon {
|
||||
color: @home-ink;
|
||||
font-size: @font-size-xl;
|
||||
}
|
||||
|
||||
&__title {
|
||||
// 设计稿卡内标题 36 设计px / 700 / #121212
|
||||
// 设计稿卡内标题 36px / 700 / #121212,盒高 52(y772-824)
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__list {
|
||||
.flex(row, flex-start, flex-start);
|
||||
// 设计稿入口间距 127 设计px(图标 90 + 间隙 37)≈ 70 + 28
|
||||
gap: 28px;
|
||||
margin-top: 16px;
|
||||
// 设计稿入口图标间距(图标 97 + 间隙 30);方块行顶 y841 = 卡顶 +87
|
||||
gap: 30px;
|
||||
margin-top: 17px;
|
||||
flex-wrap: wrap; // 卡片被收缩时换行,避免卡内溢出
|
||||
}
|
||||
|
||||
&__item {
|
||||
@@ -133,66 +157,41 @@ function onMore(): void {
|
||||
}
|
||||
}
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
// 设计稿图标块 90×90 设计px ≈ 70 CSS
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
// 设计稿:97×97 彩色方块切图(含底色与白色图案),整图渲染
|
||||
&__tile {
|
||||
display: block;
|
||||
width: 97px;
|
||||
height: 97px;
|
||||
border-radius: @radius-base;
|
||||
font-size: 28px;
|
||||
|
||||
// 底色按设计稿采样(tone → 设计稿色)
|
||||
&--amber {
|
||||
background: @home-quick-pink;
|
||||
}
|
||||
|
||||
&--blue {
|
||||
background: @home-quick-peach;
|
||||
}
|
||||
|
||||
&--green {
|
||||
background: @home-quick-green;
|
||||
}
|
||||
|
||||
&--purple {
|
||||
background: @home-quick-purple;
|
||||
}
|
||||
|
||||
&--red {
|
||||
background: fade(@danger-color, 15%);
|
||||
}
|
||||
|
||||
&--cyan {
|
||||
background: @home-quick-blue;
|
||||
}
|
||||
}
|
||||
|
||||
&__img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
object-fit: contain;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
&__label {
|
||||
// 设计稿入口文字 18 设计px / 500 / #121212
|
||||
font-size: @font-size-base;
|
||||
// 设计稿入口文字 18px / 500 / #121212
|
||||
font-size: @font-size-lg;
|
||||
font-weight: 500;
|
||||
color: @home-ink;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__more {
|
||||
// 设计稿「更多」箭头位于卡片右侧垂直居中
|
||||
// 设计稿:» 32×32 @卡内 (665,121),与方块行(顶 y+87,高 97)垂直居中 → top 87+48.5-16 = 119.5
|
||||
// 绝对定位脱离 flex 流:卡收缩(窄视口)时不参与折行
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 31px;
|
||||
top: 120px;
|
||||
right: 25px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
transform: translateY(-50%);
|
||||
background: transparent;
|
||||
font-size: @font-size-sm;
|
||||
color: @home-ring;
|
||||
color: #c9cdd4;
|
||||
cursor: pointer;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -29,11 +29,13 @@ defineProps<Props>()
|
||||
<style lang="less" scoped>
|
||||
.home-contents {
|
||||
&__block {
|
||||
// 设计稿区块卡 1780×593 设计px:白底、无描边投影
|
||||
// 设计稿区块卡 矩形 148286 @(70,736) 1780×593:白底、无描边投影
|
||||
margin-bottom: @spacing-base;
|
||||
padding: 24px 32px 32px;
|
||||
padding: 40px 45px 0; // 正文 @(115,1090) → 卡内 x45(112−70=42 标题左,正文 115−70=45)
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
min-height: 593px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
@@ -41,17 +43,18 @@ defineProps<Props>()
|
||||
}
|
||||
|
||||
&__title {
|
||||
// 设计稿栏目标题 36 设计px / 700 / #121212(无竖条)
|
||||
margin-bottom: 36px;
|
||||
font-size: @font-size-xxl;
|
||||
// 设计稿栏目标题 36px / 700 / #121212
|
||||
margin: 0 0 301px; // 正文顶 1090 − 标题底(736+40+52) ≈ 262 → 取 261
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
&__rich {
|
||||
// 设计稿正文 16 设计px / #222222
|
||||
font-size: @font-size-sm;
|
||||
line-height: 1.8;
|
||||
// 设计稿正文 @(115,1090) 1688×177 16px / #222222
|
||||
font-size: 16px;
|
||||
line-height: 1.75;
|
||||
color: @home-paragraph;
|
||||
word-break: break-word;
|
||||
|
||||
@@ -83,7 +86,7 @@ defineProps<Props>()
|
||||
:deep(h3),
|
||||
:deep(h4) {
|
||||
margin: @spacing-base 0 @spacing-sm;
|
||||
font-size: @font-size-base;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: @home-ink;
|
||||
}
|
||||
@@ -98,7 +101,7 @@ defineProps<Props>()
|
||||
:deep(th) {
|
||||
padding: @spacing-xs @spacing-sm;
|
||||
border: 1px solid @border-color;
|
||||
font-size: @font-size-sm;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
:deep(a) {
|
||||
|
||||
@@ -44,17 +44,20 @@ function isImageIcon(icon?: string): boolean {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.home-service-types {
|
||||
// 设计稿区块卡 1780×287 设计px:白底、无描边投影
|
||||
margin-bottom: @spacing-base;
|
||||
padding: 18px 32px 24px;
|
||||
// 设计稿区块卡 矩形 197 @(70,429) 1780×287:白底、无描边投影
|
||||
margin-bottom: 20px; // 下一卡 矩形 148286 y736 − 本卡底(429+287) = 20
|
||||
padding: 24px 42px 0; // 标题 @(112,453) → 卡内 x42 / y24
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
height: 287px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__title {
|
||||
// 设计稿栏目标题 36 设计px / 700 / #121212(无竖条)
|
||||
margin-bottom: 40px;
|
||||
font-size: @font-size-xxl;
|
||||
// 设计稿栏目标题 @(112,453) 36px / 700 / #121212
|
||||
margin: 0 0 132px; // 圆底顶 550 − 标题底(453+52) 之间留白,服务项文字 @y665
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
line-height: 52px;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
@@ -65,21 +68,21 @@ function isImageIcon(icon?: string): boolean {
|
||||
|
||||
&__item {
|
||||
.flex(column, center);
|
||||
// 设计稿条目横向间距 182 设计px → 定宽 140 居中
|
||||
width: 140px;
|
||||
// 设计稿圆底(550..618)与文字(665)之间 41 设计px ≈ 32 CSS
|
||||
gap: 32px;
|
||||
// 设计稿服务项文字 x:146/333/530/695/876 → 间距约 187,取定宽 187 居中
|
||||
width: 187px;
|
||||
// 设计稿圆底(约 y550..618) 与文字(y665) 之间约 47
|
||||
gap: 47px;
|
||||
}
|
||||
|
||||
&__icon {
|
||||
.flex(row, center);
|
||||
// 设计稿为 60 设计px 彩色圆底 + 白色图形
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
// 设计稿圆底约 68px
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-light;
|
||||
color: @white;
|
||||
font-size: @font-size-xl;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -112,8 +115,9 @@ function isImageIcon(icon?: string): boolean {
|
||||
}
|
||||
|
||||
&__label {
|
||||
// 设计稿条目文字 16 设计px / #333333
|
||||
font-size: @font-size-sm;
|
||||
// 设计稿服务项文字 @y665 16px / #333333
|
||||
font-size: 16px;
|
||||
line-height: 20px;
|
||||
color: @home-body;
|
||||
text-align: center;
|
||||
.ellipsis();
|
||||
|
||||
@@ -31,31 +31,31 @@ const items = [
|
||||
<style lang="less" scoped>
|
||||
.home-stats {
|
||||
.flex(row, flex-end);
|
||||
// 设计稿方块间距 30 设计px ≈ 23 CSS
|
||||
gap: 23px;
|
||||
// 设计稿方块间距 30px
|
||||
gap: 30px;
|
||||
|
||||
&__item {
|
||||
.flex(column, center, center);
|
||||
gap: 0;
|
||||
// 设计稿统计方块 112×112 设计px → 86×86 CSS,#024FFF 实底
|
||||
width: 86px;
|
||||
height: 86px;
|
||||
min-width: 86px;
|
||||
// 设计稿统计方块 112×112,#024FFF 实底
|
||||
width: 112px;
|
||||
height: 112px;
|
||||
min-width: 112px;
|
||||
padding: 0;
|
||||
border-radius: @radius-sm;
|
||||
background: @primary-strong;
|
||||
}
|
||||
|
||||
&__value {
|
||||
// 设计稿数字 48 设计px / 500 / 白
|
||||
font-size: 37px;
|
||||
// 设计稿数字 48px / 500 / 白
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: @font-size-sm;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 500;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
@@ -37,24 +37,24 @@ const greeting = computed(() => {
|
||||
&__greeting {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
// 设计稿「中午好」52 设计px / 700 / #2C2C2C
|
||||
font-size: 40px;
|
||||
// 设计稿「中午好」52px / 700 / #2C2C2C
|
||||
font-size: 52px;
|
||||
font-weight: 700;
|
||||
color: @home-welcome;
|
||||
}
|
||||
|
||||
&__wave {
|
||||
.flex(row, center);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: @radius-round;
|
||||
background: fade(@black, 4%);
|
||||
font-size: @font-size-lg;
|
||||
font-size: @font-size-xl;
|
||||
}
|
||||
|
||||
&__summary {
|
||||
// 设计稿副文案 24 设计px / 400 / #2C2C2C
|
||||
font-size: 18px;
|
||||
// 设计稿副文案 24px / 400 / #2C2C2C
|
||||
font-size: 24px;
|
||||
font-weight: 400;
|
||||
color: @home-welcome;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { AppButton } from '@/components'
|
||||
import { useRoute } from 'vue-router'
|
||||
// 业务详情页:数据只经 useHomeStore,不直接 import api
|
||||
import { useHomeStore } from '@/stores/modules/home'
|
||||
import type { BusinessType } from '@/types/api'
|
||||
@@ -9,7 +8,6 @@ import HomeServiceContents from './cpns/HomeServiceContents.vue'
|
||||
import HomeServiceTypes from './cpns/HomeServiceTypes.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const homeStore = useHomeStore()
|
||||
|
||||
const line = computed(() => homeStore.currentBusiness)
|
||||
@@ -25,58 +23,53 @@ onMounted(load)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 业务详情:设计实测内容区 x70→1850(宽 1780),故与其它常规页一致用 .container -->
|
||||
<div class="business-detail">
|
||||
<nav class="business-detail__breadcrumb text-secondary">
|
||||
<RouterLink to="/" class="link">
|
||||
首页
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>业务详情</span>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<nav class="business-detail__breadcrumb">
|
||||
<RouterLink to="/" class="link">
|
||||
首页
|
||||
</RouterLink>
|
||||
<span> > </span>
|
||||
<span>业务详情</span>
|
||||
</nav>
|
||||
|
||||
<template v-if="line">
|
||||
<header class="business-detail__hero">
|
||||
<span class="business-detail__logo">
|
||||
<!-- TODO(蓝湖): 替换业务图标切图 -->
|
||||
{{ line.name.slice(0, 2) }}
|
||||
</span>
|
||||
<div class="business-detail__intro">
|
||||
<h1 class="business-detail__name">
|
||||
{{ line.name }}
|
||||
</h1>
|
||||
<p class="business-detail__slogan text-secondary">
|
||||
{{ line.slogan }}
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
<template v-if="line">
|
||||
<header class="business-detail__hero">
|
||||
<div class="business-detail__intro">
|
||||
<h1 class="business-detail__name">
|
||||
{{ line.name }}
|
||||
</h1>
|
||||
<p class="business-detail__slogan">
|
||||
{{ line.slogan }}
|
||||
</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<HomeServiceTypes :service-types="line.serviceTypes" />
|
||||
<HomeServiceTypes :service-types="line.serviceTypes" />
|
||||
|
||||
<HomeServiceContents :contents="line.contents" />
|
||||
<HomeServiceContents :contents="line.contents" />
|
||||
</template>
|
||||
|
||||
<div class="business-detail__cta">
|
||||
<AppButton type="primary" size="lg" @click="router.push('/demand')">
|
||||
立即提报
|
||||
</AppButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<p v-else class="text-secondary">
|
||||
正在加载业务详情...
|
||||
</p>
|
||||
<p v-else class="business-detail__loading">
|
||||
正在加载业务详情...
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.business-detail {
|
||||
padding-top: @spacing-lg;
|
||||
// 设计实测:面包屑 y104、头图条 y190、白卡 y429/y736
|
||||
padding-top: 32px; // 面包屑顶 = 104 − 顶栏 72
|
||||
padding-bottom: @spacing-xxl;
|
||||
|
||||
&__breadcrumb {
|
||||
margin-bottom: 36px;
|
||||
// 设计稿面包屑 24 设计px / 500 / #666666
|
||||
font-size: 18px;
|
||||
// 设计稿面包屑 @(70,104) 24px/500 #666666
|
||||
margin-bottom: 49px; // 头图条顶 190 − 面包屑底(104+37)
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
line-height: 37px;
|
||||
color: @home-breadcrumb;
|
||||
|
||||
.link {
|
||||
@@ -84,52 +77,52 @@ onMounted(load)
|
||||
}
|
||||
}
|
||||
|
||||
// 设计稿头图卡 1780×219 设计px:浅蓝渐变底、左上图标块 + 标题 + 副标题
|
||||
// 设计稿头图条 矩形 195 @(70,190) 1780×219(浅蓝渐变底)
|
||||
&__hero {
|
||||
.flex(column, flex-start);
|
||||
gap: 18px;
|
||||
margin-bottom: @spacing-base;
|
||||
padding: 19px 22px 24px;
|
||||
padding: 129px 29px 0; // 业务名 @(99,319) → 卡内 x29 / y129
|
||||
border-radius: @radius-lg;
|
||||
background: @home-detail-hero-bg;
|
||||
height: 219px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
&__loading {
|
||||
padding: 80px 0;
|
||||
font-size: 16px;
|
||||
color: @text-color-secondary;
|
||||
}
|
||||
|
||||
&__logo {
|
||||
.flex(row, center);
|
||||
width: 62px;
|
||||
height: 62px;
|
||||
border-radius: @radius-lg;
|
||||
background: @home-detail-logo-bg;
|
||||
color: @primary-strong;
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
display: none; // 设计稿头图条内无独立 logo 块
|
||||
}
|
||||
|
||||
&__intro {
|
||||
.flex(column, flex-start);
|
||||
gap: 6px;
|
||||
gap: 8px; // 名称底 319+33=352 → 副标题顶 360
|
||||
}
|
||||
|
||||
&__name {
|
||||
// 设计稿详情标题 26 设计px / #333333
|
||||
font-size: @font-size-xl;
|
||||
font-weight: 600;
|
||||
// 设计稿业务名 @(99,319) 26px / #333333
|
||||
margin: 0;
|
||||
font-size: 26px;
|
||||
font-weight: 400;
|
||||
line-height: 33px;
|
||||
color: @home-body;
|
||||
}
|
||||
|
||||
&__slogan {
|
||||
// 设计稿副标题 14 设计px → 可读下限 11px / #333333
|
||||
font-size: 11px;
|
||||
// 设计稿副标题 @(99,360) 14px/400 #333333
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 18px;
|
||||
color: @home-body;
|
||||
}
|
||||
|
||||
&__cta {
|
||||
padding-top: @spacing-base;
|
||||
|
||||
.app-button {
|
||||
width: 100%;
|
||||
}
|
||||
display: none; // 设计稿无底部 CTA 块
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -12,7 +12,7 @@ import HomeBusinessCards from './cpns/HomeBusinessCards.vue'
|
||||
import HomeCaseShowcase from './cpns/HomeCaseShowcase.vue'
|
||||
|
||||
const homeStore = useHomeStore()
|
||||
const { stats, banners, businessLines, featuredCases } = storeToRefs(homeStore)
|
||||
const { stats, businessLines, featuredCases } = storeToRefs(homeStore)
|
||||
|
||||
const todaySummary = computed(() => `今天有${stats.value.inProgress}个项目正在进行`)
|
||||
|
||||
@@ -27,10 +27,11 @@ onMounted(() => {
|
||||
|
||||
<template>
|
||||
<div class="home">
|
||||
<!-- 设计稿头图为通栏(0..1920),故不包 .container -->
|
||||
<HomeBanner :banners="banners" />
|
||||
<!-- 设计稿头图为通栏(0..1920),静态设计图,故不包 .container -->
|
||||
<HomeBanner />
|
||||
|
||||
<div class="container home__dashboard">
|
||||
<!-- 首页设计稿单独基准:内容区 1680 / 留白 120,故用 container--home -->
|
||||
<div class="container container--home home__dashboard">
|
||||
<section class="home__dashboard-main">
|
||||
<HomeWelcome :summary="todaySummary" />
|
||||
<HomeStats :stats="stats" />
|
||||
@@ -38,11 +39,11 @@ onMounted(() => {
|
||||
<HomeQuickEntries />
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="container container--home">
|
||||
<HomeBusinessCards :lines="businessLines" />
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="container container--home">
|
||||
<HomeCaseShowcase
|
||||
:cases="featuredCases"
|
||||
@category-change="onCategoryChange"
|
||||
@@ -54,27 +55,24 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.home {
|
||||
.flex(column, flex-start);
|
||||
// 设计稿区块间距 19~20 设计px ≈ 16 CSS;头图紧贴顶栏
|
||||
gap: @spacing-base;
|
||||
// 设计稿区块间距 ≈ 20px(内容区 1680,区块卡紧邻)
|
||||
gap: 20px;
|
||||
padding-top: 0;
|
||||
padding-bottom: @spacing-xxl;
|
||||
|
||||
&__dashboard {
|
||||
.flex(row, space-between, stretch);
|
||||
// 设计稿左右卡间距 36 设计px ≈ 28 CSS
|
||||
gap: 28px;
|
||||
// 设计稿区块行 1680 设计px 宽(内容区内左右各缩 50 设计px)≈ 1294 CSS
|
||||
max-width: 1326px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
// 设计稿左右卡间距 36px(左卡宽 922 / 右卡宽 722,内容区 1680)
|
||||
gap: 36px;
|
||||
}
|
||||
|
||||
&__dashboard-main {
|
||||
.flex(row, space-between, center);
|
||||
flex: 1;
|
||||
min-width: 0; // 允许收缩,右侧快捷卡才能在窄视口让位
|
||||
gap: @spacing-lg;
|
||||
// 设计稿欢迎卡(120,754,922,245):白底 + 浅灰描边,内边距 61/106/66/73 设计px
|
||||
padding: 46px 56px 46px 82px;
|
||||
// 设计稿欢迎卡(120,754,922,245):白底 + 浅灰描边
|
||||
padding: 0 73px 0 106px;
|
||||
border: 1px solid @home-card-border;
|
||||
border-radius: @radius-lg;
|
||||
background: @white;
|
||||
|
||||
Reference in New Issue
Block a user