feat(app): 添加多模板关于我们页面及相关路由和404页面
- 新增404页面,优化未找到页面体验,避免被搜索引擎索引 - 增加文件代理接口,隐藏真实文件服务器地址,支持文件请求代理 - 实现/article、/case、/product及/page动态路由兼容列表与详情展示 - 添加动态CMS页面兼容入口处理旧式路径,统一路由与SEO设置 - 新增模板1、模板7、模板2、模板3关于我们页面,实现多模板支持 - 模板增强支持CMS单页内容加载及SEO信息动态设置 - 配置环境变量及Git忽略文件规则辅助开发和构建环境管理
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<div class="min-h-screen py-16 bg-[#faf6ef]">
|
||||
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="max-w-6xl mx-auto">
|
||||
<div class="text-center mb-12">
|
||||
<span class="inline-block px-3 py-1 rounded-full bg-[#f0e6d8] text-[#8b6f47] text-sm font-semibold mb-4">联系我们</span>
|
||||
<h1 class="text-3xl font-bold text-[#4a3f35] mb-4">期待与您相遇</h1>
|
||||
<p class="text-[#8a7d6b] max-w-2xl mx-auto">有任何问题或合作意向,欢迎随时与我们联系</p>
|
||||
</div>
|
||||
|
||||
<div class="grid lg:grid-cols-2 gap-10">
|
||||
<!-- 联系信息 -->
|
||||
<div class="bg-white rounded-3xl p-8 shadow-sm border border-[#e8e0d4]">
|
||||
<h2 class="text-xl font-bold text-[#4a3f35] mb-6">联系方式</h2>
|
||||
<div class="space-y-6">
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="w-10 h-10 rounded-xl bg-[#f0e6d8] flex items-center justify-center flex-shrink-0">
|
||||
<svg class="w-5 h-5 text-[#8b6f47]" 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-[#4a3f35]">电话咨询</h3>
|
||||
<p class="text-[#8a7d6b] mt-1">{{ siteInfo?.phone || '400-000-0000' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="w-10 h-10 rounded-xl bg-[#f0e6d8] flex items-center justify-center flex-shrink-0">
|
||||
<svg class="w-5 h-5 text-[#8b6f47]" 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-[#4a3f35]">电子邮箱</h3>
|
||||
<p class="text-[#8a7d6b] mt-1">{{ siteInfo?.email || 'contact@example.com' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-start gap-4">
|
||||
<div class="w-10 h-10 rounded-xl bg-[#f0e6d8] flex items-center justify-center flex-shrink-0">
|
||||
<svg class="w-5 h-5 text-[#8b6f47]" 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-[#4a3f35]">公司地址</h3>
|
||||
<p class="text-[#8a7d6b] mt-1">{{ siteInfo?.address || '请填写公司地址' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 在线表单 -->
|
||||
<div class="bg-white rounded-3xl p-8 shadow-sm border border-[#e8e0d4]">
|
||||
<h2 class="text-xl font-bold text-[#4a3f35] mb-6">在线留言</h2>
|
||||
<ContactForm
|
||||
input-class="w-full px-4 py-2.5 border border-[#e8e0d4] rounded-xl focus:outline-none focus:border-[#8b6f47] bg-[#faf6ef] placeholder-[#b9a892]"
|
||||
submit-class="w-full px-6 py-3 bg-[#8b6f47] text-white font-semibold rounded-xl hover:bg-[#6f5638] transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
label-class="block text-sm font-medium text-[#4a3f35] 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'
|
||||
/**
|
||||
* 模板 3 - 联系我们页(暖米轻商风)
|
||||
*/
|
||||
const { siteInfo, fetchSiteInfo } = 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>
|
||||
Reference in New Issue
Block a user