1
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="header bottomShadow" :class="{ 'mini': isMiniHeader }">
|
||||
<div class="content pageWidth">
|
||||
|
||||
|
||||
<!-- 主要导航区域 -->
|
||||
<div class="bottom desktop">
|
||||
<div class="nav-container">
|
||||
@@ -13,17 +13,13 @@
|
||||
<nav class="mainMenu">
|
||||
<div class="nav-item" v-for="menu in menus" :key="menu.name">
|
||||
<router-link :to="menu.url" class="nav-link">
|
||||
{{menu.name}}
|
||||
<span v-if="menu.child.length>0" class="downCaret"></span>
|
||||
{{ menu.name }}
|
||||
<span v-if="menu.child.length > 0" class="downCaret">▼</span>
|
||||
</router-link>
|
||||
<div class="dropDown bottomShadowSegment" v-if="menu.child.length>0">
|
||||
<router-link
|
||||
:to="sonMenu.url"
|
||||
v-for="sonMenu in menu.child"
|
||||
:key="sonMenu.name"
|
||||
class="dropdown-item"
|
||||
>
|
||||
{{sonMenu.name}}
|
||||
<div class="dropDown bottomShadowSegment" v-if="menu.child.length > 0">
|
||||
<router-link :to="sonMenu.url" v-for="sonMenu in menu.child" :key="sonMenu.name"
|
||||
class="dropdown-item">
|
||||
{{ sonMenu.name }}
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,18 +40,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 移动端菜单 -->
|
||||
<div id="mobileMenu" class="headerMobileMenu bread">
|
||||
<div class="menuDummy"></div>
|
||||
<div class="menuContent">
|
||||
<ul>
|
||||
<li v-for="menu in menus" :key="menu.name">
|
||||
<router-link :to="menu.url" v-if="menu.name=='首页'">{{menu.name}}</router-link>
|
||||
<label v-else class="hasSubmenu" style="display:block;">{{menu.name}}</label>
|
||||
<ul class="subMenu" v-if="menu.child.length>0">
|
||||
<router-link :to="menu.url" v-if="menu.child.length === 0">{{ menu.name }}</router-link>
|
||||
<label v-else class="hasSubmenu" style="display:block;">{{ menu.name }}</label>
|
||||
<ul class="subMenu" v-if="menu.child.length > 0">
|
||||
<li v-for="sonMenu in menu.child" :key="sonMenu.name">
|
||||
<router-link class="hasSubmenu" :to="sonMenu.url">{{sonMenu.name}}</router-link>
|
||||
<router-link class="hasSubmenu" :to="sonMenu.url">{{ sonMenu.name }}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -88,18 +84,18 @@ export default {
|
||||
},
|
||||
{
|
||||
name: '关于我们',
|
||||
url: '/aboutUs/aboutUs',
|
||||
url: '/aboutUs',
|
||||
child: []
|
||||
},
|
||||
{
|
||||
name: '我们的方案',
|
||||
url: '/ourPlan/ourPlan',
|
||||
url: '/ourPlan',
|
||||
child: [
|
||||
{ name: 'AI集成', url: '/ourPlan/aiSolutions' },
|
||||
{ name: '智能建筑', url: '/ourPlan/estateManagement' },
|
||||
{ name: '物联网', url: '/ourPlan/iot' },
|
||||
{ name: '设施管理', url: '/ourPlan/facilityManagement' },
|
||||
{ name: 'AI解决方案', url: '/ourPlan/aiSolutions' },
|
||||
{ name: '技术集成', url: '/ourPlan/technologyIntegration' }
|
||||
{ name: '系统集成', url: '/ourPlan/technologyIntegration' }
|
||||
]
|
||||
},
|
||||
|
||||
@@ -175,18 +171,18 @@ export default {
|
||||
this.toggle_class("mobileMenu", "active", true);
|
||||
}, true);
|
||||
|
||||
// 返回按钮
|
||||
this.add_event_listener(".linkGoBack", "click", () => {
|
||||
this.remove_class("mobileMenu", "active", true);
|
||||
// 关闭移动端菜单后滚动到顶部
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
// 返回按钮
|
||||
this.add_event_listener(".linkGoBack", "click", () => {
|
||||
this.remove_class("mobileMenu", "active", true);
|
||||
// 关闭移动端菜单后滚动到顶部
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
initScrollListener() {
|
||||
window.addEventListener('scroll', () => {
|
||||
if (window.pageYOffset > 200) {
|
||||
@@ -230,7 +226,7 @@ export default {
|
||||
z-index: 1000 !important;
|
||||
background: rgba(255, 255, 255, 0.95) !important;
|
||||
backdrop-filter: blur(10px) !important;
|
||||
transition: all var(--transition-speed) ease !important;
|
||||
transition: all 0.3s ease !important;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||
/* 覆盖旧表格布局 */
|
||||
display: block !important;
|
||||
@@ -239,68 +235,7 @@ export default {
|
||||
|
||||
.header.mini {
|
||||
background: rgba(255, 255, 255, 0.98) !important;
|
||||
box-shadow: var(--shadow-light) !important;
|
||||
}
|
||||
|
||||
/* 顶部联系信息 - 覆盖旧样式 */
|
||||
.top {
|
||||
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
|
||||
padding: 8px 0 !important;
|
||||
/* 覆盖旧表格布局 */
|
||||
display: block !important;
|
||||
height: auto !important;
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.contact-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.contact-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.contact-item:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.contact-item a {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.inlineTextIcon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
|
||||
/* 搜索框 */
|
||||
.search {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
border-radius: 20px;
|
||||
padding: 6px 15px;
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.search::placeholder {
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.search:focus {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-color: rgba(255, 255, 255, 0.5);
|
||||
outline: none;
|
||||
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
|
||||
}
|
||||
|
||||
/* 主要导航区域 - 覆盖旧样式 */
|
||||
@@ -313,8 +248,14 @@ export default {
|
||||
|
||||
.nav-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.logoCell {
|
||||
flex-shrink: 0;
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.logoCell .logo {
|
||||
@@ -326,10 +267,18 @@ export default {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.mainMenuCell {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
/* 主导航菜单 */
|
||||
.mainMenu {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
@@ -344,8 +293,9 @@ export default {
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
transition: all 0.3s ease;
|
||||
border-radius: var(--border-radius);
|
||||
border-radius: 8px;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.nav-link:hover {
|
||||
@@ -373,15 +323,16 @@ export default {
|
||||
.dropDown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--shadow-medium);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
|
||||
padding: 15px 0;
|
||||
min-width: 200px;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transform: translateY(-10px);
|
||||
transform: translateX(-50%) translateY(-10px);
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
@@ -389,7 +340,7 @@ export default {
|
||||
.nav-item:hover .dropDown {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateY(0);
|
||||
transform: translateX(-50%) translateY(0);
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
@@ -399,6 +350,7 @@ export default {
|
||||
text-decoration: none;
|
||||
transition: all 0.3s ease;
|
||||
border-radius: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dropdown-item:hover {
|
||||
@@ -412,6 +364,7 @@ export default {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
transition: transform 0.3s ease;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.nav-item:hover .downCaret {
|
||||
@@ -480,8 +433,8 @@ export default {
|
||||
color: #2c3e50;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
border-radius: var(--border-radius);
|
||||
transition: all var(--transition-speed) ease;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.menuContent a:hover,
|
||||
@@ -515,267 +468,77 @@ export default {
|
||||
color: #3498db;
|
||||
}
|
||||
|
||||
/* 现代响应式设计 - 使用容器查询和逻辑属性 */
|
||||
/* 基础响应式容器 */
|
||||
.header {
|
||||
container-type: inline-size;
|
||||
container-name: header;
|
||||
}
|
||||
|
||||
/* 使用容器查询替代媒体查询 */
|
||||
@container header (max-width: 768px) {
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.desktop {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
.mobile {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.contact-info {
|
||||
flex-direction: column !important;
|
||||
gap: 10px !important;
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.searchContainer {
|
||||
width: 100% !important;
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
|
||||
.search {
|
||||
width: 100% !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
/* 移动端头部高度调整 */
|
||||
.header {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
|
||||
.header .content {
|
||||
padding: 0 1em !important;
|
||||
}
|
||||
|
||||
body {
|
||||
padding-top: 100px !important;
|
||||
}
|
||||
|
||||
.nav-container {
|
||||
gap: 1rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
@container header (min-width: 769px) {
|
||||
@media (min-width: 769px) {
|
||||
.mobile {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
||||
.desktop {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用逻辑属性实现更好的国际化支持 */
|
||||
.header .content {
|
||||
padding-inline: 3em;
|
||||
padding-block: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.header .content {
|
||||
padding-inline: 1em;
|
||||
.nav-container {
|
||||
gap: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 CSS Grid 实现更灵活的布局 */
|
||||
.nav-container {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
gap: 2rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@container header (max-width: 768px) {
|
||||
@media (max-width: 1200px) {
|
||||
.nav-container {
|
||||
grid-template-columns: 1fr auto;
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 CSS 自定义属性实现主题切换 */
|
||||
:root {
|
||||
--header-bg: rgba(255, 255, 255, 0.95);
|
||||
--header-border: rgba(0, 0, 0, 0.1);
|
||||
--nav-hover-bg: rgba(52, 152, 219, 0.1);
|
||||
--nav-hover-color: #3498db;
|
||||
}
|
||||
|
||||
/* 深色主题支持 */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--header-bg: rgba(30, 30, 30, 0.95);
|
||||
--header-border: rgba(255, 255, 255, 0.1);
|
||||
--nav-hover-bg: rgba(52, 152, 219, 0.2);
|
||||
.nav-link {
|
||||
padding: 12px 20px;
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 CSS 自定义属性 */
|
||||
.header {
|
||||
background: var(--header-bg) !important;
|
||||
border-bottom: 1px solid var(--header-border) !important;
|
||||
}
|
||||
|
||||
.nav-link:hover {
|
||||
background: var(--nav-hover-bg) !important;
|
||||
color: var(--nav-hover-color) !important;
|
||||
}
|
||||
|
||||
/* 现代动画效果 - 使用 CSS 自定义属性和性能优化 */
|
||||
@keyframes slideDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-20px);
|
||||
@media (max-width: 1024px) {
|
||||
.nav-link {
|
||||
padding: 10px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
|
||||
.logoCell .logo {
|
||||
height: 45px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 will-change 优化动画性能 */
|
||||
.nav-item {
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
/* 使用 CSS 自定义属性控制动画延迟 */
|
||||
.nav-item {
|
||||
animation: slideDown 0.5s ease forwards;
|
||||
animation-delay: calc(var(--animation-index, 0) * 0.1s);
|
||||
}
|
||||
|
||||
/* 使用 CSS 计数器自动生成动画延迟 */
|
||||
.nav-item:nth-child(1) { --animation-index: 1; }
|
||||
.nav-item:nth-child(2) { --animation-index: 2; }
|
||||
.nav-item:nth-child(3) { --animation-index: 3; }
|
||||
.nav-item:nth-child(4) { --animation-index: 4; }
|
||||
|
||||
/* 使用 CSS 逻辑属性实现更好的动画方向 */
|
||||
@keyframes slideInFromStart {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 支持 RTL 的动画 */
|
||||
[dir="rtl"] .nav-item {
|
||||
animation: slideInFromStart 0.5s ease forwards;
|
||||
}
|
||||
|
||||
/* 使用现代 CSS 实现内容间距 */
|
||||
/* 使用 CSS 自定义属性定义头部高度 */
|
||||
:root {
|
||||
--header-height: 120px;
|
||||
--header-height-mobile: 100px;
|
||||
|
||||
/* 添加更多主题变量 */
|
||||
--transition-speed: 0.3s;
|
||||
--border-radius: 8px;
|
||||
--shadow-light: 0 2px 20px rgba(0, 0, 0, 0.1);
|
||||
--shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
/* 容器查询回退方案 - 为不支持容器查询的浏览器提供媒体查询 */
|
||||
@supports not (container-type: inline-size) {
|
||||
@media (max-width: 768px) {
|
||||
.desktop {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.mobile {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.contact-info {
|
||||
flex-direction: column !important;
|
||||
gap: 10px !important;
|
||||
align-items: flex-start !important;
|
||||
}
|
||||
|
||||
.searchContainer {
|
||||
width: 100% !important;
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
|
||||
.search {
|
||||
width: 100% !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.header {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.header .content {
|
||||
padding: 0 1em !important;
|
||||
}
|
||||
|
||||
body {
|
||||
padding-top: 100px !important;
|
||||
}
|
||||
|
||||
.nav-container {
|
||||
grid-template-columns: 1fr auto !important;
|
||||
gap: 1rem !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 769px) {
|
||||
.mobile {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.desktop {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用逻辑属性确保内容不被遮挡 */
|
||||
/* 确保内容不被遮挡 */
|
||||
body {
|
||||
padding-block-start: var(--header-height) !important;
|
||||
}
|
||||
|
||||
/* 使用容器查询替代媒体查询 */
|
||||
@container header (max-width: 768px) {
|
||||
body {
|
||||
padding-block-start: var(--header-height-mobile) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 CSS 逻辑属性实现更好的 RTL 支持 */
|
||||
.header {
|
||||
inset-block-start: 0;
|
||||
inset-inline: 0;
|
||||
}
|
||||
|
||||
/* 使用 CSS 逻辑属性实现更好的间距 */
|
||||
.contact-info {
|
||||
gap: 1rem;
|
||||
padding-top: 120px !important;
|
||||
}
|
||||
|
||||
/* 使用逻辑属性实现更好的间距 */
|
||||
.nav-container {
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
/* 使用 CSS 逻辑属性实现更好的边框 */
|
||||
/* 使用逻辑属性实现更好的边框 */
|
||||
.header {
|
||||
border-block-end: 1px solid var(--header-border) !important;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
animation: slideDown 0.5s ease forwards;
|
||||
}
|
||||
|
||||
.nav-item:nth-child(1) { animation-delay: 0.1s; }
|
||||
.nav-item:nth-child(2) { animation-delay: 0.2s; }
|
||||
.nav-item:nth-child(3) { animation-delay: 0.3s; }
|
||||
.nav-item:nth-child(4) { animation-delay: 0.4s; }
|
||||
</style>
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
<template>
|
||||
|
||||
<div class="contentTableLeft" id="navSidebar" v-if="!isMobile">
|
||||
|
||||
<div id="navAccordion" class="accordion" style="opacity: 1;">
|
||||
|
||||
<div class="h1">
|
||||
<font style="vertical-align: inherit;" v-if="curMenu">
|
||||
<font style="vertical-align: inherit;"> {{curMenu.name}}</font>
|
||||
</font>
|
||||
</div>
|
||||
|
||||
<ul class="content" v-if="curMenu">
|
||||
<li class="category" v-for=" sonmenu in curMenu.child" :key="sonmenu.name">
|
||||
<router-link :to="sonmenu.url" :class="sonmenu.strong">
|
||||
<div class="triangle"></div>
|
||||
<font style="vertical-align: inherit;">
|
||||
<font style="vertical-align: inherit;"> {{sonmenu.name}}</font>
|
||||
</font>
|
||||
</router-link>
|
||||
<div class="mobileContent">
|
||||
<h1> {{sonmenu.name}}</h1>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import '../assets/css/content_pages.css';
|
||||
import { common } from '../static/common';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menus: window.config.menus,
|
||||
isMobile: false,
|
||||
curMenu: null,
|
||||
curChildMenu: null,
|
||||
strong: '',
|
||||
};
|
||||
},
|
||||
created: function () {
|
||||
this.Init();
|
||||
},
|
||||
methods: {
|
||||
Init: function () {
|
||||
this.isMobile = common.isMobile();
|
||||
var path = this.$route.fullPath.split('/');
|
||||
|
||||
this.curMenu = this.menus.find((p) => {
|
||||
return p.url.indexOf(path[1]) > 0;
|
||||
});
|
||||
|
||||
this.curChildMenu = this.curMenu.child.find((p) => {
|
||||
return p.url.indexOf(path[2]) > 0;
|
||||
});
|
||||
|
||||
this.curMenu.child.map((p) => {
|
||||
p.strong = 'categoryHead h2 linkProduct';
|
||||
if (p.url.indexOf(path[2]) > 0) {
|
||||
this.curChildMenu.strong =
|
||||
'categoryHead h2 linkProduct strong';
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.contentTableLeft {
|
||||
display: table;
|
||||
float: left;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user