style: 格式化项目代码
- 根据prettier配置格式化整个项目的代码
This commit is contained in:
@ -3,15 +3,15 @@
|
||||
<div text4xl>
|
||||
<div i-ep-warning inline-block />
|
||||
</div>
|
||||
<div>{{ $t("not-found") }}</div>
|
||||
<div>{{ $t('not-found') }}</div>
|
||||
<div>
|
||||
<button text-sm btn m="3 t8" @click="router.back()">
|
||||
{{ $t("back") }}
|
||||
{{ $t('back') }}
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const router = useRouter();
|
||||
const router = useRouter();
|
||||
</script>
|
||||
|
||||
@ -4,12 +4,12 @@
|
||||
<el-breadcrumb class="breadcrumb" separator="/">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">
|
||||
{{ $t("navigation.home") }}
|
||||
{{ $t('navigation.home') }}
|
||||
</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/about')">
|
||||
{{ $t("navigation.about-us") }}
|
||||
{{ $t('navigation.about-us') }}
|
||||
</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
@ -25,7 +25,7 @@
|
||||
<el-icon class="icon" size="80">
|
||||
<ElIconService />
|
||||
</el-icon>
|
||||
<br>
|
||||
<br />
|
||||
联系信息
|
||||
</el-card>
|
||||
</NuxtLink>
|
||||
@ -38,92 +38,92 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const content = ref<string | null>(null);
|
||||
const content = ref<string | null>(null);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<StrapiCompanyProfile>(
|
||||
"company-profile",
|
||||
undefined,
|
||||
{
|
||||
locale: strapiLocale,
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<StrapiCompanyProfile>(
|
||||
'company-profile',
|
||||
undefined,
|
||||
{
|
||||
locale: strapiLocale,
|
||||
}
|
||||
);
|
||||
if (response.data) {
|
||||
content.value = response.data.content || '';
|
||||
} else {
|
||||
console.warn('No company profile data found');
|
||||
}
|
||||
);
|
||||
if (response.data) {
|
||||
content.value = response.data.content || "";
|
||||
} else {
|
||||
console.warn("No company profile data found");
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch company profile:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch company profile:", error);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
padding: 2rem 1rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
padding: 2rem 1rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
padding: 1rem 1rem;
|
||||
}
|
||||
.breadcrumb {
|
||||
padding: 1rem 1rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.content {
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
:deep(.markdown-body p) {
|
||||
text-indent: 2em;
|
||||
}
|
||||
:deep(.markdown-body p) {
|
||||
text-indent: 2em;
|
||||
}
|
||||
|
||||
:deep(.markdown-body h2) {
|
||||
text-align: center;
|
||||
}
|
||||
:deep(.markdown-body h2) {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
:deep(.el-divider__text) {
|
||||
color: var(--el-color-info);
|
||||
font-size: 1em;
|
||||
}
|
||||
:deep(.el-divider__text) {
|
||||
color: var(--el-color-info);
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.button-group {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
margin-top: 2rem;
|
||||
margin-left: 2rem;
|
||||
}
|
||||
.button-group {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
margin-top: 2rem;
|
||||
margin-left: 2rem;
|
||||
}
|
||||
|
||||
.card-button {
|
||||
width: 20%;
|
||||
min-width: 200px;
|
||||
padding: 20px;
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.card-button {
|
||||
width: 20%;
|
||||
min-width: 200px;
|
||||
padding: 20px;
|
||||
margin: 0 auto;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
.card-button:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.card-button:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.icon {
|
||||
padding: 10px;
|
||||
}
|
||||
.icon {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -129,185 +129,185 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const carouselImages = ref<StrapiImage[]>([]);
|
||||
const recommend_productions = ref<Production[]>([]);
|
||||
const recommend_solutions = ref<Solution[]>([]);
|
||||
const carouselImages = ref<StrapiImage[]>([]);
|
||||
const recommend_productions = ref<Production[]>([]);
|
||||
const recommend_solutions = ref<Solution[]>([]);
|
||||
|
||||
const pending = ref(true);
|
||||
const pending = ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<StrapiHomepage>("homepage", undefined, {
|
||||
populate: {
|
||||
carousel: {
|
||||
populate: "*",
|
||||
},
|
||||
recommend_productions: {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: "*",
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<StrapiHomepage>('homepage', undefined, {
|
||||
populate: {
|
||||
carousel: {
|
||||
populate: '*',
|
||||
},
|
||||
recommend_productions: {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
},
|
||||
},
|
||||
recommend_solutions: {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
recommend_solutions: {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: "*",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
locale: strapiLocale,
|
||||
});
|
||||
if (response.data) {
|
||||
carouselImages.value = response.data.carousel || [];
|
||||
recommend_productions.value = response.data.recommend_productions || [];
|
||||
recommend_solutions.value = response.data.recommend_solutions || [];
|
||||
console.log("推荐产品:", recommend_productions.value);
|
||||
console.log("推荐解决方案:", recommend_solutions.value);
|
||||
locale: strapiLocale,
|
||||
});
|
||||
if (response.data) {
|
||||
carouselImages.value = response.data.carousel || [];
|
||||
recommend_productions.value = response.data.recommend_productions || [];
|
||||
recommend_solutions.value = response.data.recommend_solutions || [];
|
||||
console.log('推荐产品:', recommend_productions.value);
|
||||
console.log('推荐解决方案:', recommend_solutions.value);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching homepage data:', error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching homepage data:", error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const handleProductionCardClick = (documentId: string) => {
|
||||
// 使用路由导航到产品详情页
|
||||
if (documentId) {
|
||||
const localePath = useLocalePath();
|
||||
const router = useRouter();
|
||||
router.push(localePath(`/productions/${documentId}`));
|
||||
}
|
||||
};
|
||||
const handleProductionCardClick = (documentId: string) => {
|
||||
// 使用路由导航到产品详情页
|
||||
if (documentId) {
|
||||
const localePath = useLocalePath();
|
||||
const router = useRouter();
|
||||
router.push(localePath(`/productions/${documentId}`));
|
||||
}
|
||||
};
|
||||
|
||||
const handleSolutionCardClick = (documentId: string) => {
|
||||
// 使用路由导航到解决方案详情页
|
||||
if (documentId) {
|
||||
const localePath = useLocalePath();
|
||||
const router = useRouter();
|
||||
router.push(localePath(`/solutions/${documentId}`));
|
||||
}
|
||||
};
|
||||
const handleSolutionCardClick = (documentId: string) => {
|
||||
// 使用路由导航到解决方案详情页
|
||||
if (documentId) {
|
||||
const localePath = useLocalePath();
|
||||
const router = useRouter();
|
||||
router.push(localePath(`/solutions/${documentId}`));
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
section {
|
||||
padding: 2rem;
|
||||
}
|
||||
section {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
section h2 {
|
||||
color: var(--el-text-color-primary);
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
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;
|
||||
}
|
||||
section p {
|
||||
color: var(--el-text-color-regular);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.homepage-carousel .el-carousel__item {
|
||||
width: 100%;
|
||||
height: 33vw;
|
||||
/* 16:9 Aspect Ratio */
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.homepage-carousel .carousel-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.carousel-image {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
.recommend-carousel :deep(.el-carousel__button) {
|
||||
/* 指示器按钮样式 */
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: #475669;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.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-list {
|
||||
display: flex;
|
||||
padding: 1rem;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.recommend-card-group {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
.recommend-card-group {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
width: 100%;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.recommend-card {
|
||||
width: 33%;
|
||||
transition: all 0.3s ease;
|
||||
text-align: center;
|
||||
}
|
||||
.recommend-card {
|
||||
width: 33%;
|
||||
transition: all 0.3s ease;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.recommend-card :deep(.el-card__header) {
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
.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);
|
||||
}
|
||||
.recommend-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.recommend-card-body {
|
||||
margin: 10px auto;
|
||||
padding: 0px auto;
|
||||
}
|
||||
.recommend-card-body {
|
||||
margin: 10px auto;
|
||||
padding: 0px auto;
|
||||
}
|
||||
|
||||
.recommend-card-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.recommend-card-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.recommend-card-description {
|
||||
font-size: 0.8rem;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.recommend-card-description {
|
||||
font-size: 0.8rem;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.recommend-card .el-image {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.recommend-card .el-image {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-breadcrumb class="breadcrumb" separator="/">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
$t("navigation.home")
|
||||
$t('navigation.home')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/productions')">{{
|
||||
$t("navigation.productions")
|
||||
$t('navigation.productions')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opactiy-50">{{
|
||||
@ -102,7 +102,7 @@
|
||||
>
|
||||
<template #extra>
|
||||
<el-button type="primary" @click="$router.push('/productions')">
|
||||
{{ $t("back-to-productions") }}
|
||||
{{ $t('back-to-productions') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
@ -111,166 +111,166 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const route = useRoute();
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const route = useRoute();
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const production = ref<Production | null>(null);
|
||||
const pending = ref(true);
|
||||
const production = ref<Production | null>(null);
|
||||
const pending = ref(true);
|
||||
|
||||
const activeName = ref("details"); // 默认选中概览标签
|
||||
const activeName = ref('details'); // 默认选中概览标签
|
||||
|
||||
// 获取路由参数(slug 或 id)
|
||||
const documentId = computed(() => route.params.slug as string);
|
||||
// 获取路由参数(slug 或 id)
|
||||
const documentId = computed(() => route.params.slug as string);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<Production>(
|
||||
"productions",
|
||||
documentId.value,
|
||||
{
|
||||
populate: {
|
||||
production_specs: {
|
||||
populate: "*",
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<Production>(
|
||||
'productions',
|
||||
documentId.value,
|
||||
{
|
||||
populate: {
|
||||
production_specs: {
|
||||
populate: '*',
|
||||
},
|
||||
production_images: {
|
||||
populate: '*',
|
||||
},
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
questions: {
|
||||
populate: '*',
|
||||
},
|
||||
production_documents: {
|
||||
populate: 'document',
|
||||
},
|
||||
},
|
||||
production_images: {
|
||||
populate: "*",
|
||||
},
|
||||
cover: {
|
||||
populate: "*",
|
||||
},
|
||||
questions: {
|
||||
populate: "*",
|
||||
},
|
||||
production_documents: {
|
||||
populate: "document",
|
||||
},
|
||||
},
|
||||
locale: strapiLocale,
|
||||
locale: strapiLocale,
|
||||
}
|
||||
);
|
||||
if (response.data) {
|
||||
const item = response.data;
|
||||
production.value = {
|
||||
...item,
|
||||
};
|
||||
console.log('Fetched production:', production.value);
|
||||
}
|
||||
);
|
||||
if (response.data) {
|
||||
const item = response.data;
|
||||
production.value = {
|
||||
...item,
|
||||
};
|
||||
console.log("Fetched production:", production.value);
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch production:', error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch production:", error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// SEO
|
||||
useHead({
|
||||
title: computed(() => production.value?.title || "Product Detail"),
|
||||
meta: [
|
||||
{
|
||||
name: "description",
|
||||
content: computed(() => production.value?.summary || ""),
|
||||
},
|
||||
],
|
||||
});
|
||||
// SEO
|
||||
useHead({
|
||||
title: computed(() => production.value?.title || 'Product Detail'),
|
||||
meta: [
|
||||
{
|
||||
name: 'description',
|
||||
content: computed(() => production.value?.summary || ''),
|
||||
},
|
||||
],
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
min-height: 80vh;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
min-height: 80vh;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
padding: 2rem;
|
||||
}
|
||||
.breadcrumb {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.production-header {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
gap: 3rem;
|
||||
}
|
||||
|
||||
.production-image .el-image {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.production-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;
|
||||
}
|
||||
|
||||
.production-carousel :deep(.el-carousel__button) {
|
||||
/* 指示器按钮样式 */
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: #475669;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.production-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;
|
||||
}
|
||||
|
||||
.production-tabs ::v-deep(.el-tabs__nav) {
|
||||
min-width: 30%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.production-tabs ::v-deep(.el-tabs__content) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.production-content h2 {
|
||||
color: var(--el-text-color-primary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.not-found {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.production-header {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2rem;
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
gap: 3rem;
|
||||
}
|
||||
|
||||
.production-image .el-image {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.production-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;
|
||||
}
|
||||
|
||||
.production-carousel :deep(.el-carousel__button) {
|
||||
/* 指示器按钮样式 */
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: #475669;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.production-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;
|
||||
}
|
||||
|
||||
.production-tabs ::v-deep(.el-tabs__nav) {
|
||||
min-width: 30%;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.production-tabs ::v-deep(.el-tabs__content) {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.production-content h2 {
|
||||
color: var(--el-text-color-primary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.not-found {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.production-header {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.production-info h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ $t("our-productions") }}</h1>
|
||||
<h1 class="page-title">{{ $t('our-productions') }}</h1>
|
||||
<el-breadcrumb class="breadcrumb">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
$t("navigation.home")
|
||||
$t('navigation.home')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/productions')">{{
|
||||
$t("navigation.productions")
|
||||
$t('navigation.productions')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
@ -42,117 +42,117 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const activeNames = ref<string[]>([]);
|
||||
const activeNames = ref<string[]>([]);
|
||||
|
||||
const productions = ref<Production[]>([]);
|
||||
const productions = ref<Production[]>([]);
|
||||
|
||||
// 按类型分组
|
||||
// 兼容 production_type 既可能为对象也可能为字符串
|
||||
const groupedProductions = computed(() => {
|
||||
const groups: Record<string, Production[]> = {};
|
||||
for (const prod of productions.value) {
|
||||
let typeKey = "";
|
||||
if (typeof prod.production_type === "string") {
|
||||
typeKey = prod.production_type;
|
||||
} else if (
|
||||
prod.production_type &&
|
||||
typeof prod.production_type === "object" &&
|
||||
"type" in prod.production_type
|
||||
) {
|
||||
typeKey = prod.production_type.type || "";
|
||||
// 按类型分组
|
||||
// 兼容 production_type 既可能为对象也可能为字符串
|
||||
const groupedProductions = computed(() => {
|
||||
const groups: Record<string, Production[]> = {};
|
||||
for (const prod of productions.value) {
|
||||
let typeKey = '';
|
||||
if (typeof prod.production_type === 'string') {
|
||||
typeKey = prod.production_type;
|
||||
} else if (
|
||||
prod.production_type &&
|
||||
typeof prod.production_type === 'object' &&
|
||||
'type' in prod.production_type
|
||||
) {
|
||||
typeKey = prod.production_type.type || '';
|
||||
}
|
||||
if (!groups[typeKey]) groups[typeKey] = [];
|
||||
groups[typeKey]?.push(prod);
|
||||
}
|
||||
if (!groups[typeKey]) groups[typeKey] = [];
|
||||
groups[typeKey]?.push(prod);
|
||||
}
|
||||
return groups;
|
||||
});
|
||||
return groups;
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await find<Production>("productions", {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: "*",
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await find<Production>('productions', {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
production_type: {
|
||||
populate: '*',
|
||||
},
|
||||
},
|
||||
production_type: {
|
||||
populate: "*",
|
||||
filters: {
|
||||
show_in_production_list: {
|
||||
$eq: true, // 只获取在产品列表中显示的产品
|
||||
},
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
show_in_production_list: {
|
||||
$eq: true, // 只获取在产品列表中显示的产品
|
||||
},
|
||||
},
|
||||
locale: strapiLocale,
|
||||
});
|
||||
productions.value = response.data.map((item: Production) => ({
|
||||
...item,
|
||||
// 保持 production_type 原始类型,兼容对象或字符串
|
||||
production_type: item.production_type,
|
||||
}));
|
||||
// 默认展开所有分组
|
||||
activeNames.value = Object.keys(groupedProductions.value);
|
||||
activeNames.value.push("no-category"); // 展开未分类
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch productions:", error);
|
||||
}
|
||||
});
|
||||
locale: strapiLocale,
|
||||
});
|
||||
productions.value = response.data.map((item: Production) => ({
|
||||
...item,
|
||||
// 保持 production_type 原始类型,兼容对象或字符串
|
||||
production_type: item.production_type,
|
||||
}));
|
||||
// 默认展开所有分组
|
||||
activeNames.value = Object.keys(groupedProductions.value);
|
||||
activeNames.value.push('no-category'); // 展开未分类
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch productions:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
padding: 2rem;
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
}
|
||||
.page-container {
|
||||
padding: 2rem;
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.productions-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 40px;
|
||||
}
|
||||
.productions-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.production-group {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
.production-group {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.group-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 16px;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
.group-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 16px;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.group-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding-top: 1rem;
|
||||
gap: 20px;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.group-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding-top: 1rem;
|
||||
gap: 20px;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__header) {
|
||||
padding: 30px auto;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
:deep(.el-collapse-item__header) {
|
||||
padding: 30px auto;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="search-page">
|
||||
<div class="search-header">
|
||||
<h1 class="page-title">{{ $t("search.title") }}</h1>
|
||||
<h1 class="page-title">{{ $t('search.title') }}</h1>
|
||||
<div class="search-bar">
|
||||
<el-input
|
||||
v-model="keyword"
|
||||
@ -14,11 +14,11 @@
|
||||
@clear="handleClear"
|
||||
/>
|
||||
<el-button type="primary" @click="navigateToQuery(keyword)">
|
||||
{{ $t("search.search-button") }}
|
||||
{{ $t('search.search-button') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<p v-if="keyword && hasResults" class="search-meta">
|
||||
{{ $t("search.results-for", { query: keyword }) }}
|
||||
{{ $t('search.results-for', { query: keyword }) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<h2 class="section-title">
|
||||
{{ getIndexLabel(section.indexUid) }}
|
||||
<span class="section-count">{{
|
||||
$t("search.result-count", { count: section.estimatedTotalHits })
|
||||
$t('search.result-count', { count: section.estimatedTotalHits })
|
||||
}}</span>
|
||||
</h2>
|
||||
</header>
|
||||
@ -73,296 +73,299 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Search } from "@element-plus/icons-vue";
|
||||
import type { SearchHit, SearchSection } from "~/composables/useMeilisearch";
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
import type { SearchHit, SearchSection } from '~/composables/useMeilisearch';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const localePath = useLocalePath();
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const localePath = useLocalePath();
|
||||
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const { search } = useMeilisearch();
|
||||
const { search } = useMeilisearch();
|
||||
|
||||
const loading = ref(true);
|
||||
const keyword = ref("");
|
||||
const sections = ref<SearchSection[]>([]);
|
||||
const localeSections = computed(() =>
|
||||
sections.value.map((section) => ({
|
||||
...section,
|
||||
hits: section.hits.filter(
|
||||
(hit) =>
|
||||
!hit.locale ||
|
||||
String(hit.locale).toLowerCase() === strapiLocale.toLowerCase()
|
||||
),
|
||||
}))
|
||||
);
|
||||
const filteredSections = computed(() =>
|
||||
localeSections.value.filter((section) => section.hits.length > 0)
|
||||
);
|
||||
const activeRequestId = ref(0);
|
||||
|
||||
const indexLabels = computed<Record<string, string>>(() => ({
|
||||
production: t("search.sections.production"),
|
||||
solution: t("search.sections.solution"),
|
||||
support: t("search.sections.support"),
|
||||
default: t("search.sections.default"),
|
||||
}));
|
||||
|
||||
const getIndexLabel = (indexUid: string) =>
|
||||
indexLabels.value[indexUid] || indexLabels.value.default;
|
||||
|
||||
const hasResults = computed(() =>
|
||||
localeSections.value.some((section) => section.hits.length > 0)
|
||||
);
|
||||
|
||||
const getHitIdentifier = (hit: SearchHit, index: number) => {
|
||||
const candidate = [hit.objectID, hit.documentId, hit.id, hit.slug].find(
|
||||
(value) =>
|
||||
["string", "number"].includes(typeof value) && String(value).length > 0
|
||||
const loading = ref(true);
|
||||
const keyword = ref('');
|
||||
const sections = ref<SearchSection[]>([]);
|
||||
const localeSections = computed(() =>
|
||||
sections.value.map((section) => ({
|
||||
...section,
|
||||
hits: section.hits.filter(
|
||||
(hit) =>
|
||||
!hit.locale ||
|
||||
String(hit.locale).toLowerCase() === strapiLocale.toLowerCase()
|
||||
),
|
||||
}))
|
||||
);
|
||||
return candidate != null ? String(candidate) : String(index);
|
||||
};
|
||||
|
||||
const getHitTitle = (hit: SearchHit) => {
|
||||
const candidate = [hit.title, hit.name, hit.heading, hit.documentTitle].find(
|
||||
(value) => typeof value === "string" && value.trim().length > 0
|
||||
const filteredSections = computed(() =>
|
||||
localeSections.value.filter((section) => section.hits.length > 0)
|
||||
);
|
||||
return candidate ? String(candidate) : t("search.untitled");
|
||||
};
|
||||
const activeRequestId = ref(0);
|
||||
|
||||
const getHitSummary = (hit: SearchHit) => {
|
||||
const candidate = [
|
||||
hit.summary,
|
||||
hit.description,
|
||||
hit.snippet,
|
||||
hit.content,
|
||||
hit.text,
|
||||
].find((value) => typeof value === "string" && value.trim().length > 0);
|
||||
return candidate ? String(candidate) : "";
|
||||
};
|
||||
const indexLabels = computed<Record<string, string>>(() => ({
|
||||
production: t('search.sections.production'),
|
||||
solution: t('search.sections.solution'),
|
||||
support: t('search.sections.support'),
|
||||
default: t('search.sections.default'),
|
||||
}));
|
||||
|
||||
const resolveHitLink = (hit: SearchHit) => {
|
||||
if (typeof hit.route === "string" && hit.route.trim().length > 0) {
|
||||
return localePath(hit.route);
|
||||
}
|
||||
const getIndexLabel = (indexUid: string) =>
|
||||
indexLabels.value[indexUid] || indexLabels.value.default;
|
||||
|
||||
const slugCandidate = [hit.slug, hit.documentId, hit.id, hit.objectID].find(
|
||||
(value) =>
|
||||
["string", "number"].includes(typeof value) && String(value).length > 0
|
||||
const hasResults = computed(() =>
|
||||
localeSections.value.some((section) => section.hits.length > 0)
|
||||
);
|
||||
|
||||
if (!slugCandidate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const slug = String(slugCandidate);
|
||||
|
||||
if (hit.indexUid === "production") {
|
||||
return localePath({ path: `/productions/${slug}` });
|
||||
}
|
||||
|
||||
if (hit.indexUid === "solution") {
|
||||
return localePath({ path: `/solutions/${slug}` });
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const navigateToQuery = (value: string) => {
|
||||
const trimmed = value.trim();
|
||||
if (!trimmed) return;
|
||||
navigateTo({
|
||||
path: localePath("/search"),
|
||||
query: { query: trimmed },
|
||||
});
|
||||
};
|
||||
|
||||
const performSearch = async (value: string) => {
|
||||
activeRequestId.value += 1;
|
||||
const requestId = activeRequestId.value;
|
||||
const trimmed = value.trim();
|
||||
if (!trimmed) {
|
||||
if (requestId === activeRequestId.value) {
|
||||
sections.value = [];
|
||||
loading.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const results = await search(trimmed, { limit: 12 });
|
||||
if (requestId === activeRequestId.value) {
|
||||
sections.value = results;
|
||||
}
|
||||
console.log(results);
|
||||
console.log(localeSections.value);
|
||||
} catch (error) {
|
||||
console.error("Failed to perform search", error);
|
||||
if (requestId === activeRequestId.value) {
|
||||
sections.value = [];
|
||||
}
|
||||
} finally {
|
||||
if (requestId === activeRequestId.value) {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function debounce<T extends (...args: never[]) => void>(
|
||||
fn: T,
|
||||
delay: number
|
||||
): (...args: Parameters<T>) => void {
|
||||
let timer: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
return function (this: never, ...args: Parameters<T>) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, args);
|
||||
}, delay);
|
||||
const getHitIdentifier = (hit: SearchHit, index: number) => {
|
||||
const candidate = [hit.objectID, hit.documentId, hit.id, hit.slug].find(
|
||||
(value) =>
|
||||
['string', 'number'].includes(typeof value) && String(value).length > 0
|
||||
);
|
||||
return candidate != null ? String(candidate) : String(index);
|
||||
};
|
||||
}
|
||||
|
||||
const handleInput = debounce((value: string) => {
|
||||
performSearch(value);
|
||||
}, 300);
|
||||
const getHitTitle = (hit: SearchHit) => {
|
||||
const candidate = [
|
||||
hit.title,
|
||||
hit.name,
|
||||
hit.heading,
|
||||
hit.documentTitle,
|
||||
].find((value) => typeof value === 'string' && value.trim().length > 0);
|
||||
return candidate ? String(candidate) : t('search.untitled');
|
||||
};
|
||||
|
||||
const handleClear = () => {
|
||||
keyword.value = "";
|
||||
sections.value = [];
|
||||
router.replace(localePath({ path: "/search" }));
|
||||
};
|
||||
const getHitSummary = (hit: SearchHit) => {
|
||||
const candidate = [
|
||||
hit.summary,
|
||||
hit.description,
|
||||
hit.snippet,
|
||||
hit.content,
|
||||
hit.text,
|
||||
].find((value) => typeof value === 'string' && value.trim().length > 0);
|
||||
return candidate ? String(candidate) : '';
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
if (typeof route.query.query === "string" && route.query.query.trim()) {
|
||||
keyword.value = route.query.query;
|
||||
performSearch(route.query.query);
|
||||
} else {
|
||||
loading.value = false;
|
||||
const resolveHitLink = (hit: SearchHit) => {
|
||||
if (typeof hit.route === 'string' && hit.route.trim().length > 0) {
|
||||
return localePath(hit.route);
|
||||
}
|
||||
|
||||
const slugCandidate = [hit.slug, hit.documentId, hit.id, hit.objectID].find(
|
||||
(value) =>
|
||||
['string', 'number'].includes(typeof value) && String(value).length > 0
|
||||
);
|
||||
|
||||
if (!slugCandidate) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const slug = String(slugCandidate);
|
||||
|
||||
if (hit.indexUid === 'production') {
|
||||
return localePath({ path: `/productions/${slug}` });
|
||||
}
|
||||
|
||||
if (hit.indexUid === 'solution') {
|
||||
return localePath({ path: `/solutions/${slug}` });
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
const navigateToQuery = (value: string) => {
|
||||
const trimmed = value.trim();
|
||||
if (!trimmed) return;
|
||||
navigateTo({
|
||||
path: localePath('/search'),
|
||||
query: { query: trimmed },
|
||||
});
|
||||
};
|
||||
|
||||
const performSearch = async (value: string) => {
|
||||
activeRequestId.value += 1;
|
||||
const requestId = activeRequestId.value;
|
||||
const trimmed = value.trim();
|
||||
if (!trimmed) {
|
||||
if (requestId === activeRequestId.value) {
|
||||
sections.value = [];
|
||||
loading.value = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
loading.value = true;
|
||||
try {
|
||||
const results = await search(trimmed, { limit: 12 });
|
||||
if (requestId === activeRequestId.value) {
|
||||
sections.value = results;
|
||||
}
|
||||
console.log(results);
|
||||
console.log(localeSections.value);
|
||||
} catch (error) {
|
||||
console.error('Failed to perform search', error);
|
||||
if (requestId === activeRequestId.value) {
|
||||
sections.value = [];
|
||||
}
|
||||
} finally {
|
||||
if (requestId === activeRequestId.value) {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function debounce<T extends (...args: never[]) => void>(
|
||||
fn: T,
|
||||
delay: number
|
||||
): (...args: Parameters<T>) => void {
|
||||
let timer: ReturnType<typeof setTimeout> | null = null;
|
||||
|
||||
return function (this: never, ...args: Parameters<T>) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
timer = setTimeout(() => {
|
||||
fn.apply(this, args);
|
||||
}, delay);
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
useHead(() => ({
|
||||
title: t("search.head-title"),
|
||||
}));
|
||||
const handleInput = debounce((value: string) => {
|
||||
performSearch(value);
|
||||
}, 300);
|
||||
|
||||
const handleClear = () => {
|
||||
keyword.value = '';
|
||||
sections.value = [];
|
||||
router.replace(localePath({ path: '/search' }));
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
if (typeof route.query.query === 'string' && route.query.query.trim()) {
|
||||
keyword.value = route.query.query;
|
||||
performSearch(route.query.query);
|
||||
} else {
|
||||
loading.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
useHead(() => ({
|
||||
title: t('search.head-title'),
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-page {
|
||||
margin: 0 auto;
|
||||
max-width: 960px;
|
||||
padding: 2.5rem 1.5rem 3rem;
|
||||
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;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.search-meta {
|
||||
font-size: 0.9rem;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.search-state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 3rem 0;
|
||||
}
|
||||
|
||||
.search-results {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2.5rem;
|
||||
}
|
||||
|
||||
.search-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.section-count {
|
||||
font-size: 0.9rem;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.section-results {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.result-card {
|
||||
border-radius: 12px;
|
||||
transition: box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.result-card:hover {
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.result-title {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.result-summary {
|
||||
font-size: 0.95rem;
|
||||
color: var(--el-text-color-regular);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.search-page {
|
||||
padding: 2rem 1rem;
|
||||
margin: 0 auto;
|
||||
max-width: 960px;
|
||||
padding: 2.5rem 1.5rem 3rem;
|
||||
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 {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.search-meta {
|
||||
font-size: 0.9rem;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.search-state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 3rem 0;
|
||||
}
|
||||
|
||||
.search-results {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2.5rem;
|
||||
}
|
||||
|
||||
.search-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
.section-count {
|
||||
font-size: 0.9rem;
|
||||
color: var(--el-text-color-secondary);
|
||||
}
|
||||
|
||||
.section-results {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.result-card {
|
||||
border-radius: 12px;
|
||||
transition: box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.result-card:hover {
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
.result-title {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.result-summary {
|
||||
font-size: 0.95rem;
|
||||
color: var(--el-text-color-regular);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.search-page {
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
<el-breadcrumb class="breadcrumb" separator="/">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
$t("navigation.home")
|
||||
$t('navigation.home')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/solutions')">{{
|
||||
$t("navigation.solutions")
|
||||
$t('navigation.solutions')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">{{
|
||||
@ -40,91 +40,91 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const route = useRoute();
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const route = useRoute();
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const solution = ref<Solution | null>(null);
|
||||
const solution = ref<Solution | null>(null);
|
||||
|
||||
// 获取路由参数(documentId)
|
||||
const documentId = computed(() => route.params.slug as string);
|
||||
// 获取路由参数(documentId)
|
||||
const documentId = computed(() => route.params.slug as string);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<Solution>("solutions", documentId.value, {
|
||||
populate: "*",
|
||||
locale: strapiLocale,
|
||||
});
|
||||
if (response.data) {
|
||||
solution.value = {
|
||||
...response.data,
|
||||
// 确保 solution_type 保持原始类型
|
||||
solution_type: response.data.solution_type,
|
||||
};
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<Solution>('solutions', documentId.value, {
|
||||
populate: '*',
|
||||
locale: strapiLocale,
|
||||
});
|
||||
if (response.data) {
|
||||
solution.value = {
|
||||
...response.data,
|
||||
// 确保 solution_type 保持原始类型
|
||||
solution_type: response.data.solution_type,
|
||||
};
|
||||
}
|
||||
console.log('Fetched Solution:', solution.value);
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch solution:', error);
|
||||
}
|
||||
console.log("Fetched Solution:", solution.value);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch solution:", error);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
padding: 1rem;
|
||||
min-height: 80vh;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
padding: 1rem;
|
||||
min-height: 80vh;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
padding: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.breadcrumb {
|
||||
padding: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.solution-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
.solution-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.solution-header el-image {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.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);
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.summary {
|
||||
font-size: 0.8rem;
|
||||
color: var(--el-text-color-secondary);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.solution-content {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.solution-content {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
.loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ $t("learn-our-solutions") }}</h1>
|
||||
<h1 class="page-title">{{ $t('learn-our-solutions') }}</h1>
|
||||
<el-breadcrumb class="breadcrumb">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
$t("navigation.home")
|
||||
$t('navigation.home')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/solutions')">{{
|
||||
$t("navigation.solutions")
|
||||
$t('navigation.solutions')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
@ -52,87 +52,87 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const activeName = ref<string>("all");
|
||||
const activeName = ref<string>('all');
|
||||
|
||||
const solutions = ref<Solution[]>([]);
|
||||
const solutions = ref<Solution[]>([]);
|
||||
|
||||
// 按类型分组
|
||||
const groupedSolutions = computed(() => {
|
||||
const gourps: Record<string, Solution[]> = {};
|
||||
for (const sol of solutions.value) {
|
||||
let typeKey = "";
|
||||
if (typeof sol.solution_type === "string") {
|
||||
typeKey = sol.solution_type;
|
||||
} else if (
|
||||
sol.solution_type &&
|
||||
typeof sol.solution_type === "object" &&
|
||||
"type" in sol.solution_type
|
||||
) {
|
||||
typeKey = sol.solution_type.type || "";
|
||||
// 按类型分组
|
||||
const groupedSolutions = computed(() => {
|
||||
const gourps: Record<string, Solution[]> = {};
|
||||
for (const sol of solutions.value) {
|
||||
let typeKey = '';
|
||||
if (typeof sol.solution_type === 'string') {
|
||||
typeKey = sol.solution_type;
|
||||
} else if (
|
||||
sol.solution_type &&
|
||||
typeof sol.solution_type === 'object' &&
|
||||
'type' in sol.solution_type
|
||||
) {
|
||||
typeKey = sol.solution_type.type || '';
|
||||
}
|
||||
if (!gourps[typeKey]) gourps[typeKey] = [];
|
||||
gourps[typeKey]?.push(sol);
|
||||
}
|
||||
if (!gourps[typeKey]) gourps[typeKey] = [];
|
||||
gourps[typeKey]?.push(sol);
|
||||
}
|
||||
return gourps;
|
||||
});
|
||||
return gourps;
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await find<Solution>("solutions", {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: "*",
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await find<Solution>('solutions', {
|
||||
populate: {
|
||||
cover: {
|
||||
populate: '*',
|
||||
},
|
||||
solution_type: {
|
||||
populate: '*',
|
||||
},
|
||||
},
|
||||
solution_type: {
|
||||
populate: "*",
|
||||
},
|
||||
},
|
||||
locale: strapiLocale,
|
||||
});
|
||||
solutions.value = response.data.map((item: Solution) => ({
|
||||
...item,
|
||||
solution_type: item.solution_type,
|
||||
}));
|
||||
console.log("Fetched Solutions:", solutions.value);
|
||||
console.log("Grouped Solutions:", groupedSolutions.value);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch solutions:", error);
|
||||
}
|
||||
});
|
||||
locale: strapiLocale,
|
||||
});
|
||||
solutions.value = response.data.map((item: Solution) => ({
|
||||
...item,
|
||||
solution_type: item.solution_type,
|
||||
}));
|
||||
console.log('Fetched Solutions:', solutions.value);
|
||||
console.log('Grouped Solutions:', groupedSolutions.value);
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch solutions:', error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
padding: 2rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
padding: 2rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 1rem;
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.solution-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
gap: 40px;
|
||||
}
|
||||
.solution-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 1rem;
|
||||
margin-bottom: 2rem;
|
||||
gap: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -3,21 +3,21 @@
|
||||
<div v-if="content">
|
||||
<support-tabs model-value="contact-us" />
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ $t("navigation.contact-info") }}</h1>
|
||||
<h1 class="page-title">{{ $t('navigation.contact-info') }}</h1>
|
||||
<el-breadcrumb class="breadcrumb" separator="/">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">
|
||||
{{ $t("navigation.home") }}
|
||||
{{ $t('navigation.home') }}
|
||||
</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/support')">
|
||||
{{ $t("navigation.support") }}
|
||||
{{ $t('navigation.support') }}
|
||||
</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/support/contact-us')">
|
||||
{{ $t("navigation.contact-info") }}
|
||||
{{ $t('navigation.contact-info') }}
|
||||
</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
@ -34,62 +34,62 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const { findOne } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const content = ref<string>("");
|
||||
const content = ref<string>('');
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await findOne<StrapiContactInfo>(
|
||||
"contact-info",
|
||||
undefined,
|
||||
{
|
||||
populate: "*",
|
||||
locale: strapiLocale,
|
||||
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');
|
||||
}
|
||||
);
|
||||
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);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch contact info:", error);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
padding: 2rem 2rem 0rem;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
padding: 2rem 2rem 0rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.page-content {
|
||||
padding: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
:deep(.markdown-body ul) {
|
||||
list-style-type: none;
|
||||
}
|
||||
:deep(.markdown-body ul) {
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -6,21 +6,21 @@
|
||||
<div v-else>
|
||||
<support-tabs model-value="documents" />
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ $t("navigation.documents") }}</h1>
|
||||
<h1 class="page-title">{{ $t('navigation.documents') }}</h1>
|
||||
<el-breadcrumb class="breadcrumb" separator="/">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
$t("navigation.home")
|
||||
$t('navigation.home')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/support')">{{
|
||||
$t("navigation.support")
|
||||
$t('navigation.support')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/support/documents')">{{
|
||||
$t("navigation.documents")
|
||||
$t('navigation.documents')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
@ -33,57 +33,57 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const pending = ref(true);
|
||||
const pending = ref(true);
|
||||
|
||||
const documents = ref<StrapiMedia[]>([]);
|
||||
const documents = ref<StrapiMedia[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await find<ProductionDocument>("production-documents", {
|
||||
locale: strapiLocale,
|
||||
populate: "document",
|
||||
});
|
||||
if (response.data) {
|
||||
documents.value =
|
||||
response.data.map((item) => ({
|
||||
...item.document,
|
||||
})) || [];
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const response = await find<ProductionDocument>('production-documents', {
|
||||
locale: strapiLocale,
|
||||
populate: 'document',
|
||||
});
|
||||
if (response.data) {
|
||||
documents.value =
|
||||
response.data.map((item) => ({
|
||||
...item.document,
|
||||
})) || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching documents:', error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching documents:", error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
padding: 2rem 2rem 0rem;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
padding: 2rem 2rem 0rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 1rem 2rem 2rem;
|
||||
}
|
||||
.page-content {
|
||||
padding: 1rem 2rem 2rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -6,21 +6,21 @@
|
||||
<div v-else>
|
||||
<support-tabs model-value="faq" />
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ $t("navigation.faq") }}</h1>
|
||||
<h1 class="page-title">{{ $t('navigation.faq') }}</h1>
|
||||
<el-breadcrumb class="breadcrumb" separator="/">
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
$t("navigation.home")
|
||||
$t('navigation.home')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/support')">{{
|
||||
$t("navigation.support")
|
||||
$t('navigation.support')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/support/faq')">{{
|
||||
$t("navigation.faq")
|
||||
$t('navigation.faq')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
@ -33,53 +33,53 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
const { find } = useStrapi();
|
||||
const { getStrapiLocale } = useLocalizations();
|
||||
const strapiLocale = getStrapiLocale();
|
||||
|
||||
const questions = ref<Question[]>([]);
|
||||
const questions = ref<Question[]>([]);
|
||||
|
||||
const pending = ref(true);
|
||||
const pending = ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const faqData = await find<Question>("questions", {
|
||||
locale: strapiLocale,
|
||||
});
|
||||
if (faqData) {
|
||||
questions.value = faqData.data || [];
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const faqData = await find<Question>('questions', {
|
||||
locale: strapiLocale,
|
||||
});
|
||||
if (faqData) {
|
||||
questions.value = faqData.data || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch FAQ data:', error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch FAQ data:", error);
|
||||
} finally {
|
||||
pending.value = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
padding: 2rem 2rem 0rem;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
padding: 2rem 2rem 0rem;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 1rem 2rem 2rem;
|
||||
}
|
||||
.page-content {
|
||||
padding: 1rem 2rem 2rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -3,16 +3,16 @@
|
||||
<support-tabs />
|
||||
<div class="page-content">
|
||||
<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-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/')">{{
|
||||
$t("navigation.home")
|
||||
$t('navigation.home')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item class="text-md opacity-50">
|
||||
<NuxtLink :to="$localePath('/support')">{{
|
||||
$t("navigation.support")
|
||||
$t('navigation.support')
|
||||
}}</NuxtLink>
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
@ -32,7 +32,7 @@
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<div class="card-title">
|
||||
<span>{{ $t("navigation.faq") }}</span>
|
||||
<span>{{ $t('navigation.faq') }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -58,7 +58,7 @@
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<div class="card-title">
|
||||
<span>{{ $t("navigation.documents") }}</span>
|
||||
<span>{{ $t('navigation.documents') }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -84,7 +84,7 @@
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<div class="card-title">
|
||||
<span>{{ $t("navigation.contact-info") }}</span>
|
||||
<span>{{ $t('navigation.contact-info') }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -112,97 +112,97 @@
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
}
|
||||
.page-header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.page-title {
|
||||
font-size: 2rem;
|
||||
font-weight: bold;
|
||||
color: var(--el-color-primary);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
.breadcrumb {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
padding: 1rem 2rem 2rem;
|
||||
}
|
||||
.page-content {
|
||||
padding: 1rem 2rem 2rem;
|
||||
}
|
||||
|
||||
section {
|
||||
line-height: 1.6;
|
||||
width: 60%;
|
||||
}
|
||||
section {
|
||||
line-height: 1.6;
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.card-group {
|
||||
display: flex;
|
||||
gap: 50px;
|
||||
justify-content: space-around;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.card-group {
|
||||
display: flex;
|
||||
gap: 50px;
|
||||
justify-content: space-around;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.el-card {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
box-shadow: none;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.el-card {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
box-shadow: none;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.card-icon {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
.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-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-link {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.card-button {
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
font-size: 1rem;
|
||||
color: var(--el-color-primary);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.button-group {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
margin-top: 2rem;
|
||||
margin-left: 2rem;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-row:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.el-row:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.el-col {
|
||||
border-radius: 4px;
|
||||
}
|
||||
.el-col {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
border-radius: 4px;
|
||||
min-height: 36px;
|
||||
}
|
||||
.grid-content {
|
||||
border-radius: 4px;
|
||||
min-height: 36px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user