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
@@ -0,0 +1,52 @@
<template>
<section v-if="enabled" class="py-16 lg:py-20 bg-[#0f0f0f]">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-12">
<h2 class="text-2xl sm:text-3xl font-bold text-white mb-4" data-reveal>
{{ title }}
</h2>
<div class="w-16 h-1 bg-[#d4af37] mx-auto mb-4" data-reveal data-reveal-delay="100" />
<p v-if="subtitle" class="text-[#a0a0a0] max-w-2xl mx-auto" data-reveal data-reveal-delay="200">
{{ subtitle }}
</p>
</div>
<div class="grid sm:grid-cols-2 lg:grid-cols-4 gap-6">
<div
v-for="(item, index) in items"
:key="item.title || index"
class="bg-[#1a1a1a] border border-[#333] rounded-xl p-6 hover:border-[#d4af37]/50 transition-all duration-300 anim-card group"
data-reveal
:data-reveal-delay="index * 100"
>
<div
class="w-12 h-12 rounded-lg bg-[#d4af37]/10 flex items-center justify-center mb-4 transition-transform duration-300 group-hover:scale-110"
>
<FeatureIcon :name="item.icon" class="w-6 h-6 text-[#d4af37]" />
</div>
<h3 class="text-lg font-semibold text-white mb-2">{{ item.title }}</h3>
<p class="text-sm text-[#a0a0a0] leading-relaxed">{{ item.desc }}</p>
</div>
</div>
</div>
</section>
</template>
<script setup lang="ts">
/**
* 模板 4 - 核心业务模块(黑金高端风,后台可配置)
* 数据来自 useFeatures(),未配置时回退到人力资源行业默认数据。
*/
import FeatureIcon from '~/components/FeatureIcon.vue'
import { useFeatures } from '~/composables/useFeatures'
import type { FeatureItem } from '~/types'
const defaultFeatures: FeatureItem[] = [
{ title: '人才招聘', desc: '覆盖蓝领、白领、高端人才全渠道招聘,精准匹配企业用工需求。', icon: 'users' },
{ title: '劳务派遣', desc: '合规灵活的派遣方案,降低用工风险,提升组织弹性。', icon: 'user' },
{ title: '人事外包', desc: '入离职、档案、考勤、薪酬全流程外包,让企业聚焦核心业务。', icon: 'document' },
{ title: '薪酬社保', desc: '专业薪税筹划与社保代缴,确保合规准时,省心省力。', icon: 'money' }
]
const { enabled, title, subtitle, items } = useFeatures(defaultFeatures)
</script>
@@ -0,0 +1,90 @@
<template>
<footer class="bg-[#1a1a1a] border-t border-[#333] py-10">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row md:items-start md:justify-between gap-8">
<!-- 品牌 -->
<div class="max-w-xs">
<SiteBrand
link-class="mb-2"
:logo="siteLogo"
:icon="siteIcon"
:name="siteName"
logo-class="h-8 w-auto max-w-[180px] object-contain"
icon-class="h-6 w-auto object-contain"
name-class="font-bold text-[#d4af37] text-lg"
/>
<p v-if="slogan" class="text-sm text-gray-400 mb-2">{{ slogan }}</p>
<p class="text-sm text-gray-400 leading-relaxed">{{ siteInfo?.comments || '专注企业数字化官网建设,提供品牌展示与业务增长一体化解决方案。' }}</p>
</div>
<!-- 快速链接 -->
<nav class="flex flex-col gap-2">
<div class="text-sm font-semibold text-[#d4af37] mb-1">快速链接</div>
<NuxtLink
v-for="link in quickLinks"
:key="link.navigationId || link.path"
:to="getNavLink(link)"
:target="link.target === '_blank' ? '_blank' : undefined"
class="text-sm text-gray-300 hover:text-[#d4af37] transition-colors"
>
{{ link.title }}
</NuxtLink>
</nav>
<!-- 联系方式 -->
<div class="flex flex-col gap-1 text-sm text-gray-300">
<div class="font-semibold text-[#d4af37] mb-1">联系我们</div>
<span v-if="phone">电话{{ phone }}</span>
<span v-if="email">邮箱{{ email }}</span>
<span v-if="address">地址{{ address }}</span>
<span v-if="officialWebsite">官网:<a :href="officialWebsiteUrl" target="_blank" rel="nofollow" class="hover:text-[#d4af37] transition-colors">{{ officialWebsite }}</a></span>
</div>
<!-- 关注我们 -->
<div v-if="wxQrcode || socialLinks.length" class="flex flex-col gap-2">
<div class="font-semibold text-[#d4af37] mb-1">关注我们</div>
<img v-if="wxQrcode" :src="wxQrcode" alt="微信二维码" class="w-28 h-28 object-contain border border-[#333] rounded-lg">
<p v-if="wxQrcode" class="text-xs text-gray-500">{{ siteConfig?.wxQrcodeText || '扫码关注' }}</p>
<a
v-for="link in socialLinks"
:key="link.url"
:href="link.url"
target="_blank"
rel="nofollow"
class="text-sm text-gray-300 hover:text-[#d4af37] transition-colors"
>{{ link.name || link.type }}</a>
</div>
</div>
<div class="mt-8 pt-6 border-t border-[#333] flex flex-wrap items-center justify-between gap-2 text-xs text-gray-500">
<span>{{ copyright || '© ' + new Date().getFullYear() + ' ' + (siteName || '企业官网') }}</span>
<div class="flex items-center gap-3">
<span v-if="icpNo">{{ icpNo }}</span>
<span v-if="siteInfo?.policeNo">{{ siteInfo.policeNo }}</span>
<a
rel="nofollow"
href="https://site.websoft.top"
target="_blank"
class="hover:text-[#d4af37] transition-colors"
>Powered by ·企业官网</a>
</div>
</div>
</div>
</footer>
</template>
<script setup lang="ts">
/**
* 模板 4 - Footer 组件(深色高端风)
* 使用 config 与 useSite 的 bottomNavigationstop!==1 的页脚链接)渲染
*/
import type { CmsNavigation } from '~/types'
const { siteInfo, siteName, siteLogo, siteIcon, siteConfig, bottomNavigations, phone, email, address, copyright, wxQrcode, icpNo, 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,147 @@
<template>
<header class="sticky top-0 z-50 bg-[#1a1a1a] border-b border-[#333]">
<div class="container mx-auto px-4 h-16 flex items-center justify-between">
<!-- Logo -->
<SiteBrand
link-class="flex-shrink-0"
:logo="siteLogo"
:icon="siteIcon"
:name="siteName"
logo-class="h-12 w-auto max-w-[200px] object-contain"
icon-class="h-8 w-auto object-contain"
name-class="font-bold text-[#d4af37] truncate max-w-[160px] sm:max-w-xs"
/>
<!-- 搜索框后台 setting.searchBtn 控制是否显示 -->
<SiteSearchBox v-if="showHeaderSearch" variant="dark" accent="#d4af37" class="hidden lg:flex items-center ml-8 mr-auto" />
<!-- 桌面端导航 -->
<nav class="hidden md:flex items-center gap-6 text-base">
<template v-for="item in navItems" :key="item.navigationId || item.path">
<!-- 有子菜单 -->
<div v-if="item.children && item.children.length > 0" class="relative group">
<button class="font-medium text-gray-200 hover:text-[#d4af37] transition-colors flex items-center gap-1">
{{ item.title }}
<svg class="w-4 h-4" 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">
<div class="bg-[#222] rounded-lg shadow-lg border border-[#333] py-2 min-w-[160px]">
<NuxtLink
v-for="child in item.children"
:key="child.navigationId"
:to="getChildPath(child)"
class="block px-4 py-2 text-[15px] text-gray-200 hover:text-[#d4af37] hover:bg-[#333] transition-colors whitespace-nowrap"
>
{{ child.title }}
</NuxtLink>
</div>
</div>
</div>
<!-- 无子菜单 -->
<NuxtLink
v-else
:to="getNavLink(item)"
:target="item.target === '_blank' ? '_blank' : undefined"
class="font-medium text-gray-200 hover:text-[#d4af37] transition-colors"
active-class="text-[#d4af37]"
>
{{ item.title }}
</NuxtLink>
</template>
</nav>
<!-- CTA -->
<div class="hidden md:block ml-6">
<NuxtLink
to="/contact"
class="inline-flex items-center justify-center px-4 py-2 bg-[#d4af37] text-[#1a1a1a] text-base font-semibold rounded-full hover:bg-[#e6c35a] transition-colors"
>
在线咨询
</NuxtLink>
</div>
<!-- 移动端菜单按钮 -->
<button
class="md:hidden p-2 rounded-lg hover:bg-[#333]"
@click="mobileMenuOpen = !mobileMenuOpen"
>
<svg v-if="!mobileMenuOpen" class="w-6 h-6 text-[#d4af37]" 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-[#d4af37]" 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
v-if="mobileMenuOpen"
class="md:hidden bg-[#1a1a1a] border-t border-[#333]"
>
<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-4 py-3 text-base font-semibold text-[#d4af37]">
{{ item.title }}
</div>
<NuxtLink
v-for="child in item.children"
:key="child.navigationId"
:to="getChildPath(child)"
class="block px-8 py-2 text-sm text-gray-300 hover:text-[#d4af37] hover:bg-[#333] 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-4 py-3 text-base font-medium text-gray-200 hover:text-[#d4af37] hover:bg-[#333] rounded-lg transition-colors"
active-class="text-[#d4af37] bg-[#333]"
@click="mobileMenuOpen = false"
>
{{ item.title }}
</NuxtLink>
</template>
<NuxtLink
to="/contact"
class="block px-4 py-3 mt-2 text-center bg-[#d4af37] text-[#1a1a1a] font-semibold rounded-lg hover:bg-[#e6c35a] transition-colors"
@click="mobileMenuOpen = false"
>
在线咨询
</NuxtLink>
</div>
</div>
</header>
</template>
<script setup lang="ts">
/**
* 模板 4 - Header 组件(深色高端风)
* 使用 useSite 的 navigations(合并 topNavs + bottomNavs,过滤 top===1)渲染导航菜单
*/
import type { CmsNavigation } from '~/types'
const { siteInfo, siteName, siteLogo, siteIcon, navigations, showHeaderSearch, fetchSiteInfo } = useSite()
const mobileMenuOpen = ref(false)
/** 子导航链接统一走 app/utils 的 getNavLink(自动避免 /page/4598?navId=4598 冗余拼接) */
function getChildPath(child: CmsNavigation): string {
return getNavLink(child)
}
// 获取站点信息(含导航数据)
await fetchSiteInfo()
/** 导航项(从 useSite 的 navigations 获取,已合并 topNavs + bottomNavs 并过滤 top===1 */
const navItems = computed<CmsNavigation[]>(() => {
return navigations.value || []
})
</script>
@@ -0,0 +1,270 @@
<template>
<section
class="relative overflow-hidden"
:class="bannerMode ? 'group text-white' : 'bg-[#0f0f0f] text-white'"
>
<!-- 模式 B有轮播图 全宽轮播背景 + 文案叠加 -->
<template v-if="bannerMode">
<div class="relative w-full min-h-[520px] lg:min-h-[600px] flex items-center">
<!-- 轮播图背景 -->
<div class="absolute inset-0">
<div
v-for="(b, i) in banners"
:key="b.id || i"
class="absolute inset-0 w-full h-full transition-opacity duration-700 ease-in-out"
:class="i === currentBannerIndex ? 'opacity-100 z-10' : 'opacity-0 z-0'"
>
<img
:src="bannerImg(b)"
:alt="b.title || ''"
class="w-full h-full object-cover"
>
<!-- 黑色遮罩保证文案可读 -->
<div class="absolute inset-0 bg-gradient-to-r from-black/85 via-black/60 to-black/30" />
</div>
</div>
<!-- 文案内容 -->
<div class="relative z-20 w-full">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-20 lg:py-28">
<div class="max-w-2xl">
<h1
class="text-3xl sm:text-4xl lg:text-5xl font-bold leading-tight mb-6"
data-reveal
>
{{ heroTitle }}
</h1>
<p
class="text-base sm:text-lg text-gray-200 mb-8 leading-relaxed"
data-reveal
data-reveal-delay="100"
>
{{ heroSubtitle }}
</p>
<div class="flex flex-wrap gap-4" data-reveal data-reveal-delay="200">
<button
type="button"
class="inline-flex items-center justify-center px-6 py-3 bg-[#d4af37] text-[#1a1a1a] font-semibold rounded hover:bg-[#e6c35a] transition-colors"
@click="openConsult()"
>
立即咨询
</button>
<NuxtLink
v-if="newsNav"
:to="newsNav.path || '/article'"
class="inline-flex items-center justify-center px-6 py-3 border border-[#d4af37] text-[#d4af37] font-semibold rounded hover:bg-[#d4af37]/10 transition-colors"
>
了解更多
</NuxtLink>
</div>
</div>
</div>
</div>
<!-- 左右箭头 -->
<button
v-if="banners.length > 1"
type="button"
aria-label="上一张"
class="absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-black/40 hover:bg-black/60 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition z-30"
@click="prev"
>
<svg class="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
</svg>
</button>
<button
v-if="banners.length > 1"
type="button"
aria-label="下一张"
class="absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-black/40 hover:bg-black/60 text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition z-30"
@click="next"
>
<svg class="w-5 h-5" 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>
</button>
<!-- 指示点 -->
<div
v-if="banners.length > 1"
class="absolute bottom-6 left-1/2 -translate-x-1/2 flex gap-2 z-30"
>
<button
v-for="(b, i) in banners"
:key="'dot-' + (b.id || i)"
type="button"
:aria-label="'切换到第 ' + (i + 1) + ' '"
class="w-2.5 h-2.5 rounded-full transition"
:class="i === currentBannerIndex ? 'bg-[#d4af37] scale-110' : 'bg-white/50 hover:bg-white/80'"
@click="goTo(i)"
/>
</div>
</div>
</template>
<!-- 模式 A无轮播图 黑金背景 + 文案 + 右侧特性卡片 -->
<template v-else>
<!-- 装饰光晕 -->
<div class="absolute top-0 right-0 w-[500px] h-[500px] bg-[#d4af37]/10 rounded-full blur-[120px] -translate-y-1/3 translate-x-1/4" />
<div class="absolute bottom-0 left-0 w-[400px] h-[400px] bg-[#d4af37]/5 rounded-full blur-[100px] translate-y-1/3 -translate-x-1/4" />
<div class="relative z-10 container mx-auto px-4 sm:px-6 lg:px-8 py-20 lg:py-28">
<div class="grid lg:grid-cols-2 gap-12 lg:gap-16 items-center">
<!-- 左侧文案 -->
<div class="max-w-2xl">
<div class="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-[#d4af37]/30 bg-[#d4af37]/10 text-[#d4af37] text-sm mb-6" data-reveal>
<span class="w-1.5 h-1.5 rounded-full bg-[#d4af37]" />
专业 · 高效 · 可信赖
</div>
<h1 class="text-3xl sm:text-4xl lg:text-5xl font-bold leading-tight mb-6" data-reveal data-reveal-delay="100">
{{ heroTitle }}
</h1>
<p class="text-base sm:text-lg text-gray-300 mb-8 leading-relaxed" data-reveal data-reveal-delay="200">
{{ heroSubtitle }}
</p>
<div class="flex flex-wrap gap-4" data-reveal data-reveal-delay="300">
<button
type="button"
class="inline-flex items-center justify-center px-6 py-3 bg-[#d4af37] text-[#1a1a1a] font-semibold rounded hover:bg-[#e6c35a] transition-colors"
@click="openConsult()"
>
立即咨询
</button>
<NuxtLink
v-if="newsNav"
:to="newsNav.path || '/article'"
class="inline-flex items-center justify-center px-6 py-3 border border-[#d4af37] text-[#d4af37] font-semibold rounded hover:bg-[#d4af37]/10 transition-colors"
>
了解更多
</NuxtLink>
</div>
</div>
<!-- 右侧特性卡片 -->
<div class="grid sm:grid-cols-2 gap-4" data-reveal data-reveal-delay="400">
<div
v-for="(f, i) in displayFeatures"
:key="i"
class="bg-[#1a1a1a]/80 border border-[#333] rounded-lg p-5 hover:border-[#d4af37]/50 transition-colors"
:data-reveal-delay="400 + i * 100"
>
<div class="w-10 h-10 rounded-lg bg-[#d4af37]/10 flex items-center justify-center mb-3">
<svg class="w-5 h-5 text-[#d4af37]" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
</svg>
</div>
<p class="text-white font-medium">{{ f }}</p>
</div>
</div>
</div>
</div>
</template>
</section>
</template>
<script setup lang="ts">
/**
* 模板 4 - Hero 主视觉区(黑金高端风)
*
* 双模式:
* - 有轮播图(/api/banner 返回 ≥1 张):全宽轮播背景 + 文案叠加 + 左右箭头/指示点;
* - 无轮播图:黑金背景 + 左侧文案/CTA + 右侧 4 个特性卡片。
*/
import type { CmsNavigation, CmsBanner, ApiEnvelope, PageResult } from '~/types'
import { ensureFullUrl } from '~/utils/image'
import { getBannerLink } from '~/utils'
const { siteInfo, siteName, navigations, fetchSiteInfo } = useSite()
const { openConsult } = useConsult()
await fetchSiteInfo()
/** 轮播图数据 */
const { data: bannerRes } = await useFetch<ApiEnvelope<PageResult<CmsBanner>> | PageResult<CmsBanner>>('/api/banner', {
query: { position: 'home_slider' }
})
const banners = computed<CmsBanner[]>(() => {
const d = bannerRes.value as (ApiEnvelope<PageResult<CmsBanner>> | PageResult<CmsBanner>) | null
if (!d) return []
const list = ((d as ApiEnvelope<PageResult<CmsBanner>>)?.data?.list
?? (d as PageResult<CmsBanner>)?.list
?? []) as CmsBanner[]
return list
.filter((b) => hasImage(b) && b.deleted !== 1 && b.status !== 2)
.sort((a, b) => (a.sortNum ?? 0) - (b.sortNum ?? 0))
})
const bannerMode = computed(() => banners.value.length > 0)
const currentBannerIndex = ref(0)
let bannerTimer: ReturnType<typeof setInterval> | null = null
function startAuto() {
if (banners.value.length > 1) {
bannerTimer = setInterval(() => {
currentBannerIndex.value = (currentBannerIndex.value + 1) % banners.value.length
}, 5000)
}
}
function stopAuto() {
if (bannerTimer) { clearInterval(bannerTimer); bannerTimer = null }
}
onMounted(() => { startAuto() })
onBeforeUnmount(() => { stopAuto() })
function prev() {
const n = banners.value.length
currentBannerIndex.value = (currentBannerIndex.value - 1 + n) % n
}
function next() {
const n = banners.value.length
currentBannerIndex.value = (currentBannerIndex.value + 1) % n
}
function goTo(i: number) {
currentBannerIndex.value = i
}
function bannerImg(b: CmsBanner): string {
const raw = ensureFullUrl(b.image || b.imageUrl || b.pic || b.url || '')
return raw.replace(/resize,w_\d+/, 'resize,w_1920')
}
function bannerLink(b: CmsBanner): string {
return getBannerLink(b)
}
function hasImage(b: CmsBanner): boolean {
return !!(b.image || b.imageUrl || b.pic || b.url)
}
const heroTitle = computed(() => {
return siteName.value ? `${siteName.value} · 让企业人才管理更简单` : '专业人力资源服务伙伴'
})
const heroSubtitle = computed(() => {
return siteInfo.value?.comments
|| '提供人才招聘、劳务派遣、人事外包、薪酬社保等一站式人力资源解决方案,助力企业降本增效、专注核心业务。'
})
const newsNav = computed<CmsNavigation | undefined>(() => {
const navs = navigations.value || []
return navs.find((n) => n.model === 'article')
})
const defaultFeatures = [
'人才招聘与配置',
'劳务派遣外包',
'薪酬社保代缴',
'企业培训咨询'
]
const { heroFeatures } = useFeatures()
const displayFeatures = computed<string[]>(() => {
const cfg = heroFeatures.value
if (cfg && cfg.length > 0) return cfg.slice(0, 4)
return defaultFeatures
})
</script>