feat(app): 添加多模板关于我们页面及相关路由和404页面

- 新增404页面,优化未找到页面体验,避免被搜索引擎索引
- 增加文件代理接口,隐藏真实文件服务器地址,支持文件请求代理
- 实现/article、/case、/product及/page动态路由兼容列表与详情展示
- 添加动态CMS页面兼容入口处理旧式路径,统一路由与SEO设置
- 新增模板1、模板7、模板2、模板3关于我们页面,实现多模板支持
- 模板增强支持CMS单页内容加载及SEO信息动态设置
- 配置环境变量及Git忽略文件规则辅助开发和构建环境管理
This commit is contained in:
2026-09-08 12:13:44 +08:00
commit 2b69686795
381 changed files with 59891 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

@@ -0,0 +1,82 @@
<template>
<footer class="bg-[#1B2233] text-[#C7CEDB]">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12 lg:py-16">
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-8 lg:gap-12">
<!-- 公司信息 -->
<div class="sm:col-span-2 lg:col-span-1">
<SiteBrand
link-class="mb-4"
:logo="siteLogo"
:icon="siteIcon"
:name="siteName"
logo-class="h-9 w-auto max-w-[200px] object-contain"
icon-class="h-6 w-auto object-contain"
name-class="text-lg font-bold text-white"
>
<template #fallback-icon>
<div class="w-9 h-9 rounded-lg bg-[#CF1313] flex items-center justify-center">
<svg class="w-5 h-5 text-white" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2L3 7v10l9 5 9-5V7l-9-5zm0 2.3L18.5 8 12 11.7 5.5 8 12 4.3zM5 9.6l6 3.3v6.8l-6-3.3V9.6zm14 0v6.8l-6 3.3V12.9l6-3.3z" /></svg>
</div>
</template>
</SiteBrand>
<p v-if="slogan" class="text-sm text-[#9AA3B5] mb-3">{{ slogan }}</p>
<p class="text-sm text-[#9AA3B5] leading-relaxed">{{ siteInfo?.comments || siteInfo?.content || '以技术驱动企业数字化升级,为客户提供专业、可靠的软件产品与解决方案。' }}</p>
</div>
<!-- 快捷链接 -->
<div>
<h4 class="text-white font-semibold mb-4">快捷导航</h4>
<ul class="space-y-2">
<li v-for="item in quickLinks" :key="item.navigationId">
<NuxtLink :to="getNavLink(item)" :target="item.target === '_blank' ? '_blank' : undefined" class="text-sm text-[#9AA3B5] hover:text-[#FF6B6B] transition-colors">{{ item.title }}</NuxtLink>
</li>
</ul>
</div>
<!-- 联系方式 -->
<div>
<h4 class="text-white font-semibold mb-4">联系我们</h4>
<ul class="space-y-2 text-sm text-[#9AA3B5]">
<li v-if="phone"><span class="text-[#6B7488]">电话</span>{{ phone }}</li>
<li v-if="email"><span class="text-[#6B7488]">邮箱</span>{{ email }}</li>
<li v-if="address" class="leading-relaxed"><span class="text-[#6B7488]">地址</span>{{ address }}</li>
<li v-if="officialWebsite"><span class="text-[#6B7488]">官网:</span><a :href="officialWebsiteUrl" target="_blank" rel="nofollow" class="hover:text-[#FF6B6B] transition-colors">{{ officialWebsite }}</a></li>
</ul>
</div>
<!-- 关注我们 -->
<div v-if="wxQrcode || socialLinks.length">
<h4 class="text-white font-semibold mb-4">关注我们</h4>
<div v-if="wxQrcode" class="bg-white rounded-xl p-3 inline-block">
<img :src="wxQrcode" alt="微信二维码" class="w-32 h-32 object-contain">
</div>
<p v-if="wxQrcode" class="text-xs text-[#6B7488] mt-2">{{ siteConfig?.wxQrcodeText || '扫码关注' }}</p>
<div v-if="socialLinks.length" class="mt-3 flex flex-col gap-1">
<a v-for="link in socialLinks" :key="link.url" :href="link.url" target="_blank" rel="nofollow" class="text-sm text-[#9AA3B5] hover:text-[#FF6B6B] transition-colors">{{ link.name || link.type }}</a>
</div>
</div>
</div>
<div class="border-t border-[#2C3548] mt-12 pt-8 flex flex-col sm:flex-row items-center justify-between gap-4">
<p class="text-sm text-[#6B7488]">{{ copyright || `© ${new Date().getFullYear()} ${siteName || '企业官网'} 版权所有` }}</p>
<div class="flex items-center gap-4">
<p v-if="icpNo" class="text-sm text-[#6B7488]">{{ icpNo }}</p>
<p v-if="siteInfo?.policeNo" class="text-sm text-[#6B7488]">{{ siteInfo.policeNo }}</p>
<div class="flex items-center gap-2 text-xs">
<span class="text-[#6B7488]">Powered by</span>
<a rel="nofollow" href="https://site.websoft.top" target="_blank" class="text-[#6B7488] hover:text-[#FF6B6B] transition-colors">·企业官网</a>
</div>
</div>
</div>
</div>
</footer>
</template>
<script setup lang="ts">
import type { CmsNavigation } from '~/types'
const { siteInfo, siteName, siteLogo, siteIcon, siteConfig, bottomNavigations, phone, email, address, icpNo, copyright, wxQrcode, slogan, officialWebsite, officialWebsiteUrl, socialLinks } = useSite()
const quickLinks = computed<CmsNavigation[]>(() => {
const navs = bottomNavigations.value || []
return navs.filter((nav) => nav.model !== 'index').slice(0, 6)
})
</script>
@@ -0,0 +1,113 @@
<template>
<!-- 顶部信息条 -->
<div class="bg-[#1E2A47] text-[#C7CEDB] text-xs">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-9">
<span class="truncate">{{ topWelcome }}</span>
<div class="flex items-center gap-3 flex-shrink-0">
<span class="hidden sm:inline">全国统一服务热线</span>
<a v-if="phone" :href="`tel:${phone}`" class="font-semibold text-white hover:text-[#FF6B6B] transition-colors">{{ phone }}</a>
</div>
</div>
</div>
</div>
<header class="sticky top-0 z-50 bg-white border-b border-[#E5E7EB]">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-20">
<!-- Logo -->
<SiteBrand
link-class="flex-shrink-0"
:logo="siteLogo"
:icon="siteIcon"
:name="siteName"
logo-class="h-12 w-auto max-w-[220px] object-contain"
icon-class="h-8 w-auto object-contain"
name-class="text-xl font-bold text-[#1E2A47] truncate max-w-[200px]"
>
<template #fallback-icon>
<div class="w-10 h-10 rounded-lg bg-[#1E2A47] flex items-center justify-center">
<svg class="w-6 h-6 text-white" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2L3 7v10l9 5 9-5V7l-9-5zm0 2.3L18.5 8 12 11.7 5.5 8 12 4.3zM5 9.6l6 3.3v6.8l-6-3.3V9.6zm14 0v6.8l-6 3.3V12.9l6-3.3z" /></svg>
</div>
</template>
</SiteBrand>
<!-- 搜索框后台 setting.searchBtn 控制是否显示提交带关键词跳转资讯列表 -->
<SiteSearchBox v-if="showHeaderSearch" variant="light" accent="#1E2A47" class="hidden lg:flex items-center ml-8" />
<!-- 桌面端导航 -->
<nav class="hidden lg:flex items-center gap-1 ml-auto">
<template v-for="item in navItems" :key="item.navigationId || item.path">
<div v-if="item.children && item.children.length > 0" class="relative group h-20 flex items-center">
<button class="flex items-center gap-1 px-3 text-base font-medium text-[#1E2A47] hover:text-[#CF1313] transition-colors">
{{ item.title }}
<svg class="w-4 h-4 transition-transform group-hover:rotate-180" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" /></svg>
</button>
<div class="absolute left-0 top-full pt-2 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200">
<div class="bg-white rounded-xl shadow-xl border border-[#E5E7EB] py-2 min-w-[200px]">
<NuxtLink
v-for="child in item.children" :key="child.navigationId" :to="getChildPath(child)"
class="block px-5 py-2.5 text-[15px] text-[#333333] hover:text-[#CF1313] hover:bg-[#F4F6FA] transition-colors whitespace-nowrap"
>
{{ child.title }}
</NuxtLink>
</div>
</div>
</div>
<NuxtLink
v-else :to="getNavLink(item)" :target="item.target === '_blank' ? '_blank' : undefined"
class="px-3 text-base font-medium text-[#1E2A47] hover:text-[#CF1313] transition-colors" active-class="text-[#CF1313]"
>
{{ item.title }}
</NuxtLink>
</template>
<NuxtLink to="/contact" class="ml-3 inline-flex items-center justify-center px-5 py-2.5 bg-[#CF1313] text-white text-base font-semibold rounded-full hover:bg-[#A60E0E] transition-colors shadow-sm">立即咨询</NuxtLink>
</nav>
<!-- 移动端汉堡 -->
<button class="lg:hidden ml-auto p-2 rounded-lg hover:bg-[#F4F6FA]" @click="mobileMenuOpen = !mobileMenuOpen" aria-label="菜单">
<svg v-if="!mobileMenuOpen" class="w-6 h-6 text-[#1E2A47]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /></svg>
<svg v-else class="w-6 h-6 text-[#1E2A47]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
</button>
</div>
</div>
<!-- 移动端展开菜单 -->
<div v-if="mobileMenuOpen" class="lg:hidden bg-white border-t border-[#E5E7EB]">
<div class="container mx-auto px-4 py-4 space-y-1">
<template v-for="item in navItems" :key="item.navigationId || item.path">
<div v-if="item.children && item.children.length > 0">
<div class="px-2 py-2.5 text-base font-semibold text-[#1E2A47]">{{ item.title }}</div>
<NuxtLink
v-for="child in item.children" :key="child.navigationId" :to="getChildPath(child)"
class="block px-6 py-2 text-sm text-[#666666] hover:text-[#CF1313] hover:bg-[#F4F6FA] rounded-lg transition-colors" @click="mobileMenuOpen = false"
>
{{ child.title }}
</NuxtLink>
</div>
<NuxtLink
v-else :to="getNavLink(item)" :target="item.target === '_blank' ? '_blank' : undefined"
class="block px-2 py-2.5 text-base font-medium text-[#1E2A47] hover:text-[#CF1313] hover:bg-[#F4F6FA] rounded-lg transition-colors"
active-class="text-[#CF1313] bg-[#F4F6FA]" @click="mobileMenuOpen = false"
>
{{ item.title }}
</NuxtLink>
</template>
<NuxtLink to="/contact" class="block px-2 py-2.5 mt-2 text-center bg-[#CF1313] text-white font-semibold rounded-lg hover:bg-[#A60E0E] transition-colors" @click="mobileMenuOpen = false">立即咨询</NuxtLink>
</div>
</div>
</header>
</template>
<script setup lang="ts">
import type { CmsNavigation } from '~/types'
const { siteInfo, siteName, siteLogo, siteIcon, navigations, phone, showHeaderSearch, fetchSiteInfo } = useSite()
const mobileMenuOpen = ref(false)
const topWelcome = computed(() => siteInfo.value?.welcomeInfo || `${siteName.value || '我们'} · 专业的企业数字化服务提供商`)
function getChildPath(child: CmsNavigation): string { return getNavLink(child) }
await fetchSiteInfo()
const navItems = computed<CmsNavigation[]>(() => navigations.value || [])
</script>
@@ -0,0 +1,48 @@
<template>
<section class="relative overflow-hidden">
<img :src="heroBanner" alt="" class="absolute inset-0 w-full h-full object-cover">
<div class="absolute inset-0 bg-gradient-to-r from-[#16203A]/95 via-[#1E2A47]/80 to-[#1E2A47]/30" />
<div class="absolute -top-24 -right-24 w-96 h-96 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="absolute bottom-0 left-0 w-full h-1.5 bg-[#CF1313]" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
<div class="max-w-3xl py-24 lg:py-32">
<span class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-sm font-medium text-white mb-6 border border-white/20" data-reveal>
<span class="w-2 h-2 rounded-full bg-[#CF1313]" /> 专业 · 可靠 · 数字化
</span>
<h1 class="text-3xl sm:text-4xl lg:text-5xl font-extrabold text-white leading-tight mb-6" data-reveal>{{ heroTitle }}</h1>
<p class="text-base sm:text-lg text-white/85 mb-8 leading-relaxed max-w-2xl" data-reveal data-reveal-delay="120">{{ heroSubtitle }}</p>
<div class="flex flex-wrap gap-4" data-reveal data-reveal-delay="240">
<button type="button" class="inline-flex items-center justify-center px-8 py-3 bg-[#CF1313] text-white font-semibold rounded-full hover:bg-[#A60E0E] transition-colors shadow-lg" @click="openConsult()">免费咨询</button>
<NuxtLink v-if="productNav" :to="productNav.path || '/product'" class="inline-flex items-center justify-center px-8 py-3 border-2 border-white text-white font-semibold rounded-full hover:bg-white/10 transition-colors">产品与方案</NuxtLink>
</div>
<!-- 数据指标 -->
<div class="grid grid-cols-2 sm:grid-cols-4 gap-6 mt-14" data-reveal data-reveal-delay="360">
<div v-for="stat in stats" :key="stat.label">
<div class="text-2xl lg:text-3xl font-bold text-white">{{ stat.value }}</div>
<div class="text-xs text-white/70 mt-1">{{ stat.label }}</div>
</div>
</div>
</div>
</div>
</section>
</template>
<script setup lang="ts">
import type { CmsNavigation } from '~/types'
import heroBanner from '../assets/hero-banner.jpg'
const { siteInfo, siteName, navigations, fetchSiteInfo } = useSite()
const { openConsult } = useConsult()
await fetchSiteInfo()
const heroTitle = computed(() => siteName.value ? `${siteName.value} · 企业数字化伙伴` : '企业数字化升级的首选伙伴')
const heroSubtitle = computed(() => siteInfo.value?.comments || '以技术驱动业务增长,提供专业、安全、可落地的软件产品与行业解决方案,助力企业实现数字化转型。')
const productNav = computed<CmsNavigation | undefined>(() => (navigations.value || []).find((n) => n.model === 'product'))
const stats = [
{ value: '20+', label: '服务行业' },
{ value: '500+', label: '合作客户' },
{ value: '99.9%', label: '服务可用率' },
{ value: '7×24', label: '技术支持' }
]
</script>
+19
View File
@@ -0,0 +1,19 @@
import type { TemplateConfig } from '~/composables/useTemplate'
/**
* 模板 6 配置
* 企业科技风(广西网软 / websoft.top 品牌官网风格)
* 深蓝主色 + 中国红点缀,适合软件、科技、企业服务、政企类官网
*/
export default {
id: 'template-06',
name: '企业科技蓝红模板',
description: '稳重专业的企业科技风,深蓝主色 + 中国红点缀,适合软件、科技、企业服务、政企类品牌官网',
preview: '/templates/cloud-website/template-06.png',
supportedModules: ['home', 'about', 'products', 'cases', 'news', 'contact'],
themeConfig: {
primaryColor: '#1E2A47',
secondaryColor: '#CF1313',
fontFamily: '"Noto Sans SC", "Source Han Sans SC", "思源黑体", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif'
}
} satisfies TemplateConfig
+185
View File
@@ -0,0 +1,185 @@
<template>
<div>
<!-- Hero 横幅 -->
<section class="bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-16 -right-16 w-72 h-72 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12 lg:py-16 relative z-10">
<nav class="text-xs text-white/60 mb-3" aria-label="面包屑">
<NuxtLink to="/" class="hover:text-white">首页</NuxtLink>
<span class="mx-2">/</span>
<span class="text-white">关于我们</span>
</nav>
<h1 class="text-3xl font-bold text-white" data-reveal>关于我们</h1>
<p class="text-white/70 mt-3 max-w-2xl leading-relaxed" data-reveal data-reveal-delay="100">
{{ slogan || '专业务实,做企业值得信赖的数字化伙伴' }}
</p>
</div>
</section>
<!-- 公司简介 -->
<section class="py-16 lg:py-20 bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="grid lg:grid-cols-2 gap-12 items-center">
<div class="rounded-2xl overflow-hidden shadow-lg order-2 lg:order-1" data-reveal data-reveal-delay="120">
<img :src="aboutImg1" alt="关于我们" class="w-full h-72 lg:h-96 object-cover">
</div>
<div class="order-1 lg:order-2">
<span class="inline-block px-3 py-1 rounded-full bg-[#F4F6FA] text-[#CF1313] text-sm font-semibold mb-4" data-reveal>公司简介</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-6" data-reveal>专业务实做企业值得信赖的数字化伙伴</h2>
<div class="text-[#666666] leading-relaxed mb-8 space-y-4">
<p v-if="introText">{{ introText }}</p>
<template v-else>
<p>我们深耕企业软件与行业信息化领域聚焦客户需求提供从咨询规划产品设计到研发交付运维支持的一站式服务</p>
<p>以稳定可靠的架构与持续优化的服务帮助客户降低数字化门槛提升运营效率实现可持续的业务增长</p>
</template>
</div>
<div class="flex flex-wrap gap-3 mb-8">
<span v-for="tag in tags" :key="tag"
class="px-3 py-1.5 rounded-full bg-[#F4F6FA] border border-[#E5E7EB] text-sm text-[#1E2A47]">{{ tag }}</span>
</div>
<NuxtLink to="/contact" class="inline-flex items-center px-6 py-3 bg-[#CF1313] text-white font-semibold rounded-full hover:bg-[#A60E0E] transition-colors shadow-sm">
联系我们
<svg class="w-4 h-4 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /></svg>
</NuxtLink>
</div>
</div>
</div>
</section>
<!-- 我们的优势 -->
<section class="py-16 lg:py-20 bg-[#F4F6FA]">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-12">
<span class="inline-block px-3 py-1 rounded-full bg-white text-[#CF1313] text-sm font-semibold mb-4" data-reveal>核心优势</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-4" data-reveal>为什么选择我们</h2>
<p class="text-[#666666] max-w-2xl mx-auto">从技术到服务全链路保障客户的数字化投资回报</p>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-6">
<div v-for="(item, index) in advantages" :key="item.title"
class="bg-white rounded-2xl p-7 shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB] anim-card group" data-reveal :data-reveal-delay="index * 100">
<div class="w-14 h-14 rounded-xl flex items-center justify-center mb-5 bg-[#FDECEC]">
<svg class="w-7 h-7 text-[#CF1313]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" :d="item.icon" /></svg>
</div>
<h3 class="text-lg font-semibold text-[#1E2A47] mb-2">{{ item.title }}</h3>
<p class="text-sm text-[#666666] leading-relaxed">{{ item.desc }}</p>
</div>
</div>
</div>
</section>
<!-- 发展历程 -->
<section class="py-16 lg:py-20 bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="grid lg:grid-cols-2 gap-12 items-center">
<div class="order-2 lg:order-1">
<span class="inline-block px-3 py-1 rounded-full bg-[#F4F6FA] text-[#CF1313] text-sm font-semibold mb-4" data-reveal>发展历程</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-8" data-reveal>一路同行步履不停</h2>
<div class="relative border-l-2 border-[#E5E7EB] pl-8 space-y-8">
<div v-for="(m, index) in milestones" :key="m.year" class="relative" data-reveal :data-reveal-delay="index * 100">
<span class="absolute -left-[41px] top-1 w-5 h-5 rounded-full bg-[#CF1313] border-4 border-white shadow"></span>
<div class="text-[#CF1313] font-bold text-lg">{{ m.year }}</div>
<div class="text-[#1E2A47] font-semibold mt-1">{{ m.title }}</div>
<p class="text-[#666666] text-sm leading-relaxed mt-1">{{ m.desc }}</p>
</div>
</div>
</div>
<div class="order-1 lg:order-2 rounded-2xl overflow-hidden shadow-lg" data-reveal data-reveal-delay="120">
<img :src="aboutImg2" alt="发展历程" class="w-full h-80 lg:h-[480px] object-cover">
</div>
</div>
</div>
</section>
<!-- 数据实力 -->
<section class="py-16 lg:py-20 bg-[#F4F6FA]">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-12">
<span class="inline-block px-3 py-1 rounded-full bg-white text-[#CF1313] text-sm font-semibold mb-4" data-reveal>数据实力</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-4" data-reveal>用结果说话</h2>
<p class="text-[#666666] max-w-2xl mx-auto">沉淀多年的交付能力与行业口碑是我们最扎实的底气</p>
</div>
<div class="grid grid-cols-2 lg:grid-cols-4 gap-6">
<div v-for="(s, index) in stats" :key="s.label"
class="bg-white rounded-2xl p-8 text-center shadow-sm border border-[#E5E7EB] anim-card" data-reveal :data-reveal-delay="index * 100">
<div class="text-[#1E2A47] font-bold text-3xl sm:text-4xl">
{{ s.value }}<span class="text-[#CF1313]">{{ s.suffix }}</span>
</div>
<div class="text-sm text-[#666666] mt-2">{{ s.label }}</div>
</div>
</div>
</div>
</section>
<!-- 联系 CTA -->
<section class="py-16 lg:py-20 bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-20 -right-20 w-80 h-80 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 text-center relative z-10">
<h2 class="text-2xl sm:text-3xl font-bold text-white mb-4" data-reveal>有项目需求或合作意向</h2>
<p class="text-white/80 max-w-2xl mx-auto mb-8" data-reveal data-reveal-delay="100">立即联系我们获取专属方案与产品演示</p>
<button type="button" class="inline-flex items-center justify-center px-8 py-3 bg-[#CF1313] text-white font-semibold rounded-full hover:bg-[#A60E0E] transition-colors shadow-lg" @click="openConsult()">立即咨询</button>
</div>
</section>
</div>
<!-- 关于页附件CMS 单页管理维护 -->
<PageAttachments
v-if="aboutAttachments.length"
:attachments="aboutAttachments"
class="mt-10"
/>
</template>
<script setup lang="ts">
import aboutImg1 from '../assets/about-1.jpg'
import aboutImg2 from '../assets/about-2.jpg'
import type { CaseItem, Product, PageResult, ApiEnvelope, PageDetail, PageAttachment } from '~/types'
const { siteInfo, slogan, fetchSiteInfo } = useSite()
const { openConsult } = useConsult()
await fetchSiteInfo()
// 关于页附件(CMS「单页管理」按 path=about 维护)
const { data: aboutPage } = await useFetch<PageDetail>('/api/page/detail', { query: { path: 'about' } })
const aboutAttachments = computed<PageAttachment[]>(() => aboutPage.value?.attachments || [])
// 公司简介:优先取自 CMS 站点描述,回退到模板内置文案
const introText = computed(() => siteInfo.value?.comments || siteInfo.value?.content || '')
const tags = ['自主研发', '行业深耕', '安全稳定', '贴身服务']
const advantages = [
{ title: '技术实力', desc: '核心产品自主可控,技术栈先进,按需灵活扩展与定制。', icon: 'M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z' },
{ title: '行业经验', desc: '多行业落地实践,深刻理解业务场景与真实痛点。', icon: 'M12 2l8 4v6c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V6l8-4z' },
{ title: '服务体系', desc: '从咨询规划到运维支持全流程陪伴,7×24 响应。', icon: 'M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z' },
{ title: '客户口碑', desc: '以交付质量与长期服务,赢得客户的持续信赖。', icon: 'M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z' }
]
// 发展历程(模板内置占位,可按租户实际历史在后台或模板中调整)
const milestones = [
{ year: '2015', title: '扬帆起航', desc: '公司正式成立,组建核心研发团队,确立企业数字化服务方向。' },
{ year: '2018', title: '技术沉淀', desc: '自研核心产品体系成型,服务客户覆盖多个重点行业。' },
{ year: '2021', title: '规模跃升', desc: '交付能力持续增强,建立标准化实施与运维服务体系。' },
{ year: '2024', title: '智领未来', desc: '拥抱云原生与智能化,为客户提供更敏捷的数字化方案。' }
]
// 数据实力:案例与产品取自实时接口,无数据时展示占位值(可按需修改)
const cases = ref<CaseItem[]>([])
try {
const res = await $fetch<PageResult<CaseItem>>('/api/case/list', { query: { page: 1, limit: 100 } })
cases.value = res?.list || []
} catch { cases.value = [] }
const products = ref<Product[]>([])
try {
const res = await $fetch<ApiEnvelope<PageResult<Product>> | PageResult<Product>>('/api/product/list', { query: { page: 1, limit: 50 } })
const envelope = res as ApiEnvelope<PageResult<Product>>
products.value = envelope?.data?.list || (res as PageResult<Product>)?.list || []
} catch { products.value = [] }
const stats = computed(() => [
{ value: String(cases.value.length || 200), suffix: '+', label: '成功案例' },
{ value: String(products.value.length || 50), suffix: '+', label: '产品与方案' },
{ value: '500', suffix: '+', label: '服务客户' },
{ value: '10', suffix: '年+', label: '行业经验' }
])
</script>
@@ -0,0 +1,43 @@
<template>
<div class="min-h-screen bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div v-if="caseItem" class="max-w-4xl mx-auto">
<div class="mb-6"><NuxtLink :to="`/case${caseItem?.navigationId ? '?navId=' + caseItem.navigationId : ''}`" class="text-sm text-[#666666] hover:text-[#CF1313]"> 返回案例列表</NuxtLink></div>
<h1 class="text-3xl sm:text-4xl font-bold text-[#1E2A47] mb-4">{{ caseItem.title }}</h1>
<div class="flex flex-wrap items-center gap-4 text-sm text-[#666666] mb-8 pb-8 border-b border-[#E5E7EB]">
<span v-if="caseItem.clientName" class="px-3 py-1 bg-[#FDECEC] text-[#CF1313] rounded-full">{{ caseItem.clientName }}</span>
<span v-if="caseItem.projectTime">项目时间{{ caseItem.projectTime }}</span>
<span v-if="caseItem.categoryName">行业{{ caseItem.categoryName }}</span>
</div>
<div v-if="caseItem.cover" class="rounded-2xl overflow-hidden mb-10 bg-[#F4F6FA] flex items-center justify-center">
<img :src="fileUrl(caseItem.cover)" :alt="caseItem.title" class="w-full max-h-[420px] object-contain">
</div>
<p v-if="caseItem.summary" class="text-lg text-[#666666] mb-8 leading-relaxed">{{ caseItem.summary }}</p>
<div class="cms-content">
<RichText :content="caseItem.content" />
</div>
</div>
<div v-else class="text-center py-20">
<h1 class="text-2xl font-bold text-[#1E2A47] mb-4">案例不存在或已下架</h1>
<NuxtLink :to="`/case${caseItem?.navigationId ? '?navId=' + caseItem.navigationId : ''}`" class="text-[#CF1313] hover:underline">返回案例列表</NuxtLink>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { CaseItem } from '~/types'
const route = useRoute()
const id = route.params.id as string
const { fileUrl } = useFileUrl()
const { data: caseItem } = await useFetch<CaseItem | null>(`/api/case/detail?id=${id}`, { key: `case-${id}` })
</script>
<style scoped>
.cms-content :deep(h2),
.cms-content :deep(h3),
.cms-content :deep(h4) { color: #1E2A47; margin-top: 1.5em; margin-bottom: .75em; }
.cms-content :deep(p) { color: #333333; line-height: 1.85; margin-bottom: 1em; }
.cms-content :deep(a) { color: #CF1313; }
.cms-content :deep(img) { border-radius: 12px; }
</style>
@@ -0,0 +1,118 @@
<template>
<div class="min-h-screen bg-[#F4F6FA]">
<div class="bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-16 -right-16 w-72 h-72 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12 lg:py-16 relative z-10">
<nav class="text-xs text-white/60 mb-3" aria-label="面包屑">
<NuxtLink to="/" class="hover:text-white">首页</NuxtLink>
<span class="mx-2">/</span>
<span class="text-white">客户案例</span>
</nav>
<h1 class="text-3xl font-bold text-white mb-2">{{ pageTitle }}</h1>
<p class="text-white/70 max-w-2xl">来自不同行业的真实落地实践</p>
</div>
</div>
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div v-if="pending" class="flex justify-center py-12"><SiteLoading /></div>
<SiteError v-else-if="error" message="获取案例列表失败" />
<div v-else class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
<article v-for="item in cases" :key="item.id" class="group bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB]">
<NuxtLink :to="`/case/${item.id}`" class="block">
<div class="h-56 bg-[#F4F6FA] overflow-hidden flex items-center justify-center">
<img v-if="item.cover" :src="fileUrl(item.cover)" :alt="item.title" class="w-full h-full object-contain group-hover:scale-105 transition-transform duration-500">
<span v-else class="flex items-center justify-center h-full text-[#C9B7A3]">暂无图片</span>
</div>
<div class="p-5">
<h2 class="text-lg font-semibold text-[#1E2A47] mb-2 group-hover:text-[#CF1313] transition-colors">{{ item.title }}</h2>
<p class="text-sm text-[#666666] line-clamp-2">{{ stripHtml(item.summary) }}</p>
<div v-if="item.clientName" class="mt-3 text-xs text-[#666666]">客户{{ item.clientName }}</div>
</div>
</NuxtLink>
</article>
</div>
<!-- 分页 -->
<div v-if="totalPages > 1" class="flex justify-center mt-12">
<nav class="flex items-center gap-2">
<button
v-for="p in totalPages"
:key="p"
class="px-4 py-2 text-sm rounded-lg transition-colors"
:class="p === currentPage ? 'bg-[#CF1313] text-white' : 'bg-white text-[#1E2A47] hover:bg-[#E5E7EB]'"
@click="currentPage = p"
>
{{ p }}
</button>
</nav>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { CaseItem, PageResult } from '~/types'
import { collectDescendantNavIds } from '~/utils/nav-tree'
const { fileUrl } = useFileUrl()
const route = useRoute()
const { allNavigations, fetchSiteInfo } = useSite()
// 确保导航数据已加载(用于栏目标题与分类判定)
await fetchSiteInfo()
// 列表(栏目)入口 /case/{navigationId} 时按分类过滤;/case 根目录展示全部案例
const navigationId = computed<number | undefined>(() => {
const id = route.params.id
return id ? Number(id) : undefined
})
// 聚合:父栏目访问时递归收集自身 + 所有后代栏目 navigationId,交给后端 IN 查询
const categoryIds = computed<string | undefined>(() => {
const ids = collectDescendantNavIds(navigationId.value, allNavigations.value || [])
return ids.length ? ids.join(',') : undefined
})
const currentPage = ref(1)
const limit = 12
const { data, pending, error } = await useFetch<PageResult<CaseItem>>('/api/case/list', {
key: `case-list-${categoryIds.value ?? navigationId.value ?? 'all'}-p${currentPage.value}`,
query: {
page: currentPage,
limit,
...(categoryIds.value
? { categoryIds: categoryIds.value }
: (navigationId.value ? { navigationId: navigationId.value } : {}))
},
watch: [currentPage, categoryIds, navigationId]
})
const cases = computed(() => data.value?.list || [])
const totalCount = computed(() => data.value?.count ?? 0)
const totalPages = computed(() => Math.max(1, Math.ceil(totalCount.value / limit)))
// 切换栏目时回到第 1 页
watch([categoryIds, navigationId], () => {
currentPage.value = 1
})
// 栏目标题:命中导航取导航标题,否则用模块默认名
const pageTitle = computed(() => {
const id = navigationId.value
if (id == null) return '案例展示'
const navs = (allNavigations.value || []) as any[]
const find = (items: any[]): any => {
for (const it of items) {
if (it.navigationId === id) return it
if (it.children?.length) {
const f = find(it.children)
if (f) return f
}
}
return undefined
}
return find(navs)?.title || '案例展示'
})
</script>
@@ -0,0 +1,78 @@
<template>
<div class="min-h-screen bg-[#F4F6FA]">
<div class="bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-16 -right-16 w-72 h-72 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12 lg:py-16 relative z-10">
<nav class="text-xs text-white/60 mb-3" aria-label="面包屑">
<NuxtLink to="/" class="hover:text-white">首页</NuxtLink>
<span class="mx-2">/</span>
<span class="text-white">联系我们</span>
</nav>
<h1 class="text-3xl font-bold text-white mb-2">期待与您相遇</h1>
<p class="text-white/70 max-w-2xl">有任何问题或合作意向欢迎随时与我们联系</p>
</div>
</div>
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="max-w-6xl mx-auto">
<div class="grid lg:grid-cols-2 gap-8">
<!-- 联系信息 -->
<div class="bg-white rounded-2xl p-8 shadow-sm border border-[#E5E7EB]">
<h2 class="text-xl font-bold text-[#1E2A47] mb-6">联系方式</h2>
<div class="space-y-6">
<div class="flex items-start gap-4">
<div class="w-11 h-11 rounded-xl bg-[#FDECEC] flex items-center justify-center flex-shrink-0">
<svg class="w-5 h-5 text-[#CF1313]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" /></svg>
</div>
<div><h3 class="font-medium text-[#1E2A47]">电话咨询</h3><p class="text-[#666666] mt-1">{{ siteInfo?.phone || phone || '400-000-0000' }}</p></div>
</div>
<div class="flex items-start gap-4">
<div class="w-11 h-11 rounded-xl bg-[#FDECEC] flex items-center justify-center flex-shrink-0">
<svg class="w-5 h-5 text-[#CF1313]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /></svg>
</div>
<div><h3 class="font-medium text-[#1E2A47]">电子邮箱</h3><p class="text-[#666666] mt-1">{{ siteInfo?.email || email || 'contact@example.com' }}</p></div>
</div>
<div class="flex items-start gap-4">
<div class="w-11 h-11 rounded-xl bg-[#FDECEC] flex items-center justify-center flex-shrink-0">
<svg class="w-5 h-5 text-[#CF1313]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z" /></svg>
</div>
<div><h3 class="font-medium text-[#1E2A47]">公司地址</h3><p class="text-[#666666] mt-1">{{ siteInfo?.address || address || '请填写公司地址' }}</p></div>
</div>
</div>
<div v-if="wxQrcode" class="mt-8 pt-6 border-t border-[#E5E7EB]">
<h3 class="font-medium text-[#1E2A47] mb-3">微信扫码</h3>
<img :src="wxQrcode" alt="微信二维码" class="w-32 h-32 object-contain bg-[#F4F6FA] rounded-xl p-2">
</div>
</div>
<!-- 在线留言 -->
<div class="bg-white rounded-2xl p-8 shadow-sm border border-[#E5E7EB]">
<h2 class="text-xl font-bold text-[#1E2A47] mb-6">在线留言</h2>
<ContactForm
input-class="w-full px-4 py-2.5 border border-[#E5E7EB] rounded-xl focus:outline-none focus:border-[#CF1313] bg-[#F4F6FA]"
submit-class="w-full px-6 py-3 bg-[#CF1313] text-white font-semibold rounded-xl hover:bg-[#A60E0E] transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
label-class="block text-sm font-medium text-[#1E2A47] mb-1"
:accent="config.themeConfig.primaryColor"
/>
</div>
</div>
</div>
</div>
<PageAttachments
v-if="contactAttachments.length"
:attachments="contactAttachments"
class="mt-10"
/>
</div>
</template>
<script setup lang="ts">
import type { PageDetail, PageAttachment } from '~/types'
import config from '../config'
const { siteInfo, fetchSiteInfo, phone, email, address, wxQrcode } = useSite()
await fetchSiteInfo()
// 联系页附件(CMS「单页管理」按 path=contact 维护)
const { data: contactPage } = await useFetch<PageDetail>('/api/page/detail', { query: { path: 'contact' } })
const contactAttachments = computed<PageAttachment[]>(() => contactPage.value?.attachments || [])
</script>
+214
View File
@@ -0,0 +1,214 @@
<template>
<div>
<HeroSection />
<!-- 关于我们 -->
<section class="py-16 lg:py-20 bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="grid lg:grid-cols-2 gap-12 items-center">
<div class="order-2 lg:order-1 rounded-2xl overflow-hidden shadow-lg" data-reveal data-reveal-delay="120">
<img :src="aboutImg" alt="关于我们" class="w-full h-72 lg:h-80 object-cover">
</div>
<div class="order-1 lg:order-2">
<span class="inline-block px-3 py-1 rounded-full bg-[#F4F6FA] text-[#CF1313] text-sm font-semibold mb-4">关于我们</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-6" data-reveal>专业务实做企业值得信赖的数字化伙伴</h2>
<div class="text-[#666666] leading-relaxed mb-8 space-y-4">
<p v-if="siteInfo?.comments || siteInfo?.content">{{ siteInfo?.comments || siteInfo?.content }}</p>
<template v-else>
<p>我们深耕企业软件与行业信息化领域聚焦客户需求提供从咨询规划产品设计到研发交付运维支持的一站式服务</p>
<p>以稳定可靠的架构与持续优化的服务帮助客户降低数字化门槛提升运营效率实现可持续的业务增长</p>
</template>
</div>
<div class="grid grid-cols-3 gap-4 mb-8">
<div class="text-center p-3 rounded-2xl bg-[#F4F6FA] border border-[#E5E7EB]">
<div class="text-[#CF1313] font-bold text-xl mb-1">技术驱动</div>
<div class="text-xs text-[#666666]">自主研发<br>持续迭代</div>
</div>
<div class="text-center p-3 rounded-2xl bg-[#F4F6FA] border border-[#E5E7EB]">
<div class="text-[#CF1313] font-bold text-xl mb-1">行业沉淀</div>
<div class="text-xs text-[#666666]">多行业<br>落地经验</div>
</div>
<div class="text-center p-3 rounded-2xl bg-[#F4F6FA] border border-[#E5E7EB]">
<div class="text-[#CF1313] font-bold text-xl mb-1">贴身服务</div>
<div class="text-xs text-[#666666]">7×24<br>响应支持</div>
</div>
</div>
<NuxtLink to="/about" class="inline-flex items-center text-[#CF1313] font-semibold hover:text-[#A60E0E] transition-colors">了解更多 <svg class="w-4 h-4 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /></svg></NuxtLink>
</div>
</div>
</div>
</section>
<!-- 核心优势 -->
<section class="py-16 lg:py-20 bg-[#F4F6FA]">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-12">
<span class="inline-block px-3 py-1 rounded-full bg-white text-[#CF1313] text-sm font-semibold mb-4">核心优势</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-4">为什么选择我们</h2>
<p class="text-[#666666] max-w-2xl mx-auto">从技术到服务全链路保障客户的数字化投资回报</p>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-6">
<div v-for="(item, index) in features" :key="item.title"
class="bg-white rounded-2xl p-7 shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB] anim-card group" data-reveal :data-reveal-delay="index * 100">
<div class="w-14 h-14 rounded-xl flex items-center justify-center mb-5 bg-[#FDECEC]">
<svg class="w-7 h-7 text-[#CF1313]" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" :d="item.icon" /></svg>
</div>
<h3 class="text-lg font-semibold text-[#1E2A47] mb-2">{{ item.title }}</h3>
<p class="text-sm text-[#666666] leading-relaxed">{{ item.desc }}</p>
</div>
</div>
</div>
</section>
<!-- 最新动态 -->
<section v-if="latestArticles.length > 0" class="py-16 lg:py-20 bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-end justify-between mb-10">
<div>
<span class="inline-block px-3 py-1 rounded-full bg-[#F4F6FA] text-[#CF1313] text-sm font-semibold mb-3">新闻资讯</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47]">最新动态</h2>
</div>
<NuxtLink v-if="newsNav" :to="newsNav.path || '/article'" class="hidden sm:inline-flex items-center text-[#CF1313] font-semibold hover:text-[#A60E0E] transition-colors">查看更多 </NuxtLink>
</div>
<div class="grid md:grid-cols-3 gap-6">
<article v-for="(item, index) in latestArticles" :key="item.id || item.articleId"
class="bg-[#F4F6FA] rounded-2xl overflow-hidden shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB] anim-card" data-reveal :data-reveal-delay="index * 100">
<NuxtLink :to="`/article/${item.id || item.articleId}`">
<div class="h-48 bg-white flex items-center justify-center overflow-hidden">
<img v-if="item.image || item.cover || item.photo" :src="fileUrl(item.image || item.cover || item.photo || '')" :alt="item.title" class="w-full h-full object-contain">
<span v-else class="text-[#C9B7A3]">暂无图片</span>
</div>
</NuxtLink>
<div class="p-5">
<div class="text-xs text-[#666666] mb-2">{{ formatDate(item.publishTime || item.createTime) }}<span v-if="item.categoryName" class="ml-2 text-[#CF1313]">{{ item.categoryName }}</span></div>
<h3 class="text-lg font-semibold text-[#1E2A47] mb-2 line-clamp-2 hover:text-[#CF1313] transition-colors"><NuxtLink :to="`/article/${item.id || item.articleId}`">{{ item.title }}</NuxtLink></h3>
<p class="text-sm text-[#666666] line-clamp-3">{{ stripHtml(item.summary) }}</p>
</div>
</article>
</div>
</div>
</section>
<!-- 精选产品 -->
<section v-if="products.length > 0" class="py-16 lg:py-20 bg-[#F4F6FA]">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-12">
<span class="inline-block px-3 py-1 rounded-full bg-white text-[#CF1313] text-sm font-semibold mb-4">产品与方案</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-4">精选产品</h2>
<p class="text-[#666666] max-w-2xl mx-auto">面向多行业场景的成熟产品开箱即用灵活扩展</p>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-6">
<article v-for="(item, index) in products" :key="item.id ?? item.productId"
class="bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB] anim-card" data-reveal :data-reveal-delay="index * 100">
<NuxtLink :to="`/product/${item.id ?? item.productId}`">
<div class="h-44 bg-[#F4F6FA] overflow-hidden flex items-center justify-center">
<img v-if="item.cover" :src="fileUrl(item.cover)" :alt="item.productName" class="w-full h-full object-contain">
<span v-else class="text-[#C9B7A3]">暂无图片</span>
</div>
</NuxtLink>
<div class="p-5">
<h3 class="text-lg font-semibold text-[#1E2A47] mb-1 hover:text-[#CF1313] transition-colors">
<NuxtLink :to="`/product/${item.id ?? item.productId}`">{{ item.productName }}</NuxtLink>
</h3>
<p class="text-sm text-[#666666] line-clamp-2">{{ stripHtml(item.description || item.subtitle) }}</p>
</div>
</article>
</div>
<div v-if="productNav" class="text-center mt-10">
<NuxtLink :to="productNav.path || '/product'" class="inline-flex items-center text-[#CF1313] font-semibold hover:text-[#A60E0E] transition-colors">查看全部产品 </NuxtLink>
</div>
</div>
</section>
<!-- 案例展示 -->
<section v-if="cases.length > 0" class="py-16 lg:py-20 bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-12">
<span class="inline-block px-3 py-1 rounded-full bg-[#F4F6FA] text-[#CF1313] text-sm font-semibold mb-4">客户案例</span>
<h2 class="text-2xl sm:text-3xl font-bold text-[#1E2A47] mb-4">成功案例</h2>
<p class="text-[#666666] max-w-2xl mx-auto">来自不同行业的真实落地实践</p>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
<article v-for="(item, index) in cases" :key="item.id"
class="group bg-[#F4F6FA] rounded-2xl overflow-hidden shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB] anim-card" data-reveal :data-reveal-delay="index * 100">
<NuxtLink :to="`/case/${item.id}`" class="block">
<div class="h-52 bg-white overflow-hidden flex items-center justify-center">
<img v-if="item.cover" :src="fileUrl(item.cover)" :alt="item.title" class="w-full h-full object-contain group-hover:scale-105 transition-transform duration-500">
<span v-else class="text-[#C9B7A3]">暂无图片</span>
</div>
<div class="p-5">
<h3 class="text-lg font-semibold text-[#1E2A47] mb-2 group-hover:text-[#CF1313] transition-colors">{{ item.title }}</h3>
<p class="text-sm text-[#666666] line-clamp-2">{{ stripHtml(item.summary) }}</p>
<div v-if="item.clientName" class="mt-3 text-xs text-[#666666]">客户{{ item.clientName }}</div>
</div>
</NuxtLink>
</article>
</div>
<div v-if="caseNav" class="text-center mt-10">
<NuxtLink :to="caseNav.path || '/case'" class="inline-flex items-center text-[#CF1313] font-semibold hover:text-[#A60E0E] transition-colors">查看更多案例 </NuxtLink>
</div>
</div>
</section>
<!-- 联系 CTA -->
<section class="py-16 lg:py-20 bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-20 -right-20 w-80 h-80 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 text-center relative z-10">
<h2 class="text-2xl sm:text-3xl font-bold text-white mb-4" data-reveal>有项目需求或合作意向</h2>
<p class="text-white/80 max-w-2xl mx-auto mb-8" data-reveal data-reveal-delay="100">立即联系我们获取专属方案与产品演示</p>
<button type="button" class="inline-flex items-center justify-center px-8 py-3 bg-[#CF1313] text-white font-semibold rounded-full hover:bg-[#A60E0E] transition-colors shadow-lg" @click="openConsult()">立即咨询</button>
</div>
</section>
</div>
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
import HeroSection from '../components/HeroSection.vue'
import aboutImg from '../assets/about-1.jpg'
import type { CmsNavigation, Article, Product, CaseItem, PageResult, ApiEnvelope } from '~/types'
const { siteInfo, siteName, navigations, fetchSiteInfo } = useSite()
const { fileUrl } = useFileUrl()
const { openConsult } = useConsult()
await fetchSiteInfo()
const newsNav = computed<CmsNavigation | undefined>(() => (navigations.value || []).find((n) => n.model === 'article'))
const productNav = computed<CmsNavigation | undefined>(() => (navigations.value || []).find((n) => n.model === 'product'))
const caseNav = computed<CmsNavigation | undefined>(() => (navigations.value || []).find((n) => n.model === 'case'))
const features = [
{ title: '自主研发', desc: '核心产品自主可控,按需灵活定制与扩展。', icon: 'M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z' },
{ title: '安全稳定', desc: '金融级安全架构,高可用部署与灾备保障。', icon: 'M12 2l8 4v6c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V6l8-4z' },
{ title: '快速交付', desc: '成熟组件沉淀,标准化流程缩短上线周期。', icon: 'M13 10V3L4 14h7v7l9-11h-7z' },
{ title: '持续运维', desc: '7×24 技术支持与版本迭代,长期陪伴成长。', icon: 'M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z' }
]
const latestArticles = ref<Article[]>([])
if (newsNav.value) {
try {
const res = await $fetch<ApiEnvelope<PageResult<Article>> | PageResult<Article>>('/api/article/list', {
query: { navigationId: newsNav.value.navigationId, page: 1, limit: 3 }
})
const envelope = res as ApiEnvelope<PageResult<Article>>
latestArticles.value = envelope?.data?.list || (res as PageResult<Article>)?.list || []
} catch { latestArticles.value = [] }
}
const products = ref<Product[]>([])
try {
const res = await $fetch<ApiEnvelope<PageResult<Product>> | PageResult<Product>>('/api/product/list', { query: { page: 1, limit: 50 } })
const envelope = res as ApiEnvelope<PageResult<Product>>
const list = envelope?.data?.list || (res as PageResult<Product>)?.list || []
const topList = list.filter((p) => (p.top ?? 0) > 0)
products.value = (topList.length > 0 ? topList : list).slice(0, 4)
} catch { products.value = [] }
const cases = ref<CaseItem[]>([])
try {
const res = await $fetch<PageResult<CaseItem>>('/api/case/list', { query: { page: 1, limit: 6 } })
cases.value = res?.list || []
} catch { cases.value = [] }
function formatDate(date?: string) { if (!date) return ''; return dayjs(date).format('YYYY-MM-DD') }
</script>
@@ -0,0 +1,48 @@
<template>
<div class="min-h-screen bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div v-if="article" class="max-w-4xl mx-auto">
<div class="mb-6"><NuxtLink :to="`/article${article?.navigationId ? '?navId=' + article.navigationId : ''}`" class="text-sm text-[#666666] hover:text-[#CF1313]"> 返回新闻列表</NuxtLink></div>
<h1 class="text-3xl sm:text-4xl font-bold text-[#1E2A47] mb-4">{{ article.title }}</h1>
<div class="flex flex-wrap items-center gap-4 text-sm text-[#666666] mb-8 pb-8 border-b border-[#E5E7EB]">
<span v-if="article.categoryName" class="px-3 py-1 bg-[#FDECEC] text-[#CF1313] rounded-full">{{ article.categoryName }}</span>
<span>发布时间{{ formatDate(article.publishTime || article.createTime) }}</span>
<span v-if="article.author">作者{{ article.author }}</span>
</div>
<div v-if="article.image || article.cover" class="rounded-2xl overflow-hidden mb-10 bg-[#F4F6FA] flex items-center justify-center">
<img :src="fileUrl(article.image || article.cover)" :alt="article.title" class="w-full max-h-[420px] object-contain">
</div>
<div class="cms-content">
<RichText :content="article.content" />
<PageAttachments
v-if="article?.files?.length"
:attachments="article.files"
/>
</div>
</div>
<div v-else class="text-center py-20">
<h1 class="text-2xl font-bold text-[#1E2A47] mb-4">文章不存在或已下架</h1>
<NuxtLink :to="`/article${article?.navigationId ? '?navId=' + article.navigationId : ''}`" class="text-[#CF1313] hover:underline">返回新闻列表</NuxtLink>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
import type { Article } from '~/types'
const route = useRoute()
const id = route.params.id as string
const { fileUrl } = useFileUrl()
const { data: article } = await useFetch<Article | null>(`/api/article/detail?id=${id}`, { key: `article-${id}` })
function formatDate(date?: string) { if (!date) return ''; return dayjs(date).format('YYYY-MM-DD') }
</script>
<style scoped>
.cms-content :deep(h2),
.cms-content :deep(h3),
.cms-content :deep(h4) { color: #1E2A47; margin-top: 1.5em; margin-bottom: .75em; }
.cms-content :deep(p) { color: #333333; line-height: 1.85; margin-bottom: 1em; }
.cms-content :deep(a) { color: #CF1313; }
.cms-content :deep(img) { border-radius: 12px; }
</style>
@@ -0,0 +1,113 @@
<template>
<div class="min-h-screen bg-[#F4F6FA]">
<!-- 栏目头图 -->
<div class="bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-16 -right-16 w-72 h-72 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12 lg:py-16 relative z-10">
<nav class="text-xs text-white/60 mb-3" aria-label="面包屑">
<NuxtLink to="/" class="hover:text-white">首页</NuxtLink>
<span class="mx-2">/</span>
<span class="text-white">{{ pageTitle }}</span>
</nav>
<h1 class="text-3xl font-bold text-white mb-2">{{ pageTitle }}</h1>
<p class="text-white/70 max-w-2xl">了解企业最新动态行业洞察与产品资讯</p>
</div>
</div>
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div v-if="pending" class="flex justify-center py-12"><SiteLoading /></div>
<div v-else-if="error" class="text-center py-12"><SiteError message="获取新闻列表失败" /></div>
<template v-else>
<div v-if="articles.length > 0" class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
<article v-for="item in articles" :key="item.id || item.articleId" class="bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB] group">
<NuxtLink :to="`/article/${item.id || item.articleId}`">
<div class="h-52 bg-[#F4F6FA] flex items-center justify-center overflow-hidden">
<img v-if="item.image || item.cover || item.photo" :src="fileUrl(item.image || item.cover || item.photo || '')" :alt="item.title" class="w-full h-full object-contain group-hover:scale-105 transition-transform duration-500">
<span v-else class="text-[#C9B7A3]">暂无图片</span>
</div>
</NuxtLink>
<div class="p-5">
<div class="flex items-center gap-3 text-xs text-[#666666] mb-2">
<span>{{ formatDate(item.publishTime || item.createTime) }}</span>
<span v-if="item.categoryName" class="px-2 py-0.5 rounded-full bg-[#FDECEC] text-[#CF1313]">{{ item.categoryName }}</span>
</div>
<h2 class="text-lg font-semibold text-[#1E2A47] mb-2 line-clamp-2 hover:text-[#CF1313] transition-colors"><NuxtLink :to="`/article/${item.id || item.articleId}`">{{ item.title }}</NuxtLink></h2>
<p class="text-sm text-[#666666] line-clamp-3">{{ stripHtml(item.summary) }}</p>
</div>
</article>
</div>
<div v-else class="text-center py-20">
<svg class="w-16 h-16 mx-auto text-[#C9B7A3] mb-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" /></svg>
<p class="text-[#666666]">暂无新闻内容</p>
</div>
<div v-if="totalPages > 1" class="flex justify-center mt-12">
<nav class="flex items-center gap-2">
<button v-for="p in totalPages" :key="p" class="w-10 h-10 text-sm rounded-full transition-colors" :class="p === currentPage ? 'bg-[#CF1313] text-white' : 'bg-white text-[#1E2A47] border border-[#E5E7EB] hover:bg-[#F4F6FA]'" @click="currentPage = p">{{ p }}</button>
</nav>
</div>
</template>
</div>
</div>
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
import type { Article, PageResult, ApiEnvelope, CmsNavigation } from '~/types'
import { collectDescendantNavIds } from '~/utils/nav-tree'
const { allNavigations, fetchSiteInfo } = useSite()
const { fileUrl } = useFileUrl()
const route = useRoute()
await fetchSiteInfo()
/** navigationId 优先级:route.query.navId > route.params.id > model=article 第一个栏目 */
const navigationId = computed<number | undefined>(() => {
const queryNavId = route.query.navId as string
if (queryNavId) { const num = Number(queryNavId); if (!Number.isNaN(num)) return num }
const routeId = route.params.id as string
if (routeId) { const num = Number(routeId); if (!Number.isNaN(num)) return num }
const navs = allNavigations.value || []
const nav = navs.find((n) => n.model === 'article' || (n.path || '').split('/').filter(Boolean)[0] === 'article')
return nav?.navigationId
})
/** 聚合:父栏目访问时递归收集自身 + 所有后代栏目 navigationId,交给后端 IN 查询 */
const categoryIds = computed<string | undefined>(() => {
const ids = collectDescendantNavIds(navigationId.value, allNavigations.value || [])
return ids.length ? ids.join(',') : undefined
})
const pageTitle = computed(() => {
const navs = allNavigations.value || []
const findNav = (items: CmsNavigation[]): CmsNavigation | undefined => {
for (const item of items) {
if (item.navigationId === navigationId.value) return item
if (item.children?.length) { const f = findNav(item.children); if (f) return f }
}
return undefined
}
if (keywords.value) return `搜索:"${keywords.value}"`
return findNav(navs)?.title || '新闻资讯'
})
/** 搜索关键词(来自 Header 搜索框提交的 ?keywords= */
const keywords = computed(() => ((route.query.keywords as string) || '').trim())
const currentPage = ref(1)
const limit = 12
const { data, pending, error } = await useFetch<ApiEnvelope<PageResult<Article>> | PageResult<Article>>('/api/article/list', {
key: `t6-news-list-${keywords.value || 'all'}-${categoryIds.value ?? navigationId.value ?? 'default'}-p${currentPage.value}`,
query: { categoryIds: keywords.value ? undefined : categoryIds.value, keywords: keywords.value || undefined, page: currentPage, limit },
watch: [currentPage, navigationId, categoryIds, keywords]
})
const articles = computed<Article[]>(() => {
const envelope = data.value as ApiEnvelope<PageResult<Article>>
const direct = data.value as PageResult<Article>
return envelope?.data?.list || direct?.list || []
})
const totalCount = computed(() => {
const envelope = data.value as ApiEnvelope<PageResult<Article>>
const direct = data.value as PageResult<Article>
return envelope?.data?.count || envelope?.data?.total || direct?.count || direct?.total || 0
})
const totalPages = computed(() => Math.ceil(totalCount.value / limit))
watch([navigationId, keywords], () => { currentPage.value = 1 })
function formatDate(date?: string) { if (!date) return ''; return dayjs(date).format('YYYY-MM-DD') }
</script>
+176
View File
@@ -0,0 +1,176 @@
<template>
<div class="min-h-screen bg-white">
<div class="bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-16 -right-16 w-72 h-72 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12 lg:py-16 relative z-10">
<nav class="text-xs text-white/60 mb-3" aria-label="面包屑">
<NuxtLink to="/" class="hover:text-white">首页</NuxtLink>
<span class="mx-2">/</span>
<span class="text-white">{{ pageTitle }}</span>
</nav>
<h1 class="text-3xl font-bold text-white">{{ pageTitle }}</h1>
</div>
</div>
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-16">
<!-- 自身内容 -->
<div v-if="pageData && pageData.hasContent" class="max-w-4xl mx-auto">
<div v-if="pageData.updateTime" class="text-[#666666] text-sm mb-8">更新时间{{ formatDate(pageData.updateTime) }}</div>
<div class="cms-content">
<RichText :content="pageData.content" />
</div>
<PageAttachments
v-if="pageData?.attachments?.length"
:attachments="pageData.attachments"
/>
</div>
<!-- 子栏目聚合列表 -->
<div v-if="childCards.length" class="max-w-5xl mx-auto mt-12">
<h2 class="text-2xl font-bold text-[#1E2A47] mb-8 text-center">子栏目</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<NuxtLink
v-for="p in childCards"
:key="p.navigationId"
:to="`/page/${p.navigationId}`"
class="block p-6 rounded-xl border border-gray-200 hover:shadow-lg hover:border-[#CF1313] transition"
>
<h3 class="text-lg font-semibold text-[#1E2A47] mb-2">{{ p.title }}</h3>
<p class="text-sm text-[#666666] leading-relaxed line-clamp-3">{{ excerpt(p.content) }}</p>
</NuxtLink>
</div>
</div>
<!-- 空状态 -->
<div v-if="!pageData?.hasContent && !childCards.length" class="max-w-4xl mx-auto text-center py-16">
<h1 class="text-2xl font-bold text-[#1E2A47] mb-4">{{ pageTitle }}</h1>
<p class="text-[#666666] mb-2">{{ emptyState.title }}</p>
<p class="text-[#9AA3B5] text-sm mb-6 leading-relaxed">{{ emptyState.desc }}<br>当前导航{{ currentNav?.title || pageTitle }}ID{{ navigationId }}</p>
<NuxtLink to="/" class="text-[#CF1313] hover:underline">返回首页</NuxtLink>
</div>
</div>
</div>
</template>
<script setup lang="ts">
/**
* 模板 6 - 通用 CMS 页面
* 支持两种入口:
* 1. /page/:navigationId → CMS 导航路径(优先)
* 2. /:slug → 传统路径
*
* 父栏目聚合:当当前 page 栏目拥有子栏目时,递归收集其下所有子栏目的单页,
* 以卡片列表形式聚合展示(每个子页卡片链接到 /page/{childNavId} 详情页)。
*/
import dayjs from 'dayjs'
import type { CmsNavigation, PageDetail } from '~/types'
import { collectDescendantNavIds, isParentNavigation } from '~/utils/nav-tree'
interface ChildPage {
pageId?: number
title?: string
path?: string
content?: string
navigationId?: number
image?: string | null
}
const route = useRoute()
const { allNavigations, fetchSiteInfo } = useSite()
await fetchSiteInfo()
/** 从路由获取 navigationId */
const navigationId = computed(() => {
const id = route.params.id as string
if (id) {
const num = Number(id)
if (!Number.isNaN(num)) return num
}
return undefined
})
/** 当前栏目是否为父栏目(拥有子栏目) */
const hasChildren = computed(() => isParentNavigation(navigationId.value, allNavigations.value || []))
/** 递归收集当前栏目自身 + 所有后代 navigationId */
const descendantNavIds = computed(() =>
collectDescendantNavIds(navigationId.value, allNavigations.value || [])
)
/** 从导航中查找当前页面信息(使用 allNavigations,已做标题映射) */
const currentNav = computed<CmsNavigation | undefined>(() => {
if (!navigationId.value) return undefined
const findNav = (items: CmsNavigation[]): CmsNavigation | undefined => {
for (const item of items) {
if (item.navigationId === navigationId.value) return item
if (item.children?.length) {
const found = findNav(item.children)
if (found) return found
}
}
return undefined
}
return findNav(allNavigations.value)
})
/** 获取页面内容 */
const navId = navigationId.value
const pagePath = (() => {
const num = Number(route.params.id)
return Number.isNaN(num) ? (route.params.id as string) : undefined
})()
const { data: pageData } = await useFetch<PageDetail>('/api/page/detail', {
key: `page-${navId ?? pagePath ?? 'default'}`,
query: { navigationId: navId, path: pagePath }
})
/** 父栏目聚合:取其下所有子栏目的单页(不含父栏目自身,避免与顶部内容重复) */
const childPages = ref<ChildPage[]>([])
if (hasChildren.value && descendantNavIds.value.length) {
const { data: childrenData } = await useFetch<{ list: ChildPage[]; count: number }>('/api/page/children', {
key: `page-children-${navId}`,
query: { navigationIds: descendantNavIds.value.join(',') }
})
childPages.value = childrenData.value?.list || []
}
const childCards = computed(() => childPages.value.filter(p => p.navigationId !== navId))
const pageTitle = computed(() => {
return pageData.value?.title || currentNav.value?.title || '页面'
})
/** 空内容兜底文案,按状态区分「未录入」与「接口异常」 */
const emptyState = computed(() => {
const status = pageData.value?.status
if (status === 'error') {
return { title: '内容暂时无法加载', desc: '内容接口暂时不可用,请稍后再试。' }
}
return { title: '内容尚未录入', desc: '该页面正文尚未在 CMS 管理后台配置,请前往 CMS 后台为该导航补充内容。' }
})
/** 富文本正文截取纯文本摘要 */
function excerpt(html?: string, len = 80) {
if (!html) return ''
const text = (html || '')
.replace(/<[^>]+>/g, '')
.replace(/&nbsp;/g, ' ')
.replace(/\s+/g, ' ')
.trim()
return text.length > len ? text.slice(0, len) + '…' : text
}
function formatDate(date?: string) {
if (!date) return ''
return dayjs(date).format('YYYY-MM-DD')
}
</script>
<style scoped>
.cms-content :deep(h2),
.cms-content :deep(h3),
.cms-content :deep(h4) { color: #1E2A47; margin-top: 1.5em; margin-bottom: .75em; }
.cms-content :deep(p) { color: #333333; line-height: 1.85; margin-bottom: 1em; }
.cms-content :deep(a) { color: #CF1313; }
.cms-content :deep(img) { border-radius: 12px; }
</style>
@@ -0,0 +1,51 @@
<template>
<div class="min-h-screen bg-white">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div v-if="product" class="max-w-5xl mx-auto">
<div class="mb-6"><NuxtLink :to="`/product${product?.navigationId ? '?navId=' + product.navigationId : ''}`" class="text-sm text-[#666666] hover:text-[#CF1313]"> 返回产品列表</NuxtLink></div>
<div class="grid lg:grid-cols-2 gap-10 mb-12">
<div class="h-72 lg:h-96 bg-[#F4F6FA] rounded-2xl overflow-hidden flex items-center justify-center">
<img v-if="product.cover" :src="fileUrl(product.cover)" :alt="product.productName" class="w-full h-full object-contain">
<span v-else class="text-[#C9B7A3]">暂无图片</span>
</div>
<div>
<h1 class="text-3xl font-bold text-[#1E2A47] mb-4">{{ product.productName }}</h1>
<p v-if="product.subtitle" class="text-lg text-[#666666] mb-6">{{ product.subtitle }}</p>
<p class="text-[#666666] leading-relaxed mb-6">{{ stripHtml(product.description) }}</p>
<div v-if="product.price" class="text-2xl font-bold text-[#CF1313] mb-6">{{ product.price }}</div>
<button type="button" class="inline-flex items-center justify-center px-8 py-3 bg-[#CF1313] text-white font-semibold rounded-full hover:bg-[#A60E0E] transition-colors"
@click="openConsult({ need: `咨询产品:${product.productName}`, source: 'product-detail' })">立即咨询</button>
</div>
</div>
<div class="border-t border-[#E5E7EB] pt-10">
<h2 class="text-2xl font-bold text-[#1E2A47] mb-6">产品详情</h2>
<div class="cms-content">
<RichText :content="product.content" />
</div>
</div>
</div>
<div v-else class="text-center py-20">
<h1 class="text-2xl font-bold text-[#1E2A47] mb-4">产品不存在或已下架</h1>
<NuxtLink :to="`/product${product?.navigationId ? '?navId=' + product.navigationId : ''}`" class="text-[#CF1313] hover:underline">返回产品列表</NuxtLink>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { Product } from '~/types'
const route = useRoute()
const id = route.params.id as string
const { fileUrl } = useFileUrl()
const { openConsult } = useConsult()
const { data: product } = await useFetch<Product | null>(`/api/product/detail?id=${id}`, { key: `product-${id}` })
</script>
<style scoped>
.cms-content :deep(h2),
.cms-content :deep(h3),
.cms-content :deep(h4) { color: #1E2A47; margin-top: 1.5em; margin-bottom: .75em; }
.cms-content :deep(p) { color: #333333; line-height: 1.85; margin-bottom: 1em; }
.cms-content :deep(a) { color: #CF1313; }
.cms-content :deep(img) { border-radius: 12px; }
</style>
@@ -0,0 +1,99 @@
<template>
<div class="min-h-screen bg-[#F4F6FA]">
<div class="bg-[#1E2A47] relative overflow-hidden">
<div class="absolute -top-16 -right-16 w-72 h-72 rounded-full bg-[#CF1313]/20 blur-3xl" />
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12 lg:py-16 relative z-10">
<nav class="text-xs text-white/60 mb-3" aria-label="面包屑">
<NuxtLink to="/" class="hover:text-white">首页</NuxtLink>
<span class="mx-2">/</span>
<span class="text-white">产品与方案</span>
</nav>
<h1 class="text-3xl font-bold text-white mb-2">产品中心</h1>
<p class="text-white/70 max-w-2xl">面向多行业场景的成熟产品开箱即用灵活扩展</p>
</div>
</div>
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div v-if="pending" class="flex justify-center py-12"><SiteLoading /></div>
<SiteError v-else-if="error" message="获取产品列表失败" />
<div v-else class="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
<article v-for="item in products" :key="item.id ?? item.productId" class="bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-md transition-shadow border border-[#E5E7EB] group">
<div class="h-56 bg-[#F4F6FA] flex items-center justify-center overflow-hidden">
<img v-if="item.cover" :src="fileUrl(item.cover)" :alt="item.productName" class="w-full h-full object-contain group-hover:scale-105 transition-transform duration-500">
<span v-else class="text-[#C9B7A3]">暂无图片</span>
</div>
<div class="p-5">
<h2 class="text-lg font-semibold text-[#1E2A47] mb-2 hover:text-[#CF1313] transition-colors"><NuxtLink :to="`/product/${item.id ?? item.productId}`">{{ item.productName }}</NuxtLink></h2>
<p class="text-sm text-[#666666] line-clamp-2 mb-4">{{ stripHtml(item.description || item.subtitle) }}</p>
<div class="flex items-center justify-between">
<span v-if="item.price" class="text-lg font-bold text-[#CF1313]">{{ item.price }}</span>
<NuxtLink :to="`/product/${item.id ?? item.productId}`" class="text-sm text-[#CF1313] hover:text-[#A60E0E] font-medium">了解详情 </NuxtLink>
</div>
</div>
</article>
</div>
<!-- 分页 -->
<div v-if="totalPages > 1" class="flex justify-center mt-12">
<nav class="flex items-center gap-2">
<button
v-for="p in totalPages"
:key="p"
class="px-4 py-2 text-sm rounded-lg transition-colors"
:class="p === currentPage ? 'bg-[#CF1313] text-white' : 'bg-white text-[#1E2A47] hover:bg-[#E5E7EB]'"
@click="currentPage = p"
>
{{ p }}
</button>
</nav>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { Product, PageResult, ApiEnvelope } from '~/types'
import { collectDescendantNavIds } from '~/utils/nav-tree'
const { fileUrl } = useFileUrl()
const { allNavigations, fetchSiteInfo } = useSite()
const route = useRoute()
await fetchSiteInfo()
const navigationId = computed<number | undefined>(() => {
const qid = route.query.navId as string
if (qid) { const n = Number(qid); if (!Number.isNaN(n)) return n }
const pid = route.params.id as string
if (pid) { const n = Number(pid); if (!Number.isNaN(n)) return n }
return undefined
})
// 聚合:父栏目访问时递归收集自身 + 所有后代栏目 navigationId,交给后端 IN 查询
const categoryIds = computed<string | undefined>(() => {
const ids = collectDescendantNavIds(navigationId.value, allNavigations.value || [])
return ids.length ? ids.join(',') : undefined
})
const currentPage = ref(1)
const limit = 12
const { data, pending, error } = await useFetch<ApiEnvelope<PageResult<Product>> | PageResult<Product>>('/api/product/list', {
key: `t6-product-list-${categoryIds.value ?? navigationId.value ?? 'all'}-p${currentPage.value}`,
query: {
page: currentPage,
limit,
...(categoryIds.value
? { categoryIds: categoryIds.value }
: (navigationId.value ? { navigationId: navigationId.value } : {}))
},
watch: [currentPage, categoryIds, navigationId]
})
const products = computed<Product[]>(() => {
const envelope = data.value as ApiEnvelope<PageResult<Product>>
const direct = data.value as PageResult<Product>
return envelope?.data?.list || direct?.list || []
})
const totalCount = computed(() => {
const envelope = data.value as ApiEnvelope<PageResult<Product>>
const direct = data.value as PageResult<Product>
return envelope?.data?.count || envelope?.data?.total || direct?.count || direct?.total || 0
})
const totalPages = computed(() => Math.max(1, Math.ceil(totalCount.value / limit)))
// 切换栏目时回到第 1 页
watch([categoryIds, navigationId], () => { currentPage.value = 1 })
</script>
+12
View File
@@ -0,0 +1,12 @@
/* 模板 6 主题变量(企业科技风,深蓝 + 中国红) */
[data-template-id="template-06"] {
--t6-primary: #1E2A47; /* 深蓝主色:头部/页脚背景 */
--t6-primary-dark: #16203A; /* 深蓝加深:渐变、悬浮 */
--t6-accent: #CF1313; /* 中国红点缀:按钮、强调 */
--t6-accent-dark: #A60E0E; /* 红色加深 */
--t6-bg: #F4F6FA; /* 浅灰蓝区块背景 */
--t6-text: #333333; /* 正文主色 */
--t6-text-secondary: #666666; /* 次级文字 */
--t6-border: #E5E7EB; /* 边框 */
--t6-footer-bg: #1B2233; /* 页脚背景 */
}