style: 格式化项目代码
- 根据prettier配置格式化整个项目的代码
This commit is contained in:
14
README.md
14
README.md
@ -19,7 +19,6 @@
|
|||||||
- 关于我们
|
- 关于我们
|
||||||
- 公司基本信息
|
- 公司基本信息
|
||||||
|
|
||||||
|
|
||||||
## 安装与设置
|
## 安装与设置
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
@ -27,25 +26,25 @@
|
|||||||
|
|
||||||
1. 克隆项目仓库:
|
1. 克隆项目仓库:
|
||||||
|
|
||||||
``` bash
|
```bash
|
||||||
git clone http://192.168.84.125/remilia/jinshen-website.git
|
git clone http://192.168.84.125/remilia/jinshen-website.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2. 进入项目目录:
|
2. 进入项目目录:
|
||||||
|
|
||||||
``` bash
|
```bash
|
||||||
cd jinshen-website
|
cd jinshen-website
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 安装依赖
|
3. 安装依赖
|
||||||
|
|
||||||
``` bash
|
```bash
|
||||||
pnpm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 运行开发环境
|
4. 运行开发环境
|
||||||
|
|
||||||
``` bash
|
```bash
|
||||||
pnpm run dev
|
pnpm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -65,11 +64,13 @@ pnpm run dev
|
|||||||
1. 构建生产版本
|
1. 构建生产版本
|
||||||
|
|
||||||
项目构建
|
项目构建
|
||||||
``` bash
|
|
||||||
|
```bash
|
||||||
pnpm run build
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
预览构建版本
|
预览构建版本
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm run preview
|
pnpm run preview
|
||||||
```
|
```
|
||||||
@ -77,3 +78,4 @@ pnpm run preview
|
|||||||
2. 部署
|
2. 部署
|
||||||
|
|
||||||
部署构建后的项目并推送到文件服务器中,具体步骤视服务器配置而定
|
部署构建后的项目并推送到文件服务器中,具体步骤视服务器配置而定
|
||||||
|
|
||||||
|
|||||||
20
app/app.vue
20
app/app.vue
@ -9,28 +9,28 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElConfigProvider } from "element-plus";
|
import { ElConfigProvider } from 'element-plus';
|
||||||
|
|
||||||
const { login } = useStrapiAuth();
|
const { login } = useStrapiAuth();
|
||||||
|
|
||||||
const { getElementPlusLocale } = useLocalizations();
|
const { getElementPlusLocale } = useLocalizations();
|
||||||
|
|
||||||
const elementPlusLocale = getElementPlusLocale();
|
const elementPlusLocale = getElementPlusLocale();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 检查用户是否已登录
|
// 检查用户是否已登录
|
||||||
const user = useStrapiUser();
|
const user = useStrapiUser();
|
||||||
if (!user.value) {
|
if (!user.value) {
|
||||||
// 如果未登录,重定向到登录页面
|
// 如果未登录,重定向到登录页面
|
||||||
login({ identifier: "remilia", password: "huanshuo51" })
|
login({ identifier: 'remilia', password: 'huanshuo51' })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("Login successful");
|
console.log('Login successful');
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Login failed:", error);
|
console.error('Login failed:', error);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("User is already logged in:", user.value);
|
console.log('User is already logged in:', user.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Source Han Sans CN";
|
font-family: "Source Han Sans CN";
|
||||||
src: url("/fonts/source-han-sans/SourceHanSansCN-Regular-Alphabetic.woff2") format("woff2"),
|
src:
|
||||||
url("/fonts/source-han-sans/SourceHanSansCN-Regular-Alphabetic.woff") format("woff");
|
url("/fonts/source-han-sans/SourceHanSansCN-Regular-Alphabetic.woff2")
|
||||||
|
format("woff2"),
|
||||||
|
url("/fonts/source-han-sans/SourceHanSansCN-Regular-Alphabetic.woff")
|
||||||
|
format("woff");
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@ -9,8 +12,12 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Source Han Sans CN";
|
font-family: "Source Han Sans CN";
|
||||||
src: url("/fonts/source-han-sans/SourceHanSansCN-Bold-Alphabetic.woff2") format("woff2"),
|
src:
|
||||||
url("/fonts/source-han-sans/SourceHanSansCN-Bold-Alphabetic.woff") format("woff");
|
url("/fonts/source-han-sans/SourceHanSansCN-Bold-Alphabetic.woff2")
|
||||||
|
format("woff2"),
|
||||||
|
url("/fonts/source-han-sans/SourceHanSansCN-Bold-Alphabetic.woff")
|
||||||
|
format("woff");
|
||||||
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
@ -18,8 +25,11 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "Source Han Sans CN";
|
font-family: "Source Han Sans CN";
|
||||||
src: url("/fonts/source-han-sans/SourceHanSansCN-Light-Alphabetic.woff2") format("woff2"),
|
src:
|
||||||
url("/fonts/source-han-sans/SourceHanSansCN-Light-Alphabetic.woff") format("woff");
|
url("/fonts/source-han-sans/SourceHanSansCN-Light-Alphabetic.woff2")
|
||||||
|
format("woff2"),
|
||||||
|
url("/fonts/source-han-sans/SourceHanSansCN-Light-Alphabetic.woff")
|
||||||
|
format("woff");
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
@forward 'element-plus/theme-chalk/src/dark/var.scss' with (
|
@forward "element-plus/theme-chalk/src/dark/var.scss" with (
|
||||||
$bg-color: (
|
$bg-color: (
|
||||||
'page': #0a0a0a,
|
"page": #0a0a0a,
|
||||||
'overlay': #1d1e1f,
|
"overlay": #1d1e1f,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,26 +1,26 @@
|
|||||||
$-colors: (
|
$-colors: (
|
||||||
'primary': (
|
"primary": (
|
||||||
'base': #177ee5,
|
"base": #177ee5,
|
||||||
),
|
),
|
||||||
'success': (
|
"success": (
|
||||||
'base': green,
|
"base": green,
|
||||||
),
|
),
|
||||||
'warning': (
|
"warning": (
|
||||||
'base': #f9a23c,
|
"base": #f9a23c,
|
||||||
),
|
),
|
||||||
'danger': (
|
"danger": (
|
||||||
'base': #ff3300,
|
"base": #ff3300,
|
||||||
),
|
),
|
||||||
'error': (
|
"error": (
|
||||||
'base': #f56c6c,
|
"base": #f56c6c,
|
||||||
),
|
),
|
||||||
'info': (
|
"info": (
|
||||||
'base': #909399,
|
"base": #909399,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
|
@forward "element-plus/theme-chalk/src/common/var.scss" with (
|
||||||
$colors: $-colors
|
$colors: $-colors
|
||||||
);
|
);
|
||||||
|
|
||||||
@use './dark.scss';
|
@use "./dark.scss";
|
||||||
|
|||||||
@ -17,5 +17,6 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--font-main: "Source Han Sans CN", "Noto Sans CJK SC", "Noto Sans CJK", sans-serif;
|
--font-main:
|
||||||
|
"Source Han Sans CN", "Noto Sans CJK SC", "Noto Sans CJK", sans-serif;
|
||||||
}
|
}
|
||||||
@ -28,48 +28,48 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineProps({
|
defineProps({
|
||||||
documents: {
|
documents: {
|
||||||
type: Array as () => Array<StrapiMedia>,
|
type: Array as () => Array<StrapiMedia>,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleDownload = async (fileName: string, fileUrl: string) => {
|
const handleDownload = async (fileName: string, fileUrl: string) => {
|
||||||
const response = await fetch(fileUrl);
|
const response = await fetch(fileUrl);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
|
||||||
const link = document.createElement("a");
|
const link = document.createElement('a');
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.download = fileName;
|
link.download = fileName;
|
||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.document-list {
|
.document-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.document-meta {
|
.document-meta {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.download-button {
|
.download-button {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.document-content {
|
.document-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -4,39 +4,39 @@
|
|||||||
<!-- Logo 和公司信息 -->
|
<!-- Logo 和公司信息 -->
|
||||||
<div class="footer-section">
|
<div class="footer-section">
|
||||||
<div class="footer-logo">
|
<div class="footer-logo">
|
||||||
<img src="/jinshen-logo.png" alt="Jinshen Logo" class="logo-image">
|
<img src="/jinshen-logo.png" alt="Jinshen Logo" class="logo-image" />
|
||||||
<h3>{{ $t("company-name") }}</h3>
|
<h3>{{ $t('company-name') }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<p class="company-description">
|
<p class="company-description">
|
||||||
{{ $t("company-description") }}
|
{{ $t('company-description') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 快速链接 -->
|
<!-- 快速链接 -->
|
||||||
<div class="footer-section">
|
<div class="footer-section">
|
||||||
<h4>{{ $t("quick-links") }}</h4>
|
<h4>{{ $t('quick-links') }}</h4>
|
||||||
<ul class="footer-links">
|
<ul class="footer-links">
|
||||||
<li>
|
<li>
|
||||||
<NuxtLinkLocale to="/">{{ $t("navigation.home") }}</NuxtLinkLocale>
|
<NuxtLinkLocale to="/">{{ $t('navigation.home') }}</NuxtLinkLocale>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<NuxtLink :to="$localePath('/productions')">{{
|
<NuxtLink :to="$localePath('/productions')">{{
|
||||||
$t("navigation.productions")
|
$t('navigation.productions')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<NuxtLink :to="$localePath('/solutions')">{{
|
<NuxtLink :to="$localePath('/solutions')">{{
|
||||||
$t("navigation.solutions")
|
$t('navigation.solutions')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<NuxtLink :to="$localePath('/support')">{{
|
<NuxtLink :to="$localePath('/support')">{{
|
||||||
$t("navigation.support")
|
$t('navigation.support')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<NuxtLink :to="$localePath('/about')">{{
|
<NuxtLink :to="$localePath('/about')">{{
|
||||||
$t("navigation.about-us")
|
$t('navigation.about-us')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -44,24 +44,24 @@
|
|||||||
|
|
||||||
<!-- 联系信息 -->
|
<!-- 联系信息 -->
|
||||||
<div class="footer-section">
|
<div class="footer-section">
|
||||||
<h4>{{ $t("contact-info") }}</h4>
|
<h4>{{ $t('contact-info') }}</h4>
|
||||||
<div class="contact-item">
|
<div class="contact-item">
|
||||||
<el-icon><Phone /></el-icon>
|
<el-icon><Phone /></el-icon>
|
||||||
<span>{{ $t("telephone") }}: 0573-88187988</span>
|
<span>{{ $t('telephone') }}: 0573-88187988</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-item">
|
<div class="contact-item">
|
||||||
<el-icon><Message /></el-icon>
|
<el-icon><Message /></el-icon>
|
||||||
<span>{{ $t("email") }}: jinshen@wzjinshen.com</span>
|
<span>{{ $t('email') }}: jinshen@wzjinshen.com</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-item">
|
<div class="contact-item">
|
||||||
<el-icon><Location /></el-icon>
|
<el-icon><Location /></el-icon>
|
||||||
<span>{{ $t("address") }}: {{ $t("company-address") }}</span>
|
<span>{{ $t('address') }}: {{ $t('company-address') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 社交媒体 -->
|
<!-- 社交媒体 -->
|
||||||
<div class="footer-section">
|
<div class="footer-section">
|
||||||
<h4>{{ $t("follow-us") }}</h4>
|
<h4>{{ $t('follow-us') }}</h4>
|
||||||
<div class="social-links">
|
<div class="social-links">
|
||||||
<a href="#" class="social-link" aria-label="WeChat">
|
<a href="#" class="social-link" aria-label="WeChat">
|
||||||
<el-icon size="20"><ChatDotRound /></el-icon>
|
<el-icon size="20"><ChatDotRound /></el-icon>
|
||||||
@ -84,21 +84,21 @@
|
|||||||
<div class="footer-container">
|
<div class="footer-container">
|
||||||
<div class="copyright">
|
<div class="copyright">
|
||||||
<p>
|
<p>
|
||||||
© {{ currentYear }} {{ $t("company-name") }}.
|
© {{ currentYear }} {{ $t('company-name') }}.
|
||||||
{{ $t("all-rights-reserved") }}
|
{{ $t('all-rights-reserved') }}
|
||||||
</p>
|
</p>
|
||||||
<p>备案号: 浙ICP备12003709号-5</p>
|
<p>备案号: 浙ICP备12003709号-5</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer-links-bottom">
|
<div class="footer-links-bottom">
|
||||||
<NuxtLink :to="$localePath('/privacy')">{{
|
<NuxtLink :to="$localePath('/privacy')">{{
|
||||||
$t("privacy-policy")
|
$t('privacy-policy')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
<span class="separator">|</span>
|
<span class="separator">|</span>
|
||||||
<NuxtLink :to="$localePath('/terms')">{{
|
<NuxtLink :to="$localePath('/terms')">{{
|
||||||
$t("terms-of-service")
|
$t('terms-of-service')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
<span class="separator">|</span>
|
<span class="separator">|</span>
|
||||||
<NuxtLink :to="$localePath('/sitemap')">{{ $t("sitemap") }}</NuxtLink>
|
<NuxtLink :to="$localePath('/sitemap')">{{ $t('sitemap') }}</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -106,98 +106,98 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
import {
|
||||||
Phone,
|
Phone,
|
||||||
Message,
|
Message,
|
||||||
Location,
|
Location,
|
||||||
ChatDotRound,
|
ChatDotRound,
|
||||||
Star,
|
Star,
|
||||||
Link,
|
Link,
|
||||||
} from "@element-plus/icons-vue";
|
} from '@element-plus/icons-vue';
|
||||||
|
|
||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.jinshen-footer {
|
.jinshen-footer {
|
||||||
background: var(--el-bg-color-page);
|
background: var(--el-bg-color-page);
|
||||||
border-top: 1px solid var(--el-border-color);
|
border-top: 1px solid var(--el-border-color);
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-container {
|
.footer-container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 2rem 1rem;
|
padding: 2rem 1rem;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-section h3,
|
.footer-section h3,
|
||||||
.footer-section h4 {
|
.footer-section h4 {
|
||||||
color: var(--el-text-color-primary);
|
color: var(--el-text-color-primary);
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-logo {
|
.footer-logo {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-image {
|
.logo-image {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.company-description {
|
.company-description {
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-links {
|
.footer-links {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-links li {
|
.footer-links li {
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-links a {
|
.footer-links a {
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: color 0.3s ease;
|
transition: color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-links a:hover {
|
.footer-links a:hover {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact-item {
|
.contact-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact-item .el-icon {
|
.contact-item .el-icon {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-links {
|
.social-links {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-link {
|
.social-link {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -208,58 +208,58 @@ const currentYear = new Date().getFullYear();
|
|||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-link:hover {
|
.social-link:hover {
|
||||||
background: var(--el-color-primary);
|
background: var(--el-color-primary);
|
||||||
color: white;
|
color: white;
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-bottom {
|
.footer-bottom {
|
||||||
background: var(--el-fill-color-light);
|
background: var(--el-fill-color-light);
|
||||||
border-top: 1px solid var(--el-border-color-lighter);
|
border-top: 1px solid var(--el-border-color-lighter);
|
||||||
padding: 1rem 0;
|
padding: 1rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-bottom .footer-container {
|
.footer-bottom .footer-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 1rem;
|
padding: 0 1rem;
|
||||||
grid-template-columns: none;
|
grid-template-columns: none;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copyright p {
|
.copyright p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-links-bottom {
|
.footer-links-bottom {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-links-bottom a {
|
.footer-links-bottom a {
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
transition: color 0.3s ease;
|
transition: color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-links-bottom a:hover {
|
.footer-links-bottom a:hover {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.separator {
|
.separator {
|
||||||
color: var(--el-text-color-placeholder);
|
color: var(--el-text-color-placeholder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 响应式设计 */
|
/* 响应式设计 */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.footer-container {
|
.footer-container {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
padding: 1.5rem 1rem;
|
padding: 1.5rem 1rem;
|
||||||
@ -275,10 +275,10 @@ const currentYear = new Date().getFullYear();
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 暗色模式适配 */
|
/* 暗色模式适配 */
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
.jinshen-footer {
|
.jinshen-footer {
|
||||||
background: var(--el-bg-color-page);
|
background: var(--el-bg-color-page);
|
||||||
}
|
}
|
||||||
@ -286,5 +286,5 @@ const currentYear = new Date().getFullYear();
|
|||||||
.footer-bottom {
|
.footer-bottom {
|
||||||
background: var(--el-fill-color-darker);
|
background: var(--el-fill-color-darker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -22,16 +22,16 @@
|
|||||||
router
|
router
|
||||||
>
|
>
|
||||||
<el-menu-item index="productions" :route="$localePath('/productions')">
|
<el-menu-item index="productions" :route="$localePath('/productions')">
|
||||||
<span class="title">{{ $t("navigation.productions") }}</span>
|
<span class="title">{{ $t('navigation.productions') }}</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="solutions" :route="$localePath('/solutions')">
|
<el-menu-item index="solutions" :route="$localePath('/solutions')">
|
||||||
<span class="title">{{ $t("navigation.solutions") }}</span>
|
<span class="title">{{ $t('navigation.solutions') }}</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="support" :route="$localePath('/support')">
|
<el-menu-item index="support" :route="$localePath('/support')">
|
||||||
<span class="title">{{ $t("navigation.support") }}</span>
|
<span class="title">{{ $t('navigation.support') }}</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="about" :route="$localePath('/about')">
|
<el-menu-item index="about" :route="$localePath('/about')">
|
||||||
<span class="title">{{ $t("navigation.about-us") }}</span>
|
<span class="title">{{ $t('navigation.about-us') }}</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</div>
|
</div>
|
||||||
@ -62,119 +62,119 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Search } from "@element-plus/icons-vue";
|
import { Search } from '@element-plus/icons-vue';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
|
|
||||||
const { setLocale } = useI18n();
|
const { setLocale } = useI18n();
|
||||||
|
|
||||||
const searchQuery = ref("");
|
const searchQuery = ref('');
|
||||||
|
|
||||||
const activeName = ref<string | undefined>(undefined);
|
const activeName = ref<string | undefined>(undefined);
|
||||||
|
|
||||||
const handleSearch = () => {
|
const handleSearch = () => {
|
||||||
const trimmed = searchQuery.value.trim();
|
const trimmed = searchQuery.value.trim();
|
||||||
if (!trimmed) return;
|
if (!trimmed) return;
|
||||||
navigateTo({
|
navigateTo({
|
||||||
path: localePath("/search"),
|
path: localePath('/search'),
|
||||||
query: {
|
query: {
|
||||||
query: trimmed,
|
query: trimmed,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
searchQuery.value = "";
|
searchQuery.value = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const refreshMenu = () => {
|
const refreshMenu = () => {
|
||||||
const path = router.currentRoute.value.path;
|
const path = router.currentRoute.value.path;
|
||||||
if (path.startsWith("/productions")) {
|
if (path.startsWith('/productions')) {
|
||||||
activeName.value = "productions";
|
activeName.value = 'productions';
|
||||||
} else if (path.startsWith("/solutions")) {
|
} else if (path.startsWith('/solutions')) {
|
||||||
activeName.value = "solutions";
|
activeName.value = 'solutions';
|
||||||
} else if (path.startsWith("/support")) {
|
} else if (path.startsWith('/support')) {
|
||||||
activeName.value = "support";
|
activeName.value = 'support';
|
||||||
} else if (path.startsWith("/about")) {
|
} else if (path.startsWith('/about')) {
|
||||||
activeName.value = "about";
|
activeName.value = 'about';
|
||||||
} else {
|
} else {
|
||||||
activeName.value = undefined; // 默认不激活任何菜单项
|
activeName.value = undefined; // 默认不激活任何菜单项
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
refreshMenu();
|
refreshMenu();
|
||||||
// 监听路由变化以更新激活状态
|
// 监听路由变化以更新激活状态
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
refreshMenu();
|
refreshMenu();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.header-container {
|
.header-container {
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: 1px solid #e0e0e0;
|
border-bottom: 1px solid #e0e0e0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-section {
|
.logo-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-link {
|
.logo-link {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.website-logo {
|
.website-logo {
|
||||||
height: 64px;
|
height: 64px;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-menu-section {
|
.header-menu-section {
|
||||||
flex: 2;
|
flex: 2;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-menu {
|
.header-menu {
|
||||||
margin-right: 40px;
|
margin-right: 40px;
|
||||||
border-bottom: none !important;
|
border-bottom: none !important;
|
||||||
width: auto;
|
width: auto;
|
||||||
--el-menu-horizontal-height: 100%;
|
--el-menu-horizontal-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-menu .el-menu-item {
|
.header-menu .el-menu-item {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-menu .el-menu-item.is-active {
|
.header-menu .el-menu-item.is-active {
|
||||||
border-bottom: 2.5px solid var(--el-color-primary-dark-2);
|
border-bottom: 2.5px solid var(--el-color-primary-dark-2);
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-menu .el-menu-item:hover {
|
.header-menu .el-menu-item:hover {
|
||||||
border-bottom: 2.5px solid var(--el-color-primary);
|
border-bottom: 2.5px solid var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-actions {
|
.header-actions {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.translate-link {
|
.translate-link {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -5,68 +5,68 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface Props {
|
interface Props {
|
||||||
content: string;
|
content: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
|
|
||||||
const contentWithAbsoluteUrls = convertMedia(props.content);
|
const contentWithAbsoluteUrls = convertMedia(props.content);
|
||||||
|
|
||||||
// 将 Markdown 转换成 HTML
|
// 将 Markdown 转换成 HTML
|
||||||
const safeHtml = computed(() => renderMarkdown(contentWithAbsoluteUrls));
|
const safeHtml = computed(() => renderMarkdown(contentWithAbsoluteUrls));
|
||||||
// const safeHtml = computed(() => renderMarkdown(props.content))
|
// const safeHtml = computed(() => renderMarkdown(props.content))
|
||||||
|
|
||||||
console.log("Rendered HTML:", safeHtml.value);
|
console.log('Rendered HTML:', safeHtml.value);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.markdown-body {
|
.markdown-body {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body h1 {
|
.markdown-body h1 {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body h2 {
|
.markdown-body h2 {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body h3 {
|
.markdown-body h3 {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
margin-bottom: 0.5em;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body p {
|
.markdown-body p {
|
||||||
text-indent: 2em;
|
text-indent: 2em;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
margin: 0.5em 0;
|
margin: 0.5em 0;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body ol {
|
.markdown-body ol {
|
||||||
list-style-type: decimal;
|
list-style-type: decimal;
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body ul {
|
.markdown-body ul {
|
||||||
list-style-type: disc;
|
list-style-type: disc;
|
||||||
padding-left: 2em;
|
padding-left: 2em;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-body hr {
|
.markdown-body hr {
|
||||||
border: none;
|
border: none;
|
||||||
border-top: 1px solid var(--el-border-color);
|
border-top: 1px solid var(--el-border-color);
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -17,70 +17,70 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface Props {
|
interface Props {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
imageUrl: string;
|
imageUrl: string;
|
||||||
id?: string | number;
|
id?: string | number;
|
||||||
slug?: string;
|
slug?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
// 优先使用 slug,如果没有则使用 id
|
// 优先使用 slug,如果没有则使用 id
|
||||||
const routeParam = props.slug || props.id;
|
const routeParam = props.slug || props.id;
|
||||||
if (routeParam) {
|
if (routeParam) {
|
||||||
navigateTo(localePath(`/productions/${routeParam}`));
|
navigateTo(localePath(`/productions/${routeParam}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.production-card {
|
.production-card {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-card:hover {
|
.production-card:hover {
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-name {
|
.production-name {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-description {
|
.card-description {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-card .el-image {
|
.production-card .el-image {
|
||||||
height: 150px;
|
height: 150px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-body {
|
.card-body {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
padding: 0px auto;
|
padding: 0px auto;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 响应式设计 */
|
/* 响应式设计 */
|
||||||
@media (max-width: 1200px) {
|
@media (max-width: 1200px) {
|
||||||
.production-card {
|
.production-card {
|
||||||
width: 45%;
|
width: 45%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.production-card {
|
.production-card {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -14,29 +14,29 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineProps({
|
defineProps({
|
||||||
questions: {
|
questions: {
|
||||||
type: Array as () => Array<{ title: string; content: string }>,
|
type: Array as () => Array<{ title: string; content: string }>,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.question-list {
|
.question-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-collapse {
|
.question-collapse {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-collapse :deep(.el-collapse-item) {
|
.question-collapse :deep(.el-collapse-item) {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-collapse :deep(.el-collapse-item__header) {
|
.question-collapse :deep(.el-collapse-item__header) {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@ -48,14 +48,14 @@ defineProps({
|
|||||||
background-color: #e1e6eb;
|
background-color: #e1e6eb;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-collapse :deep(.el-collapse-item__wrap) {
|
.question-collapse :deep(.el-collapse-item__wrap) {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question-collapse :deep(.el-collapse-item__content) {
|
.question-collapse :deep(.el-collapse-item__content) {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -21,65 +21,65 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface Props {
|
interface Props {
|
||||||
title: string;
|
title: string;
|
||||||
summary: string;
|
summary: string;
|
||||||
coverUrl: string;
|
coverUrl: string;
|
||||||
documentId?: string;
|
documentId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<Props>();
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
const routeParam = props.documentId;
|
const routeParam = props.documentId;
|
||||||
if (routeParam) {
|
if (routeParam) {
|
||||||
navigateTo(localePath(`/solutions/${routeParam}`));
|
navigateTo(localePath(`/solutions/${routeParam}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.solution-card {
|
.solution-card {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-card:hover {
|
.solution-card:hover {
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-title {
|
.solution-title {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.card-header) {
|
:deep(.card-header) {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-bottom: none !important;
|
border-bottom: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.card-body) {
|
:deep(.card-body) {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
padding: 1px auto;
|
padding: 1px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-card .el-image {
|
.solution-card .el-image {
|
||||||
height: 250px;
|
height: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1200px) {
|
@media (max-width: 1200px) {
|
||||||
.solution-card {
|
.solution-card {
|
||||||
width: 45%;
|
width: 45%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.solution-card {
|
.solution-card {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -22,24 +22,24 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
type: Object as () => ProductionSpecGroup[],
|
type: Object as () => ProductionSpecGroup[],
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// 默认全部展开
|
// 默认全部展开
|
||||||
const activeName = ref<string[]>(
|
const activeName = ref<string[]>(
|
||||||
props.data.map((item: ProductionSpecGroup) => {
|
props.data.map((item: ProductionSpecGroup) => {
|
||||||
return item.title;
|
return item.title;
|
||||||
}) || []
|
}) || []
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.spec-collapse ::v-deep(.el-collapse-item__header) {
|
.spec-collapse ::v-deep(.el-collapse-item__header) {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -12,29 +12,29 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const activeTab = ref(props.modelValue || "");
|
const activeTab = ref(props.modelValue || '');
|
||||||
const options = [
|
const options = [
|
||||||
{ label: "服务支持", value: "" },
|
{ label: '服务支持', value: '' },
|
||||||
{ label: "常见问题", value: "faq" },
|
{ label: '常见问题', value: 'faq' },
|
||||||
{ label: "文档资料", value: "documents" },
|
{ label: '文档资料', value: 'documents' },
|
||||||
{ label: "联系售后", value: "contact-us" },
|
{ label: '联系售后', value: 'contact-us' },
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleSegmentedChange = (value: string) => {
|
const handleSegmentedChange = (value: string) => {
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
navigateTo(localePath(`/support/${value}`));
|
navigateTo(localePath(`/support/${value}`));
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.segmented {
|
.segmented {
|
||||||
--el-segmented-bg-color: transparent;
|
--el-segmented-bg-color: transparent;
|
||||||
--el-segmented-item-active-color: var(--el-color-primary);
|
--el-segmented-item-active-color: var(--el-color-primary);
|
||||||
--el-segmented-item-color: var(--el-text-color-secondary);
|
--el-segmented-item-color: var(--el-text-color-secondary);
|
||||||
@ -42,15 +42,15 @@ const handleSegmentedChange = (value: string) => {
|
|||||||
--el-segmented-item-border-color: transparent;
|
--el-segmented-item-border-color: transparent;
|
||||||
--el-segmented-item-active-border-color: transparent;
|
--el-segmented-item-active-border-color: transparent;
|
||||||
border-bottom: 1px solid var(--el-border-color-light);
|
border-bottom: 1px solid var(--el-border-color-light);
|
||||||
}
|
}
|
||||||
|
|
||||||
.segmented :deep(.el-segmented__item-selected) {
|
.segmented :deep(.el-segmented__item-selected) {
|
||||||
/* --el-border-radius-base: 16px; */
|
/* --el-border-radius-base: 16px; */
|
||||||
transition: none;
|
transition: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.segmented :deep(.el-segmented__item) {
|
.segmented :deep(.el-segmented__item) {
|
||||||
&:hover {
|
&:hover {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
@ -60,5 +60,5 @@ const handleSegmentedChange = (value: string) => {
|
|||||||
color: var(--el-color-primary-dark-2);
|
color: var(--el-color-primary-dark-2);
|
||||||
border-bottom: 4px solid var(--el-color-primary-dark-2);
|
border-bottom: 4px solid var(--el-color-primary-dark-2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import type { StrapiLocale } from "@nuxtjs/strapi";
|
import type { StrapiLocale } from '@nuxtjs/strapi';
|
||||||
import type { Language as ElementLanguage } from "element-plus/es/locale";
|
import type { Language as ElementLanguage } from 'element-plus/es/locale';
|
||||||
import zhCn from "element-plus/es/locale/lang/zh-cn";
|
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
||||||
import en from "element-plus/es/locale/lang/en";
|
import en from 'element-plus/es/locale/lang/en';
|
||||||
|
|
||||||
// Strapi本地化映射
|
// Strapi本地化映射
|
||||||
export const strapiLocales: Record<string, StrapiLocale> = {
|
export const strapiLocales: Record<string, StrapiLocale> = {
|
||||||
zh: "zh-CN",
|
zh: 'zh-CN',
|
||||||
en: "en",
|
en: 'en',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Element Plus本地化映射
|
// Element Plus本地化映射
|
||||||
@ -21,14 +21,14 @@ export const useLocalizations = () => {
|
|||||||
// 获取Strapi本地化代码
|
// 获取Strapi本地化代码
|
||||||
const getStrapiLocale = (nuxtLocale?: string): StrapiLocale => {
|
const getStrapiLocale = (nuxtLocale?: string): StrapiLocale => {
|
||||||
const currentLocale = nuxtLocale || locale.value;
|
const currentLocale = nuxtLocale || locale.value;
|
||||||
return strapiLocales[currentLocale] || "zh-Hans";
|
return strapiLocales[currentLocale] || 'zh-Hans';
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取Element Plus本地化
|
// 获取Element Plus本地化
|
||||||
const getElementPlusLocale = (nuxtLocale?: string) => {
|
const getElementPlusLocale = (nuxtLocale?: string) => {
|
||||||
const currentLocale = nuxtLocale || locale.value;
|
const currentLocale = nuxtLocale || locale.value;
|
||||||
const elementPlusLocale =
|
const elementPlusLocale =
|
||||||
elementPlusLocales[currentLocale] || elementPlusLocales["zh"];
|
elementPlusLocales[currentLocale] || elementPlusLocales['zh'];
|
||||||
return elementPlusLocale;
|
return elementPlusLocale;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { MeiliSearch } from "meilisearch";
|
import { MeiliSearch } from 'meilisearch';
|
||||||
import type { SearchParams, SearchResponse } from "meilisearch";
|
import type { SearchParams, SearchResponse } from 'meilisearch';
|
||||||
|
|
||||||
interface RawSearchSection {
|
interface RawSearchSection {
|
||||||
indexUid: string;
|
indexUid: string;
|
||||||
@ -26,7 +26,7 @@ const parseIndexes = (indexes: string | string[] | undefined): string[] => {
|
|||||||
return indexes.map((item) => item.trim()).filter(Boolean);
|
return indexes.map((item) => item.trim()).filter(Boolean);
|
||||||
}
|
}
|
||||||
return indexes
|
return indexes
|
||||||
.split(",")
|
.split(',')
|
||||||
.map((item) => item.trim())
|
.map((item) => item.trim())
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
};
|
};
|
||||||
@ -45,7 +45,7 @@ export const useMeilisearch = () => {
|
|||||||
|
|
||||||
const host = runtimeConfig.public?.meili?.host;
|
const host = runtimeConfig.public?.meili?.host;
|
||||||
if (!host) {
|
if (!host) {
|
||||||
console.warn("Meilisearch host is not configured.");
|
console.warn('Meilisearch host is not configured.');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const apiKey = runtimeConfig.public?.meili?.searchKey;
|
const apiKey = runtimeConfig.public?.meili?.searchKey;
|
||||||
@ -72,7 +72,7 @@ export const useMeilisearch = () => {
|
|||||||
|
|
||||||
const activeIndexes = indexes.value;
|
const activeIndexes = indexes.value;
|
||||||
if (!activeIndexes.length) {
|
if (!activeIndexes.length) {
|
||||||
console.warn("No Meilisearch indexes configured.");
|
console.warn('No Meilisearch indexes configured.');
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,14 +101,14 @@ export const useMeilisearch = () => {
|
|||||||
settled
|
settled
|
||||||
.filter(
|
.filter(
|
||||||
(result): result is PromiseRejectedResult =>
|
(result): result is PromiseRejectedResult =>
|
||||||
result.status === "rejected"
|
result.status === 'rejected'
|
||||||
)
|
)
|
||||||
.forEach((result) => {
|
.forEach((result) => {
|
||||||
console.error("Meilisearch query failed", result.reason);
|
console.error('Meilisearch query failed', result.reason);
|
||||||
});
|
});
|
||||||
|
|
||||||
return settled
|
return settled
|
||||||
.filter((result) => result.status === "fulfilled")
|
.filter((result) => result.status === 'fulfilled')
|
||||||
.map((result) => {
|
.map((result) => {
|
||||||
const fulfilled = result as PromiseFulfilledResult<RawSearchSection>;
|
const fulfilled = result as PromiseFulfilledResult<RawSearchSection>;
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -13,25 +13,25 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.app-container {
|
.app-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content {
|
.main-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-footer {
|
.page-footer {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -3,15 +3,15 @@
|
|||||||
<div text4xl>
|
<div text4xl>
|
||||||
<div i-ep-warning inline-block />
|
<div i-ep-warning inline-block />
|
||||||
</div>
|
</div>
|
||||||
<div>{{ $t("not-found") }}</div>
|
<div>{{ $t('not-found') }}</div>
|
||||||
<div>
|
<div>
|
||||||
<button text-sm btn m="3 t8" @click="router.back()">
|
<button text-sm btn m="3 t8" @click="router.back()">
|
||||||
{{ $t("back") }}
|
{{ $t('back') }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -4,12 +4,12 @@
|
|||||||
<el-breadcrumb class="breadcrumb" separator="/">
|
<el-breadcrumb class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">
|
<NuxtLink :to="$localePath('/')">
|
||||||
{{ $t("navigation.home") }}
|
{{ $t('navigation.home') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/about')">
|
<NuxtLink :to="$localePath('/about')">
|
||||||
{{ $t("navigation.about-us") }}
|
{{ $t('navigation.about-us') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<el-icon class="icon" size="80">
|
<el-icon class="icon" size="80">
|
||||||
<ElIconService />
|
<ElIconService />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<br>
|
<br />
|
||||||
联系信息
|
联系信息
|
||||||
</el-card>
|
</el-card>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
@ -38,70 +38,70 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { findOne } = useStrapi();
|
const { findOne } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
|
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const content = ref<string | null>(null);
|
const content = ref<string | null>(null);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await findOne<StrapiCompanyProfile>(
|
const response = await findOne<StrapiCompanyProfile>(
|
||||||
"company-profile",
|
'company-profile',
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
content.value = response.data.content || "";
|
content.value = response.data.content || '';
|
||||||
} else {
|
} else {
|
||||||
console.warn("No company profile data found");
|
console.warn('No company profile data found');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch company profile:", error);
|
console.error('Failed to fetch company profile:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
padding: 2rem 1rem;
|
padding: 2rem 1rem;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
padding: 1rem 1rem;
|
padding: 1rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.markdown-body p) {
|
:deep(.markdown-body p) {
|
||||||
text-indent: 2em;
|
text-indent: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.markdown-body h2) {
|
:deep(.markdown-body h2) {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-divider__text) {
|
:deep(.el-divider__text) {
|
||||||
color: var(--el-color-info);
|
color: var(--el-color-info);
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-group {
|
.button-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: left;
|
justify-content: left;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
margin-left: 2rem;
|
margin-left: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-button {
|
.card-button {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
@ -109,21 +109,21 @@ onMounted(async () => {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-button:hover {
|
.card-button:hover {
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -129,34 +129,34 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { findOne } = useStrapi();
|
const { findOne } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const carouselImages = ref<StrapiImage[]>([]);
|
const carouselImages = ref<StrapiImage[]>([]);
|
||||||
const recommend_productions = ref<Production[]>([]);
|
const recommend_productions = ref<Production[]>([]);
|
||||||
const recommend_solutions = ref<Solution[]>([]);
|
const recommend_solutions = ref<Solution[]>([]);
|
||||||
|
|
||||||
const pending = ref(true);
|
const pending = ref(true);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await findOne<StrapiHomepage>("homepage", undefined, {
|
const response = await findOne<StrapiHomepage>('homepage', undefined, {
|
||||||
populate: {
|
populate: {
|
||||||
carousel: {
|
carousel: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
recommend_productions: {
|
recommend_productions: {
|
||||||
populate: {
|
populate: {
|
||||||
cover: {
|
cover: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
recommend_solutions: {
|
recommend_solutions: {
|
||||||
populate: {
|
populate: {
|
||||||
cover: {
|
cover: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -167,79 +167,79 @@ onMounted(async () => {
|
|||||||
carouselImages.value = response.data.carousel || [];
|
carouselImages.value = response.data.carousel || [];
|
||||||
recommend_productions.value = response.data.recommend_productions || [];
|
recommend_productions.value = response.data.recommend_productions || [];
|
||||||
recommend_solutions.value = response.data.recommend_solutions || [];
|
recommend_solutions.value = response.data.recommend_solutions || [];
|
||||||
console.log("推荐产品:", recommend_productions.value);
|
console.log('推荐产品:', recommend_productions.value);
|
||||||
console.log("推荐解决方案:", recommend_solutions.value);
|
console.log('推荐解决方案:', recommend_solutions.value);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching homepage data:", error);
|
console.error('Error fetching homepage data:', error);
|
||||||
} finally {
|
} finally {
|
||||||
pending.value = false;
|
pending.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleProductionCardClick = (documentId: string) => {
|
const handleProductionCardClick = (documentId: string) => {
|
||||||
// 使用路由导航到产品详情页
|
// 使用路由导航到产品详情页
|
||||||
if (documentId) {
|
if (documentId) {
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
router.push(localePath(`/productions/${documentId}`));
|
router.push(localePath(`/productions/${documentId}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSolutionCardClick = (documentId: string) => {
|
const handleSolutionCardClick = (documentId: string) => {
|
||||||
// 使用路由导航到解决方案详情页
|
// 使用路由导航到解决方案详情页
|
||||||
if (documentId) {
|
if (documentId) {
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
router.push(localePath(`/solutions/${documentId}`));
|
router.push(localePath(`/solutions/${documentId}`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
section {
|
section {
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
section h2 {
|
section h2 {
|
||||||
color: var(--el-text-color-primary);
|
color: var(--el-text-color-primary);
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
section p {
|
section p {
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.homepage-carousel .el-carousel__item {
|
.homepage-carousel .el-carousel__item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 33vw;
|
height: 33vw;
|
||||||
/* 16:9 Aspect Ratio */
|
/* 16:9 Aspect Ratio */
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-carousel__item h3 {
|
.el-carousel__item h3 {
|
||||||
display: flex;
|
display: flex;
|
||||||
color: #475669;
|
color: #475669;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
line-height: 300px;
|
line-height: 300px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.homepage-carousel .carousel-item {
|
.homepage-carousel .carousel-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: #f5f7fa;
|
background-color: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.carousel-image {
|
.carousel-image {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.carousel-image-caption {
|
.carousel-image-caption {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@ -249,65 +249,65 @@ section p {
|
|||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-carousel :deep(.el-carousel__button) {
|
.recommend-carousel :deep(.el-carousel__button) {
|
||||||
/* 指示器按钮样式 */
|
/* 指示器按钮样式 */
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: #475669;
|
background-color: #475669;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-list {
|
.recommend-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card-group {
|
.recommend-card-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card {
|
.recommend-card {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card :deep(.el-card__header) {
|
.recommend-card :deep(.el-card__header) {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card:hover {
|
.recommend-card:hover {
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card-body {
|
.recommend-card-body {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
padding: 0px auto;
|
padding: 0px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card-title {
|
.recommend-card-title {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card-description {
|
.recommend-card-description {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.recommend-card .el-image {
|
.recommend-card .el-image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-breadcrumb class="breadcrumb" separator="/">
|
<el-breadcrumb class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
$t("navigation.home")
|
$t('navigation.home')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/productions')">{{
|
<NuxtLink :to="$localePath('/productions')">{{
|
||||||
$t("navigation.productions")
|
$t('navigation.productions')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opactiy-50">{{
|
<el-breadcrumb-item class="text-md opactiy-50">{{
|
||||||
@ -102,7 +102,7 @@
|
|||||||
>
|
>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<el-button type="primary" @click="$router.push('/productions')">
|
<el-button type="primary" @click="$router.push('/productions')">
|
||||||
{{ $t("back-to-productions") }}
|
{{ $t('back-to-productions') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-result>
|
</el-result>
|
||||||
@ -111,40 +111,40 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { findOne } = useStrapi();
|
const { findOne } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const production = ref<Production | null>(null);
|
const production = ref<Production | null>(null);
|
||||||
const pending = ref(true);
|
const pending = ref(true);
|
||||||
|
|
||||||
const activeName = ref("details"); // 默认选中概览标签
|
const activeName = ref('details'); // 默认选中概览标签
|
||||||
|
|
||||||
// 获取路由参数(slug 或 id)
|
// 获取路由参数(slug 或 id)
|
||||||
const documentId = computed(() => route.params.slug as string);
|
const documentId = computed(() => route.params.slug as string);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await findOne<Production>(
|
const response = await findOne<Production>(
|
||||||
"productions",
|
'productions',
|
||||||
documentId.value,
|
documentId.value,
|
||||||
{
|
{
|
||||||
populate: {
|
populate: {
|
||||||
production_specs: {
|
production_specs: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
production_images: {
|
production_images: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
cover: {
|
cover: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
questions: {
|
questions: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
production_documents: {
|
production_documents: {
|
||||||
populate: "document",
|
populate: 'document',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
@ -155,52 +155,52 @@ onMounted(async () => {
|
|||||||
production.value = {
|
production.value = {
|
||||||
...item,
|
...item,
|
||||||
};
|
};
|
||||||
console.log("Fetched production:", production.value);
|
console.log('Fetched production:', production.value);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch production:", error);
|
console.error('Failed to fetch production:', error);
|
||||||
} finally {
|
} finally {
|
||||||
pending.value = false;
|
pending.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// SEO
|
// SEO
|
||||||
useHead({
|
useHead({
|
||||||
title: computed(() => production.value?.title || "Product Detail"),
|
title: computed(() => production.value?.title || 'Product Detail'),
|
||||||
meta: [
|
meta: [
|
||||||
{
|
{
|
||||||
name: "description",
|
name: 'description',
|
||||||
content: computed(() => production.value?.summary || ""),
|
content: computed(() => production.value?.summary || ''),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
min-height: 80vh;
|
min-height: 80vh;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-header {
|
.production-header {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 2fr 1fr;
|
grid-template-columns: 2fr 1fr;
|
||||||
gap: 3rem;
|
gap: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-image .el-image {
|
.production-image .el-image {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 500px;
|
height: 500px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-image-caption {
|
.production-image-caption {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 10px;
|
bottom: 10px;
|
||||||
/* left: 10%; */
|
/* left: 10%; */
|
||||||
@ -210,60 +210,60 @@ useHead({
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-carousel :deep(.el-carousel__button) {
|
.production-carousel :deep(.el-carousel__button) {
|
||||||
/* 指示器按钮样式 */
|
/* 指示器按钮样式 */
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: #475669;
|
background-color: #475669;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-info h1 {
|
.production-info h1 {
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary {
|
.summary {
|
||||||
color: var(--el-color-info);
|
color: var(--el-color-info);
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-tabs ::v-deep(.el-tabs__nav) {
|
.production-tabs ::v-deep(.el-tabs__nav) {
|
||||||
min-width: 30%;
|
min-width: 30%;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-tabs ::v-deep(.el-tabs__content) {
|
.production-tabs ::v-deep(.el-tabs__content) {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-content h2 {
|
.production-content h2 {
|
||||||
color: var(--el-text-color-primary);
|
color: var(--el-text-color-primary);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.not-found {
|
.not-found {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 400px;
|
min-height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 响应式设计 */
|
/* 响应式设计 */
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.production-header {
|
.production-header {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
@ -272,5 +272,5 @@ useHead({
|
|||||||
.production-info h1 {
|
.production-info h1 {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div class="page-header">
|
<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 class="breadcrumb">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
$t("navigation.home")
|
$t('navigation.home')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/productions')">{{
|
<NuxtLink :to="$localePath('/productions')">{{
|
||||||
$t("navigation.productions")
|
$t('navigation.productions')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -42,45 +42,45 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { find } = useStrapi();
|
const { find } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
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 既可能为对象也可能为字符串
|
// 兼容 production_type 既可能为对象也可能为字符串
|
||||||
const groupedProductions = computed(() => {
|
const groupedProductions = computed(() => {
|
||||||
const groups: Record<string, Production[]> = {};
|
const groups: Record<string, Production[]> = {};
|
||||||
for (const prod of productions.value) {
|
for (const prod of productions.value) {
|
||||||
let typeKey = "";
|
let typeKey = '';
|
||||||
if (typeof prod.production_type === "string") {
|
if (typeof prod.production_type === 'string') {
|
||||||
typeKey = prod.production_type;
|
typeKey = prod.production_type;
|
||||||
} else if (
|
} else if (
|
||||||
prod.production_type &&
|
prod.production_type &&
|
||||||
typeof prod.production_type === "object" &&
|
typeof prod.production_type === 'object' &&
|
||||||
"type" in prod.production_type
|
'type' in prod.production_type
|
||||||
) {
|
) {
|
||||||
typeKey = prod.production_type.type || "";
|
typeKey = prod.production_type.type || '';
|
||||||
}
|
}
|
||||||
if (!groups[typeKey]) groups[typeKey] = [];
|
if (!groups[typeKey]) groups[typeKey] = [];
|
||||||
groups[typeKey]?.push(prod);
|
groups[typeKey]?.push(prod);
|
||||||
}
|
}
|
||||||
return groups;
|
return groups;
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await find<Production>("productions", {
|
const response = await find<Production>('productions', {
|
||||||
populate: {
|
populate: {
|
||||||
cover: {
|
cover: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
production_type: {
|
production_type: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
@ -97,62 +97,62 @@ onMounted(async () => {
|
|||||||
}));
|
}));
|
||||||
// 默认展开所有分组
|
// 默认展开所有分组
|
||||||
activeNames.value = Object.keys(groupedProductions.value);
|
activeNames.value = Object.keys(groupedProductions.value);
|
||||||
activeNames.value.push("no-category"); // 展开未分类
|
activeNames.value.push('no-category'); // 展开未分类
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch productions:", error);
|
console.error('Failed to fetch productions:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.productions-container {
|
.productions-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 40px;
|
gap: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.production-group {
|
.production-group {
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-title {
|
.group-title {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.group-list {
|
.group-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-collapse-item__header) {
|
:deep(.el-collapse-item__header) {
|
||||||
padding: 30px auto;
|
padding: 30px auto;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="search-page">
|
<div class="search-page">
|
||||||
<div class="search-header">
|
<div class="search-header">
|
||||||
<h1 class="page-title">{{ $t("search.title") }}</h1>
|
<h1 class="page-title">{{ $t('search.title') }}</h1>
|
||||||
<div class="search-bar">
|
<div class="search-bar">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
@ -14,11 +14,11 @@
|
|||||||
@clear="handleClear"
|
@clear="handleClear"
|
||||||
/>
|
/>
|
||||||
<el-button type="primary" @click="navigateToQuery(keyword)">
|
<el-button type="primary" @click="navigateToQuery(keyword)">
|
||||||
{{ $t("search.search-button") }}
|
{{ $t('search.search-button') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="keyword && hasResults" class="search-meta">
|
<p v-if="keyword && hasResults" class="search-meta">
|
||||||
{{ $t("search.results-for", { query: keyword }) }}
|
{{ $t('search.results-for', { query: keyword }) }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<h2 class="section-title">
|
<h2 class="section-title">
|
||||||
{{ getIndexLabel(section.indexUid) }}
|
{{ getIndexLabel(section.indexUid) }}
|
||||||
<span class="section-count">{{
|
<span class="section-count">{{
|
||||||
$t("search.result-count", { count: section.estimatedTotalHits })
|
$t('search.result-count', { count: section.estimatedTotalHits })
|
||||||
}}</span>
|
}}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</header>
|
</header>
|
||||||
@ -73,23 +73,23 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Search } from "@element-plus/icons-vue";
|
import { Search } from '@element-plus/icons-vue';
|
||||||
import type { SearchHit, SearchSection } from "~/composables/useMeilisearch";
|
import type { SearchHit, SearchSection } from '~/composables/useMeilisearch';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const localePath = useLocalePath();
|
const localePath = useLocalePath();
|
||||||
|
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const { search } = useMeilisearch();
|
const { search } = useMeilisearch();
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
const keyword = ref("");
|
const keyword = ref('');
|
||||||
const sections = ref<SearchSection[]>([]);
|
const sections = ref<SearchSection[]>([]);
|
||||||
const localeSections = computed(() =>
|
const localeSections = computed(() =>
|
||||||
sections.value.map((section) => ({
|
sections.value.map((section) => ({
|
||||||
...section,
|
...section,
|
||||||
hits: section.hits.filter(
|
hits: section.hits.filter(
|
||||||
@ -98,60 +98,63 @@ const localeSections = computed(() =>
|
|||||||
String(hit.locale).toLowerCase() === strapiLocale.toLowerCase()
|
String(hit.locale).toLowerCase() === strapiLocale.toLowerCase()
|
||||||
),
|
),
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
const filteredSections = computed(() =>
|
const filteredSections = computed(() =>
|
||||||
localeSections.value.filter((section) => section.hits.length > 0)
|
localeSections.value.filter((section) => section.hits.length > 0)
|
||||||
);
|
);
|
||||||
const activeRequestId = ref(0);
|
const activeRequestId = ref(0);
|
||||||
|
|
||||||
const indexLabels = computed<Record<string, string>>(() => ({
|
const indexLabels = computed<Record<string, string>>(() => ({
|
||||||
production: t("search.sections.production"),
|
production: t('search.sections.production'),
|
||||||
solution: t("search.sections.solution"),
|
solution: t('search.sections.solution'),
|
||||||
support: t("search.sections.support"),
|
support: t('search.sections.support'),
|
||||||
default: t("search.sections.default"),
|
default: t('search.sections.default'),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const getIndexLabel = (indexUid: string) =>
|
const getIndexLabel = (indexUid: string) =>
|
||||||
indexLabels.value[indexUid] || indexLabels.value.default;
|
indexLabels.value[indexUid] || indexLabels.value.default;
|
||||||
|
|
||||||
const hasResults = computed(() =>
|
const hasResults = computed(() =>
|
||||||
localeSections.value.some((section) => section.hits.length > 0)
|
localeSections.value.some((section) => section.hits.length > 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
const getHitIdentifier = (hit: SearchHit, index: number) => {
|
const getHitIdentifier = (hit: SearchHit, index: number) => {
|
||||||
const candidate = [hit.objectID, hit.documentId, hit.id, hit.slug].find(
|
const candidate = [hit.objectID, hit.documentId, hit.id, hit.slug].find(
|
||||||
(value) =>
|
(value) =>
|
||||||
["string", "number"].includes(typeof value) && String(value).length > 0
|
['string', 'number'].includes(typeof value) && String(value).length > 0
|
||||||
);
|
);
|
||||||
return candidate != null ? String(candidate) : String(index);
|
return candidate != null ? String(candidate) : String(index);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getHitTitle = (hit: SearchHit) => {
|
const getHitTitle = (hit: SearchHit) => {
|
||||||
const candidate = [hit.title, hit.name, hit.heading, hit.documentTitle].find(
|
const candidate = [
|
||||||
(value) => typeof value === "string" && value.trim().length > 0
|
hit.title,
|
||||||
);
|
hit.name,
|
||||||
return candidate ? String(candidate) : t("search.untitled");
|
hit.heading,
|
||||||
};
|
hit.documentTitle,
|
||||||
|
].find((value) => typeof value === 'string' && value.trim().length > 0);
|
||||||
|
return candidate ? String(candidate) : t('search.untitled');
|
||||||
|
};
|
||||||
|
|
||||||
const getHitSummary = (hit: SearchHit) => {
|
const getHitSummary = (hit: SearchHit) => {
|
||||||
const candidate = [
|
const candidate = [
|
||||||
hit.summary,
|
hit.summary,
|
||||||
hit.description,
|
hit.description,
|
||||||
hit.snippet,
|
hit.snippet,
|
||||||
hit.content,
|
hit.content,
|
||||||
hit.text,
|
hit.text,
|
||||||
].find((value) => typeof value === "string" && value.trim().length > 0);
|
].find((value) => typeof value === 'string' && value.trim().length > 0);
|
||||||
return candidate ? String(candidate) : "";
|
return candidate ? String(candidate) : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const resolveHitLink = (hit: SearchHit) => {
|
const resolveHitLink = (hit: SearchHit) => {
|
||||||
if (typeof hit.route === "string" && hit.route.trim().length > 0) {
|
if (typeof hit.route === 'string' && hit.route.trim().length > 0) {
|
||||||
return localePath(hit.route);
|
return localePath(hit.route);
|
||||||
}
|
}
|
||||||
|
|
||||||
const slugCandidate = [hit.slug, hit.documentId, hit.id, hit.objectID].find(
|
const slugCandidate = [hit.slug, hit.documentId, hit.id, hit.objectID].find(
|
||||||
(value) =>
|
(value) =>
|
||||||
["string", "number"].includes(typeof value) && String(value).length > 0
|
['string', 'number'].includes(typeof value) && String(value).length > 0
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!slugCandidate) {
|
if (!slugCandidate) {
|
||||||
@ -160,27 +163,27 @@ const resolveHitLink = (hit: SearchHit) => {
|
|||||||
|
|
||||||
const slug = String(slugCandidate);
|
const slug = String(slugCandidate);
|
||||||
|
|
||||||
if (hit.indexUid === "production") {
|
if (hit.indexUid === 'production') {
|
||||||
return localePath({ path: `/productions/${slug}` });
|
return localePath({ path: `/productions/${slug}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hit.indexUid === "solution") {
|
if (hit.indexUid === 'solution') {
|
||||||
return localePath({ path: `/solutions/${slug}` });
|
return localePath({ path: `/solutions/${slug}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const navigateToQuery = (value: string) => {
|
const navigateToQuery = (value: string) => {
|
||||||
const trimmed = value.trim();
|
const trimmed = value.trim();
|
||||||
if (!trimmed) return;
|
if (!trimmed) return;
|
||||||
navigateTo({
|
navigateTo({
|
||||||
path: localePath("/search"),
|
path: localePath('/search'),
|
||||||
query: { query: trimmed },
|
query: { query: trimmed },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const performSearch = async (value: string) => {
|
const performSearch = async (value: string) => {
|
||||||
activeRequestId.value += 1;
|
activeRequestId.value += 1;
|
||||||
const requestId = activeRequestId.value;
|
const requestId = activeRequestId.value;
|
||||||
const trimmed = value.trim();
|
const trimmed = value.trim();
|
||||||
@ -201,7 +204,7 @@ const performSearch = async (value: string) => {
|
|||||||
console.log(results);
|
console.log(results);
|
||||||
console.log(localeSections.value);
|
console.log(localeSections.value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to perform search", error);
|
console.error('Failed to perform search', error);
|
||||||
if (requestId === activeRequestId.value) {
|
if (requestId === activeRequestId.value) {
|
||||||
sections.value = [];
|
sections.value = [];
|
||||||
}
|
}
|
||||||
@ -210,12 +213,12 @@ const performSearch = async (value: string) => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function debounce<T extends (...args: never[]) => void>(
|
function debounce<T extends (...args: never[]) => void>(
|
||||||
fn: T,
|
fn: T,
|
||||||
delay: number
|
delay: number
|
||||||
): (...args: Parameters<T>) => void {
|
): (...args: Parameters<T>) => void {
|
||||||
let timer: ReturnType<typeof setTimeout> | null = null;
|
let timer: ReturnType<typeof setTimeout> | null = null;
|
||||||
|
|
||||||
return function (this: never, ...args: Parameters<T>) {
|
return function (this: never, ...args: Parameters<T>) {
|
||||||
@ -226,132 +229,132 @@ function debounce<T extends (...args: never[]) => void>(
|
|||||||
fn.apply(this, args);
|
fn.apply(this, args);
|
||||||
}, delay);
|
}, delay);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleInput = debounce((value: string) => {
|
const handleInput = debounce((value: string) => {
|
||||||
performSearch(value);
|
performSearch(value);
|
||||||
}, 300);
|
}, 300);
|
||||||
|
|
||||||
const handleClear = () => {
|
const handleClear = () => {
|
||||||
keyword.value = "";
|
keyword.value = '';
|
||||||
sections.value = [];
|
sections.value = [];
|
||||||
router.replace(localePath({ path: "/search" }));
|
router.replace(localePath({ path: '/search' }));
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (typeof route.query.query === "string" && route.query.query.trim()) {
|
if (typeof route.query.query === 'string' && route.query.query.trim()) {
|
||||||
keyword.value = route.query.query;
|
keyword.value = route.query.query;
|
||||||
performSearch(route.query.query);
|
performSearch(route.query.query);
|
||||||
} else {
|
} else {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
useHead(() => ({
|
useHead(() => ({
|
||||||
title: t("search.head-title"),
|
title: t('search.head-title'),
|
||||||
}));
|
}));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.search-page {
|
.search-page {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: 960px;
|
max-width: 960px;
|
||||||
padding: 2.5rem 1.5rem 3rem;
|
padding: 2.5rem 1.5rem 3rem;
|
||||||
min-height: 70vh;
|
min-height: 70vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-header {
|
.search-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
font-size: 2.25rem;
|
font-size: 2.25rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--el-text-color-primary);
|
color: var(--el-text-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-bar {
|
.search-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-meta {
|
.search-meta {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-state {
|
.search-state {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 3rem 0;
|
padding: 3rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-results {
|
.search-results {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 2.5rem;
|
gap: 2.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-section {
|
.search-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-header {
|
.section-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-title {
|
.section-title {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--el-text-color-primary);
|
color: var(--el-text-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-count {
|
.section-count {
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-results {
|
.section-results {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.result-card {
|
.result-card {
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
transition: box-shadow 0.2s ease;
|
transition: box-shadow 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.result-card:hover {
|
.result-card:hover {
|
||||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
|
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
|
||||||
}
|
}
|
||||||
|
|
||||||
.result-title {
|
.result-title {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.result-summary {
|
.result-summary {
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.search-page {
|
.search-page {
|
||||||
padding: 2rem 1rem;
|
padding: 2rem 1rem;
|
||||||
}
|
}
|
||||||
@ -364,5 +367,5 @@ useHead(() => ({
|
|||||||
.search-input {
|
.search-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -5,12 +5,12 @@
|
|||||||
<el-breadcrumb class="breadcrumb" separator="/">
|
<el-breadcrumb class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
$t("navigation.home")
|
$t('navigation.home')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/solutions')">{{
|
<NuxtLink :to="$localePath('/solutions')">{{
|
||||||
$t("navigation.solutions")
|
$t('navigation.solutions')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">{{
|
<el-breadcrumb-item class="text-md opacity-50">{{
|
||||||
@ -40,20 +40,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { findOne } = useStrapi();
|
const { findOne } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const solution = ref<Solution | null>(null);
|
const solution = ref<Solution | null>(null);
|
||||||
|
|
||||||
// 获取路由参数(documentId)
|
// 获取路由参数(documentId)
|
||||||
const documentId = computed(() => route.params.slug as string);
|
const documentId = computed(() => route.params.slug as string);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await findOne<Solution>("solutions", documentId.value, {
|
const response = await findOne<Solution>('solutions', documentId.value, {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
});
|
});
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
@ -63,68 +63,68 @@ onMounted(async () => {
|
|||||||
solution_type: response.data.solution_type,
|
solution_type: response.data.solution_type,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
console.log("Fetched Solution:", solution.value);
|
console.log('Fetched Solution:', solution.value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch solution:", error);
|
console.error('Failed to fetch solution:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
min-height: 80vh;
|
min-height: 80vh;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-header {
|
.solution-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-header el-image {
|
.solution-header el-image {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content h1 {
|
.page-content h1 {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-meta {
|
.solution-meta {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary {
|
.summary {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-content {
|
.solution-content {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading {
|
.loading {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-container">
|
<div class="page-container">
|
||||||
<div class="page-header">
|
<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 class="breadcrumb">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
$t("navigation.home")
|
$t('navigation.home')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/solutions')">{{
|
<NuxtLink :to="$localePath('/solutions')">{{
|
||||||
$t("navigation.solutions")
|
$t('navigation.solutions')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -52,44 +52,44 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { find } = useStrapi();
|
const { find } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
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 groupedSolutions = computed(() => {
|
||||||
const gourps: Record<string, Solution[]> = {};
|
const gourps: Record<string, Solution[]> = {};
|
||||||
for (const sol of solutions.value) {
|
for (const sol of solutions.value) {
|
||||||
let typeKey = "";
|
let typeKey = '';
|
||||||
if (typeof sol.solution_type === "string") {
|
if (typeof sol.solution_type === 'string') {
|
||||||
typeKey = sol.solution_type;
|
typeKey = sol.solution_type;
|
||||||
} else if (
|
} else if (
|
||||||
sol.solution_type &&
|
sol.solution_type &&
|
||||||
typeof sol.solution_type === "object" &&
|
typeof sol.solution_type === 'object' &&
|
||||||
"type" in sol.solution_type
|
'type' in sol.solution_type
|
||||||
) {
|
) {
|
||||||
typeKey = sol.solution_type.type || "";
|
typeKey = sol.solution_type.type || '';
|
||||||
}
|
}
|
||||||
if (!gourps[typeKey]) gourps[typeKey] = [];
|
if (!gourps[typeKey]) gourps[typeKey] = [];
|
||||||
gourps[typeKey]?.push(sol);
|
gourps[typeKey]?.push(sol);
|
||||||
}
|
}
|
||||||
return gourps;
|
return gourps;
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await find<Solution>("solutions", {
|
const response = await find<Solution>('solutions', {
|
||||||
populate: {
|
populate: {
|
||||||
cover: {
|
cover: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
solution_type: {
|
solution_type: {
|
||||||
populate: "*",
|
populate: '*',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
@ -98,41 +98,41 @@ onMounted(async () => {
|
|||||||
...item,
|
...item,
|
||||||
solution_type: item.solution_type,
|
solution_type: item.solution_type,
|
||||||
}));
|
}));
|
||||||
console.log("Fetched Solutions:", solutions.value);
|
console.log('Fetched Solutions:', solutions.value);
|
||||||
console.log("Grouped Solutions:", groupedSolutions.value);
|
console.log('Grouped Solutions:', groupedSolutions.value);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch solutions:", error);
|
console.error('Failed to fetch solutions:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-title {
|
.page-title {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.solution-list {
|
.solution-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
gap: 40px;
|
gap: 40px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -3,21 +3,21 @@
|
|||||||
<div v-if="content">
|
<div v-if="content">
|
||||||
<support-tabs model-value="contact-us" />
|
<support-tabs model-value="contact-us" />
|
||||||
<div class="page-header">
|
<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 class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">
|
<NuxtLink :to="$localePath('/')">
|
||||||
{{ $t("navigation.home") }}
|
{{ $t('navigation.home') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/support')">
|
<NuxtLink :to="$localePath('/support')">
|
||||||
{{ $t("navigation.support") }}
|
{{ $t('navigation.support') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/support/contact-us')">
|
<NuxtLink :to="$localePath('/support/contact-us')">
|
||||||
{{ $t("navigation.contact-info") }}
|
{{ $t('navigation.contact-info') }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -34,62 +34,62 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { findOne } = useStrapi();
|
const { findOne } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
|
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const content = ref<string>("");
|
const content = ref<string>('');
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await findOne<StrapiContactInfo>(
|
const response = await findOne<StrapiContactInfo>(
|
||||||
"contact-info",
|
'contact-info',
|
||||||
undefined,
|
undefined,
|
||||||
{
|
{
|
||||||
populate: "*",
|
populate: '*',
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
content.value = response.data.content || "";
|
content.value = response.data.content || '';
|
||||||
} else {
|
} else {
|
||||||
console.warn("No contact info data found");
|
console.warn('No contact info data found');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch contact info:", error);
|
console.error('Failed to fetch contact info:', error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 2rem 2rem 0rem;
|
padding: 2rem 2rem 0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.markdown-body ul) {
|
:deep(.markdown-body ul) {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -6,21 +6,21 @@
|
|||||||
<div v-else>
|
<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>
|
||||||
<el-breadcrumb class="breadcrumb" separator="/">
|
<el-breadcrumb class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
$t("navigation.home")
|
$t('navigation.home')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/support')">{{
|
<NuxtLink :to="$localePath('/support')">{{
|
||||||
$t("navigation.support")
|
$t('navigation.support')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/support/documents')">{{
|
<NuxtLink :to="$localePath('/support/documents')">{{
|
||||||
$t("navigation.documents")
|
$t('navigation.documents')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -33,19 +33,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { find } = useStrapi();
|
const { find } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const pending = ref(true);
|
const pending = ref(true);
|
||||||
|
|
||||||
const documents = ref<StrapiMedia[]>([]);
|
const documents = ref<StrapiMedia[]>([]);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await find<ProductionDocument>("production-documents", {
|
const response = await find<ProductionDocument>('production-documents', {
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
populate: "document",
|
populate: 'document',
|
||||||
});
|
});
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
documents.value =
|
documents.value =
|
||||||
@ -54,36 +54,36 @@ onMounted(async () => {
|
|||||||
})) || [];
|
})) || [];
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error fetching documents:", error);
|
console.error('Error fetching documents:', error);
|
||||||
} finally {
|
} finally {
|
||||||
pending.value = false;
|
pending.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 2rem 2rem 0rem;
|
padding: 2rem 2rem 0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
padding: 1rem 2rem 2rem;
|
padding: 1rem 2rem 2rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -6,21 +6,21 @@
|
|||||||
<div v-else>
|
<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>
|
||||||
<el-breadcrumb class="breadcrumb" separator="/">
|
<el-breadcrumb class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
$t("navigation.home")
|
$t('navigation.home')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/support')">{{
|
<NuxtLink :to="$localePath('/support')">{{
|
||||||
$t("navigation.support")
|
$t('navigation.support')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/support/faq')">{{
|
<NuxtLink :to="$localePath('/support/faq')">{{
|
||||||
$t("navigation.faq")
|
$t('navigation.faq')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -33,53 +33,53 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { find } = useStrapi();
|
const { find } = useStrapi();
|
||||||
const { getStrapiLocale } = useLocalizations();
|
const { getStrapiLocale } = useLocalizations();
|
||||||
const strapiLocale = getStrapiLocale();
|
const strapiLocale = getStrapiLocale();
|
||||||
|
|
||||||
const questions = ref<Question[]>([]);
|
const questions = ref<Question[]>([]);
|
||||||
|
|
||||||
const pending = ref(true);
|
const pending = ref(true);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const faqData = await find<Question>("questions", {
|
const faqData = await find<Question>('questions', {
|
||||||
locale: strapiLocale,
|
locale: strapiLocale,
|
||||||
});
|
});
|
||||||
if (faqData) {
|
if (faqData) {
|
||||||
questions.value = faqData.data || [];
|
questions.value = faqData.data || [];
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Failed to fetch FAQ data:", error);
|
console.error('Failed to fetch FAQ data:', error);
|
||||||
} finally {
|
} finally {
|
||||||
pending.value = false;
|
pending.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 2rem 2rem 0rem;
|
padding: 2rem 2rem 0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
padding: 1rem 2rem 2rem;
|
padding: 1rem 2rem 2rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -3,16 +3,16 @@
|
|||||||
<support-tabs />
|
<support-tabs />
|
||||||
<div class="page-content">
|
<div class="page-content">
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1 class="page-title">{{ $t("navigation.support") }}</h1>
|
<h1 class="page-title">{{ $t('navigation.support') }}</h1>
|
||||||
<el-breadcrumb class="breadcrumb" separator="/">
|
<el-breadcrumb class="breadcrumb" separator="/">
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/')">{{
|
<NuxtLink :to="$localePath('/')">{{
|
||||||
$t("navigation.home")
|
$t('navigation.home')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item class="text-md opacity-50">
|
<el-breadcrumb-item class="text-md opacity-50">
|
||||||
<NuxtLink :to="$localePath('/support')">{{
|
<NuxtLink :to="$localePath('/support')">{{
|
||||||
$t("navigation.support")
|
$t('navigation.support')
|
||||||
}}</NuxtLink>
|
}}</NuxtLink>
|
||||||
</el-breadcrumb-item>
|
</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<span>{{ $t("navigation.faq") }}</span>
|
<span>{{ $t('navigation.faq') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -58,7 +58,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<span>{{ $t("navigation.documents") }}</span>
|
<span>{{ $t('navigation.documents') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -84,7 +84,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<span>{{ $t("navigation.contact-info") }}</span>
|
<span>{{ $t('navigation.contact-info') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -112,54 +112,54 @@
|
|||||||
<script setup lang="ts"></script>
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page-container {
|
.page-container {
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-header {
|
.page-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
padding: 1rem 2rem 2rem;
|
padding: 1rem 2rem 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
width: 60%;
|
width: 60%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-group {
|
.card-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 50px;
|
gap: 50px;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-card {
|
.el-card {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-icon {
|
.card-icon {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -167,42 +167,42 @@ section {
|
|||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-link {
|
.card-link {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-button {
|
.card-button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-group {
|
.button-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: left;
|
justify-content: left;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
margin-left: 2rem;
|
margin-left: 2rem;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row {
|
.el-row {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-row:last-child {
|
.el-row:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-col {
|
.el-col {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-content {
|
.grid-content {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
min-height: 36px;
|
min-height: 36px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
export * from "./common";
|
export * from './common';
|
||||||
export * from "./production";
|
export * from './production';
|
||||||
export * from "./singleTypes";
|
export * from './singleTypes';
|
||||||
export * from "./solution";
|
export * from './solution';
|
||||||
export * from "./question";
|
export * from './question';
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import type {
|
|||||||
StrapiImage,
|
StrapiImage,
|
||||||
StrapiMedia,
|
StrapiMedia,
|
||||||
StrapiRelation,
|
StrapiRelation,
|
||||||
} from "./common";
|
} from './common';
|
||||||
|
|
||||||
export interface ProductionType extends StrapiEntity {
|
export interface ProductionType extends StrapiEntity {
|
||||||
type: string;
|
type: string;
|
||||||
@ -29,13 +29,13 @@ export interface Production extends StrapiEntity {
|
|||||||
production_specs: ProductionSpecGroup[];
|
production_specs: ProductionSpecGroup[];
|
||||||
production_documents: StrapiRelation<
|
production_documents: StrapiRelation<
|
||||||
ProductionDocument,
|
ProductionDocument,
|
||||||
"related_productions"
|
'related_productions'
|
||||||
>[];
|
>[];
|
||||||
questions: StrapiRelation<Question, "related_productions">[];
|
questions: StrapiRelation<Question, 'related_productions'>[];
|
||||||
show_in_production_list: boolean;
|
show_in_production_list: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductionDocument extends StrapiEntity {
|
export interface ProductionDocument extends StrapiEntity {
|
||||||
document: StrapiMedia;
|
document: StrapiMedia;
|
||||||
related_productions: StrapiRelation<Production, "production_documents">[];
|
related_productions: StrapiRelation<Production, 'production_documents'>[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
export interface Question extends StrapiEntity {
|
export interface Question extends StrapiEntity {
|
||||||
title: string;
|
title: string;
|
||||||
content: string;
|
content: string;
|
||||||
related_productions: StrapiRelation<Production, "questions">[];
|
related_productions: StrapiRelation<Production, 'questions'>[];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import type { StrapiEntity, StrapiImage } from "./common";
|
import type { StrapiEntity, StrapiImage } from './common';
|
||||||
|
|
||||||
export interface SolutionType extends StrapiEntity {
|
export interface SolutionType extends StrapiEntity {
|
||||||
type: string;
|
type: string;
|
||||||
|
|||||||
@ -8,5 +8,5 @@ export function formatFileSize(sizeInKB: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function formatFileExtension(ext: string): string {
|
export function formatFileExtension(ext: string): string {
|
||||||
return ext.startsWith(".") ? ext.slice(1).toUpperCase() : ext.toUpperCase();
|
return ext.startsWith('.') ? ext.slice(1).toUpperCase() : ext.toUpperCase();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import MarkdownIt from "markdown-it";
|
import MarkdownIt from 'markdown-it';
|
||||||
|
|
||||||
const md = new MarkdownIt({
|
const md = new MarkdownIt({
|
||||||
html: true,
|
html: true,
|
||||||
@ -10,8 +10,8 @@ const md = new MarkdownIt({
|
|||||||
export function renderMarkdown(content: string): string {
|
export function renderMarkdown(content: string): string {
|
||||||
const dirtyHtml = md.render(content);
|
const dirtyHtml = md.render(content);
|
||||||
|
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== 'undefined') {
|
||||||
import("dompurify").then((DOMPurify) => {
|
import('dompurify').then((DOMPurify) => {
|
||||||
return DOMPurify.default.sanitize(dirtyHtml);
|
return DOMPurify.default.sanitize(dirtyHtml);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ export function convertMedia(content: string): string {
|
|||||||
// 通过正则表达式替换Markdown中的图片链接
|
// 通过正则表达式替换Markdown中的图片链接
|
||||||
//  -> )
|
//  -> )
|
||||||
|
|
||||||
if (!content) return "";
|
if (!content) return '';
|
||||||
|
|
||||||
const contentWithAbsoluteUrls = content.replace(
|
const contentWithAbsoluteUrls = content.replace(
|
||||||
/!\[([^\]]*)\]\((\/uploads\/[^)]+)\)/g,
|
/!\[([^\]]*)\]\((\/uploads\/[^)]+)\)/g,
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
export default {
|
export default {
|
||||||
extends: ['@commitlint/config-conventional']
|
extends: ['@commitlint/config-conventional'],
|
||||||
};
|
};
|
||||||
@ -1,15 +1,18 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import withNuxt from './.nuxt/eslint.config.mjs'
|
import withNuxt from './.nuxt/eslint.config.mjs';
|
||||||
|
|
||||||
export default withNuxt(
|
export default withNuxt(
|
||||||
// Your custom configs here
|
// Your custom configs here
|
||||||
{
|
{
|
||||||
rules: {
|
rules: {
|
||||||
"vue/html-self-closing": ["warn", {
|
'vue/html-self-closing': [
|
||||||
"html": {
|
'warn',
|
||||||
"void": "any",
|
{
|
||||||
|
html: {
|
||||||
|
void: 'any',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}]
|
);
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
export default defineI18nConfig(() => ({
|
export default defineI18nConfig(() => ({
|
||||||
legacy: false,
|
legacy: false,
|
||||||
locale: 'zh',
|
locale: 'zh',
|
||||||
fallbackLocale: 'zh'
|
fallbackLocale: 'zh',
|
||||||
}))
|
}));
|
||||||
|
|||||||
@ -2,4 +2,5 @@ export default defineI18nConfig(() => ({
|
|||||||
legacy: false,
|
legacy: false,
|
||||||
locale: 'zh',
|
locale: 'zh',
|
||||||
fallbackLocale: 'zh',
|
fallbackLocale: 'zh',
|
||||||
}))
|
}));
|
||||||
|
|
||||||
|
|||||||
@ -1,33 +1,33 @@
|
|||||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
compatibilityDate: "2025-07-15",
|
compatibilityDate: '2025-07-15',
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
|
||||||
app: {
|
app: {
|
||||||
// head
|
// head
|
||||||
head: {
|
head: {
|
||||||
title: "金申机械制造有限公司",
|
title: '金申机械制造有限公司',
|
||||||
meta: [
|
meta: [
|
||||||
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||||
{
|
{
|
||||||
name: "description",
|
name: 'description',
|
||||||
content: "Jinshen Website",
|
content: 'Jinshen Website',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
|
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
public: {
|
public: {
|
||||||
meili: {
|
meili: {
|
||||||
host: process.env.MEILI_HOST || "http://localhost:7700",
|
host: process.env.MEILI_HOST || 'http://localhost:7700',
|
||||||
searchKey: process.env.MEILI_SEARCH_KEY || "",
|
searchKey: process.env.MEILI_SEARCH_KEY || '',
|
||||||
indexes: process.env.MEILI_SEARCH_INDEXES
|
indexes: process.env.MEILI_SEARCH_INDEXES
|
||||||
? (typeof process.env.MEILI_SEARCH_INDEXES === "string"
|
? typeof process.env.MEILI_SEARCH_INDEXES === 'string'
|
||||||
? process.env.MEILI_SEARCH_INDEXES.split(",").map(i => i.trim())
|
? process.env.MEILI_SEARCH_INDEXES.split(',').map((i) => i.trim())
|
||||||
: process.env.MEILI_SEARCH_INDEXES)
|
: process.env.MEILI_SEARCH_INDEXES
|
||||||
: ["production", "solution"],
|
: ['production', 'solution'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -38,22 +38,22 @@ export default defineNuxtConfig({
|
|||||||
|
|
||||||
// css
|
// css
|
||||||
css: [
|
css: [
|
||||||
"@unocss/reset/tailwind.css",
|
'@unocss/reset/tailwind.css',
|
||||||
"~/assets/scss/index.scss",
|
'~/assets/scss/index.scss',
|
||||||
"~/assets/css/fonts.css",
|
'~/assets/css/fonts.css',
|
||||||
"@mdi/font/css/materialdesignicons.min.css",
|
'@mdi/font/css/materialdesignicons.min.css',
|
||||||
],
|
],
|
||||||
|
|
||||||
nitro: {
|
nitro: {
|
||||||
esbuild: {
|
esbuild: {
|
||||||
options: {
|
options: {
|
||||||
target: "esnext",
|
target: 'esnext',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
prerender: {
|
prerender: {
|
||||||
crawlLinks: false,
|
crawlLinks: false,
|
||||||
routes: ["/"],
|
routes: ['/'],
|
||||||
ignore: ["/hi"],
|
ignore: ['/hi'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -73,53 +73,52 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
elementPlus: {
|
elementPlus: {
|
||||||
icon: "ElIcon",
|
icon: 'ElIcon',
|
||||||
importStyle: "scss",
|
importStyle: 'scss',
|
||||||
themes: ["dark"],
|
themes: ['dark'],
|
||||||
},
|
},
|
||||||
|
|
||||||
i18n: {
|
i18n: {
|
||||||
detectBrowserLanguage: {
|
detectBrowserLanguage: {
|
||||||
useCookie: true,
|
useCookie: true,
|
||||||
cookieKey: "i18n_redirected",
|
cookieKey: 'i18n_redirected',
|
||||||
redirectOn: "root",
|
redirectOn: 'root',
|
||||||
alwaysRedirect: true
|
alwaysRedirect: true,
|
||||||
},
|
},
|
||||||
locales: [
|
locales: [
|
||||||
{ code: "en", language: "en-US", name: "English", file: "en.json" },
|
{ code: 'en', language: 'en-US', name: 'English', file: 'en.json' },
|
||||||
{ code: "zh", language: "zh-CN", name: "简体中文", file: "zh.json" },
|
{ code: 'zh', language: 'zh-CN', name: '简体中文', file: 'zh.json' },
|
||||||
],
|
],
|
||||||
defaultLocale: "zh",
|
defaultLocale: 'zh',
|
||||||
strategy: "prefix_except_default",
|
strategy: 'prefix_except_default',
|
||||||
langDir: "locales",
|
langDir: 'locales',
|
||||||
},
|
},
|
||||||
|
|
||||||
strapi: {
|
strapi: {
|
||||||
url: process.env.STRAPI_URL || "http://localhost:1337",
|
url: process.env.STRAPI_URL || 'http://localhost:1337',
|
||||||
token: process.env.STRAPI_TOKEN || undefined,
|
token: process.env.STRAPI_TOKEN || undefined,
|
||||||
prefix: "/api",
|
prefix: '/api',
|
||||||
admin: "/admin",
|
admin: '/admin',
|
||||||
version: "v5",
|
version: 'v5',
|
||||||
cookie: {},
|
cookie: {},
|
||||||
cookieName: "strapi_jwt",
|
cookieName: 'strapi_jwt',
|
||||||
},
|
},
|
||||||
|
|
||||||
imports: {
|
imports: {
|
||||||
dirs: ['types/**']
|
dirs: ['types/**'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
modules: [
|
modules: [
|
||||||
"@nuxt/eslint",
|
'@nuxt/eslint',
|
||||||
"@nuxt/fonts",
|
'@nuxt/fonts',
|
||||||
"@nuxt/icon",
|
'@nuxt/icon',
|
||||||
"@nuxt/image",
|
'@nuxt/image',
|
||||||
"@nuxt/test-utils",
|
'@nuxt/test-utils',
|
||||||
"@vueuse/nuxt",
|
'@vueuse/nuxt',
|
||||||
"@pinia/nuxt",
|
'@pinia/nuxt',
|
||||||
"@unocss/nuxt",
|
'@unocss/nuxt',
|
||||||
"@element-plus/nuxt",
|
'@element-plus/nuxt',
|
||||||
"@nuxtjs/i18n",
|
'@nuxtjs/i18n',
|
||||||
"@nuxtjs/strapi",
|
'@nuxtjs/strapi',
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,29 +14,29 @@ export default {
|
|||||||
// 使用单引号
|
// 使用单引号
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
// 尾随逗号
|
// 尾随逗号
|
||||||
trailingComma: "es5",
|
trailingComma: 'es5',
|
||||||
// 对象大括号内的空格
|
// 对象大括号内的空格
|
||||||
bracketSpacing: true,
|
bracketSpacing: true,
|
||||||
// 箭头函数参数括号
|
// 箭头函数参数括号
|
||||||
arrowParens: "always",
|
arrowParens: 'always',
|
||||||
// 括号行位置
|
// 括号行位置
|
||||||
bracketSameLine: false,
|
bracketSameLine: false,
|
||||||
// 换行符使用 lf
|
// 换行符使用 lf
|
||||||
endOfLine: "lf",
|
endOfLine: 'lf',
|
||||||
// HTML 空格敏感度
|
// HTML 空格敏感度
|
||||||
htmlWhitespaceSensitivity: "css",
|
htmlWhitespaceSensitivity: 'css',
|
||||||
// Vue 文件脚本和样式缩进
|
// Vue 文件脚本和样式缩进
|
||||||
vueIndentScriptAndStyle: true,
|
vueIndentScriptAndStyle: true,
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
// 对 CSS 文件使用双引号
|
// 对 CSS 文件使用双引号
|
||||||
files: "*.css",
|
files: '*.css',
|
||||||
options: { singleQuote: false },
|
options: { singleQuote: false },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// 对 SCSS 文件使用双引号
|
// 对 SCSS 文件使用双引号
|
||||||
files: "*.scss",
|
files: '*.scss',
|
||||||
options: { singleQuote: false },
|
options: { singleQuote: false },
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,12 +7,18 @@ import {
|
|||||||
// presetWebFonts,
|
// presetWebFonts,
|
||||||
transformerDirectives,
|
transformerDirectives,
|
||||||
transformerVariantGroup,
|
transformerVariantGroup,
|
||||||
} from 'unocss'
|
} from 'unocss';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
['btn', 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
|
[
|
||||||
['icon-btn', 'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'],
|
'btn',
|
||||||
|
'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'icon-btn',
|
||||||
|
'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
presets: [
|
presets: [
|
||||||
presetUno(),
|
presetUno(),
|
||||||
@ -30,8 +36,5 @@ export default defineConfig({
|
|||||||
// },
|
// },
|
||||||
// }),
|
// }),
|
||||||
],
|
],
|
||||||
transformers: [
|
transformers: [transformerDirectives(), transformerVariantGroup()],
|
||||||
transformerDirectives(),
|
});
|
||||||
transformerVariantGroup(),
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|||||||
Reference in New Issue
Block a user