feat 案例库样式整改

This commit is contained in:
Ironsp
2026-10-13 15:34:55 +08:00
parent f552dd370c
commit 5fa940e9ba
3 changed files with 38 additions and 31 deletions

View File

@@ -18,7 +18,7 @@ const coverStyle = computed(() =>
<template> <template>
<section class="case-hero" :style="coverStyle"> <section class="case-hero" :style="coverStyle">
<div class="container case-hero__inner"> <div class="case-hero__inner">
<span v-if="tag" class="case-hero__tag">{{ tag }}</span> <span v-if="tag" class="case-hero__tag">{{ tag }}</span>
<h1 class="case-hero__title"> <h1 class="case-hero__title">
{{ props.item.title }} {{ props.item.title }}
@@ -30,15 +30,9 @@ const coverStyle = computed(() =>
<style lang="less" scoped> <style lang="less" scoped>
.case-hero { .case-hero {
position: relative; position: relative;
width: auto; width: 100%;
max-width: @home-content;
height: 180px; height: 180px;
margin: 0 @home-gutter;
border-radius: @radius-base; border-radius: @radius-base;
@media (max-width: 1600px) {
margin: 0 @spacing-lg;
}
background-color: @primary-color; background-color: @primary-color;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
@@ -58,7 +52,8 @@ const coverStyle = computed(() =>
.flex(column, flex-end, flex-start); .flex(column, flex-end, flex-start);
gap: @spacing-sm; gap: @spacing-sm;
height: 100%; height: 100%;
padding-bottom: @spacing-lg; box-sizing: border-box;
padding: 0 @spacing-lg @spacing-lg;
} }
&__tag { &__tag {

View File

@@ -51,19 +51,21 @@ onMounted(load)
</div> </div>
<template v-if="item"> <template v-if="item">
<CaseHero :item="item" /> <div class="container case-detail__body">
<CaseHero :item="item" />
<div class="container case-detail__main"> <div class="case-detail__main">
<CaseDetailHeader :item="item" @favorite="onFavorite" @share="onShare" /> <CaseDetailHeader :item="item" @favorite="onFavorite" @share="onShare" />
<CaseRichText :item="item" /> <CaseRichText :item="item" />
<button <button
class="case-detail__cta" class="case-detail__cta"
type="button" type="button"
@click="router.push('/demand')" @click="router.push('/demand')"
> >
一键填报类似案例 一键填报类似案例
</button> </button>
</div>
</div> </div>
</template> </template>
@@ -85,10 +87,14 @@ onMounted(load)
font-size: @font-size-sm; font-size: @font-size-sm;
} }
&__body {
.flex(column, flex-start, stretch);
gap: @spacing-base;
}
&__main { &__main {
.flex(column, flex-start, stretch); .flex(column, flex-start, stretch);
gap: @spacing-base; gap: @spacing-base;
padding-top: @spacing-lg;
} }
&__cta { &__cta {

View File

@@ -33,9 +33,7 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
<template> <template>
<section class="home-cases"> <section class="home-cases">
<div class="home-cases__head"> <div class="home-cases__head">
<h3 class="home-cases__title"> <h3 class="home-cases__title">案例库精选</h3>
案例库精选
</h3>
<div class="home-cases__tabs"> <div class="home-cases__tabs">
<button <button
v-for="cat in categories" v-for="cat in categories"
@@ -60,7 +58,12 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
@click="$router.push(`/cases/${item.id}`)" @click="$router.push(`/cases/${item.id}`)"
> >
<div class="home-cases__cover"> <div class="home-cases__cover">
<img v-if="item.cover" v-lazy="item.cover" class="home-cases__img" :alt="item.title"> <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" /> <div v-else class="home-cases__img home-cases__img--placeholder" />
</div> </div>
@@ -140,13 +143,13 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
} }
&__grid { &__grid {
display: flex; display: grid;
gap: 24px; grid-template-columns: repeat(4, 1fr);
gap: @spacing-lg;
} }
&__card { &__card {
overflow: hidden; overflow: hidden;
flex: 1 1 0;
min-width: 0; min-width: 0;
min-height: 220px; min-height: 220px;
box-sizing: border-box; box-sizing: border-box;
@@ -155,7 +158,10 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
background: @white; background: @white;
box-shadow: none; box-shadow: none;
cursor: pointer; cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; transition:
transform 0.2s,
box-shadow 0.2s,
border-color 0.2s;
&:hover { &:hover {
border-color: @primary-color; border-color: @primary-color;
@@ -185,7 +191,7 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
} }
&__body { &__body {
padding: 0 20px; padding: 0 20px 10px 20px;
} }
&__name { &__name {
@@ -201,7 +207,7 @@ const visibleCases = computed<Case[]>(() => props.cases.slice(0, 4))
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
gap: 0 @spacing-lg; gap: 0 @spacing-lg;
margin-top: 43px; margin-top: 20px;
font-size: 13px; font-size: 13px;
line-height: 20px; line-height: 20px;
color: @home-body; color: @home-body;