Compare commits
26 Commits
246a0b9d4f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 66adf7f545 | |||
| f87b977c87 | |||
| 601c4abe53 | |||
| b71ee98129 | |||
| 7611d4f079 | |||
| 76fb3ddcb7 | |||
| aa26731731 | |||
| f2533767d2 | |||
| f1116491b6 | |||
| 537a6b0bd6 | |||
| bcc08a53ea | |||
| fa1a22b286 | |||
| 8c720b7ac3 | |||
| 33c0b9cc43 | |||
| fcaf595b73 | |||
| ef20832761 | |||
| 03a692afb5 | |||
| 7b21def74f | |||
| 783d482e0a | |||
| 62ec215340 | |||
| e02f975217 | |||
| 5530776035 | |||
| 63cdff9c41 | |||
| f1398a5545 | |||
| 36d24a4740 | |||
| c9b5b1fad9 |
@ -38,6 +38,10 @@
|
|||||||
<div class="product-info">
|
<div class="product-info">
|
||||||
<h1>{{ product.name }}</h1>
|
<h1>{{ product.name }}</h1>
|
||||||
<p class="summary">{{ product.summary }}</p>
|
<p class="summary">{{ product.summary }}</p>
|
||||||
|
<p v-if="product.status === 'discontinued'" class="discontinued-warning">
|
||||||
|
<el-icon><ElIconWarning /></el-icon>
|
||||||
|
{{ $t('product-discontinued-warning') }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -105,6 +109,10 @@
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.discontinued-warning {
|
||||||
|
color: var(--el-color-error);
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.product-header {
|
.product-header {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
|||||||
75
app/components/pages/search/SearchResultCard.vue
Normal file
75
app/components/pages/search/SearchResultCard.vue
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="result-card">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<h3 class="result-title">{{ item.title }}</h3>
|
||||||
|
<p v-if="item.summary" class="result-summary">
|
||||||
|
{{ item.summary }}
|
||||||
|
</p>
|
||||||
|
<p v-if="item.sectionType" class="result-type">
|
||||||
|
<span>{{ $t('search.section') }}: </span>
|
||||||
|
<span class="result-type-name">{{ typeLabel }}</span>
|
||||||
|
<span v-if="item.type" class="result-type-name"
|
||||||
|
>({{ item.type }})</span
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" class="image-col">
|
||||||
|
<el-image
|
||||||
|
v-if="item.thumbnail"
|
||||||
|
:src="item.thumbnail"
|
||||||
|
:alt="item.title"
|
||||||
|
style="width: 150px"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
defineProps<{
|
||||||
|
item: SearchItemView;
|
||||||
|
typeLabel: string;
|
||||||
|
}>();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.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);
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-summary {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
color: var(--el-text-color-regular);
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-type {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-type-name {
|
||||||
|
margin-left: 4px;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-col {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -3,19 +3,13 @@
|
|||||||
<div class="search-results">
|
<div class="search-results">
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-for="hit in paginatedHits"
|
v-for="hit in paginatedHits"
|
||||||
:key="`${hit.type}-${hit.id}`"
|
:key="`${hit.sectionType}-${hit.id}`"
|
||||||
:to="localePath(resolveHitLink(hit))"
|
:to="localePath(resolveHitLink(hit))"
|
||||||
>
|
>
|
||||||
<el-card class="result-card">
|
<search-result-card
|
||||||
<h3 class="result-title">{{ hit.title }}</h3>
|
:item="hit"
|
||||||
<p v-if="hit.summary" class="result-summary">
|
:type-label="getIndexLabel(hit.sectionType)"
|
||||||
{{ hit.summary }}
|
/>
|
||||||
</p>
|
|
||||||
<p v-if="hit.type" class="result-type">
|
|
||||||
<span>{{ $t('search.section') }}: </span>
|
|
||||||
<span class="result-type-name">{{ getIndexLabel(hit.type) }}</span>
|
|
||||||
</p>
|
|
||||||
</el-card>
|
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -72,7 +66,7 @@
|
|||||||
const items = props.searchItems;
|
const items = props.searchItems;
|
||||||
const filteredHits = computed(() => {
|
const filteredHits = computed(() => {
|
||||||
if (props.category) {
|
if (props.category) {
|
||||||
return items.filter((item) => item.type === props.category);
|
return items.filter((item) => item.sectionType === props.category);
|
||||||
} else {
|
} else {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
@ -116,19 +110,19 @@
|
|||||||
|
|
||||||
const slug = String(slugCandidate);
|
const slug = String(slugCandidate);
|
||||||
|
|
||||||
if (item.type === 'product') {
|
if (item.sectionType === 'product') {
|
||||||
return localePath({ path: `/products/${slug}` });
|
return localePath({ path: `/products/${slug}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.type === 'solution') {
|
if (item.sectionType === 'solution') {
|
||||||
return localePath({ path: `/solutions/${slug}` });
|
return localePath({ path: `/solutions/${slug}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.type === 'document') {
|
if (item.sectionType === 'document') {
|
||||||
return localePath({ path: `/download/${slug}` });
|
return localePath({ path: `/download/${slug}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.type === 'question') {
|
if (item.sectionType === 'question') {
|
||||||
return localePath({ path: `/support/faq`, query: { focus: slug } });
|
return localePath({ path: `/support/faq`, query: { focus: slug } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
const resultCount = computed(() => {
|
const resultCount = computed(() => {
|
||||||
const map: Record<string, number> = { all: props.searchItems.length };
|
const map: Record<string, number> = { all: props.searchItems.length };
|
||||||
for (const item of props.searchItems) {
|
for (const item of props.searchItems) {
|
||||||
map[item.type] = (map[item.type] ?? 0) + 1;
|
map[item.sectionType] = (map[item.sectionType] ?? 0) + 1;
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
});
|
});
|
||||||
@ -47,3 +47,9 @@
|
|||||||
currentPage.value = 1; // 重置页码
|
currentPage.value = 1; // 重置页码
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-tabs {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -7,7 +7,17 @@
|
|||||||
@click="handleClick(doc.fileId)"
|
@click="handleClick(doc.fileId)"
|
||||||
>
|
>
|
||||||
<div class="document-info">
|
<div class="document-info">
|
||||||
<h3>{{ doc.title }}</h3>
|
<div class="document-title">
|
||||||
|
<h3>
|
||||||
|
{{ doc.title }}
|
||||||
|
<span v-if="showCategory && doc.type" class="document-category">
|
||||||
|
|
|
||||||
|
</span>
|
||||||
|
<span v-if="showCategory && doc.type" class="document-category">
|
||||||
|
{{ doc.type.name }}
|
||||||
|
</span>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
<div class="document-content">
|
<div class="document-content">
|
||||||
<span v-if="doc.size" class="document-meta"
|
<span v-if="doc.size" class="document-meta"
|
||||||
>{{ $t('document-meta.size') }}: {{ formatFileSize(doc.size) }}
|
>{{ $t('document-meta.size') }}: {{ formatFileSize(doc.size) }}
|
||||||
@ -28,6 +38,10 @@
|
|||||||
type: Array as () => Array<ProductDocumentView>,
|
type: Array as () => Array<ProductDocumentView>,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
showCategory: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
@ -63,6 +77,15 @@
|
|||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.document-title {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.document-category {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
.download-button {
|
.download-button {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
<ul class="footer-links">
|
<ul class="footer-links">
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
href="http://cal.3w.jinshen.cn"
|
href="http://cal.jinshen.cn"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferer"
|
rel="noopener noreferer"
|
||||||
>
|
>
|
||||||
@ -84,7 +84,12 @@
|
|||||||
© {{ currentYear }} {{ $t('company-name') }}.
|
© {{ currentYear }} {{ $t('company-name') }}.
|
||||||
{{ $t('all-rights-reserved') }}
|
{{ $t('all-rights-reserved') }}
|
||||||
</p>
|
</p>
|
||||||
<p>备案号: 浙ICP备12003709号-5</p>
|
<p>
|
||||||
|
备案号:
|
||||||
|
<a href="https://beian.miit.gov.cn/" target="_blank"
|
||||||
|
>浙ICP备12003709号-5</a
|
||||||
|
>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="footer-links-bottom"> -->
|
<!-- <div class="footer-links-bottom"> -->
|
||||||
<!-- <NuxtLink :to="$localePath('/privacy')">{{ -->
|
<!-- <NuxtLink :to="$localePath('/privacy')">{{ -->
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
class="hide-on-mobile"
|
class="hide-on-mobile"
|
||||||
type="info"
|
type="info"
|
||||||
:underline="false"
|
:underline="false"
|
||||||
href="http://cal.3w.jinshen.cn"
|
href="http://cal.jinshen.cn"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<el-icon class="mdi mdi-calculator action-icon" />
|
<el-icon class="mdi mdi-calculator action-icon" />
|
||||||
|
|||||||
@ -51,9 +51,19 @@
|
|||||||
// 展开目标项
|
// 展开目标项
|
||||||
activeNames.value = [target.id];
|
activeNames.value = [target.id];
|
||||||
|
|
||||||
|
await nextTick();
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 100)); // 等待动画完成
|
||||||
|
|
||||||
// 平滑滚动到对应位置
|
// 平滑滚动到对应位置
|
||||||
|
// const el = document.querySelector(`#q-${target.id}`);
|
||||||
|
// el?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||||
|
setTimeout(() => {
|
||||||
const el = document.querySelector(`#q-${target.id}`);
|
const el = document.querySelector(`#q-${target.id}`);
|
||||||
el?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
el?.scrollIntoView({
|
||||||
|
behavior: 'smooth',
|
||||||
|
block: 'start',
|
||||||
|
});
|
||||||
|
}, 200); // 与 el-collapse 的 transition 时间匹配
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div v-if="!pending">
|
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<el-skeleton :loading="pending" :rows="10" animated>
|
||||||
|
<template #default>
|
||||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
<!-- 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-if="!hydrated" v-html="companyProfile.content || ''" /> -->
|
||||||
<!-- <div v-else> -->
|
<!-- <div v-else> -->
|
||||||
<!-- <html-renderer -->
|
<!-- <html-renderer -->
|
||||||
@ -13,9 +14,10 @@
|
|||||||
<!-- :html="companyProfile.content || ''" -->
|
<!-- :html="companyProfile.content || ''" -->
|
||||||
<!-- /> -->
|
<!-- /> -->
|
||||||
<!-- </div> -->
|
<!-- </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">
|
<div class="button-group">
|
||||||
<learn-more-card
|
<learn-more-card
|
||||||
:title="$t('navigation.contact-info')"
|
:title="$t('navigation.contact-info')"
|
||||||
@ -28,9 +30,8 @@
|
|||||||
@click="openMap"
|
@click="openMap"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<div v-else class="loading">
|
</el-skeleton>
|
||||||
<el-skeleton :rows="5" animated />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -42,7 +43,9 @@
|
|||||||
{ label: $t('navigation.home'), to: localePath('/') },
|
{ label: $t('navigation.home'), to: localePath('/') },
|
||||||
{ label: $t('navigation.about-us') },
|
{ 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 = () => {
|
const openMap = () => {
|
||||||
window.open(localePath('/locate'));
|
window.open(localePath('/locate'));
|
||||||
@ -106,5 +109,9 @@
|
|||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -4,11 +4,17 @@
|
|||||||
<h1 class="page-title">{{ $t('navigation.downloads') }}</h1>
|
<h1 class="page-title">{{ $t('navigation.downloads') }}</h1>
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</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" />
|
<file-card :file-id="id" :file="file" />
|
||||||
</div>
|
</template>
|
||||||
<div v-else>
|
</el-skeleton>
|
||||||
<el-skeleton :rows="6" animated />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -66,4 +72,10 @@
|
|||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>redirecting...</div>
|
<div class="page-container">
|
||||||
|
<h1>{{ $t('redirecting') }}</h1>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -10,3 +12,17 @@
|
|||||||
window.location.href = platform;
|
window.location.href = platform;
|
||||||
});
|
});
|
||||||
</script>
|
</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>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div v-if="!pending">
|
|
||||||
<div v-if="product">
|
<div v-if="product">
|
||||||
<!-- 面包屑导航 -->
|
<!-- 面包屑导航 -->
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
@ -19,15 +18,6 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -37,7 +27,7 @@
|
|||||||
// 获取路由参数
|
// 获取路由参数
|
||||||
const id = route.params.slug as string;
|
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(() => [
|
const breadcrumbItems = computed(() => [
|
||||||
{ label: $t('navigation.home'), to: localePath('/') },
|
{ label: $t('navigation.home'), to: localePath('/') },
|
||||||
|
|||||||
@ -1,10 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
|
<div>
|
||||||
<h1 class="page-title">{{ $t('our-products') }}</h1>
|
<h1 class="page-title">{{ $t('our-products') }}</h1>
|
||||||
|
<p class="page-subtitle">
|
||||||
|
{{ $t('products-desc') }}{{ $t('find-discontinued-products') }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</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">
|
<div class="products-container">
|
||||||
<el-collapse v-model="activeNames" class="product-collapse">
|
<el-collapse v-model="activeNames" class="product-collapse">
|
||||||
<el-collapse-item
|
<el-collapse-item
|
||||||
@ -26,9 +51,8 @@
|
|||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
<div v-else>
|
</el-skeleton>
|
||||||
<el-skeleton :rows="6" animated />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -102,13 +126,18 @@
|
|||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
margin-bottom: 1rem;
|
}
|
||||||
|
|
||||||
|
.page-subtitle {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
@ -140,6 +169,50 @@
|
|||||||
justify-content: flex-start;
|
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%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.el-collapse-item__header) {
|
:deep(.el-collapse-item__header) {
|
||||||
padding: 30px auto;
|
padding: 30px auto;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
|
|||||||
@ -1,11 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search-page">
|
<div class="search-page">
|
||||||
<search-header v-model="keyword" />
|
<search-header v-model="keyword" />
|
||||||
<div v-if="loading" class="search-state">
|
<div class="search-state">
|
||||||
<el-skeleton :rows="4" animated />
|
<el-skeleton
|
||||||
</div>
|
:loading="loading"
|
||||||
<search-tabs v-else-if="hasResults" :search-items="searchItems" />
|
animated
|
||||||
<div v-else class="search-state">
|
: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
|
<el-empty
|
||||||
:description="
|
:description="
|
||||||
route.query.query
|
route.query.query
|
||||||
@ -14,6 +26,9 @@
|
|||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-skeleton>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -96,7 +111,11 @@
|
|||||||
.search-state {
|
.search-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 3rem 0;
|
}
|
||||||
|
|
||||||
|
.skeleton-item {
|
||||||
|
height: 80px;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div v-if="!pending">
|
|
||||||
<div v-if="solution">
|
<div v-if="solution">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
@ -16,10 +15,6 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="loading">
|
|
||||||
<el-skeleton :rows="5" animated />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -29,7 +24,7 @@
|
|||||||
// 获取路由参数
|
// 获取路由参数
|
||||||
const id = route.params.slug as string;
|
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(() => [
|
const breadcrumbItems = computed(() => [
|
||||||
{ label: $t('navigation.home'), to: localePath('/') },
|
{ label: $t('navigation.home'), to: localePath('/') },
|
||||||
|
|||||||
@ -1,10 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
|
<div>
|
||||||
<h1 class="page-title">{{ $t('learn-our-solutions') }}</h1>
|
<h1 class="page-title">{{ $t('learn-our-solutions') }}</h1>
|
||||||
|
<p class="page-subtitle">{{ $t('solutions-desc') }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</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-tabs v-model="activeName" class="solutions-tabs">
|
||||||
<el-tab-pane :label="$t('all')" name="all">
|
<el-tab-pane :label="$t('all')" name="all">
|
||||||
<div class="solution-list">
|
<div class="solution-list">
|
||||||
@ -36,9 +59,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</template>
|
||||||
<div v-else>
|
</el-skeleton>
|
||||||
<el-skeleton :rows="6" animated />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -52,7 +74,9 @@
|
|||||||
{ label: $t('navigation.solutions') },
|
{ 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');
|
const activeName = ref<string>('all');
|
||||||
|
|
||||||
@ -94,15 +118,20 @@
|
|||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 1rem;
|
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-subtitle {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: var(--el-text-color-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
@ -114,4 +143,38 @@
|
|||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
gap: 40px;
|
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%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -6,7 +6,14 @@
|
|||||||
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
|
||||||
</div>
|
</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 -->
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||||
<div class="html-typography" v-html="contactInfo?.content || ''" />
|
<div class="html-typography" v-html="contactInfo?.content || ''" />
|
||||||
<!-- <div v-if="!hydrated" v-html="contactInfo?.content || ''" /> -->
|
<!-- <div v-if="!hydrated" v-html="contactInfo?.content || ''" /> -->
|
||||||
@ -16,9 +23,8 @@
|
|||||||
<!-- :html="contactInfo?.content || ''" -->
|
<!-- :html="contactInfo?.content || ''" -->
|
||||||
<!-- /> -->
|
<!-- /> -->
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
</div>
|
</template>
|
||||||
<div v-else class="loading">
|
</el-skeleton>
|
||||||
<el-skeleton :rows="5" animated />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -31,7 +37,9 @@
|
|||||||
{ label: $t('navigation.support'), to: localePath('/support') },
|
{ label: $t('navigation.support'), to: localePath('/support') },
|
||||||
{ label: $t('navigation.contact-info') },
|
{ 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) => {
|
watch(error, (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
@ -79,4 +87,10 @@
|
|||||||
:deep(.markdown-body ul) {
|
:deep(.markdown-body ul) {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div v-if="pending">
|
<div>
|
||||||
<el-skeleton :rows="5" animated />
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<support-tabs model-value="documents" />
|
<support-tabs model-value="documents" />
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1 class="page-title">{{ $t('navigation.documents') }}</h1>
|
<h1 class="page-title">{{ $t('navigation.documents') }}</h1>
|
||||||
@ -17,7 +14,36 @@
|
|||||||
:document-type-options="documentTypeOptions"
|
:document-type-options="documentTypeOptions"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<document-list :documents="paginatedDocuments" />
|
<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="
|
||||||
|
filters.selectedDocumentType === null ||
|
||||||
|
filters.selectedDocumentType === undefined
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-pagination
|
<el-pagination
|
||||||
v-model:current-page="page"
|
v-model:current-page="page"
|
||||||
@ -27,6 +53,8 @@
|
|||||||
:page-size="documentsPerPage"
|
:page-size="documentsPerPage"
|
||||||
:total="filteredDocuments.length"
|
:total="filteredDocuments.length"
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
|
</el-skeleton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -50,7 +78,9 @@
|
|||||||
const page = ref(1);
|
const page = ref(1);
|
||||||
const documentsPerPage = 10;
|
const documentsPerPage = 10;
|
||||||
|
|
||||||
const { data: documents, pending, error } = await useDocumentList();
|
const { data, pending, error } = useDocumentList();
|
||||||
|
|
||||||
|
const documents = computed(() => data.value ?? []);
|
||||||
|
|
||||||
const documentTypeOptions = computed(() => {
|
const documentTypeOptions = computed(() => {
|
||||||
const types: DocumentTypeView[] = [];
|
const types: DocumentTypeView[] = [];
|
||||||
@ -196,6 +226,12 @@
|
|||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.el-pagination) {
|
:deep(.el-pagination) {
|
||||||
.btn-prev,
|
.btn-prev,
|
||||||
.btn-next {
|
.btn-next {
|
||||||
|
|||||||
@ -1,9 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<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" />
|
<support-tabs model-value="faq" />
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1 class="page-title">{{ $t('navigation.faq') }}</h1>
|
<h1 class="page-title">{{ $t('navigation.faq') }}</h1>
|
||||||
@ -18,6 +14,22 @@
|
|||||||
:question-type-options="questionTypeOptions"
|
: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" />
|
<question-list :questions="paginatedQuestions" />
|
||||||
|
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@ -28,7 +40,8 @@
|
|||||||
:page-size="questionsPerPage"
|
:page-size="questionsPerPage"
|
||||||
:total="filteredQuestions.length"
|
:total="filteredQuestions.length"
|
||||||
/>
|
/>
|
||||||
</div>
|
</template>
|
||||||
|
</el-skeleton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -57,7 +70,9 @@
|
|||||||
{ label: $t('navigation.faq') },
|
{ 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 questionTypeOptions = computed(() => {
|
||||||
const types: QuestionTypeView[] = [];
|
const types: QuestionTypeView[] = [];
|
||||||
@ -208,6 +223,12 @@
|
|||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:deep(.el-pagination) {
|
:deep(.el-pagination) {
|
||||||
.btn-prev,
|
.btn-prev,
|
||||||
.btn-next {
|
.btn-next {
|
||||||
|
|||||||
@ -137,5 +137,9 @@
|
|||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
||||||
"company-description": "We specialize in manufacturing a range of paper tube and can equipment, integrating design, manufacturing, sales, and service.",
|
"company-description": "We specialize in manufacturing a range of paper tube and can equipment, integrating design, manufacturing, sales, and service.",
|
||||||
"learn-more": "Learn More",
|
"learn-more": "Learn More",
|
||||||
"products-desc": "We provide high-quality product solutions to meet various business needs.",
|
"products-desc": "We provide the latest products an instant service support to meet various business needs of our customers.",
|
||||||
"solutions-desc": "Providing customized technology solutions for enterprises to accelerate digital transformation.",
|
"solutions-desc": "We offer diversified technical solutions for enterprises, supporting various fields such as industry and packaging.",
|
||||||
"support-desc": "24/7 professional technical support to ensure stable operation of your business.",
|
"support-desc": "24/7 professional technical support to ensure stable operation of your business.",
|
||||||
"quick-links": "Quick Links",
|
"quick-links": "Quick Links",
|
||||||
"utilities": "Utilities",
|
"utilities": "Utilities",
|
||||||
@ -63,7 +63,9 @@
|
|||||||
"back-to-home": "Back to Home",
|
"back-to-home": "Back to Home",
|
||||||
"no-content-available": "No detailed information available",
|
"no-content-available": "No detailed information available",
|
||||||
"loading": "Loading...",
|
"loading": "Loading...",
|
||||||
"our-products": "Our Products",
|
"our-products": "Our Latest Products",
|
||||||
|
"find-discontinued-products": "To find discontinued products, please use the search function.",
|
||||||
|
"product-discontinued-warning": "Product is discontinued and may no longer receive immediate support or updates",
|
||||||
"learn-our-solutions": "Learn Our Solutions",
|
"learn-our-solutions": "Learn Our Solutions",
|
||||||
"all": "All",
|
"all": "All",
|
||||||
"support-page-desc": "Zhejiang Jinshen Machinery Manufacturing Co., Ltd is committed to providing high-quality products and services to our customers. For products such as paper tube machines, slitting machines, and paper straw equipment, we offer comprehensive after-sales support to ensure our customers can use our products with confidence.",
|
"support-page-desc": "Zhejiang Jinshen Machinery Manufacturing Co., Ltd is committed to providing high-quality products and services to our customers. For products such as paper tube machines, slitting machines, and paper straw equipment, we offer comprehensive after-sales support to ensure our customers can use our products with confidence.",
|
||||||
@ -125,5 +127,6 @@
|
|||||||
"specs": "Specifications",
|
"specs": "Specifications",
|
||||||
"faq": "FAQ",
|
"faq": "FAQ",
|
||||||
"documents": "Documents"
|
"documents": "Documents"
|
||||||
}
|
},
|
||||||
|
"redirecting": "Redirecting..."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
||||||
"company-description": "Especializado en la producción de una serie de equipos de tubos y latas de papel, integrando diseño, fabricación, ventas y servicio.",
|
"company-description": "Especializado en la producción de una serie de equipos de tubos y latas de papel, integrando diseño, fabricación, ventas y servicio.",
|
||||||
"learn-more": "Saber más",
|
"learn-more": "Saber más",
|
||||||
"products-desc": "Ofrecemos soluciones de productos de alta calidad que satisfacen diversas necesidades empresariales.",
|
"products-desc": "Ofrecemos los últimos productos y un servicio de asistencia instantáneo para satisfacer las diversas necesidades comerciales de nuestros clientes.",
|
||||||
"solutions-desc": "Providing customized technology solutions for enterprises to accelerate digital transformation.",
|
"solutions-desc": "Ofrecemos soluciones técnicas diversificadas para empresas, prestando apoyo en diversos campos, como la industria y el embalaje.",
|
||||||
"support-desc": "Soporte técnico profesional 24/7, asegurando la estabilidad de su negocio.",
|
"support-desc": "Soporte técnico profesional 24/7, asegurando la estabilidad de su negocio.",
|
||||||
"quick-links": "Enlaces rápidos",
|
"quick-links": "Enlaces rápidos",
|
||||||
"utilities": "Herramientas útiles",
|
"utilities": "Herramientas útiles",
|
||||||
@ -63,7 +63,9 @@
|
|||||||
"back-to-home": "Volver al inicio",
|
"back-to-home": "Volver al inicio",
|
||||||
"no-content-available": "No hay información disponible",
|
"no-content-available": "No hay información disponible",
|
||||||
"loading": "Cargando...",
|
"loading": "Cargando...",
|
||||||
"our-products": "Nuestros productos",
|
"our-products": "Nuestros últimos productos",
|
||||||
|
"find-discontinued-products": "Para encontrar productos descatalogados, utilice la función de búsqueda.",
|
||||||
|
"product-discontinued-warning": "Este producto ha sido descontinuado y puede que ya no reciba soporte o actualizaciones inmediatas.",
|
||||||
"learn-our-solutions": "Aprenda sobre nuestras soluciones",
|
"learn-our-solutions": "Aprenda sobre nuestras soluciones",
|
||||||
"all": "Todo",
|
"all": "Todo",
|
||||||
"support-page-desc": "Zhejiang Jinshen Machinery Manufacturing Co., Ltd se dedica a proporcionar productos y servicios de alta calidad a los clientes. Para máquinas de tubos de papel, máquinas de corte y pajitas de papel, ofrecemos un servicio postventa integral para garantizar que los clientes puedan usar nuestros productos con confianza.",
|
"support-page-desc": "Zhejiang Jinshen Machinery Manufacturing Co., Ltd se dedica a proporcionar productos y servicios de alta calidad a los clientes. Para máquinas de tubos de papel, máquinas de corte y pajitas de papel, ofrecemos un servicio postventa integral para garantizar que los clientes puedan usar nuestros productos con confianza.",
|
||||||
@ -124,5 +126,6 @@
|
|||||||
"specs": "Especificaciones",
|
"specs": "Especificaciones",
|
||||||
"faq": "FAQ",
|
"faq": "FAQ",
|
||||||
"documents": "Documentos"
|
"documents": "Documentos"
|
||||||
}
|
},
|
||||||
|
"redirecting": "Redirigiendo..."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
"company-name": "Jinshen Machinary Manufacturing Co., Ltd.",
|
||||||
"company-description": "Профессионально производим оборудование для бумажных трубок и канистр, услуги по проектированию, производству, продаже и сервисному обслуживанию.",
|
"company-description": "Профессионально производим оборудование для бумажных трубок и канистр, услуги по проектированию, производству, продаже и сервисному обслуживанию.",
|
||||||
"learn-more": "Узнать больше",
|
"learn-more": "Узнать больше",
|
||||||
"products-desc": "Мы предоставляем высококачественные решения для различных бизнес-потребностей.",
|
"products-desc": "Мы предоставляем новейшие продукты и мгновенную сервисную поддержку для удовлетворения различных бизнес-потребностей наших клиентов.",
|
||||||
"solutions-desc": "Предлагаем индивидуальные технологические решения для содействия цифровой трансформации.",
|
"solutions-desc": "Мы предлагаем разнообразные технические решения для предприятий, поддерживая различные области, такие как промышленность и упаковка.",
|
||||||
"support-desc": "Профессиональная техническая поддержка 24/7, обеспечивающая стабильную работу вашего бизнеса.",
|
"support-desc": "Профессиональная техническая поддержка 24/7, обеспечивающая стабильную работу вашего бизнеса.",
|
||||||
"quick-links": "Быстрые ссылки",
|
"quick-links": "Быстрые ссылки",
|
||||||
"utilities": "Полезные инструменты",
|
"utilities": "Полезные инструменты",
|
||||||
@ -63,7 +63,9 @@
|
|||||||
"back-to-home": "Вернуться на главную",
|
"back-to-home": "Вернуться на главную",
|
||||||
"no-content-available": "Нет доступной информации",
|
"no-content-available": "Нет доступной информации",
|
||||||
"loading": "Загрузка...",
|
"loading": "Загрузка...",
|
||||||
"our-products": "Наши продукты",
|
"our-products": "Наши последние продукты",
|
||||||
|
"find-discontinued-products": "Чтобы найти другие продукты, используйте функцию поиска.",
|
||||||
|
"product-discontinued-warning": "Этот продукт снят с производства и может больше не получать мгновенную поддержку или обновления",
|
||||||
"learn-our-solutions": "Узнайте о наших решениях",
|
"learn-our-solutions": "Узнайте о наших решениях",
|
||||||
"all": "Все",
|
"all": "Все",
|
||||||
"support-page-desc": "Zhejiang Jinshen Machinery Manufacturing Co., Ltd Стремится предоставлять клиентам высококачественные продукты и услуги. Мы предлагаем послепродажное обслуживание для таких продуктов, как машины для бумажных трубок и соломинок, обеспечивая уверенность клиентов в использовании нашей продукции.",
|
"support-page-desc": "Zhejiang Jinshen Machinery Manufacturing Co., Ltd Стремится предоставлять клиентам высококачественные продукты и услуги. Мы предлагаем послепродажное обслуживание для таких продуктов, как машины для бумажных трубок и соломинок, обеспечивая уверенность клиентов в использовании нашей продукции.",
|
||||||
@ -124,5 +126,6 @@
|
|||||||
"specs": "Технические спецификации",
|
"specs": "Технические спецификации",
|
||||||
"faq": "Часто задаваемые вопросы",
|
"faq": "Часто задаваемые вопросы",
|
||||||
"documents": "Связанные документы"
|
"documents": "Связанные документы"
|
||||||
}
|
},
|
||||||
|
"redirecting": "Перенаправление..."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
"company-name": "金申机械制造有限公司",
|
"company-name": "金申机械制造有限公司",
|
||||||
"company-description": "专业生产一系列纸管、纸罐设备,集设计、制造、销售、服务于一体。",
|
"company-description": "专业生产一系列纸管、纸罐设备,集设计、制造、销售、服务于一体。",
|
||||||
"learn-more": "了解更多",
|
"learn-more": "了解更多",
|
||||||
"products-desc": "我们提供高质量的产品解决方案,满足各种业务需求。",
|
"products-desc": "我们提供最新的产品与即时的服务支持,满足客户的各类业务需求。",
|
||||||
"solutions-desc": "为企业提供定制化的技术解决方案,助力数字化转型。",
|
"solutions-desc": "我们为企业提供多样化的技术解决方案,在工业、包装等多种领域提供支持。",
|
||||||
"support-desc": "7x24小时专业技术支持,确保您的业务稳定运行。",
|
"support-desc": "7x24小时专业技术支持,确保您的业务稳定运行。",
|
||||||
"quick-links": "快速链接",
|
"quick-links": "快速链接",
|
||||||
"utilities": "实用工具",
|
"utilities": "实用工具",
|
||||||
@ -63,7 +63,9 @@
|
|||||||
"back-to-home": "返回首页",
|
"back-to-home": "返回首页",
|
||||||
"no-content-available": "暂无详细信息",
|
"no-content-available": "暂无详细信息",
|
||||||
"loading": "加载中...",
|
"loading": "加载中...",
|
||||||
"our-products": "我们的产品",
|
"our-products": "我们的最新产品",
|
||||||
|
"find-discontinued-products": "如需查找其他产品,请使用搜索功能",
|
||||||
|
"product-discontinued-warning": "本产品已停产,可能不再提供即时的支持或更新",
|
||||||
"learn-our-solutions": "了解我们的解决方案",
|
"learn-our-solutions": "了解我们的解决方案",
|
||||||
"all": "全部",
|
"all": "全部",
|
||||||
"support-page-desc": "金申机械制造有限公司致力于为客户提供优质的产品与服务。针对纸管机、分纸机、纸吸管等产品,我们提供全方位的售后服务,确保客户能够安心地使用我们的产品。",
|
"support-page-desc": "金申机械制造有限公司致力于为客户提供优质的产品与服务。针对纸管机、分纸机、纸吸管等产品,我们提供全方位的售后服务,确保客户能够安心地使用我们的产品。",
|
||||||
@ -124,5 +126,6 @@
|
|||||||
"specs": "技术规格",
|
"specs": "技术规格",
|
||||||
"faq": "常见问题",
|
"faq": "常见问题",
|
||||||
"documents": "相关文档"
|
"documents": "相关文档"
|
||||||
}
|
},
|
||||||
|
"redirecting": "正在跳转..."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,17 @@ export default defineNuxtConfig({
|
|||||||
htmlAttrs: {
|
htmlAttrs: {
|
||||||
lang: 'zh',
|
lang: 'zh',
|
||||||
},
|
},
|
||||||
link: [{ rel: 'icon', type: 'image/x-icon', href: '/jinshen-logo.ico' }],
|
link: [
|
||||||
|
{ rel: 'icon', type: 'image/x-icon', href: '/jinshen-logo.ico' },
|
||||||
|
{
|
||||||
|
rel: 'apple-touch-icon',
|
||||||
|
href: '/jinshen-logo.png',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rel: 'manifest',
|
||||||
|
href: '/manifest.json',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
BIN
public/logo196x196.png
Normal file
BIN
public/logo196x196.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
public/logo512x512.png
Normal file
BIN
public/logo512x512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
20
public/manifest.json
Normal file
20
public/manifest.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "金申机械制造有限公司",
|
||||||
|
"short_name": "金申机械",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/logo196x196.png",
|
||||||
|
"sizes": "196x196",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/logo512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"theme_color": "#0f172a"
|
||||||
|
}
|
||||||
@ -11,7 +11,7 @@ export default defineEventHandler(async (event) => {
|
|||||||
if (!q) return [];
|
if (!q) return [];
|
||||||
|
|
||||||
const meili = getMeiliService();
|
const meili = getMeiliService();
|
||||||
const sections = await meili.search(q, { limit: 12 }, locale);
|
const sections = await meili.search(q, { limit: 500 }, locale);
|
||||||
|
|
||||||
// 空Section过滤
|
// 空Section过滤
|
||||||
const filteredSections = sections.filter(
|
const filteredSections = sections.filter(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
query GetDocumentList($locale: String!) {
|
query GetDocumentList($locale: String!) {
|
||||||
product_documents(filter: { status: { _eq: "published" } }) {
|
product_documents(filter: { status: { _eq: "published" } }, limit: 500) {
|
||||||
id
|
id
|
||||||
file {
|
file {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -51,6 +51,13 @@ query GetProduct($id: ID!, $locale: String!) {
|
|||||||
id
|
id
|
||||||
product_documents_id(filter: { status: { _eq: "published" } }) {
|
product_documents_id(filter: { status: { _eq: "published" } }) {
|
||||||
id
|
id
|
||||||
|
type {
|
||||||
|
id
|
||||||
|
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
}
|
||||||
|
}
|
||||||
file {
|
file {
|
||||||
id
|
id
|
||||||
filesize
|
filesize
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
query GetProductList($locale: String!) {
|
query GetProductList($locale: String!) {
|
||||||
products(filter: { status: { _eq: "in-production" } }) {
|
products(filter: { status: { _eq: "in-production" } }, limit: 200) {
|
||||||
id
|
id
|
||||||
status
|
status
|
||||||
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
translations(filter: { languages_code: { code: { _eq: $locale } } }) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
query GetQuestionList($locale: String!) {
|
query GetQuestionList($locale: String!) {
|
||||||
questions(filter: { status: { _eq: "published" } }) {
|
questions(filter: { status: { _eq: "published" } }, limit: 500) {
|
||||||
id
|
id
|
||||||
type {
|
type {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
query GetSolutionList($locale: String!) {
|
query GetSolutionList($locale: String!) {
|
||||||
solutions(filter: { status: { _eq: "published" } }) {
|
solutions(filter: { status: { _eq: "published" } }, limit: 200) {
|
||||||
id
|
id
|
||||||
cover {
|
cover {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -347,6 +347,15 @@ describe('toProductDocumentView', () => {
|
|||||||
filesize: 1000,
|
filesize: 1000,
|
||||||
filename_download: 'doc1.pdf',
|
filename_download: 'doc1.pdf',
|
||||||
},
|
},
|
||||||
|
type: {
|
||||||
|
id: 1,
|
||||||
|
translations: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: 'manual',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
translations: [
|
translations: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -363,6 +372,10 @@ describe('toProductDocumentView', () => {
|
|||||||
fileId: 'rand-om__-uuid-1234',
|
fileId: 'rand-om__-uuid-1234',
|
||||||
filename: 'doc1.pdf',
|
filename: 'doc1.pdf',
|
||||||
title: 'Document Title 1',
|
title: 'Document Title 1',
|
||||||
|
type: {
|
||||||
|
id: '1',
|
||||||
|
name: 'manual',
|
||||||
|
},
|
||||||
size: 1000,
|
size: 1000,
|
||||||
url: '/api/assets/rand-om__-uuid-1234',
|
url: '/api/assets/rand-om__-uuid-1234',
|
||||||
},
|
},
|
||||||
@ -391,6 +404,10 @@ describe('toProductDocumentView', () => {
|
|||||||
fileId: 'rand-om__-uuid-1234',
|
fileId: 'rand-om__-uuid-1234',
|
||||||
filename: 'doc1.pdf',
|
filename: 'doc1.pdf',
|
||||||
title: '',
|
title: '',
|
||||||
|
type: {
|
||||||
|
id: '-1',
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
size: 1000,
|
size: 1000,
|
||||||
url: '/api/assets/rand-om__-uuid-1234',
|
url: '/api/assets/rand-om__-uuid-1234',
|
||||||
},
|
},
|
||||||
@ -413,6 +430,10 @@ describe('toProductDocumentView', () => {
|
|||||||
filename: '',
|
filename: '',
|
||||||
title: '',
|
title: '',
|
||||||
size: 0,
|
size: 0,
|
||||||
|
type: {
|
||||||
|
id: '-1',
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
url: '',
|
url: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -421,6 +442,10 @@ describe('toProductDocumentView', () => {
|
|||||||
filename: '',
|
filename: '',
|
||||||
title: '',
|
title: '',
|
||||||
size: 0,
|
size: 0,
|
||||||
|
type: {
|
||||||
|
id: '-1',
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
url: '',
|
url: '',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@ -431,9 +456,9 @@ describe('toProductDocumentView', () => {
|
|||||||
* 单元测试: toProductView
|
* 单元测试: toProductView
|
||||||
*/
|
*/
|
||||||
describe('toProductView', () => {
|
describe('toProductView', () => {
|
||||||
test('convert raw data to ProductView correctly', () => {
|
const baseData: Product = {
|
||||||
const rawData: Product = {
|
|
||||||
id: 1,
|
id: 1,
|
||||||
|
status: 'in-production',
|
||||||
translations: [
|
translations: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -443,9 +468,14 @@ describe('toProductView', () => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
test('convert raw data to ProductView correctly', () => {
|
||||||
|
const rawData: Product = {
|
||||||
|
...baseData,
|
||||||
|
};
|
||||||
|
|
||||||
expect(toProductView(rawData)).toEqual({
|
expect(toProductView(rawData)).toEqual({
|
||||||
id: '1',
|
id: '1',
|
||||||
|
status: 'in-production',
|
||||||
name: 'Product Name',
|
name: 'Product Name',
|
||||||
summary: 'Product Summary',
|
summary: 'Product Summary',
|
||||||
description: 'Product Description',
|
description: 'Product Description',
|
||||||
@ -458,12 +488,13 @@ describe('toProductView', () => {
|
|||||||
|
|
||||||
test('convert raw data with missing translations', () => {
|
test('convert raw data with missing translations', () => {
|
||||||
const rawData: Product = {
|
const rawData: Product = {
|
||||||
id: 1,
|
...baseData,
|
||||||
translations: [],
|
translations: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
expect(toProductView(rawData)).toEqual({
|
expect(toProductView(rawData)).toEqual({
|
||||||
id: '1',
|
id: '1',
|
||||||
|
status: 'in-production',
|
||||||
name: '',
|
name: '',
|
||||||
summary: '',
|
summary: '',
|
||||||
description: '',
|
description: '',
|
||||||
@ -473,4 +504,23 @@ describe('toProductView', () => {
|
|||||||
specs: [],
|
specs: [],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('conert raw data with missing status', () => {
|
||||||
|
const rawData: Product = {
|
||||||
|
...baseData,
|
||||||
|
status: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(toProductView(rawData)).toEqual({
|
||||||
|
id: '1',
|
||||||
|
status: 'discontinued',
|
||||||
|
name: 'Product Name',
|
||||||
|
summary: 'Product Summary',
|
||||||
|
description: 'Product Description',
|
||||||
|
images: [],
|
||||||
|
documents: [],
|
||||||
|
faqs: [],
|
||||||
|
specs: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { isObject } from '../../server/utils/object';
|
import { isObject } from '../../server/utils/object';
|
||||||
|
import { toDocumentTypeView } from './documentMapper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将 Directus 返回的 ProductImage 数据转换为 ProductImageView 视图模型
|
* 将 Directus 返回的 ProductImage 数据转换为 ProductImageView 视图模型
|
||||||
@ -161,6 +162,10 @@ export function toProductDocumentView(
|
|||||||
size: 0,
|
size: 0,
|
||||||
title: '',
|
title: '',
|
||||||
url: '',
|
url: '',
|
||||||
|
type: {
|
||||||
|
id: '-1',
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
} satisfies ProductDocumentView;
|
} satisfies ProductDocumentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,6 +178,10 @@ export function toProductDocumentView(
|
|||||||
size: 0,
|
size: 0,
|
||||||
title: '',
|
title: '',
|
||||||
url: '',
|
url: '',
|
||||||
|
type: {
|
||||||
|
id: '-1',
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
} satisfies ProductDocumentView;
|
} satisfies ProductDocumentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,6 +193,8 @@ export function toProductDocumentView(
|
|||||||
|
|
||||||
const trans = document.translations?.[0];
|
const trans = document.translations?.[0];
|
||||||
|
|
||||||
|
const typeView = toDocumentTypeView(document.type ?? null);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: item.id.toString(),
|
id: item.id.toString(),
|
||||||
fileId: file?.id ?? '',
|
fileId: file?.id ?? '',
|
||||||
@ -191,6 +202,7 @@ export function toProductDocumentView(
|
|||||||
size: file?.filesize ?? 0,
|
size: file?.filesize ?? 0,
|
||||||
title: trans?.title ?? '',
|
title: trans?.title ?? '',
|
||||||
url: url,
|
url: url,
|
||||||
|
type: typeView,
|
||||||
} satisfies ProductDocumentView;
|
} satisfies ProductDocumentView;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -207,6 +219,8 @@ export function toProductDocumentView(
|
|||||||
export function toProductView(raw: Product): ProductView {
|
export function toProductView(raw: Product): ProductView {
|
||||||
const trans = raw.translations?.[0];
|
const trans = raw.translations?.[0];
|
||||||
|
|
||||||
|
const status = raw.status ?? 'discontinued';
|
||||||
|
|
||||||
const images = toProductImageView(raw.images ?? []);
|
const images = toProductImageView(raw.images ?? []);
|
||||||
|
|
||||||
const specs = toProductSpecGroupView(raw.specs ?? []);
|
const specs = toProductSpecGroupView(raw.specs ?? []);
|
||||||
@ -217,6 +231,7 @@ export function toProductView(raw: Product): ProductView {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: raw.id.toString(),
|
id: raw.id.toString(),
|
||||||
|
status: status,
|
||||||
name: trans?.name ?? '',
|
name: trans?.name ?? '',
|
||||||
summary: trans?.summary ?? '',
|
summary: trans?.summary ?? '',
|
||||||
images: images,
|
images: images,
|
||||||
|
|||||||
@ -12,13 +12,16 @@ describe('converters', () => {
|
|||||||
summary: 'High efficiency',
|
summary: 'High efficiency',
|
||||||
description: 'Detailed description',
|
description: 'Detailed description',
|
||||||
type: 'pump',
|
type: 'pump',
|
||||||
|
cover: 'rand-om__-uuid-1234',
|
||||||
};
|
};
|
||||||
const result = converters.products(item);
|
const result = converters.products(item);
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
id: 1,
|
id: 1,
|
||||||
type: 'product',
|
sectionType: 'product',
|
||||||
title: 'Hydraulic Pump',
|
title: 'Hydraulic Pump',
|
||||||
summary: 'High efficiency',
|
summary: 'High efficiency',
|
||||||
|
type: 'pump',
|
||||||
|
thumbnail: '/api/assets/rand-om__-uuid-1234',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -29,13 +32,16 @@ describe('converters', () => {
|
|||||||
summary: 'Effective solution',
|
summary: 'Effective solution',
|
||||||
content: 'Detailed content',
|
content: 'Detailed content',
|
||||||
type: 'Type A',
|
type: 'Type A',
|
||||||
|
cover: 'rand-om__-uuid-5678',
|
||||||
};
|
};
|
||||||
const result = converters.solutions(item);
|
const result = converters.solutions(item);
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
id: 1,
|
id: 1,
|
||||||
type: 'solution',
|
sectionType: 'solution',
|
||||||
title: 'Solution A',
|
title: 'Solution A',
|
||||||
summary: 'Effective solution',
|
summary: 'Effective solution',
|
||||||
|
type: 'Type A',
|
||||||
|
thumbnail: '/api/assets/rand-om__-uuid-5678',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -47,13 +53,15 @@ describe('converters', () => {
|
|||||||
'This is a detailed explanation of how to use the product effectively.',
|
'This is a detailed explanation of how to use the product effectively.',
|
||||||
products: ['Product A'],
|
products: ['Product A'],
|
||||||
product_types: ['Type A'],
|
product_types: ['Type A'],
|
||||||
|
type: 'Question Type',
|
||||||
};
|
};
|
||||||
const result = converters.questions(item);
|
const result = converters.questions(item);
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
id: 1,
|
id: 1,
|
||||||
title: 'How to use product?',
|
title: 'How to use product?',
|
||||||
summary: '',
|
summary: undefined,
|
||||||
type: 'question',
|
type: 'Question Type',
|
||||||
|
sectionType: 'question',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -64,13 +72,15 @@ describe('converters', () => {
|
|||||||
products: ['Product A'],
|
products: ['Product A'],
|
||||||
product_types: ['Type A'],
|
product_types: ['Type A'],
|
||||||
fileUUID: 'TEST-UUID',
|
fileUUID: 'TEST-UUID',
|
||||||
|
type: 'manual',
|
||||||
};
|
};
|
||||||
const result = converters.product_documents(item);
|
const result = converters.product_documents(item);
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
id: 'TEST-UUID',
|
id: 'TEST-UUID',
|
||||||
title: 'User Manual',
|
title: 'User Manual',
|
||||||
summary: '',
|
summary: undefined,
|
||||||
type: 'document',
|
sectionType: 'document',
|
||||||
|
type: 'manual',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -6,31 +6,35 @@ export const converters: {
|
|||||||
} = {
|
} = {
|
||||||
products: (item: MeiliIndexMap['products']): SearchItemView => ({
|
products: (item: MeiliIndexMap['products']): SearchItemView => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
type: 'product',
|
sectionType: 'product',
|
||||||
title: item.name,
|
title: item.name,
|
||||||
summary: item.summary,
|
summary: item?.summary,
|
||||||
|
type: item?.type,
|
||||||
|
thumbnail: item?.cover ? `/api/assets/${item.cover}` : undefined,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
solutions: (item: MeiliIndexMap['solutions']): SearchItemView => ({
|
solutions: (item: MeiliIndexMap['solutions']): SearchItemView => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
type: 'solution',
|
sectionType: 'solution',
|
||||||
title: item.title,
|
title: item.title,
|
||||||
summary: item.summary,
|
summary: item?.summary,
|
||||||
|
type: item?.type,
|
||||||
|
thumbnail: item?.cover ? `/api/assets/${item.cover}` : undefined,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
questions: (item: MeiliIndexMap['questions']): SearchItemView => ({
|
questions: (item: MeiliIndexMap['questions']): SearchItemView => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
type: 'question',
|
sectionType: 'question',
|
||||||
title: item.title,
|
title: item.title,
|
||||||
summary: '',
|
type: item?.type,
|
||||||
}),
|
}),
|
||||||
|
|
||||||
product_documents: (
|
product_documents: (
|
||||||
item: MeiliIndexMap['product_documents']
|
item: MeiliIndexMap['product_documents']
|
||||||
): SearchItemView => ({
|
): SearchItemView => ({
|
||||||
id: item.fileUUID || item.id,
|
id: item.fileUUID || item.id,
|
||||||
type: 'document',
|
sectionType: 'document',
|
||||||
title: item.title,
|
title: item.title,
|
||||||
summary: '',
|
type: item?.type,
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -9,13 +9,16 @@ export interface MeiliProductIndex {
|
|||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
/** 产品简介 **/
|
/** 产品简介 **/
|
||||||
summary: string;
|
summary?: string;
|
||||||
|
|
||||||
/** 产品详情 **/
|
/** 产品详情 **/
|
||||||
description: string;
|
description?: string;
|
||||||
|
|
||||||
/** 产品类型 **/
|
/** 产品类型 **/
|
||||||
type: string;
|
type?: string;
|
||||||
|
|
||||||
|
/** 产品缩略图 **/
|
||||||
|
cover?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,13 +32,16 @@ export interface MeiliSolutionIndex {
|
|||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
/** 解决方案摘要 **/
|
/** 解决方案摘要 **/
|
||||||
summary: string;
|
summary?: string;
|
||||||
|
|
||||||
/** 解决方案内容 **/
|
/** 解决方案内容 **/
|
||||||
content: string;
|
content?: string;
|
||||||
|
|
||||||
/** 解决方案类型 **/
|
/** 解决方案类型 **/
|
||||||
type: string;
|
type?: string;
|
||||||
|
|
||||||
|
/** 解决方案缩略图 **/
|
||||||
|
cover?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +55,10 @@ export interface MeiliQuestionIndex {
|
|||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
/** 问题内容 **/
|
/** 问题内容 **/
|
||||||
content: string;
|
content?: string;
|
||||||
|
|
||||||
|
/** 问题类型 **/
|
||||||
|
type?: string;
|
||||||
|
|
||||||
/** 相关产品 **/
|
/** 相关产品 **/
|
||||||
products: string[];
|
products: string[];
|
||||||
@ -68,6 +77,9 @@ export interface MeiliProductDocumentIndex {
|
|||||||
/** 文档标题 **/
|
/** 文档标题 **/
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
|
/** 文档类型 **/
|
||||||
|
type?: string;
|
||||||
|
|
||||||
/** 相关产品 **/
|
/** 相关产品 **/
|
||||||
products: string[];
|
products: string[];
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
import type { DocumentTypeView } from './document-list-view';
|
||||||
|
import type { Product } from '../directus/my-schema.ts';
|
||||||
|
|
||||||
|
type ProductStatus = Product['status'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品图片视图模型
|
* 产品图片视图模型
|
||||||
* 用于产品详情页(/products/[slug])中的产品图片数据结构
|
* 用于产品详情页(/products/[slug])中的产品图片数据结构
|
||||||
@ -73,6 +78,9 @@ export interface ProductDocumentView {
|
|||||||
/** 文档大小 **/
|
/** 文档大小 **/
|
||||||
size: number;
|
size: number;
|
||||||
|
|
||||||
|
/** 文档类型 **/
|
||||||
|
type: DocumentTypeView;
|
||||||
|
|
||||||
/** 文档链接 **/
|
/** 文档链接 **/
|
||||||
url: string;
|
url: string;
|
||||||
}
|
}
|
||||||
@ -85,6 +93,9 @@ export interface ProductView {
|
|||||||
/** 唯一标识符 **/
|
/** 唯一标识符 **/
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
|
/** 产品状态 **/
|
||||||
|
status: ProductStatus;
|
||||||
|
|
||||||
/** 产品名称 **/
|
/** 产品名称 **/
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
|||||||
@ -3,11 +3,17 @@ export interface SearchItemView {
|
|||||||
id: number | string;
|
id: number | string;
|
||||||
|
|
||||||
/** 条目类型 **/
|
/** 条目类型 **/
|
||||||
type: 'product' | 'solution' | 'question' | 'document';
|
sectionType: 'product' | 'solution' | 'question' | 'document';
|
||||||
|
|
||||||
/** 条目标题 **/
|
/** 条目标题 **/
|
||||||
title: string;
|
title: string;
|
||||||
|
|
||||||
/** 条目摘要 **/
|
/** 条目摘要 **/
|
||||||
summary: string;
|
summary?: string;
|
||||||
|
|
||||||
|
/** 条目分类 **/
|
||||||
|
type?: string;
|
||||||
|
|
||||||
|
/** 条目预览图 **/
|
||||||
|
thumbnail?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user