修改页面样式,宽屏适配 #5

Manually merged
remilia merged 3 commits from style-fix into master 2025-09-08 16:53:32 +08:00
11 changed files with 114 additions and 155 deletions

View File

@ -1,69 +0,0 @@
<template>
<div class="page-container">
<div v-if="content">
<el-breadcrumb class="breadcrumb" separator="/">
<el-breadcrumb-item class="text-md opacity-50">
<NuxtLink :to="$localePath('/')">
{{ $t('navigation.home') }}
</NuxtLink>
</el-breadcrumb-item>
<el-breadcrumb-item class="text-md opacity-50">
<NuxtLink :to="$localePath('/about')">
{{ $t('navigation.contact-info') }}
</NuxtLink>
</el-breadcrumb-item>
</el-breadcrumb>
<div class="content">
<markdown-renderer :content="content || ''" />
</div>
</div>
<div v-else class="loading">
<el-skeleton :rows="5" animated />
</div>
</div>
</template>
<script setup lang="ts">
const { findOne } = useStrapi()
const { getStrapiLocale } = useLocalizations()
const strapiLocale = getStrapiLocale()
const content = ref<string>('')
onMounted(async () => {
try {
const response = await findOne<StrapiContactInfo>('contact-info', undefined, {
populate: '*',
locale: strapiLocale,
})
if (response.data) {
content.value = response.data.content || ''
} else {
console.warn('No contact info data found')
}
} catch (error) {
console.error('Failed to fetch contact info:', error)
}
})
</script>
<style scoped>
.page-container {
padding: 2rem 1rem;
}
.breadcrumb {
padding: 1rem 1rem;
}
.content {
padding: 1rem;
margin-bottom: 2rem;
}
:deep(.markdown-body ul) {
list-style-type: none;
}
</style>

View File

@ -64,6 +64,8 @@ onMounted(async () => {
<style scoped> <style scoped>
.page-container { .page-container {
padding: 2rem 1rem; padding: 2rem 1rem;
max-width: 1200px;
margin: 0 auto;
} }
.breadcrumb { .breadcrumb {

View File

@ -4,47 +4,40 @@
<el-carousel class="homepage-carousel" height="auto" :interval="5000" arrow="never" autoplay> <el-carousel class="homepage-carousel" height="auto" :interval="5000" arrow="never" autoplay>
<el-carousel-item v-for="(item, index) in carouselImages" :key="index"> <el-carousel-item v-for="(item, index) in carouselImages" :key="index">
<div class="carousel-item"> <div class="carousel-item">
<el-image <el-image class="carousel-image" :src="useStrapiMedia(item.url || '')"
class="carousel-image" :src="useStrapiMedia(item.url || '')"
:alt="item.alternativeText || `Carousel Image ${index + 1}`" fit="contain" lazy /> :alt="item.alternativeText || `Carousel Image ${index + 1}`" fit="contain" lazy />
<p v-if="item.caption" class="caption">{{ item.caption }}</p> <p v-if="item.caption" class="carousel-image-caption">{{ item.caption }}</p>
</div> </div>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<div class="recommend-production" style="padding: 2rem;"> <section>
<div class="section"> <h2>推荐产品</h2>
<h2 style="font-size: 1.5rem; font-weight: bold; margin-bottom: 1rem;">推荐产品</h2> <p>探索我们的精选产品满足您的各种需求无论是创新技术还是经典设计我们都为您提供优质选择</p>
<p>探索我们的精选产品满足您的各种需求无论是创新技术还是经典设计我们都为您提供优质选择</p> <el-carousel class="recommend-carousel" height="auto" arrow="never" indicator-position="outside"
<el-carousel :autoplay="false">
class="production-carousel" height="auto" arrow="never" indicator-position="outside" <el-carousel-item v-for="n in Math.floor(recommend_productions.length / 3) + 1" :key="n"
:autoplay="false"> class="recommend-list">
<el-carousel-item <div class="recommend-card-group">
v-for="n in Math.floor(recommend_productions.length / 3) + 1" :key="n" <el-card v-for="(item, index) in recommend_productions.slice((n - 1) * 3, n * 3)" :key="index"
class="production-list"> class="recommend-card" @click="handleProductionCardClick(item.documentId || '')">
<div class="block-group"> <template #header>
<el-card <el-image :src="useStrapiMedia(item.cover?.url || '')"
v-for="(item, index) in recommend_productions.slice((n - 1) * 3, n * 3)" :key="index" :alt="item.cover?.alternativeText || item.title" fit="cover"
class="block production-card" @click="handleProductionCardClick(item.documentId || '')"> style="width: 100%; height: 200px; border-radius: 8px;" lazy />
<template #header> </template>
<el-image <div class="recommend-card-body">
:src="useStrapiMedia(item.cover?.url || '')" <!-- Title -->
:alt="item.cover?.alternativeText || item.title" fit="cover" <div class="text-center">
style="width: 100%; height: 200px; border-radius: 8px;" lazy /> <span class="recommend-card-title">{{ item.title }}</span>
</template>
<div class="card-body">
<!-- Name -->
<div class="text-center">
<span class="production-name">{{ item.title }}</span>
</div>
<!-- Description -->
<div class="card-description text-left opacity-25">{{ item.summary }}</div>
</div> </div>
</el-card> <!-- Description -->
</div> <div class="recommend-card-description text-left opacity-25">{{ item.summary }}</div>
</el-carousel-item> </div>
</el-carousel> </el-card>
</div> </div>
</div> </el-carousel-item>
</el-carousel>
</section>
</div> </div>
<div v-else class="loading"> <div v-else class="loading">
<el-skeleton :rows="3" animated /> <el-skeleton :rows="3" animated />
@ -102,6 +95,23 @@ const handleProductionCardClick = (documentId: string) => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
section {
padding: 2rem;
}
section h2 {
color: var(--el-text-color-primary);
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 0.5rem;
}
section p {
color: var(--el-text-color-regular);
line-height: 1.6;
}
.homepage-carousel .el-carousel__item { .homepage-carousel .el-carousel__item {
width: 100%; width: 100%;
height: 33vw; height: 33vw;
@ -128,7 +138,7 @@ const handleProductionCardClick = (documentId: string) => {
height: 100%; height: 100%;
} }
.caption { .carousel-image-caption {
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
left: 50%; left: 50%;
@ -140,7 +150,7 @@ const handleProductionCardClick = (documentId: string) => {
font-size: 14px; font-size: 14px;
} }
.production-carousel :deep(.el-carousel__button) { .recommend-carousel :deep(.el-carousel__button) {
/* 指示器按钮样式 */ /* 指示器按钮样式 */
width: 8px; width: 8px;
height: 8px; height: 8px;
@ -149,13 +159,13 @@ const handleProductionCardClick = (documentId: string) => {
transition: all 0.3s ease; transition: all 0.3s ease;
} }
.production-list { .recommend-list {
display: flex; display: flex;
padding: 1rem; padding: 1rem;
height: 400px; height: 400px;
} }
.block-group { .recommend-card-group {
display: flex; display: flex;
gap: 1rem; gap: 1rem;
width: 100%; width: 100%;
@ -165,45 +175,36 @@ const handleProductionCardClick = (documentId: string) => {
} }
.block { .recommend-card {
width: 30%;
height: 100%;
border: 2px dashed #a3aac6;
}
.production-card {
transition: all 0.3s ease; transition: all 0.3s ease;
text-align: center; text-align: center;
} }
.production-card:hover { .recommend-card:hover {
transform: translateY(-4px); transform: translateY(-4px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
} }
.production-name {
font-size: 1rem; .recommend-card-body {
font-weight: 600; margin: 10px auto;
padding: 0px auto;
height: 100px;
} }
.card-description { .recommend-card-title {
font-size: 0.8rem; font-size: 1rem;
margin-top: 5px; font-weight: 600;
} }
.production-card .el-image { .recommend-card-description {
height: 150px; font-size: 0.8rem;
border-radius: 4px; margin-top: 5px;
} }
.card-body { .recommend-card .el-image {
margin: 10px auto; height: 150px;
padding: 0px auto; border-radius: 4px;
height: 100px;
} }
.section p {
color: var(--el-text-color-regular);
line-height: 1.6;
}
</style> </style>

View File

@ -129,7 +129,9 @@ useHead({
<style scoped> <style scoped>
.page-container { .page-container {
min-height: 60vh; min-height: 80vh;
max-width: 1200px;
margin: 0 auto;
} }
.breadcrumb { .breadcrumb {

View File

@ -11,19 +11,19 @@
</el-breadcrumb-item> </el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="productions-container"> <div class="page-content">
<el-collapse v-model="activeNames" class="production-collapse"> <div class="productions-container">
<el-collapse-item <el-collapse v-model="activeNames" class="production-collapse">
v-for="(group, type) in groupedProductions" :key="type" :title="type || '未分类'" <el-collapse-item v-for="(group, type) in groupedProductions" :key="type" :title="type || '未分类'"
:name="type || 'no-category'"> :name="type || 'no-category'">
<div class="group-list"> <div class="group-list">
<production-card <production-card v-for="production in group" :key="production.documentId || production.id"
v-for="production in group" :key="production.documentId || production.id" :slug="production.documentId" :image-url="useStrapiMedia(production?.cover?.url || '')"
:slug="production.documentId" :image-url="useStrapiMedia(production?.cover?.url || '')" :name="production.title" :description="production.summary || ''" />
:name="production.title" :description="production.summary || ''" /> </div>
</div> </el-collapse-item>
</el-collapse-item> </el-collapse>
</el-collapse> </div>
</div> </div>
</div> </div>
</template> </template>
@ -92,6 +92,8 @@ onMounted(async () => {
<style scoped> <style scoped>
.page-container { .page-container {
padding: 2rem; padding: 2rem;
margin: 0 auto;
max-width: 1200px;
} }
.page-header { .page-header {

View File

@ -67,7 +67,9 @@ onMounted(async () => {
<style scoped> <style scoped>
.page-container { .page-container {
padding: 1rem; padding: 1rem;
min-height: 60vh; min-height: 80vh;
max-width: 1200px;
margin: 0 auto;
} }
.breadcrumb { .breadcrumb {

View File

@ -98,6 +98,8 @@ onMounted(async () => {
<style scoped> <style scoped>
.page-container { .page-container {
padding: 2rem; padding: 2rem;
max-width: 1200px;
margin: 0 auto;
} }
.page-header { .page-header {

View File

@ -59,6 +59,11 @@ onMounted(async () => {
</script> </script>
<style scoped> <style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header { .page-header {
display: flex; display: flex;
padding: 2rem 2rem 0rem; padding: 2rem 2rem 0rem;

View File

@ -55,6 +55,11 @@ onMounted(async () => {
</script> </script>
<style scoped> <style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header { .page-header {
display: flex; display: flex;
padding: 2rem 2rem 0rem; padding: 2rem 2rem 0rem;

View File

@ -53,6 +53,11 @@ onMounted(async () => {
</script> </script>
<style scoped> <style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header { .page-header {
display: flex; display: flex;
padding: 2rem 2rem 0rem; padding: 2rem 2rem 0rem;

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="page-container"> <div class="page-container">
<support-tabs /> <support-tabs />
<div class="page-content"> <div class="page-content">
<div class="page-header"> <div class="page-header">
<h1 class="page-title">{{ $t('navigation.support') }}</h1> <h1 class="page-title">{{ $t('navigation.support') }}</h1>
<el-breadcrumb class="breadcrumb" separator="/"> <el-breadcrumb class="breadcrumb" separator="/">
@ -105,6 +105,10 @@
</script> </script>
<style scoped> <style scoped>
.page-container {
max-width: 1200px;
margin: 0 auto;
}
.page-header { .page-header {
display: flex; display: flex;
@ -123,8 +127,6 @@
.page-content { .page-content {
padding: 1rem 2rem 2rem; padding: 1rem 2rem 2rem;
max-width: 1200px;
margin: 0 auto;
} }
@ -135,7 +137,7 @@ section {
.card-group { .card-group {
display: flex; display: flex;
gap: 100px; gap: 50px;
justify-content: space-around; justify-content: space-around;
margin-bottom: 2rem; margin-bottom: 2rem;
} }