feat: 页面懒加载 #98
@ -47,3 +47,9 @@
|
||||
currentPage.value = 1; // 重置页码
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tabs {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div v-if="!pending">
|
||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||
|
||||
<div class="content">
|
||||
<el-skeleton :loading="pending" :rows="10" animated>
|
||||
<template #default>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<div class="html-typography" v-html="companyProfile.content || ''" />
|
||||
<div class="html-typography" v-html="companyProfile?.content || ''" />
|
||||
<!-- <div v-if="!hydrated" v-html="companyProfile.content || ''" /> -->
|
||||
<!-- <div v-else> -->
|
||||
<!-- <html-renderer -->
|
||||
@ -13,9 +14,10 @@
|
||||
<!-- :html="companyProfile.content || ''" -->
|
||||
<!-- /> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
|
||||
<el-divider content-position="left">{{ $t('learn-more') }}</el-divider>
|
||||
<el-divider content-position="left">{{
|
||||
$t('learn-more')
|
||||
}}</el-divider>
|
||||
<div class="button-group">
|
||||
<learn-more-card
|
||||
:title="$t('navigation.contact-info')"
|
||||
@ -28,9 +30,8 @@
|
||||
@click="openMap"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="loading">
|
||||
<el-skeleton :rows="5" animated />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -42,7 +43,9 @@
|
||||
{ label: $t('navigation.home'), to: localePath('/') },
|
||||
{ label: $t('navigation.about-us') },
|
||||
];
|
||||
const { data: companyProfile, pending, error } = await useCompanyProfile();
|
||||
const { data, pending, error } = useCompanyProfile();
|
||||
|
||||
const companyProfile = computed(() => data.value ?? null);
|
||||
|
||||
const openMap = () => {
|
||||
window.open(localePath('/locate'));
|
||||
|
||||
@ -4,11 +4,17 @@
|
||||
<h1 class="page-title">{{ $t('navigation.downloads') }}</h1>
|
||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||
</div>
|
||||
<div v-if="!pending" class="page-content">
|
||||
<div class="page-content">
|
||||
<el-skeleton
|
||||
:loading="pending"
|
||||
:rows="6"
|
||||
animated
|
||||
:throttle="{ leading: 500, trailing: 500 }"
|
||||
>
|
||||
<template #default>
|
||||
<file-card :file-id="id" :file="file" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-skeleton :rows="6" animated />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<div>redirecting...</div>
|
||||
<div class="page-container">
|
||||
<h1>{{ $t('redirecting') }}</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -10,3 +12,17 @@
|
||||
window.location.href = platform;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 80vh;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div v-if="!pending">
|
||||
<div v-if="product">
|
||||
<!-- 面包屑导航 -->
|
||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||
@ -19,15 +18,6 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="loading">
|
||||
<el-skeleton style="--el-skeleton-circle-size: 400px">
|
||||
<template #template>
|
||||
<el-skeleton-item variant="circle" />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
<el-skeleton :rows="5" animated />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -37,7 +27,7 @@
|
||||
// 获取路由参数
|
||||
const id = route.params.slug as string;
|
||||
|
||||
const { data: product, pending, error } = await useProduct(id);
|
||||
const { data: product, error } = await useProduct(id);
|
||||
|
||||
const breadcrumbItems = computed(() => [
|
||||
{ label: $t('navigation.home'), to: localePath('/') },
|
||||
|
||||
@ -10,7 +10,26 @@
|
||||
|
||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||
</div>
|
||||
<div v-if="!pending" class="page-content">
|
||||
<div>
|
||||
<el-skeleton
|
||||
animated
|
||||
:loading="pending"
|
||||
:throttle="{ leading: 500, trailing: 500 }"
|
||||
>
|
||||
<template #template>
|
||||
<div v-for="i in 3" :key="i" class="products-container">
|
||||
<el-skeleton-item variant="h1" class="skeleton-collapse" />
|
||||
<div class="skeleton-group-list">
|
||||
<el-skeleton-item
|
||||
v-for="j in 3"
|
||||
:key="j"
|
||||
variant="rect"
|
||||
class="skeleton-card"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="products-container">
|
||||
<el-collapse v-model="activeNames" class="product-collapse">
|
||||
<el-collapse-item
|
||||
@ -32,9 +51,8 @@
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-skeleton :rows="6" animated />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -151,6 +169,46 @@
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.skeleton-collapse {
|
||||
height: 50px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.skeleton-group-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 40px;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.skeleton-card {
|
||||
width: 30%;
|
||||
height: 250px;
|
||||
margin-right: 1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.skeleton-card {
|
||||
width: 45%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.group-list {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.skeleton-group-list {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.skeleton-card {
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__header) {
|
||||
padding: 30px auto;
|
||||
font-size: 1.5rem;
|
||||
|
||||
@ -1,11 +1,23 @@
|
||||
<template>
|
||||
<div class="search-page">
|
||||
<search-header v-model="keyword" />
|
||||
<div v-if="loading" class="search-state">
|
||||
<el-skeleton :rows="4" animated />
|
||||
</div>
|
||||
<search-tabs v-else-if="hasResults" :search-items="searchItems" />
|
||||
<div v-else class="search-state">
|
||||
<div class="search-state">
|
||||
<el-skeleton
|
||||
:loading="loading"
|
||||
animated
|
||||
:throttle="{ leading: 500, trailing: 500 }"
|
||||
>
|
||||
<template #template>
|
||||
<el-skeleton-item
|
||||
v-for="i in 10"
|
||||
:key="i"
|
||||
variant="rect"
|
||||
class="skeleton-item"
|
||||
/>
|
||||
</template>
|
||||
<template #default>
|
||||
<search-tabs v-if="hasResults" :search-items="searchItems" />
|
||||
<div v-else>
|
||||
<el-empty
|
||||
:description="
|
||||
route.query.query
|
||||
@ -14,6 +26,9 @@
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -96,7 +111,11 @@
|
||||
.search-state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 3rem 0;
|
||||
}
|
||||
|
||||
.skeleton-item {
|
||||
height: 80px;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div v-if="!pending">
|
||||
<div v-if="solution">
|
||||
<div class="page-header">
|
||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||
@ -16,10 +15,6 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="loading">
|
||||
<el-skeleton :rows="5" animated />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@ -29,7 +24,7 @@
|
||||
// 获取路由参数
|
||||
const id = route.params.slug as string;
|
||||
|
||||
const { data: solution, pending, error } = await useSolution(id);
|
||||
const { data: solution, error } = await useSolution(id);
|
||||
|
||||
const breadcrumbItems = computed(() => [
|
||||
{ label: $t('navigation.home'), to: localePath('/') },
|
||||
|
||||
@ -8,7 +8,26 @@
|
||||
|
||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||
</div>
|
||||
<div v-if="!pending" class="solutions-container">
|
||||
<div class="solutions-container">
|
||||
<el-skeleton
|
||||
:loading="pending"
|
||||
animated
|
||||
:throttle="{
|
||||
leading: 500,
|
||||
trailing: 500,
|
||||
}"
|
||||
>
|
||||
<template #template>
|
||||
<div class="skeleton-group-list">
|
||||
<el-skeleton-item
|
||||
v-for="i in 12"
|
||||
:key="i"
|
||||
variant="rect"
|
||||
class="skeleton-card"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<el-tabs v-model="activeName" class="solutions-tabs">
|
||||
<el-tab-pane :label="$t('all')" name="all">
|
||||
<div class="solution-list">
|
||||
@ -40,9 +59,8 @@
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-skeleton :rows="6" animated />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -56,7 +74,9 @@
|
||||
{ label: $t('navigation.solutions') },
|
||||
];
|
||||
|
||||
const { data: solutions, pending, error } = await useSolutionList();
|
||||
const { data, pending, error } = useSolutionList();
|
||||
|
||||
const solutions = computed(() => data.value ?? []);
|
||||
|
||||
const activeName = ref<string>('all');
|
||||
|
||||
@ -123,4 +143,34 @@
|
||||
margin-bottom: 2rem;
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.skeleton-group-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 20px;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.skeleton-card {
|
||||
width: 30%;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.skeleton-card {
|
||||
width: 45%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.skeleton-group-list {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.skeleton-card {
|
||||
width: 90%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -6,7 +6,14 @@
|
||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||
</div>
|
||||
|
||||
<div v-if="!pending" class="page-content">
|
||||
<div class="page-content">
|
||||
<el-skeleton
|
||||
:rows="10"
|
||||
:loading="pending"
|
||||
animated
|
||||
:throttle="{ leading: 500, trailing: 500 }"
|
||||
>
|
||||
<template #default>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<div class="html-typography" v-html="contactInfo?.content || ''" />
|
||||
<!-- <div v-if="!hydrated" v-html="contactInfo?.content || ''" /> -->
|
||||
@ -16,9 +23,8 @@
|
||||
<!-- :html="contactInfo?.content || ''" -->
|
||||
<!-- /> -->
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
<div v-else class="loading">
|
||||
<el-skeleton :rows="5" animated />
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -31,7 +37,9 @@
|
||||
{ label: $t('navigation.support'), to: localePath('/support') },
|
||||
{ label: $t('navigation.contact-info') },
|
||||
];
|
||||
const { data: contactInfo, pending, error } = await useContactInfo();
|
||||
const { data, pending, error } = useContactInfo();
|
||||
|
||||
const contactInfo = computed(() => data.value ?? null);
|
||||
|
||||
watch(error, (value) => {
|
||||
if (value) {
|
||||
|
||||
@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div v-if="pending">
|
||||
<el-skeleton :rows="5" animated />
|
||||
</div>
|
||||
<div v-else>
|
||||
<div>
|
||||
<support-tabs model-value="documents" />
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ $t('navigation.documents') }}</h1>
|
||||
@ -17,6 +14,29 @@
|
||||
:document-type-options="documentTypeOptions"
|
||||
/>
|
||||
|
||||
<el-skeleton
|
||||
:loading="pending"
|
||||
animated
|
||||
:throttle="{
|
||||
leading: 500,
|
||||
trailing: 500,
|
||||
}"
|
||||
>
|
||||
<template #template>
|
||||
<div class="flex flex-col gap-xl">
|
||||
<el-skeleton-item
|
||||
variant="rect"
|
||||
style="width: 100%; height: 100px"
|
||||
/>
|
||||
<el-skeleton-item
|
||||
v-for="i in 10"
|
||||
:key="i"
|
||||
variant="h1"
|
||||
style="height: 60px"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<document-list
|
||||
:documents="paginatedDocuments"
|
||||
:show-category="
|
||||
@ -33,6 +53,8 @@
|
||||
:page-size="documentsPerPage"
|
||||
:total="filteredDocuments.length"
|
||||
/>
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -56,7 +78,9 @@
|
||||
const page = ref(1);
|
||||
const documentsPerPage = 10;
|
||||
|
||||
const { data: documents, pending, error } = await useDocumentList();
|
||||
const { data, pending, error } = useDocumentList();
|
||||
|
||||
const documents = computed(() => data.value ?? []);
|
||||
|
||||
const documentTypeOptions = computed(() => {
|
||||
const types: DocumentTypeView[] = [];
|
||||
|
||||
@ -1,9 +1,5 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div v-if="pending" class="flex justify-center items-center h-64">
|
||||
<el-skeleton :rows="6" animated />
|
||||
</div>
|
||||
<div v-else>
|
||||
<support-tabs model-value="faq" />
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">{{ $t('navigation.faq') }}</h1>
|
||||
@ -18,6 +14,22 @@
|
||||
:question-type-options="questionTypeOptions"
|
||||
/>
|
||||
|
||||
<el-skeleton
|
||||
:loading="pending"
|
||||
animated
|
||||
:throttle="{ leading: 500, trailing: 500 }"
|
||||
>
|
||||
<template #template>
|
||||
<div class="flex flex-col gap-xl">
|
||||
<el-skeleton-item
|
||||
v-for="i in 10"
|
||||
:key="i"
|
||||
variant="h1"
|
||||
style="height: 80px"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template #default>
|
||||
<question-list :questions="paginatedQuestions" />
|
||||
|
||||
<el-pagination
|
||||
@ -28,7 +40,8 @@
|
||||
:page-size="questionsPerPage"
|
||||
:total="filteredQuestions.length"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-skeleton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -57,7 +70,9 @@
|
||||
{ label: $t('navigation.faq') },
|
||||
];
|
||||
|
||||
const { data: questions, pending, error } = await useQuestionList();
|
||||
const { data, pending, error } = useQuestionList();
|
||||
|
||||
const questions = computed(() => data.value ?? []);
|
||||
|
||||
const questionTypeOptions = computed(() => {
|
||||
const types: QuestionTypeView[] = [];
|
||||
|
||||
@ -127,5 +127,6 @@
|
||||
"specs": "Specifications",
|
||||
"faq": "FAQ",
|
||||
"documents": "Documents"
|
||||
}
|
||||
},
|
||||
"redirecting": "Redirecting..."
|
||||
}
|
||||
|
||||
@ -126,5 +126,6 @@
|
||||
"specs": "Especificaciones",
|
||||
"faq": "FAQ",
|
||||
"documents": "Documentos"
|
||||
}
|
||||
},
|
||||
"redirecting": "Redirigiendo..."
|
||||
}
|
||||
|
||||
@ -126,5 +126,6 @@
|
||||
"specs": "Технические спецификации",
|
||||
"faq": "Часто задаваемые вопросы",
|
||||
"documents": "Связанные документы"
|
||||
}
|
||||
},
|
||||
"redirecting": "Перенаправление..."
|
||||
}
|
||||
|
||||
@ -126,5 +126,6 @@
|
||||
"specs": "技术规格",
|
||||
"faq": "常见问题",
|
||||
"documents": "相关文档"
|
||||
}
|
||||
},
|
||||
"redirecting": "正在跳转..."
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user