Files
jinshen-website/app/components/shared/SolutionCard.vue
R2m1liA 58e91ed67c
All checks were successful
deploy to server / build-and-deploy (push) Successful in 2m59s
fix: 调整部分图像显示问题
- 产品/解决方案卡片图片宽度调整为100%并将比例设定为16/10
- 产品页在竖屏状态下的文字边距
2025-11-07 14:36:21 +08:00

87 lines
1.6 KiB
Vue

<template>
<el-card
class="solution-card"
body-class="card-body"
header-class="card-header"
@click="handleClick"
>
<template #header>
<!-- Cover Image -->
<el-image class="solution-cover" :src="coverUrl" fit="cover" />
</template>
<!-- Title -->
<template #default>
<div class="text-center mx-auto text-md">
<span class="solution-title">{{ title }}</span>
</div>
<!-- Summary -->
<div class="mx-auto mt-5 text-left text-sm opacity-25">{{ summary }}</div>
</template>
</el-card>
</template>
<script setup lang="ts">
interface Props {
title: string;
summary: string;
coverUrl: string;
documentId?: string;
}
const props = defineProps<Props>();
const localePath = useLocalePath();
const handleClick = () => {
const routeParam = props.documentId;
if (routeParam) {
navigateTo(localePath(`/solutions/${routeParam}`));
}
};
</script>
<style scoped>
.solution-card {
width: 30%;
cursor: pointer;
transition: all 0.3s ease;
text-align: center;
}
.solution-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.solution-title {
font-weight: 600;
}
:deep(.card-header) {
padding: 0;
border-bottom: none !important;
}
:deep(.card-body) {
margin: 10px auto;
padding: 1px auto;
}
.solution-card .el-image {
width: 100%;
aspect-ratio: 16 / 10;
}
@media (max-width: 1200px) {
.solution-card {
width: 45%;
}
}
@media (max-width: 768px) {
.solution-card {
width: 90%;
margin: 10px auto;
}
}
</style>