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,51 @@
|
||||
<template>
|
||||
<section v-if="enabled" class="py-16 lg:py-20 bg-[#FFF8F0]">
|
||||
<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-[#FFF1E6] text-[#E5472E] text-sm font-semibold mb-4">我们的承诺</span>
|
||||
<h2 class="text-2xl sm:text-3xl font-bold text-[#33291F] mb-4">{{ title }}</h2>
|
||||
<p v-if="subtitle" class="text-[#8A7B6B] max-w-2xl mx-auto">
|
||||
{{ 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-white rounded-3xl p-7 shadow-sm hover:shadow-md transition-shadow border border-[#F0E2D5] anim-card group"
|
||||
data-reveal
|
||||
:data-reveal-delay="index * 100"
|
||||
>
|
||||
<div
|
||||
class="w-14 h-14 rounded-2xl bg-[#FFF1E6] flex items-center justify-center mb-5 transition-transform duration-300 group-hover:scale-110"
|
||||
>
|
||||
<FeatureIcon :name="item.icon" class="w-7 h-7 text-[#E5472E]" />
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-[#33291F] mb-2">{{ item.title }}</h3>
|
||||
<p class="text-sm text-[#8A7B6B] leading-relaxed">{{ item.desc }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 模板 5 - 品牌承诺模块(温暖自然食品风,后台可配置)
|
||||
* 数据来自 useFeatures(),未配置时回退到下方默认值。
|
||||
* 图标统一使用食品主题暖色(模板视觉标识),颜色不随后台配置变化。
|
||||
*/
|
||||
import FeatureIcon from '~/components/FeatureIcon.vue'
|
||||
import { useFeatures } from '~/composables/useFeatures'
|
||||
import type { FeatureItem } from '~/types'
|
||||
|
||||
const defaultFeatures: FeatureItem[] = [
|
||||
{ title: '源头甄选', desc: '深入全球优质产区,严选当季好原料,从源头把控品质。', icon: 'globe' },
|
||||
{ title: '新鲜锁鲜', desc: '掌握关键保鲜工艺,锁住原料的本真营养与风味。', icon: 'cloud' },
|
||||
{ title: '严苛质检', desc: '全程质量管控体系,每一批产品都经过严格检测。', icon: 'check' },
|
||||
{ title: '营养健康', desc: '科学均衡配方,让美味与营养兼得,吃得开心更安心。', icon: 'heart' }
|
||||
]
|
||||
|
||||
const { enabled, title, subtitle, items } = useFeatures(defaultFeatures)
|
||||
</script>
|
||||
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<footer class="bg-[#2E2620] text-[#E9DFD3]">
|
||||
<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"
|
||||
default-name="品牌官网"
|
||||
logo-class="h-8 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-8 h-8 rounded-lg bg-[#E5472E] flex items-center justify-center">
|
||||
<svg class="w-5 h-5 text-white" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 2C7 2 3 6 3 11c0 5 4 9 9 9s9-4 9-9c0-5-4-9-9-9zm0 16c-3.9 0-7-3-7-7 0-2.8 1.6-5.2 4-6.4.2 1.6 1.1 3 2.5 3.8-1-.7-1.6-1.9-1.6-3.1 2.3.3 4.1 2.1 4.4 4.4.8.7 1.3 1.7 1.3 2.9 0 .6-.1 1.2-.4 1.7 1.4-.7 2.4-2.1 2.4-3.7 1.8 1.2 3 3.3 3 5.4 0 4-3.1 7-7 7z" />
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
</SiteBrand>
|
||||
<p v-if="slogan" class="text-sm text-[#B9AC9C] mb-3">{{ slogan }}</p>
|
||||
<p class="text-sm text-[#B9AC9C] 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-[#B9AC9C] hover:text-[#F2A900] 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-[#B9AC9C]">
|
||||
<li v-if="phone">
|
||||
<span class="text-[#8A7B6B]">电话:</span>{{ phone }}
|
||||
</li>
|
||||
<li v-if="email">
|
||||
<span class="text-[#8A7B6B]">邮箱:</span>{{ email }}
|
||||
</li>
|
||||
<li v-if="address" class="leading-relaxed">
|
||||
<span class="text-[#8A7B6B]">地址:</span>{{ address }}
|
||||
</li>
|
||||
<li v-if="officialWebsite">
|
||||
<span class="text-[#8A7B6B]">官网:</span>
|
||||
<a :href="officialWebsiteUrl" target="_blank" rel="nofollow" class="hover:text-[#F2A900] 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-[#8A7B6B] 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-[#B9AC9C] hover:text-[#F2A900] transition-colors"
|
||||
>
|
||||
{{ link.name || link.type }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border-t border-[#463B30] mt-12 pt-8 flex flex-col sm:flex-row items-center justify-between gap-4">
|
||||
<p class="text-sm text-[#8A7B6B]">
|
||||
{{ copyright || `© ${new Date().getFullYear()} ${siteName || '品牌官网'} 版权所有` }}
|
||||
</p>
|
||||
<div class="flex items-center gap-4">
|
||||
<p v-if="icpNo" class="text-sm text-[#8A7B6B]">
|
||||
{{ icpNo }}
|
||||
</p>
|
||||
<p v-if="siteInfo?.policeNo" class="text-sm text-[#8A7B6B]">
|
||||
{{ siteInfo.policeNo }}
|
||||
</p>
|
||||
<div class="flex items-center gap-2 text-xs">
|
||||
<span class="text-[#8A7B6B]">Powered by</span>
|
||||
<a
|
||||
rel="nofollow"
|
||||
href="https://site.websoft.top"
|
||||
target="_blank"
|
||||
class="text-[#8A7B6B] hover:text-[#F2A900] transition-colors"
|
||||
>云·企业官网</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 模板 5 - Footer 组件(温暖自然食品风)
|
||||
* 使用 config 与 useSite 的 bottomNavigations(top!==1 的页脚链接)渲染
|
||||
*/
|
||||
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,171 @@
|
||||
<template>
|
||||
<!-- 顶部数据条(满坛记品牌数据;具体数值请替换为真实数据) -->
|
||||
<div class="bg-[#2E2620] text-[#E9DFD3] text-xs">
|
||||
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="flex items-center justify-center sm:justify-end gap-x-5 gap-y-1 py-1.5">
|
||||
<span v-for="stat in topStats" :key="stat" class="flex items-center gap-1.5">
|
||||
<svg class="w-3.5 h-3.5 text-[#F2A900]" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 2l2.4 7.4H22l-6 4.6 2.3 7.4-6.3-4.8L5.7 21.4 8 14 2 9.4h7.6z" />
|
||||
</svg>
|
||||
{{ stat }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<header class="sticky top-0 z-50 bg-[#FFF8F0]/95 backdrop-blur-sm border-b border-[#F0E2D5]">
|
||||
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="flex items-center justify-between h-16 lg:h-20">
|
||||
<!-- Logo -->
|
||||
<SiteBrand
|
||||
link-class="flex-shrink-0"
|
||||
:logo="siteLogo"
|
||||
:icon="siteIcon"
|
||||
:name="siteName"
|
||||
default-name="品牌官网"
|
||||
logo-class="h-12 w-auto max-w-[200px] object-contain"
|
||||
icon-class="h-8 w-auto object-contain"
|
||||
name-class="text-lg font-bold text-[#33291F] truncate max-w-[160px] sm:max-w-xs"
|
||||
>
|
||||
<template #fallback-icon>
|
||||
<div class="w-9 h-9 rounded-xl bg-[#E5472E] flex items-center justify-center">
|
||||
<svg class="w-5 h-5 text-white" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 2C7 2 3 6 3 11c0 5 4 9 9 9s9-4 9-9c0-5-4-9-9-9zm0 16c-3.9 0-7-3-7-7 0-2.8 1.6-5.2 4-6.4.2 1.6 1.1 3 2.5 3.8-1-.7-1.6-1.9-1.6-3.1 2.3.3 4.1 2.1 4.4 4.4.8.7 1.3 1.7 1.3 2.9 0 .6-.1 1.2-.4 1.7 1.4-.7 2.4-2.1 2.4-3.7 1.8 1.2 3 3.3 3 5.4 0 4-3.1 7-7 7z" />
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
</SiteBrand>
|
||||
|
||||
<!-- 搜索框(后台 setting.searchBtn 控制是否显示) -->
|
||||
<SiteSearchBox v-if="showHeaderSearch" variant="light" accent="#E5472E" class="hidden lg:flex items-center ml-8 mr-auto" />
|
||||
|
||||
<!-- 桌面端导航 -->
|
||||
<nav class="hidden lg:flex items-center gap-8">
|
||||
<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="text-base font-medium text-[#33291F] hover:text-[#E5472E] 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-1/2 -translate-x-1/2 top-full pt-3 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all">
|
||||
<div
|
||||
class="bg-white rounded-2xl shadow-xl border border-[#F0E2D5] py-2"
|
||||
:class="item.children.length > 4 ? 'grid grid-cols-2 gap-x-2 px-2 min-w-[340px]' : 'min-w-[170px]'"
|
||||
>
|
||||
<NuxtLink
|
||||
v-for="child in item.children"
|
||||
:key="child.navigationId"
|
||||
:to="getChildPath(child)"
|
||||
class="block px-4 py-2 text-[15px] text-[#33291F] hover:text-[#E5472E] hover:bg-[#FFF1E6] transition-colors whitespace-nowrap"
|
||||
>
|
||||
{{ child.title }}
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<NuxtLink
|
||||
v-else
|
||||
:to="getNavLink(item)"
|
||||
:target="item.target === '_blank' ? '_blank' : undefined"
|
||||
class="text-base font-medium text-[#33291F] hover:text-[#E5472E] transition-colors"
|
||||
active-class="text-[#E5472E]"
|
||||
>
|
||||
{{ item.title }}
|
||||
</NuxtLink>
|
||||
</template>
|
||||
</nav>
|
||||
|
||||
<!-- CTA -->
|
||||
<div class="hidden lg:block mx-10">
|
||||
<NuxtLink
|
||||
to="/contact"
|
||||
class="inline-flex items-center justify-center px-5 py-2 bg-[#E5472E] text-white text-base font-semibold rounded-full hover:bg-[#C53A22] transition-colors shadow-sm"
|
||||
>
|
||||
立即咨询
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<!-- 移动端菜单按钮 -->
|
||||
<button
|
||||
class="lg:hidden p-2 rounded-lg hover:bg-[#F0E2D5]"
|
||||
@click="mobileMenuOpen = !mobileMenuOpen"
|
||||
>
|
||||
<svg v-if="!mobileMenuOpen" class="w-6 h-6 text-[#33291F]" 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-[#33291F]" 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-[#FFF8F0] border-t border-[#F0E2D5]">
|
||||
<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-[#33291F]">
|
||||
{{ 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-[#8A7B6B] hover:text-[#E5472E] hover:bg-[#FFF1E6] rounded-xl 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-[#33291F] hover:text-[#E5472E] hover:bg-[#FFF1E6] rounded-xl transition-colors"
|
||||
active-class="text-[#E5472E] bg-[#FFF1E6]"
|
||||
@click="mobileMenuOpen = false"
|
||||
>
|
||||
{{ item.title }}
|
||||
</NuxtLink>
|
||||
</template>
|
||||
<NuxtLink
|
||||
to="/contact"
|
||||
class="block px-4 py-3 mt-2 text-center bg-[#E5472E] text-white font-semibold rounded-xl hover:bg-[#C53A22] transition-colors"
|
||||
@click="mobileMenuOpen = false"
|
||||
>
|
||||
立即咨询
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 模板 5 - 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)
|
||||
|
||||
/** 顶部数据条(满坛记品牌;可按站点实际数据替换为接口字段) */
|
||||
const topStats = ['全球11大工厂', '远销近70个国家地区', '品牌价值568.72亿']
|
||||
|
||||
/** 子导航链接统一走 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,108 @@
|
||||
<template>
|
||||
<section class="relative overflow-hidden text-white">
|
||||
<!-- 背景图 -->
|
||||
<img
|
||||
:src="heroBanner"
|
||||
alt=""
|
||||
class="absolute inset-0 w-full h-full object-cover"
|
||||
>
|
||||
<!-- 品牌渐变叠加,保证文字可读性与主题色 -->
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-[#E5472E]/85 via-[#EE6A22]/40 to-[#F2A900]/5" />
|
||||
<!-- 装饰光斑(缓慢浮动,增加首屏活力) -->
|
||||
<div class="anim-blob absolute -top-24 -right-24 w-96 h-96 rounded-full bg-white/10 blur-3xl" />
|
||||
<div class="anim-blob anim-blob--2 absolute -bottom-32 -left-20 w-96 h-96 rounded-full bg-[#5BA53A]/20 blur-3xl" />
|
||||
<div class="absolute top-1/3 left-10 w-3 h-3 rounded-full bg-white/40" />
|
||||
<div class="absolute top-1/2 right-1/4 w-2 h-2 rounded-full bg-white/30" />
|
||||
|
||||
<div class="container mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
|
||||
<div class="grid lg:grid-cols-2 gap-12 items-center py-20 lg:py-28">
|
||||
<div class="max-w-2xl">
|
||||
<span class="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/15 text-sm font-medium mb-6" data-reveal>
|
||||
<span class="w-2 h-2 rounded-full bg-[#5BA53A]" />
|
||||
新鲜 · 自然 · 健康美味
|
||||
</span>
|
||||
<h1 class="text-3xl sm:text-4xl lg:text-5xl font-extrabold leading-tight mb-6" data-reveal>
|
||||
{{ heroTitle }}
|
||||
</h1>
|
||||
<p class="text-base sm:text-lg text-white/90 mb-8 leading-relaxed" 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-7 py-3 bg-white text-[#E5472E] font-semibold rounded-full hover:bg-[#FFF1E6] transition-colors shadow-lg anim-shimmer"
|
||||
@click="openConsult()"
|
||||
>
|
||||
免费咨询
|
||||
</button>
|
||||
<NuxtLink
|
||||
v-if="newsNav"
|
||||
:to="newsNav.path || '/news'"
|
||||
class="inline-flex items-center justify-center px-7 py-3 border-2 border-white text-white font-semibold rounded-full hover:bg-white/10 transition-colors"
|
||||
>
|
||||
查看动态
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hidden lg:flex justify-center" data-reveal data-reveal-delay="360">
|
||||
<div class="relative w-full max-w-md">
|
||||
<div class="absolute inset-0 bg-white/15 rounded-[2.5rem] transform rotate-3" />
|
||||
<div class="relative bg-white/20 backdrop-blur-sm rounded-[2.5rem] p-8 border border-white/30">
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div
|
||||
v-for="(feature, index) in features"
|
||||
:key="feature.title"
|
||||
class="bg-white/15 rounded-2xl p-4 transition-transform duration-300 hover:-translate-y-1"
|
||||
:style="{ transitionDelay: index * 60 + 'ms' }"
|
||||
>
|
||||
<div class="w-10 h-10 rounded-full bg-white/25 flex items-center justify-center mb-3">
|
||||
<svg class="w-5 h-5 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" :d="feature.icon" />
|
||||
</svg>
|
||||
</div>
|
||||
<p class="text-sm font-semibold text-white">{{ feature.title }}</p>
|
||||
<p class="text-xs text-white/75 mt-1">{{ feature.desc }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 模板 5 - Hero 主视觉区(温暖自然食品风)
|
||||
*/
|
||||
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(() => {
|
||||
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 features = [
|
||||
{ title: '源头甄选', desc: '全球优质产区', icon: 'M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z' },
|
||||
{ title: '新鲜锁鲜', desc: '先进保鲜工艺', icon: 'M12 2C7 2 3 6 3 11c0 5 4 9 9 9s9-4 9-9c0-5-4-9-9-9zm0 16c-3.9 0-7-3-7-7 0-2.8 1.6-5.2 4-6.4.2 1.6 1.1 3 2.5 3.8-1-.7-1.6-1.9-1.6-3.1 2.3.3 4.1 2.1 4.4 4.4.8.7 1.3 1.7 1.3 2.9 0 .6-.1 1.2-.4 1.7 1.4-.7 2.4-2.1 2.4-3.7 1.8 1.2 3 3.3 3 5.4 0 4-3.1 7-7 7z' },
|
||||
{ title: '严苛质检', desc: '全程品质管控', icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' },
|
||||
{ title: '营养健康', desc: '均衡天然配方', icon: 'M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z' }
|
||||
]
|
||||
</script>
|
||||
Reference in New Issue
Block a user