feat(header): 在线咨询改右下角悬浮;右侧原位置放登录/注册或我的订单/个人中心入口

This commit is contained in:
2026-09-09 15:33:45 +08:00
parent 1bba5eb58d
commit ea1b9c903a
@@ -62,8 +62,40 @@
</template>
</nav>
<!-- CTA -->
<div class="hidden lg:block" style="position: fixed; right: 20px; top: 50%; transform: translateY(-50%);">
<!-- 用户入口右侧中部悬浮未登录=登录/注册已登录=个人中心入口 -->
<div class="hidden lg:flex flex-col gap-3" style="position: fixed; right: 20px; top: 50%; transform: translateY(-50%);">
<template v-if="loggedIn">
<NuxtLink
to="/tender/orders"
class="inline-flex items-center justify-center px-4 py-2 bg-blue-600 text-white text-sm font-semibold rounded-full hover:bg-blue-700 transition-colors"
>
我的订单
</NuxtLink>
<NuxtLink
to="/tender/qualification"
class="inline-flex items-center justify-center px-4 py-2 bg-blue-600 text-white text-sm font-semibold rounded-full hover:bg-blue-700 transition-colors"
>
个人中心
</NuxtLink>
</template>
<template v-else>
<NuxtLink
to="/login"
class="inline-flex items-center justify-center px-4 py-2 bg-blue-600 text-white text-sm font-semibold rounded-full hover:bg-blue-700 transition-colors"
>
登录
</NuxtLink>
<NuxtLink
to="/register"
class="inline-flex items-center justify-center px-4 py-2 border border-blue-600 text-blue-600 text-sm font-semibold rounded-full hover:bg-blue-50 transition-colors"
>
注册
</NuxtLink>
</template>
</div>
<!-- 在线咨询右下角悬浮 -->
<div class="hidden lg:block" style="position: fixed; right: 20px; bottom: 20px;">
<NuxtLink
to="/contact"
class="inline-flex items-center justify-center px-4 py-2 bg-blue-600 text-white text-base font-semibold rounded-full hover:bg-blue-700 transition-colors"
@@ -143,6 +175,9 @@ import type { CmsNavigation } from '~/types'
const { siteInfo, siteName, siteLogo, siteIcon, navigations, showHeaderSearch, fetchSiteInfo } = useSite()
const mobileMenuOpen = ref(false)
const { isLoggedIn } = useHjcAuth()
const loggedIn = ref(isLoggedIn())
/** 子导航链接统一走 app/utils 的 getNavLink(自动避免 /page/4598?navId=4598 冗余拼接) */
function getChildPath(child: CmsNavigation): string {
return getNavLink(child)