This commit is contained in:
wangzzpeng
2026-09-28 09:27:51 +08:00
parent 7bc84bbe5e
commit 6eb2bfcbfd
25 changed files with 2887 additions and 0 deletions

View File

@@ -0,0 +1,120 @@
<script setup lang="ts">
import type { ServiceContentBlock } from '@/types/business/home'
interface Props {
/** 服务内容区块列表:后端每条富文本目录一项 */
contents: ServiceContentBlock[]
}
defineProps<Props>()
</script>
<template>
<!-- 设计稿:一个「服务内容」区块 = 一条富文本目录(块内含媒体与要点列表,可多块) -->
<div v-if="contents.length" class="home-contents">
<section
v-for="(block, index) in contents"
:key="`${block.title}-${index}`"
class="home-contents__block"
>
<h3 class="home-contents__title">
服务内容
</h3>
<!-- 后端富文本原文(含内嵌图片/视频),取自后台维护内容 -->
<div class="home-contents__rich" v-html="block.content" />
</section>
</div>
</template>
<style lang="less" scoped>
.home-contents {
&__block {
margin-bottom: @spacing-lg;
padding: @spacing-lg @spacing-xl;
border-radius: @radius-lg;
background: @white;
box-shadow: @shadow-base;
&:last-child {
margin-bottom: 0;
}
}
&__title {
position: relative;
margin-bottom: @spacing-base;
padding-left: @spacing-sm;
font-size: @font-size-xl;
font-weight: 600;
color: @heading-color;
&::before {
content: '';
position: absolute;
top: 50%;
left: 0;
width: 3px;
height: 16px;
border-radius: @radius-round;
background: @primary-color;
transform: translateY(-50%);
}
}
&__rich {
font-size: @font-size-sm;
line-height: 1.9;
color: @text-color;
word-break: break-word;
:deep(p) {
margin: 0 0 @spacing-sm;
}
:deep(ol),
:deep(ul) {
margin: 0 0 @spacing-sm;
padding-left: 1.4em;
}
:deep(li) {
margin-bottom: 2px;
}
:deep(img),
:deep(video) {
display: block;
max-width: 100%;
margin: 0 auto @spacing-base;
border-radius: @radius-base;
}
:deep(h1),
:deep(h2),
:deep(h3),
:deep(h4) {
margin: @spacing-base 0 @spacing-sm;
font-size: @font-size-base;
font-weight: 600;
color: @heading-color;
}
:deep(table) {
width: 100%;
border-collapse: collapse;
margin-bottom: @spacing-sm;
}
:deep(td),
:deep(th) {
padding: @spacing-xs @spacing-sm;
border: 1px solid @border-color;
font-size: @font-size-sm;
}
:deep(a) {
color: @primary-color;
}
}
}
</style>