Compare commits
7 Commits
300266d32c
...
84b99deef6
| Author | SHA1 | Date | |
|---|---|---|---|
| 84b99deef6 | |||
| 667413dd12 | |||
| 00c4c80e49 | |||
| 9982481c83 | |||
| 5f78c888a2 | |||
| c4e797500f | |||
| 5920925ded |
83
app/components/pages/download/FileCard.vue
Normal file
83
app/components/pages/download/FileCard.vue
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<template>
|
||||||
|
<el-card shadow="hover" class="p-4">
|
||||||
|
<template #header>
|
||||||
|
<div class="header-content">
|
||||||
|
<el-icon class="header-icon"><ElIconDocument /></el-icon>
|
||||||
|
<span class="truncate font-medium">{{ file.filename_download }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<dl class="text-gray-600 space-y-1 mb-6">
|
||||||
|
<div>
|
||||||
|
<dt class="font-semibold inline">类型:</dt>
|
||||||
|
<dd class="inline">{{ file.type }}</dd>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<dt class="font-semibold inline">大小:</dt>
|
||||||
|
<dd class="inline">{{ formatFileSize(file.filesize) }}</dd>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<dt class="font-semibold inline">上传时间:</dt>
|
||||||
|
<dd class="inline">
|
||||||
|
{{ new Date(file.uploaded_on).toLocaleDateString() }}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
<template #footer>
|
||||||
|
<div class="button-group">
|
||||||
|
<el-button type="primary" @click="handleDownload">下载</el-button>
|
||||||
|
<el-button v-if="file.previewable" @click="handlePreview"
|
||||||
|
>预览</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
fileId: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
file: {
|
||||||
|
type: Object as PropType<FileMeta>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const localePath = useLocalePath();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
function handleDownload() {
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = `/api/download/${props.fileId}`;
|
||||||
|
link.download = props.file?.filename_download ?? 'download';
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handlePreview() {
|
||||||
|
router.push(localePath(`/preview/${props.fileId}`));
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.header-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 3px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.header-icon {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
86
app/components/pages/homepage/HomepageCarousel.vue
Normal file
86
app/components/pages/homepage/HomepageCarousel.vue
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<template>
|
||||||
|
<section v-if="!pending" class="carousel-section">
|
||||||
|
<el-carousel
|
||||||
|
class="homepage-carousel"
|
||||||
|
height="auto"
|
||||||
|
:interval="5000"
|
||||||
|
arrow="never"
|
||||||
|
autoplay
|
||||||
|
>
|
||||||
|
<el-carousel-item v-for="(item, index) in carousel" :key="index">
|
||||||
|
<div class="carousel-item">
|
||||||
|
<el-image
|
||||||
|
class="carousel-image"
|
||||||
|
:src="getImageUrl(item)"
|
||||||
|
:alt="`Carousel Image ${index + 1}`"
|
||||||
|
fit="contain"
|
||||||
|
lazy
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</section>
|
||||||
|
<section v-else>
|
||||||
|
<el-skeleton :rows="5" animated />
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
homepageData: {
|
||||||
|
type: Object as PropType<HomepageView>,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
pending: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { getImageUrl } = useDirectusImage();
|
||||||
|
|
||||||
|
const carousel = computed(() => props.homepageData?.carousel || []);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.carousel-section {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.homepage-carousel .el-carousel__item {
|
||||||
|
width: 100%;
|
||||||
|
height: 33vw;
|
||||||
|
/* 16:9 Aspect Ratio */
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-carousel__item h3 {
|
||||||
|
display: flex;
|
||||||
|
color: #475669;
|
||||||
|
opacity: 0.8;
|
||||||
|
line-height: 300px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.homepage-carousel .carousel-item {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.carousel-image {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.carousel-image-caption {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
color: white;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
176
app/components/pages/homepage/HomepageProductSection.vue
Normal file
176
app/components/pages/homepage/HomepageProductSection.vue
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
<template>
|
||||||
|
<section class="homepage-section">
|
||||||
|
<h2>推荐产品</h2>
|
||||||
|
<p>
|
||||||
|
探索我们的精选产品,满足您的各种需求。无论是创新技术还是经典设计,我们都为您提供优质选择。
|
||||||
|
</p>
|
||||||
|
<div v-if="!pending">
|
||||||
|
<el-carousel
|
||||||
|
class="recommend-carousel"
|
||||||
|
height="auto"
|
||||||
|
arrow="never"
|
||||||
|
indicator-position="outside"
|
||||||
|
:autoplay="false"
|
||||||
|
>
|
||||||
|
<el-carousel-item
|
||||||
|
v-for="n in Math.floor(products.length / 3) + 1"
|
||||||
|
:key="n"
|
||||||
|
class="recommend-list"
|
||||||
|
>
|
||||||
|
<div class="recommend-card-group">
|
||||||
|
<el-card
|
||||||
|
v-for="(item, index) in products.slice((n - 1) * 3, n * 3)"
|
||||||
|
:key="index"
|
||||||
|
class="recommend-card"
|
||||||
|
@click="handleProductCardClick(item.id.toString() || '')"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<el-image
|
||||||
|
:src="getImageUrl(item.cover)"
|
||||||
|
:alt="item.name"
|
||||||
|
fit="cover"
|
||||||
|
lazy
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<div class="recommend-card-body">
|
||||||
|
<!-- Title -->
|
||||||
|
<div class="text-center">
|
||||||
|
<span class="recommend-card-title">{{ item.name }}</span>
|
||||||
|
</div>
|
||||||
|
<!-- Description -->
|
||||||
|
<div class="recommend-card-description text-left opacity-25">
|
||||||
|
{{ item.summary }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<el-skeleton :rows="4" animated />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
homepageData: {
|
||||||
|
type: Object as PropType<HomepageView>,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
pending: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { getImageUrl } = useDirectusImage();
|
||||||
|
|
||||||
|
const products = computed(() => props.homepageData?.recommendProducts || []);
|
||||||
|
|
||||||
|
const handleProductCardClick = (documentId: string) => {
|
||||||
|
// 使用路由导航到产品详情页
|
||||||
|
if (documentId) {
|
||||||
|
const localePath = useLocalePath();
|
||||||
|
const router = useRouter();
|
||||||
|
router.push(localePath(`/products/${documentId}`));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
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-section {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-carousel :deep(.el-carousel__button) {
|
||||||
|
/* 指示器按钮样式 */
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #475669;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.homepage-section {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-carousel :deep(.el-carousel__button) {
|
||||||
|
/* 指示器按钮样式 */
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #475669;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-list {
|
||||||
|
display: flex;
|
||||||
|
padding: 1rem;
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card {
|
||||||
|
width: 33%;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card :deep(.el-card__header) {
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-body {
|
||||||
|
margin: 10px auto;
|
||||||
|
padding: 0px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-title {
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-description {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card .el-image {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
176
app/components/pages/homepage/HomepageSolutionSection.vue
Normal file
176
app/components/pages/homepage/HomepageSolutionSection.vue
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
<template>
|
||||||
|
<section class="homepage-section">
|
||||||
|
<h2>推荐解决方案</h2>
|
||||||
|
<p>了解我们的定制解决方案,帮助您优化业务流程,提高效率。</p>
|
||||||
|
<div v-if="!pending">
|
||||||
|
<el-carousel
|
||||||
|
class="recommend-carousel"
|
||||||
|
height="auto"
|
||||||
|
arrow="never"
|
||||||
|
indicator-position="outside"
|
||||||
|
:autoplay="false"
|
||||||
|
>
|
||||||
|
<el-carousel-item
|
||||||
|
v-for="n in Math.floor(solutions.length / 3) + 1"
|
||||||
|
:key="n"
|
||||||
|
class="recommend-list"
|
||||||
|
>
|
||||||
|
<div class="recommend-card-group">
|
||||||
|
<el-card
|
||||||
|
v-for="(item, index) in solutions.slice((n - 1) * 3, n * 3)"
|
||||||
|
:key="index"
|
||||||
|
class="recommend-card"
|
||||||
|
@click="handleSolutionCardClick(item.id.toString() || '')"
|
||||||
|
>
|
||||||
|
<template #header>
|
||||||
|
<el-image
|
||||||
|
:src="getImageUrl(item.cover)"
|
||||||
|
:alt="item.title"
|
||||||
|
fit="cover"
|
||||||
|
lazy
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<div class="recommend-card-body">
|
||||||
|
<!-- Title -->
|
||||||
|
<div class="text-center">
|
||||||
|
<span class="recommend-card-title">{{ item.title }}</span>
|
||||||
|
</div>
|
||||||
|
<!-- Description -->
|
||||||
|
<div class="recommend-card-description text-left opacity-25">
|
||||||
|
{{ item.summary }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<el-skeleton :rows="4" animated />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
homepageData: {
|
||||||
|
type: Object as PropType<HomepageView>,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
pending: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { getImageUrl } = useDirectusImage();
|
||||||
|
|
||||||
|
const solutions = computed(
|
||||||
|
() => props.homepageData?.recommendSolutions || []
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleSolutionCardClick = (documentId: string) => {
|
||||||
|
// 使用路由导航到产品详情页
|
||||||
|
if (documentId) {
|
||||||
|
const localePath = useLocalePath();
|
||||||
|
const router = useRouter();
|
||||||
|
router.push(localePath(`/solutions/${documentId}`));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
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-section {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-carousel :deep(.el-carousel__button) {
|
||||||
|
/* 指示器按钮样式 */
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #475669;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.homepage-section {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-carousel :deep(.el-carousel__button) {
|
||||||
|
/* 指示器按钮样式 */
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #475669;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-list {
|
||||||
|
display: flex;
|
||||||
|
padding: 1rem;
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card {
|
||||||
|
width: 33%;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card :deep(.el-card__header) {
|
||||||
|
padding: 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-body {
|
||||||
|
margin: 10px auto;
|
||||||
|
padding: 0px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-title {
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card-description {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recommend-card .el-image {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
45
app/components/pages/products/ProductDetail.vue
Normal file
45
app/components/pages/products/ProductDetail.vue
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<div class="product-detail">
|
||||||
|
<el-tabs v-model="activeName" class="product-tabs" stretch>
|
||||||
|
<el-tab-pane label="产品详情" name="details">
|
||||||
|
<markdown-renderer :content="product.description || ''" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="技术规格" name="specs">
|
||||||
|
<spec-table :data="product.specs" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="常见问题" name="faq">
|
||||||
|
<question-list :questions="product.faqs" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="相关文档" name="documents">
|
||||||
|
<document-list :documents="product.documents" />
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineProps({
|
||||||
|
product: {
|
||||||
|
type: Object as PropType<ProductView>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const activeName = ref('details'); // 默认选中概览标签
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.product-tabs ::v-deep(.el-tabs__nav) {
|
||||||
|
min-width: 30%;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-tabs ::v-deep(.el-tabs__content) {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-detail h2 {
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
102
app/components/pages/products/ProductHeader.vue
Normal file
102
app/components/pages/products/ProductHeader.vue
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<template>
|
||||||
|
<div class="product-header">
|
||||||
|
<div class="product-image">
|
||||||
|
<el-image
|
||||||
|
v-if="product.images.length <= 1"
|
||||||
|
:src="getImageUrl(product.images[0].image)"
|
||||||
|
:alt="product.name"
|
||||||
|
fit="contain"
|
||||||
|
/>
|
||||||
|
<el-carousel
|
||||||
|
v-else
|
||||||
|
class="product-carousel"
|
||||||
|
height="500px"
|
||||||
|
:autoplay="false"
|
||||||
|
:loop="false"
|
||||||
|
arrow="always"
|
||||||
|
>
|
||||||
|
<el-carousel-item
|
||||||
|
v-for="(item, index) in product.images || []"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<div class="product-carousel-item">
|
||||||
|
<el-image
|
||||||
|
:src="getImageUrl(item.image || '')"
|
||||||
|
:alt="product.name"
|
||||||
|
fit="contain"
|
||||||
|
lazy
|
||||||
|
/>
|
||||||
|
<p v-if="item.caption" class="product-image-caption">
|
||||||
|
{{ item.caption }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="product-info">
|
||||||
|
<h1>{{ product.name }}</h1>
|
||||||
|
<p class="summary">{{ product.summary }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineProps({
|
||||||
|
product: {
|
||||||
|
type: Object as PropType<ProductView>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const { getImageUrl } = useDirectusImage();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.product-header {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 2fr 1fr;
|
||||||
|
gap: 3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image .el-image {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-image-caption {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10px;
|
||||||
|
/* left: 10%; */
|
||||||
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-carousel :deep(.el-carousel__button) {
|
||||||
|
/* 指示器按钮样式 */
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #475669;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.product-info h1 {
|
||||||
|
margin-top: 2rem;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
font-size: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary {
|
||||||
|
color: var(--el-color-info);
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
78
app/components/pages/search/SearchHeader.vue
Normal file
78
app/components/pages/search/SearchHeader.vue
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<template>
|
||||||
|
<div class="search-header">
|
||||||
|
<h1 class="page-title">{{ $t('search.title') }}</h1>
|
||||||
|
<div class="search-bar">
|
||||||
|
<el-input
|
||||||
|
v-model="keyword"
|
||||||
|
class="search-input"
|
||||||
|
:placeholder="$t('search-placeholder')"
|
||||||
|
:prefix-icon="Search"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="navigateToQuery(keyword)"
|
||||||
|
@clear="handleClear"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
class="search-button"
|
||||||
|
@click="navigateToQuery(keyword)"
|
||||||
|
>
|
||||||
|
{{ $t('search.search-button') }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { Search } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
|
const keyword = defineModel<string>({ default: '' });
|
||||||
|
const localePath = useLocalePath();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const navigateToQuery = (value: string) => {
|
||||||
|
const trimmed = value.trim();
|
||||||
|
if (!trimmed) return;
|
||||||
|
navigateTo({
|
||||||
|
path: localePath('/search'),
|
||||||
|
query: { query: trimmed },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClear = () => {
|
||||||
|
keyword.value = '';
|
||||||
|
router.replace(localePath({ path: '/search' }));
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.search-header {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
font-size: 2.25rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-bar {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
flex: 1;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-button {
|
||||||
|
height: 50px;
|
||||||
|
width: 100px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
49
app/components/pages/search/SearchTabs.vue
Normal file
49
app/components/pages/search/SearchTabs.vue
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<el-tabs v-model="activeTab">
|
||||||
|
<el-tab-pane
|
||||||
|
v-for="tab in tabs"
|
||||||
|
:key="tab.name"
|
||||||
|
:label="`${tab.label}(${resultCount[tab.name] || 0})`"
|
||||||
|
:name="tab.name"
|
||||||
|
>
|
||||||
|
<SearchResults
|
||||||
|
v-model:current-page="currentPage"
|
||||||
|
:search-items="searchItems"
|
||||||
|
:category="tab.name === 'all' ? undefined : tab.name"
|
||||||
|
/>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps<{
|
||||||
|
// resultCount: Record<string, number>;
|
||||||
|
searchItems: SearchItemView[];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const tabs = [
|
||||||
|
{ name: 'all', label: '全部' },
|
||||||
|
{ name: 'product', label: '产品' },
|
||||||
|
{ name: 'solution', label: '解决方案' },
|
||||||
|
{ name: 'question', label: '相关问题' },
|
||||||
|
{ name: 'document', label: '文档资料' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const resultCount = computed(() => {
|
||||||
|
const map: Record<string, number> = { all: props.searchItems.length };
|
||||||
|
for (const item of props.searchItems) {
|
||||||
|
map[item.type] = (map[item.type] ?? 0) + 1;
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 分类控制
|
||||||
|
const activeTab = ref('all');
|
||||||
|
|
||||||
|
// 分页控制
|
||||||
|
const currentPage = ref(1);
|
||||||
|
|
||||||
|
watch(activeTab, () => {
|
||||||
|
currentPage.value = 1; // 重置页码
|
||||||
|
});
|
||||||
|
</script>
|
||||||
54
app/components/pages/solutions/SolutionDetail.vue
Normal file
54
app/components/pages/solutions/SolutionDetail.vue
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<template>
|
||||||
|
<article class="solution-defail">
|
||||||
|
<header class="solution-header">
|
||||||
|
<h1 class="solution-title">{{ solution.title }}</h1>
|
||||||
|
<dl class="solution-meta">
|
||||||
|
<dt class="visually-hidden">CreatedAt:</dt>
|
||||||
|
<dd class="solution-date">
|
||||||
|
{{ new Date(solution.createAt).toLocaleDateString() }}
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<p class="solution-summary">{{ solution.summary }}</p>
|
||||||
|
</header>
|
||||||
|
<section class="solution-content">
|
||||||
|
<markdown-renderer :content="solution?.content || ''" />
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineProps({
|
||||||
|
solution: {
|
||||||
|
type: Object as PropType<SolutionView>,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.solution-title {
|
||||||
|
font-size: 2rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.solution-meta {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 1rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.solution-summary {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.solution-content {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
96
app/components/pages/support/SupportCard.vue
Normal file
96
app/components/pages/support/SupportCard.vue
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="support-card">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-icon class="card-icon" size="80">
|
||||||
|
<component :is="iconComponent" />
|
||||||
|
</el-icon>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="18">
|
||||||
|
<div class="card-title">
|
||||||
|
<span>{{ title }}</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<div class="card-content">
|
||||||
|
<p>{{ description }}</p>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<NuxtLink class="card-link" :to="to">
|
||||||
|
<el-button class="card-button" round>
|
||||||
|
<span>了解更多 > </span>
|
||||||
|
</el-button>
|
||||||
|
</NuxtLink>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineProps({
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
to: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
iconComponent: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.support-card {
|
||||||
|
width: 100%;
|
||||||
|
padding: 20px;
|
||||||
|
box-shadow: none;
|
||||||
|
border-radius: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-icon {
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 2rem;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-link {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-button {
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 1rem;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-row:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-col {
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
85
app/components/shared/ProductFilter.vue
Normal file
85
app/components/shared/ProductFilter.vue
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
<div class="question-category">
|
||||||
|
<el-row :gutter="12">
|
||||||
|
<el-col :span="8">
|
||||||
|
<span class="select-label">产品分类</span>
|
||||||
|
<el-select
|
||||||
|
v-model="model.selectedType"
|
||||||
|
placeholder="选择产品类型"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="type in productTypeOptions"
|
||||||
|
:key="type.id"
|
||||||
|
:label="type.name"
|
||||||
|
:value="type.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<span class="select-label">产品系列</span>
|
||||||
|
<el-select
|
||||||
|
v-model="model.selectedProduct"
|
||||||
|
placeholder="选择系列产品"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="product in productOptions"
|
||||||
|
:key="product.id"
|
||||||
|
:label="product.name"
|
||||||
|
:value="product.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<span class="select-label">关键词</span>
|
||||||
|
<el-input
|
||||||
|
v-model="model.keyword"
|
||||||
|
placeholder="输入关键词..."
|
||||||
|
clearable
|
||||||
|
:prefix-icon="Search"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { Search } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
productTypeOptions: {
|
||||||
|
type: Array as () => Array<{ id: number; name: string }>,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
productOptions: {
|
||||||
|
type: Array as () => Array<{ id: number; name: string }>,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const model = defineModel<{
|
||||||
|
keyword: string;
|
||||||
|
selectedType: number | null;
|
||||||
|
selectedProduct: number | null;
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.question-category {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-label {
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-select__wrapper),
|
||||||
|
:deep(.el-input__wrapper) {
|
||||||
|
height: 40px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -5,40 +5,7 @@
|
|||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!pending" class="page-content">
|
<div v-if="!pending" class="page-content">
|
||||||
<el-card shadow="hover" class="p-4">
|
<file-card :file-id="id" :file="file" />
|
||||||
<template #header>
|
|
||||||
<div class="header-content">
|
|
||||||
<el-icon class="header-icon"><ElIconDocument /></el-icon>
|
|
||||||
<span class="truncate font-medium">{{
|
|
||||||
file.filename_download
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<dl class="text-gray-600 space-y-1 mb-6">
|
|
||||||
<div>
|
|
||||||
<dt class="font-semibold inline">类型:</dt>
|
|
||||||
<dd class="inline">{{ file.type }}</dd>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<dt class="font-semibold inline">大小:</dt>
|
|
||||||
<dd class="inline">{{ formatFileSize(file.filesize) }}</dd>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<dt class="font-semibold inline">上传时间:</dt>
|
|
||||||
<dd class="inline">
|
|
||||||
{{ new Date(file.uploaded_on).toLocaleDateString() }}
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
<template #footer>
|
|
||||||
<div class="button-group">
|
|
||||||
<el-button type="primary" @click="handleDownload">下载</el-button>
|
|
||||||
<el-button v-if="file.previewable" @click="handlePreview"
|
|
||||||
>预览</el-button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-skeleton :rows="6" animated />
|
<el-skeleton :rows="6" animated />
|
||||||
@ -48,7 +15,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
|
|
||||||
const breadcrumbItems = [
|
const breadcrumbItems = [
|
||||||
@ -56,14 +22,13 @@
|
|||||||
{ label: $t('navigation.downloads'), to: localePath('/downloads') },
|
{ label: $t('navigation.downloads'), to: localePath('/downloads') },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 获取路由参数
|
const id = route.params.id as string;
|
||||||
const id = computed(() => route.params.id as string);
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: file,
|
data: file,
|
||||||
pending,
|
pending,
|
||||||
error,
|
error,
|
||||||
} = await useFetch<FileMeta>(`/api/file/${id.value}`);
|
} = await useFetch<FileMeta>(`/api/file/${id}`);
|
||||||
|
|
||||||
if (error.value || !file.value) {
|
if (error.value || !file.value) {
|
||||||
throw createError({
|
throw createError({
|
||||||
@ -71,19 +36,6 @@
|
|||||||
statusMessage: '文件未找到',
|
statusMessage: '文件未找到',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDownload() {
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = `/api/download/${id.value}`;
|
|
||||||
link.download = file.value?.filename_download ?? 'download';
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handlePreview() {
|
|
||||||
router.push(`/preview/${id.value}`);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -107,22 +59,4 @@
|
|||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 3px;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.header-icon {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
margin-right: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-group {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: baseline;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,309 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="homepage">
|
<div class="homepage">
|
||||||
<section v-if="!pending" class="carousel-section">
|
<homepage-carousel :homepage-data="homepageData" :pending="pending" />
|
||||||
<el-carousel
|
<homepage-product-section
|
||||||
class="homepage-carousel"
|
:homepage-data="homepageData"
|
||||||
height="auto"
|
:pending="pending"
|
||||||
:interval="5000"
|
|
||||||
arrow="never"
|
|
||||||
autoplay
|
|
||||||
>
|
|
||||||
<el-carousel-item v-for="(item, index) in carousel" :key="index">
|
|
||||||
<div class="carousel-item">
|
|
||||||
<el-image
|
|
||||||
class="carousel-image"
|
|
||||||
:src="getImageUrl(item)"
|
|
||||||
:alt="`Carousel Image ${index + 1}`"
|
|
||||||
fit="contain"
|
|
||||||
lazy
|
|
||||||
/>
|
/>
|
||||||
</div>
|
<homepage-solution-section
|
||||||
</el-carousel-item>
|
:homepage-data="homepageData"
|
||||||
</el-carousel>
|
:pending="pending"
|
||||||
</section>
|
|
||||||
<section v-else>
|
|
||||||
<el-skeleton :rows="5" animated />
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="homepage-section">
|
|
||||||
<h2>推荐产品</h2>
|
|
||||||
<p>
|
|
||||||
探索我们的精选产品,满足您的各种需求。无论是创新技术还是经典设计,我们都为您提供优质选择。
|
|
||||||
</p>
|
|
||||||
<div v-if="!pending">
|
|
||||||
<el-carousel
|
|
||||||
class="recommend-carousel"
|
|
||||||
height="auto"
|
|
||||||
arrow="never"
|
|
||||||
indicator-position="outside"
|
|
||||||
:autoplay="false"
|
|
||||||
>
|
|
||||||
<el-carousel-item
|
|
||||||
v-for="n in Math.floor(recommend_products.length / 3) + 1"
|
|
||||||
:key="n"
|
|
||||||
class="recommend-list"
|
|
||||||
>
|
|
||||||
<div class="recommend-card-group">
|
|
||||||
<el-card
|
|
||||||
v-for="(item, index) in recommend_products.slice(
|
|
||||||
(n - 1) * 3,
|
|
||||||
n * 3
|
|
||||||
)"
|
|
||||||
:key="index"
|
|
||||||
class="recommend-card"
|
|
||||||
@click="handleProductCardClick(item.id.toString() || '')"
|
|
||||||
>
|
|
||||||
<template #header>
|
|
||||||
<el-image
|
|
||||||
:src="getImageUrl(item.cover)"
|
|
||||||
:alt="item.name"
|
|
||||||
fit="cover"
|
|
||||||
lazy
|
|
||||||
/>
|
/>
|
||||||
</template>
|
|
||||||
<div class="recommend-card-body">
|
|
||||||
<!-- Title -->
|
|
||||||
<div class="text-center">
|
|
||||||
<span class="recommend-card-title">{{ item.name }}</span>
|
|
||||||
</div>
|
|
||||||
<!-- Description -->
|
|
||||||
<div class="recommend-card-description text-left opacity-25">
|
|
||||||
{{ item.summary }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</el-carousel-item>
|
|
||||||
</el-carousel>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<el-skeleton :rows="4" animated />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section class="homepage-section">
|
|
||||||
<h2>推荐解决方案</h2>
|
|
||||||
<p>了解我们的定制解决方案,帮助您优化业务流程,提高效率。</p>
|
|
||||||
<div v-if="!pending">
|
|
||||||
<el-carousel
|
|
||||||
class="recommend-carousel"
|
|
||||||
height="auto"
|
|
||||||
arrow="never"
|
|
||||||
indicator-position="outside"
|
|
||||||
:autoplay="false"
|
|
||||||
>
|
|
||||||
<el-carousel-item
|
|
||||||
v-for="n in Math.floor(recommend_solutions.length / 3) + 1"
|
|
||||||
:key="n"
|
|
||||||
class="recommend-list"
|
|
||||||
>
|
|
||||||
<div class="recommend-card-group">
|
|
||||||
<el-card
|
|
||||||
v-for="(item, index) in recommend_solutions.slice(
|
|
||||||
(n - 1) * 3,
|
|
||||||
n * 3
|
|
||||||
)"
|
|
||||||
:key="index"
|
|
||||||
class="recommend-card"
|
|
||||||
@click="handleSolutionCardClick(item.id.toString() || '')"
|
|
||||||
>
|
|
||||||
<template #header>
|
|
||||||
<el-image
|
|
||||||
:src="getImageUrl(item.cover)"
|
|
||||||
:alt="item.title"
|
|
||||||
fit="cover"
|
|
||||||
lazy
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<div class="recommend-card-body">
|
|
||||||
<!-- Title -->
|
|
||||||
<div class="text-center">
|
|
||||||
<span class="recommend-card-title">{{ item.title }}</span>
|
|
||||||
</div>
|
|
||||||
<!-- Description -->
|
|
||||||
<div class="recommend-card-description text-left opacity-25">
|
|
||||||
{{ item.summary }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</el-carousel-item>
|
|
||||||
</el-carousel>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<el-skeleton :rows="4" animated />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { getImageUrl } = useDirectusImage();
|
|
||||||
|
|
||||||
const { data, pending, error } = await useHomepage();
|
const { data, pending, error } = await useHomepage();
|
||||||
|
|
||||||
const homepageData = computed(() => {
|
const homepageData = computed(() => {
|
||||||
return toHomepageView(data.value);
|
return toHomepageView(data.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
const carousel = computed(() => homepageData.value?.carousel);
|
|
||||||
|
|
||||||
const recommend_products = computed(
|
|
||||||
() => homepageData.value?.recommendProducts
|
|
||||||
);
|
|
||||||
const recommend_solutions = computed(
|
|
||||||
() => homepageData.value?.recommendSolutions
|
|
||||||
);
|
|
||||||
|
|
||||||
watch(pending, () => {
|
|
||||||
console.log(data.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(error, (value) => {
|
watch(error, (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
console.error('数据获取失败: ', value);
|
console.error('数据获取失败: ', value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleProductCardClick = (documentId: string) => {
|
|
||||||
// 使用路由导航到产品详情页
|
|
||||||
if (documentId) {
|
|
||||||
const localePath = useLocalePath();
|
|
||||||
const router = useRouter();
|
|
||||||
router.push(localePath(`/products/${documentId}`));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSolutionCardClick = (documentId: string) => {
|
|
||||||
// 使用路由导航到解决方案详情页
|
|
||||||
if (documentId) {
|
|
||||||
const localePath = useLocalePath();
|
|
||||||
const router = useRouter();
|
|
||||||
router.push(localePath(`/solutions/${documentId}`));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<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;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-section {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.homepage-carousel .el-carousel__item {
|
|
||||||
width: 100%;
|
|
||||||
height: 33vw;
|
|
||||||
/* 16:9 Aspect Ratio */
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-carousel__item h3 {
|
|
||||||
display: flex;
|
|
||||||
color: #475669;
|
|
||||||
opacity: 0.8;
|
|
||||||
line-height: 300px;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.homepage-carousel .carousel-item {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-image {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-image-caption {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
color: white;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.homepage-section {
|
|
||||||
max-width: 1200px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-carousel :deep(.el-carousel__button) {
|
|
||||||
/* 指示器按钮样式 */
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #475669;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-list {
|
|
||||||
display: flex;
|
|
||||||
padding: 1rem;
|
|
||||||
height: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card-group {
|
|
||||||
display: flex;
|
|
||||||
gap: 1rem;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card {
|
|
||||||
width: 33%;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card :deep(.el-card__header) {
|
|
||||||
padding: 0;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card:hover {
|
|
||||||
transform: translateY(-4px);
|
|
||||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card-body {
|
|
||||||
margin: 10px auto;
|
|
||||||
padding: 0px auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card-title {
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card-description {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.recommend-card .el-image {
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -4,66 +4,10 @@
|
|||||||
<div v-if="product">
|
<div v-if="product">
|
||||||
<!-- 面包屑导航 -->
|
<!-- 面包屑导航 -->
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
|
|
||||||
<!-- 产品详情内容 -->
|
<!-- 产品详情内容 -->
|
||||||
<div class="product-header">
|
<product-header :product="product" />
|
||||||
<div class="product-image">
|
|
||||||
<el-image
|
|
||||||
v-if="product.images.length <= 1"
|
|
||||||
:src="getImageUrl(product.images[0].image)"
|
|
||||||
:alt="product.name"
|
|
||||||
fit="contain"
|
|
||||||
/>
|
|
||||||
<el-carousel
|
|
||||||
v-else
|
|
||||||
class="product-carousel"
|
|
||||||
height="500px"
|
|
||||||
:autoplay="false"
|
|
||||||
:loop="false"
|
|
||||||
arrow="always"
|
|
||||||
>
|
|
||||||
<el-carousel-item
|
|
||||||
v-for="(item, index) in product.images || []"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<div class="product-carousel-item">
|
|
||||||
<el-image
|
|
||||||
:src="getImageUrl(item.image || '')"
|
|
||||||
:alt="product.name"
|
|
||||||
fit="contain"
|
|
||||||
lazy
|
|
||||||
/>
|
|
||||||
<p v-if="item.caption" class="product-image-caption">
|
|
||||||
{{ item.caption }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</el-carousel-item>
|
|
||||||
</el-carousel>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="product-info">
|
|
||||||
<h1>{{ product.name }}</h1>
|
|
||||||
<p class="summary">{{ product.summary }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 产品详细描述 -->
|
<!-- 产品详细描述 -->
|
||||||
<div class="product-content">
|
<product-detail :product="product" />
|
||||||
<el-tabs v-model="activeName" class="product-tabs" stretch>
|
|
||||||
<el-tab-pane label="产品详情" name="details">
|
|
||||||
<markdown-renderer :content="product.description || ''" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="技术规格" name="specs">
|
|
||||||
<spec-table :data="product.specs" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="常见问题" name="faq">
|
|
||||||
<question-list :questions="product.faqs" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="相关文档" name="documents">
|
|
||||||
<document-list :documents="product.documents" />
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- 未找到产品 -->
|
<!-- 未找到产品 -->
|
||||||
<div v-else class="not-found">
|
<div v-else class="not-found">
|
||||||
@ -90,8 +34,6 @@
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
|
|
||||||
const { getImageUrl } = useDirectusImage();
|
|
||||||
|
|
||||||
// 获取路由参数
|
// 获取路由参数
|
||||||
const id = computed(() => route.params.slug as string);
|
const id = computed(() => route.params.slug as string);
|
||||||
|
|
||||||
@ -105,8 +47,6 @@
|
|||||||
return toProductView(rawProduct.value);
|
return toProductView(rawProduct.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
const activeName = ref('details'); // 默认选中概览标签
|
|
||||||
|
|
||||||
const breadcrumbItems = computed(() => [
|
const breadcrumbItems = computed(() => [
|
||||||
{ label: $t('navigation.home'), to: localePath('/') },
|
{ label: $t('navigation.home'), to: localePath('/') },
|
||||||
{ label: $t('navigation.products'), to: localePath('/products') },
|
{ label: $t('navigation.products'), to: localePath('/products') },
|
||||||
@ -142,67 +82,6 @@
|
|||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-header {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 2fr 1fr;
|
|
||||||
gap: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-image .el-image {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 500px;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-image-caption {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
/* left: 10%; */
|
|
||||||
background-color: rgba(0, 0, 0, 0.2);
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 5px 10px;
|
|
||||||
text-align: center;
|
|
||||||
color: white;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-carousel :deep(.el-carousel__button) {
|
|
||||||
/* 指示器按钮样式 */
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: #475669;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-info h1 {
|
|
||||||
margin-top: 2rem;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary {
|
|
||||||
color: var(--el-color-info);
|
|
||||||
font-size: 1rem;
|
|
||||||
line-height: 1.6;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-tabs ::v-deep(.el-tabs__nav) {
|
|
||||||
min-width: 30%;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-tabs ::v-deep(.el-tabs__content) {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-content h2 {
|
|
||||||
color: var(--el-text-color-primary);
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -216,16 +95,4 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 响应式设计 */
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.product-header {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
gap: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-info h1 {
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,80 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search-page">
|
<div class="search-page">
|
||||||
<div class="search-header">
|
<search-header v-model="keyword" />
|
||||||
<h1 class="page-title">{{ $t('search.title') }}</h1>
|
|
||||||
<div class="search-bar">
|
|
||||||
<el-input
|
|
||||||
v-model="keyword"
|
|
||||||
class="search-input"
|
|
||||||
:placeholder="$t('search-placeholder')"
|
|
||||||
:prefix-icon="Search"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="navigateToQuery(keyword)"
|
|
||||||
@clear="handleClear"
|
|
||||||
/>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
class="search-button"
|
|
||||||
@click="navigateToQuery(keyword)"
|
|
||||||
>
|
|
||||||
{{ $t('search.search-button') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="loading" class="search-state">
|
<div v-if="loading" class="search-state">
|
||||||
<el-skeleton :rows="4" animated />
|
<el-skeleton :rows="4" animated />
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="hasResults" class="search-results">
|
<search-tabs v-else-if="hasResults" :search-items="searchItems" />
|
||||||
<el-tabs v-model="activeTab">
|
|
||||||
<el-tab-pane :label="`全部(${resultCount['all']})`" name="all">
|
|
||||||
<search-results
|
|
||||||
v-model:current-page="currentPage"
|
|
||||||
:search-items="searchItems"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane
|
|
||||||
:label="`产品(${resultCount['product'] || 0})`"
|
|
||||||
name="product"
|
|
||||||
>
|
|
||||||
<search-results
|
|
||||||
v-model:current-page="currentPage"
|
|
||||||
:search-items="searchItems"
|
|
||||||
category="product"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane
|
|
||||||
:label="`解决方案(${resultCount['solution'] || 0})`"
|
|
||||||
name="solution"
|
|
||||||
>
|
|
||||||
<search-results
|
|
||||||
v-model:current-page="currentPage"
|
|
||||||
:search-items="searchItems"
|
|
||||||
category="solution"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane
|
|
||||||
:label="`相关问题(${resultCount['question'] || 0})`"
|
|
||||||
name="question"
|
|
||||||
>
|
|
||||||
<search-results
|
|
||||||
v-model:current-page="currentPage"
|
|
||||||
:search-items="searchItems"
|
|
||||||
category="question"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane
|
|
||||||
:label="`文档资料(${resultCount['document'] || 0})`"
|
|
||||||
name="document"
|
|
||||||
>
|
|
||||||
<search-results
|
|
||||||
v-model:current-page="currentPage"
|
|
||||||
:search-items="searchItems"
|
|
||||||
category="document"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</div>
|
|
||||||
<div v-else class="search-state">
|
<div v-else class="search-state">
|
||||||
<el-empty
|
<el-empty
|
||||||
:description="
|
:description="
|
||||||
@ -88,8 +18,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Search } from '@element-plus/icons-vue';
|
|
||||||
|
|
||||||
// i18n相关
|
// i18n相关
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { getDirectusLocale } = useLocalizations();
|
const { getDirectusLocale } = useLocalizations();
|
||||||
@ -97,8 +25,6 @@
|
|||||||
|
|
||||||
// 路由相关
|
// 路由相关
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
|
||||||
const localePath = useLocalePath();
|
|
||||||
|
|
||||||
// 搜索相关
|
// 搜索相关
|
||||||
const { search } = useMeilisearch();
|
const { search } = useMeilisearch();
|
||||||
@ -144,44 +70,10 @@
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(searchItems.value);
|
|
||||||
|
|
||||||
// 分类控制
|
|
||||||
const activeTab = ref('all');
|
|
||||||
const resultCount = computed(() => {
|
|
||||||
const map: Record<string, number> = { all: searchItems.value.length };
|
|
||||||
for (const item of searchItems.value) {
|
|
||||||
map[item.type] = (map[item.type] ?? 0) + 1;
|
|
||||||
}
|
|
||||||
return map;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 分页控制
|
|
||||||
const currentPage = ref(1);
|
|
||||||
|
|
||||||
const hasResults = computed(() =>
|
const hasResults = computed(() =>
|
||||||
filteredSections.value.some((section) => section.hits.length > 0)
|
filteredSections.value.some((section) => section.hits.length > 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
const navigateToQuery = (value: string) => {
|
|
||||||
const trimmed = value.trim();
|
|
||||||
if (!trimmed) return;
|
|
||||||
navigateTo({
|
|
||||||
path: localePath('/search'),
|
|
||||||
query: { query: trimmed },
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleClear = () => {
|
|
||||||
keyword.value = '';
|
|
||||||
sections.value = [];
|
|
||||||
router.replace(localePath({ path: '/search' }));
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(activeTab, () => {
|
|
||||||
currentPage.value = 1; // 重置页码
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => route.query.query,
|
() => route.query.query,
|
||||||
async (newQuery) => {
|
async (newQuery) => {
|
||||||
@ -216,42 +108,6 @@
|
|||||||
min-height: 70vh;
|
min-height: 70vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-header {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1rem;
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-title {
|
|
||||||
font-size: 2.25rem;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--el-text-color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-bar {
|
|
||||||
display: flex;
|
|
||||||
gap: 1rem;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-input {
|
|
||||||
flex: 1;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-button {
|
|
||||||
height: 50px;
|
|
||||||
width: 100px;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-meta {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-state {
|
.search-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@ -5,21 +5,7 @@
|
|||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</div>
|
||||||
<div class="page-content">
|
<solution-detail :solution="solution" />
|
||||||
<div class="solution-info">
|
|
||||||
<h1>{{ solution.title }}</h1>
|
|
||||||
<div class="solution-meta">
|
|
||||||
<span class="solution-date">
|
|
||||||
CreatedAt:
|
|
||||||
{{ new Date(solution.createAt).toLocaleDateString() }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p class="summary">{{ solution.summary }}</p>
|
|
||||||
<div class="solution-content">
|
|
||||||
<markdown-renderer :content="solution.content || ''" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="not-found">
|
<div v-else class="not-found">
|
||||||
<not-found-result
|
<not-found-result
|
||||||
@ -78,44 +64,6 @@
|
|||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.solution-header el-image {
|
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-content h1 {
|
|
||||||
font-size: 2rem;
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--el-color-primary);
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.solution-meta {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 1rem;
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.summary {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.solution-content {
|
|
||||||
margin-top: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@ -9,50 +9,12 @@
|
|||||||
<h1 class="page-title">{{ $t('navigation.documents') }}</h1>
|
<h1 class="page-title">{{ $t('navigation.documents') }}</h1>
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</div>
|
||||||
<div class="document-category">
|
|
||||||
<el-row :gutter="12">
|
|
||||||
<el-col :span="8">
|
|
||||||
<span class="select-label">产品分类</span>
|
|
||||||
<el-select
|
|
||||||
v-model="selectedType"
|
|
||||||
placeholder="选择产品类型"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="type in productTypeOptions"
|
|
||||||
:key="type.id"
|
|
||||||
:label="type.name"
|
|
||||||
:value="type.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<span class="select-label">产品系列</span>
|
|
||||||
<el-select
|
|
||||||
v-model="selectedProduct"
|
|
||||||
placeholder="选择系列产品"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="product in productOptions"
|
|
||||||
:key="product.id"
|
|
||||||
:label="product.name"
|
|
||||||
:value="product.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<span class="select-label">关键词</span>
|
|
||||||
<el-input
|
|
||||||
v-model="keyword"
|
|
||||||
placeholder="输入关键词..."
|
|
||||||
clearable
|
|
||||||
:prefix-icon="Search"
|
|
||||||
/>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
|
<product-filter
|
||||||
|
v-model="filters"
|
||||||
|
:product-type-options="productTypeOptions"
|
||||||
|
:product-options="productOptions"
|
||||||
|
/>
|
||||||
<document-list :documents="filteredDocuments" />
|
<document-list :documents="filteredDocuments" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -60,8 +22,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Search } from '@element-plus/icons-vue';
|
|
||||||
|
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
const breadcrumbItems = [
|
const breadcrumbItems = [
|
||||||
{ label: $t('navigation.home'), to: localePath('/') },
|
{ label: $t('navigation.home'), to: localePath('/') },
|
||||||
@ -69,17 +29,18 @@
|
|||||||
{ label: $t('navigation.documents') },
|
{ label: $t('navigation.documents') },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const filters = reactive({
|
||||||
|
selectedType: null as number | null,
|
||||||
|
selectedProduct: null as number | null,
|
||||||
|
keyword: '',
|
||||||
|
});
|
||||||
|
|
||||||
const { data, pending, error } = await useDocumentList();
|
const { data, pending, error } = await useDocumentList();
|
||||||
|
|
||||||
const documents = computed(
|
const documents = computed(
|
||||||
() => data?.value.map((item) => toDocumentListView(item)) ?? []
|
() => data?.value.map((item) => toDocumentListView(item)) ?? []
|
||||||
);
|
);
|
||||||
|
|
||||||
const keyword = ref('');
|
|
||||||
|
|
||||||
const selectedType = ref<number | null>(null);
|
|
||||||
const selectedProduct = ref<number | null>(null);
|
|
||||||
|
|
||||||
const productTypeOptions = computed(() => {
|
const productTypeOptions = computed(() => {
|
||||||
const types: DocumentListProductType[] = [];
|
const types: DocumentListProductType[] = [];
|
||||||
documents.value.forEach((doc: DocumentListView) => {
|
documents.value.forEach((doc: DocumentListView) => {
|
||||||
@ -95,13 +56,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const productOptions = computed(() => {
|
const productOptions = computed(() => {
|
||||||
if (!selectedType.value) return [];
|
if (!filters.selectedType) return [];
|
||||||
const products: DocumentListProduct[] = [];
|
const products: DocumentListProduct[] = [];
|
||||||
|
|
||||||
documents.value.forEach((doc: DocumentListView) => {
|
documents.value.forEach((doc: DocumentListView) => {
|
||||||
doc.products?.forEach((product: DocumentListProduct) => {
|
doc.products?.forEach((product: DocumentListProduct) => {
|
||||||
if (
|
if (
|
||||||
product.type.id === selectedType.value &&
|
product.type.id === filters.selectedType &&
|
||||||
!products.some((item) => item.id === product.id)
|
!products.some((item) => item.id === product.id)
|
||||||
) {
|
) {
|
||||||
products.push(product);
|
products.push(product);
|
||||||
@ -114,29 +75,32 @@
|
|||||||
|
|
||||||
const filteredDocuments = computed(() =>
|
const filteredDocuments = computed(() =>
|
||||||
documents.value.filter((doc: DocumentListView) => {
|
documents.value.filter((doc: DocumentListView) => {
|
||||||
const matchProduct = selectedProduct.value
|
const matchProduct = filters.selectedProduct
|
||||||
? doc.products?.some(
|
? doc.products?.some(
|
||||||
(product: DocumentListProduct) =>
|
(product: DocumentListProduct) =>
|
||||||
product.id === selectedProduct.value
|
product.id === filters.selectedProduct
|
||||||
)
|
)
|
||||||
: selectedType.value
|
: filters.selectedType
|
||||||
? doc.products?.some(
|
? doc.products?.some(
|
||||||
(product: DocumentListProduct) =>
|
(product: DocumentListProduct) =>
|
||||||
product.type?.id === selectedType.value
|
product.type?.id === filters.selectedType
|
||||||
)
|
)
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
const matchKeyword = keyword.value
|
const matchKeyword = filters.keyword
|
||||||
? doc.title && doc.title.includes(keyword.value)
|
? doc.title && doc.title.includes(filters.keyword)
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
return matchProduct && matchKeyword;
|
return matchProduct && matchKeyword;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(selectedType, () => {
|
watch(
|
||||||
selectedProduct.value = null;
|
() => filters.selectedType,
|
||||||
});
|
() => {
|
||||||
|
filters.selectedProduct = null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
watch(documents, (value) => {
|
watch(documents, (value) => {
|
||||||
console.log(value);
|
console.log(value);
|
||||||
|
|||||||
@ -10,50 +10,13 @@
|
|||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="question-category">
|
|
||||||
<el-row :gutter="12">
|
|
||||||
<el-col :span="8">
|
|
||||||
<span class="select-label">产品分类</span>
|
|
||||||
<el-select
|
|
||||||
v-model="selectedType"
|
|
||||||
placeholder="选择产品类型"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="type in productTypeOptions"
|
|
||||||
:key="type.id"
|
|
||||||
:label="type.name"
|
|
||||||
:value="type.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<span class="select-label">产品系列</span>
|
|
||||||
<el-select
|
|
||||||
v-model="selectedProduct"
|
|
||||||
placeholder="选择系列产品"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="product in productOptions"
|
|
||||||
:key="product.id"
|
|
||||||
:label="product.name"
|
|
||||||
:value="product.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<span class="select-label">关键词</span>
|
|
||||||
<el-input
|
|
||||||
v-model="keyword"
|
|
||||||
placeholder="输入关键词..."
|
|
||||||
clearable
|
|
||||||
:prefix-icon="Search"
|
|
||||||
/>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
|
<product-filter
|
||||||
|
v-model="filters"
|
||||||
|
:product-type-options="productTypeOptions"
|
||||||
|
:product-options="productOptions"
|
||||||
|
/>
|
||||||
|
|
||||||
<question-list :questions="filteredQuestions" />
|
<question-list :questions="filteredQuestions" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -61,10 +24,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Search } from '@element-plus/icons-vue';
|
|
||||||
|
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
|
|
||||||
|
const filters = reactive({
|
||||||
|
selectedType: null as number | null,
|
||||||
|
selectedProduct: null as number | null,
|
||||||
|
keyword: '',
|
||||||
|
});
|
||||||
|
|
||||||
const breadcrumbItems = [
|
const breadcrumbItems = [
|
||||||
{ label: $t('navigation.home'), to: localePath('/') },
|
{ label: $t('navigation.home'), to: localePath('/') },
|
||||||
{ label: $t('navigation.support'), to: localePath('/support') },
|
{ label: $t('navigation.support'), to: localePath('/support') },
|
||||||
@ -77,11 +44,6 @@
|
|||||||
() => data.value.map((item) => toQuestionListView(item)) ?? null
|
() => data.value.map((item) => toQuestionListView(item)) ?? null
|
||||||
);
|
);
|
||||||
|
|
||||||
const keyword = ref('');
|
|
||||||
|
|
||||||
const selectedType = ref<number | null>(null);
|
|
||||||
const selectedProduct = ref<number | null>(null);
|
|
||||||
|
|
||||||
const productTypeOptions = computed(() => {
|
const productTypeOptions = computed(() => {
|
||||||
const types: QuestionListProductType[] = [];
|
const types: QuestionListProductType[] = [];
|
||||||
questions.value.forEach((q: QuestionListView) => {
|
questions.value.forEach((q: QuestionListView) => {
|
||||||
@ -96,12 +58,12 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
const productOptions = computed(() => {
|
const productOptions = computed(() => {
|
||||||
if (!selectedType.value) return [];
|
if (!filters.selectedType) return [];
|
||||||
const products: QuestionListProduct[] = [];
|
const products: QuestionListProduct[] = [];
|
||||||
questions.value.forEach((q: QuestionListView) => {
|
questions.value.forEach((q: QuestionListView) => {
|
||||||
q.products.forEach((product: QuestionListProduct) => {
|
q.products.forEach((product: QuestionListProduct) => {
|
||||||
if (
|
if (
|
||||||
product.type.id === selectedType.value &&
|
product.type.id === filters.selectedType &&
|
||||||
!products.some((p) => p.id === product.id)
|
!products.some((p) => p.id === product.id)
|
||||||
) {
|
) {
|
||||||
products.push(product);
|
products.push(product);
|
||||||
@ -113,30 +75,33 @@
|
|||||||
|
|
||||||
const filteredQuestions = computed(() => {
|
const filteredQuestions = computed(() => {
|
||||||
return questions.value.filter((question: QuestionListView) => {
|
return questions.value.filter((question: QuestionListView) => {
|
||||||
const matchProduct = selectedProduct.value
|
const matchProduct = filters.selectedProduct
|
||||||
? question.products?.some(
|
? question.products?.some(
|
||||||
(product: QuestionListProduct) =>
|
(product: QuestionListProduct) =>
|
||||||
product.id === selectedProduct.value
|
product.id === filters.selectedProduct
|
||||||
)
|
)
|
||||||
: selectedType.value
|
: filters.selectedType
|
||||||
? question.products?.some(
|
? question.products?.some(
|
||||||
(product: QuestionListProduct) =>
|
(product: QuestionListProduct) =>
|
||||||
product.type.id === selectedType.value
|
product.type.id === filters.selectedType
|
||||||
)
|
)
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
const matchKeyword = keyword.value
|
const matchKeyword = filters.keyword
|
||||||
? (question.title && question.title.includes(keyword.value)) ||
|
? (question.title && question.title.includes(filters.keyword)) ||
|
||||||
(question.content && question.content.includes(keyword.value))
|
(question.content && question.content.includes(filters.keyword))
|
||||||
: true;
|
: true;
|
||||||
|
|
||||||
return matchProduct && matchKeyword;
|
return matchProduct && matchKeyword;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(selectedType, () => {
|
watch(
|
||||||
selectedProduct.value = null;
|
() => filters.selectedType,
|
||||||
});
|
() => {
|
||||||
|
filters.selectedProduct = null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
watch(data, (newVal) => {
|
watch(data, (newVal) => {
|
||||||
console.log('useAsyncData updated:', newVal);
|
console.log('useAsyncData updated:', newVal);
|
||||||
@ -171,24 +136,7 @@
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-category {
|
|
||||||
padding: 0rem 2rem;
|
|
||||||
gap: 4px;
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
padding: 1rem 2rem 2rem;
|
padding: 1rem 2rem 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-label {
|
|
||||||
color: var(--el-text-color-secondary);
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-select__wrapper),
|
|
||||||
:deep(.el-input__wrapper) {
|
|
||||||
height: 40px;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -12,87 +12,14 @@
|
|||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
<div class="card-group">
|
<div class="card-group">
|
||||||
<el-card class="card">
|
<support-card
|
||||||
<el-row>
|
v-for="(item, index) in supportItems"
|
||||||
<el-col :span="6">
|
:key="index"
|
||||||
<el-icon class="card-icon" size="80">
|
:title="item.title"
|
||||||
<ElIconQuestionFilled />
|
:description="item.description"
|
||||||
</el-icon>
|
:to="item.to"
|
||||||
</el-col>
|
:icon-component="item.iconComponent"
|
||||||
<el-col :span="18">
|
/>
|
||||||
<div class="card-title">
|
|
||||||
<span>{{ $t('navigation.faq') }}</span>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<div class="card-content">
|
|
||||||
<p>我们为用户整理了常见问题的答案,帮助您快速解决疑惑。</p>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<NuxtLink class="card-link" :to="$localePath('/support/faq')">
|
|
||||||
<el-button class="card-button" round>
|
|
||||||
<span>了解更多 > </span>
|
|
||||||
</el-button>
|
|
||||||
</NuxtLink>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
<el-card class="card">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-icon class="card-icon" size="80">
|
|
||||||
<ElIconDocumentChecked />
|
|
||||||
</el-icon>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<div class="card-title">
|
|
||||||
<span>{{ $t('navigation.documents') }}</span>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<div class="card-content">
|
|
||||||
<p>我们为用户整理了常见问题的答案,为您快速解决疑惑。</p>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<NuxtLink class="card-link" :to="$localePath('/support/documents')">
|
|
||||||
<el-button class="card-button" round>
|
|
||||||
<span>了解更多 > </span>
|
|
||||||
</el-button>
|
|
||||||
</NuxtLink>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
<el-card class="card">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-icon class="card-icon" size="80">
|
|
||||||
<ElIconService />
|
|
||||||
</el-icon>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18">
|
|
||||||
<div class="card-title">
|
|
||||||
<span>{{ $t('navigation.contact-info') }}</span>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<div class="card-content">
|
|
||||||
<p>通过电话、邮箱联系我们,我们将现场为您服务。</p>
|
|
||||||
</div>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<NuxtLink
|
|
||||||
class="card-link"
|
|
||||||
:to="$localePath('/support/contact-us')"
|
|
||||||
>
|
|
||||||
<el-button class="card-button" round>
|
|
||||||
<span>了解更多 > </span>
|
|
||||||
</el-button>
|
|
||||||
</NuxtLink>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -104,6 +31,27 @@
|
|||||||
{ label: $t('navigation.home'), to: localePath('/') },
|
{ label: $t('navigation.home'), to: localePath('/') },
|
||||||
{ label: $t('navigation.support') },
|
{ label: $t('navigation.support') },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const supportItems = [
|
||||||
|
{
|
||||||
|
title: $t('navigation.faq'),
|
||||||
|
description: '我们为用户整理了常见问题的答案,帮助您快速解决疑惑。',
|
||||||
|
to: localePath('/support/faq'),
|
||||||
|
iconComponent: ElIconQuestionFilled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: $t('navigation.documents'),
|
||||||
|
description: '我们为用户整理了常见问题的答案,帮助您快速解决疑惑。',
|
||||||
|
to: localePath('/support/documents'),
|
||||||
|
iconComponent: ElIconDocumentChecked,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: $t('navigation.contact-info'),
|
||||||
|
description: '通过电话、邮箱联系我们,我们将现场为您服务。',
|
||||||
|
to: localePath('/support/contact-us'),
|
||||||
|
iconComponent: ElIconService,
|
||||||
|
},
|
||||||
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -169,34 +117,6 @@
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-button {
|
|
||||||
cursor: pointer;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 1rem;
|
|
||||||
color: var(--el-color-primary);
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-group {
|
|
||||||
display: flex;
|
|
||||||
justify-content: left;
|
|
||||||
margin-top: 2rem;
|
|
||||||
margin-left: 2rem;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-row:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-col {
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.grid-content {
|
.grid-content {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
min-height: 36px;
|
min-height: 36px;
|
||||||
|
|||||||
Reference in New Issue
Block a user