feat ui设计稿bug修复
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user