提交 1164092e authored 作者: 王鹏飞's avatar 王鹏飞

feat: 新增导航组件和浮动咨询按钮,优化页面布局

上级 e85919f6
......@@ -253,7 +253,8 @@ const onDropdownLeave = () => {
</div>
<!-- 导航栏 -->
<nav class="app-nav">
<slot name="nav">
<nav class="app-nav">
<div class="nav-inner">
<ul class="nav-list">
<li class="nav-item" v-for="(item, navIndex) in navList" :key="item.name">
......@@ -325,7 +326,8 @@ const onDropdownLeave = () => {
</div>
</div>
</div>
</nav>
</nav>
</slot>
</header>
</template>
......
<script setup>
function goToCta() {
document.querySelector('#cta')?.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
</script>
<template>
<button class="yougu-float-cta" type="button" aria-label="详情咨询" @click="goToCta">
<svg class="yougu-float-icon" width="20" height="20" viewBox="0 0 24 24" aria-hidden="true">
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
</svg>
<span>详情咨询</span>
</button>
</template>
<style lang="scss">
.yougu-float-cta {
position: fixed;
right: 20px;
top: 50%;
z-index: 1001;
width: 48px;
padding: 16px 13px;
transform: translateY(-50%);
border: 1px solid rgba(255, 255, 255, 0.32);
border-radius: 14px;
color: #fff;
background: linear-gradient(165deg, #c22650 0%, #ab0a3d 55%, #7e0730 100%);
box-shadow: 0 14px 38px rgba(171, 10, 61, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
font-family: inherit;
cursor: pointer;
animation: yougu-float-pulse 2.8s ease-in-out infinite;
transition: transform 0.28s ease, box-shadow 0.28s ease;
.yougu-float-icon {
display: block;
width: 20px;
height: 20px;
fill: none;
stroke: currentColor;
stroke-width: 1.9;
stroke-linecap: round;
stroke-linejoin: round;
}
span {
display: block;
font-size: 14px;
font-weight: 700;
line-height: 1;
letter-spacing: 0.18em;
writing-mode: vertical-rl;
}
&:hover {
transform: translateY(-50%) translateX(-3px);
background: linear-gradient(165deg, #c22650 0%, #ab0a3d 55%, #7e0730 100%);
}
}
@keyframes yougu-float-pulse {
0%,
100% {
box-shadow: 0 14px 38px rgba(171, 10, 61, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22),
0 0 0 0 rgba(171, 10, 61, 0.32);
}
50% {
box-shadow: 0 14px 38px rgba(171, 10, 61, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22),
0 0 0 12px rgba(171, 10, 61, 0);
}
}
@media (max-width: 860px) {
.yougu-float-cta {
top: auto;
right: 16px;
bottom: 16px;
transform: none;
flex-direction: row;
gap: 8px;
padding: 12px 20px;
border-radius: 999px;
animation: yougu-float-pulse-mobile 2.8s ease-in-out infinite;
span {
writing-mode: horizontal-tb;
letter-spacing: 0.08em;
}
&:hover {
transform: translateY(-2px);
}
}
}
@keyframes yougu-float-pulse-mobile {
0%,
100% {
box-shadow: 0 12px 30px rgba(171, 10, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22),
0 0 0 0 rgba(171, 10, 61, 0.3);
}
50% {
box-shadow: 0 12px 30px rgba(171, 10, 61, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22),
0 0 0 10px rgba(171, 10, 61, 0);
}
}
</style>
<script setup>
const route = useRoute()
defineProps({ embedded: { type: Boolean, default: false } })
const isHome = computed(() => route.path === '/yougu')
const navItems = computed(() =>
isHome.value
? [
{ name: '平台定位', href: '#intro' },
{ name: '核心功能', href: '#features' },
{ name: '三端分述', href: '#intro' },
{ name: '平台价值', href: '#value' },
]
: [
{ name: '← 返回首页', href: '/yougu', home: true },
{ name: '平台定位', href: '#positioning' },
{ name: '核心功能', href: '#features' },
{ name: '平台价值', href: '#value' },
],
)
function goTo(href) {
if (!href.startsWith('#')) return
document.querySelector(href)?.scrollIntoView({ behavior: 'smooth', block: 'start' })
}
</script>
<template>
<nav class="yougu-nav" :class="{ 'is-embedded': embedded }">
<div class="yougu-nav-inner">
<div class="yougu-nav-links">
<NuxtLink
v-for="item in navItems"
:key="item.name"
:to="item.href"
:class="{ 'is-home': item.home }"
@click="item.href.startsWith('#') && goTo(item.href)">
{{ item.name }}
</NuxtLink>
</div>
<a class="yougu-nav-cta" href="#cta" @click.prevent="goTo('#cta')">详情咨询 →</a>
</div>
</nav>
</template>
<style lang="scss">
.yougu-nav {
position: fixed;
inset: 0 0 auto;
z-index: 1000;
height: 70px;
background: rgba(255, 255, 255, 0.94);
box-shadow: 0 12px 28px rgba(52, 23, 31, 0.08);
backdrop-filter: blur(14px);
}
.yougu-nav.is-embedded {
position: relative;
inset: auto;
z-index: auto;
}
.yougu-nav-inner {
max-width: 1200px;
height: 100%;
margin: 0 auto;
// padding: 0 24px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
}
.yougu-nav-links {
display: flex;
align-items: center;
gap: 30px;
min-width: 0;
a {
color: #3d322e;
font-size: 14px;
white-space: nowrap;
text-decoration: none;
transition: color 0.2s ease;
&:hover,
&.is-home {
color: #ab0a3d;
}
}
}
.yougu-nav-cta {
flex: 0 0 auto;
padding: 11px 20px;
border-radius: 999px;
color: #fff;
background: linear-gradient(135deg, #c10b48, #930735);
box-shadow: 0 8px 18px rgba(171, 10, 61, 0.22);
font-size: 14px;
text-decoration: none;
transition:
transform 0.2s ease,
box-shadow 0.2s ease;
&:visited,
&:hover,
&:focus,
&:active {
color: #fff;
}
&:hover {
transform: translateY(-1px);
box-shadow: 0 10px 22px rgba(171, 10, 61, 0.3);
}
}
@media (max-width: 720px) {
.yougu-nav-links {
gap: 12px;
a {
font-size: 12px;
}
}
.yougu-nav-cta {
padding: 9px 12px;
font-size: 12px;
}
}
</style>
<template>
<div class="yougu-layout">
<AppHeader>
<template #nav>
<YouguNav embedded />
</template>
</AppHeader>
<slot />
<AppFooter />
<YouguFloatCta />
</div>
</template>
<style>
.yougu-layout {
min-height: 100vh;
}
</style>
<script setup>
definePageMeta({ layout: 'yougu' })
// 企业端 · 人才桥
const page = {
productName: '紫荆优雇Agent·人才桥',
......
<script setup>
import { onBeforeUnmount, onMounted, ref } from 'vue'
definePageMeta({ layout: 'yougu' })
useHead({
title: '紫荆·优雇 Agent | AI 一体化人才供需协同平台',
meta: [
......
<script setup>
definePageMeta({ layout: 'yougu' })
// 学校端 · 产教图谱
const page = {
productName: '紫荆优雇Agent·产教图谱',
......
<script setup>
definePageMeta({ layout: 'yougu' })
// 学生端 · 北斗星
const page = {
productName: '紫荆优雇Agent·北斗星',
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论