feat 首页

This commit is contained in:
Ironsp
2026-10-08 17:26:33 +08:00
parent a3b04485dd
commit aa440d6bb5
21 changed files with 138 additions and 926 deletions

View File

@@ -1,10 +1,6 @@
<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[]
@@ -12,13 +8,7 @@ interface Props {
defineProps<Props>()
const FALLBACK_ILL: Record<BusinessType, string> = {
internet: illInternet,
hardware: illHardware,
iot: illIot,
manufacturing: illManufacturing,
other: illIot,
}
const FALLBACK_ACTIVE: BusinessType[] = ['internet']
</script>
<template>
@@ -31,13 +21,10 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
:key="line.id"
:to="`/business/${line.id}`"
class="home-business__card"
:class="`home-business__card--${line.id}`"
:class="{
'home-business__card--active': FALLBACK_ACTIVE.includes(line.id),
}"
>
<img
class="home-business__ill"
:src="line.icon || FALLBACK_ILL[line.id]"
:alt="line.name"
/>
<span class="home-business__check" aria-hidden="true" />
<h4 class="home-business__name">
{{ line.name }}
@@ -76,6 +63,7 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
min-width: 0;
height: 206px;
box-sizing: border-box;
padding: 0 20px;
overflow: hidden;
border: 1px solid @home-business-border;
border-radius: @radius-base;
@@ -90,19 +78,10 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
}
}
&__ill {
position: absolute;
top: 4px;
left: 48px;
width: 81px;
height: 111px;
object-fit: contain;
}
&__check {
position: absolute;
top: 24px;
right: 20px;
top: 27px;
right: 37px;
flex-shrink: 0;
width: 31px;
height: 31px;
@@ -113,8 +92,8 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
content: '';
position: absolute;
inset: 0;
width: 18px;
height: 18px;
width: 21px;
height: 21px;
margin: auto;
border-radius: @radius-round;
background: @white;
@@ -123,7 +102,7 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
}
&__name {
margin: 106px 0 0;
margin: 104px 0 0;
font-size: @font-size-title;
font-weight: 500;
line-height: 41px;
@@ -139,7 +118,7 @@ const FALLBACK_ILL: Record<BusinessType, string> = {
.multi-ellipsis(1);
}
&__card--internet {
&__card--active {
border-color: @primary-strong;
background: @primary-strong;