1
This commit is contained in:
@@ -1,83 +1,370 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="footer">
|
||||
<div class="row1">
|
||||
<div class="pageWidth">
|
||||
<table class="footerTable">
|
||||
<thead class="bread desktop smallDesktop">
|
||||
<tr>
|
||||
<th>我们的办公室</th>
|
||||
<th>快速链接</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="stackable">
|
||||
<ul class="quickLinks bread">
|
||||
<li v-for="item in contactData" :key="item.name">
|
||||
<label>{{item.name+":"}}</label>
|
||||
<label>{{item.value}}</label>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
<td class="quickLinksContainer">
|
||||
<div class="mobile mobileFooterTitle bread">Snabblänkar</div>
|
||||
<ul class="quickLinks bread">
|
||||
<li v-for="menu in menus" :key="menu.name">
|
||||
<router-link :to="menu.url">{{menu.name}}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="footer">
|
||||
<div class="footer-content">
|
||||
<div class="container">
|
||||
<!-- 主要页脚信息 -->
|
||||
<div class="footer-main">
|
||||
<div class="footer-section">
|
||||
<div class="footer-logo">
|
||||
<img :src="require('@/assets/img/logo.png')" alt="丙维科技" class="logo">
|
||||
<h3>上海丙维数字科技有限公司</h3>
|
||||
<p class="company-desc">技术驱动未来,服务创造价值</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer-section">
|
||||
<h4>关于我们</h4>
|
||||
<ul class="footer-links">
|
||||
<li><router-link to="/aboutUs/aboutUs">公司简介</router-link></li>
|
||||
<li><router-link to="/aboutUs/propystTechnology">技术优势</router-link></li>
|
||||
<li><router-link to="/aboutUs/cooperateWithUs">合作共赢</router-link></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer-section">
|
||||
<h4>解决方案</h4>
|
||||
<ul class="footer-links">
|
||||
<li><router-link to="/ourPlan/iot">物联网</router-link></li>
|
||||
<li><router-link to="/ourPlan/smartbuildings">智能建筑</router-link></li>
|
||||
<li><router-link to="/ourPlan/facilityManagement">设施管理</router-link></li>
|
||||
<li><router-link to="/ourPlan/reaEstate">房地产</router-link></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer-section">
|
||||
<h4>联系我们</h4>
|
||||
<div class="contact-info">
|
||||
<div class="contact-item">
|
||||
<span class="contact-icon">📍</span>
|
||||
<span>上海市宝山区高逸路112-118号3幢6422室</span>
|
||||
</div>
|
||||
<div class="contact-item">
|
||||
<span class="contact-icon">📞</span>
|
||||
<span>13817819452</span>
|
||||
</div>
|
||||
<div class="contact-item">
|
||||
<span class="contact-icon">✉️</span>
|
||||
<span>bimwe@bimwe.com</span>
|
||||
</div>
|
||||
<div class="contact-item">
|
||||
<span class="contact-icon">🌐</span>
|
||||
<span>www.bimwe.com</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row2">
|
||||
<div class="contentContainer pageWidth">
|
||||
<div class="bread">Copyright © 2018 Bimwe Technology co. LTD</div>
|
||||
|
||||
<div class="beian-box">
|
||||
<img src="../assets/img/beian_icon.png" style="width:20px;" />
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank">沪ICP备19005870号-1</a>
|
||||
|
||||
<!-- 页脚底部 -->
|
||||
<div class="footer-bottom">
|
||||
<div class="footer-bottom-content">
|
||||
<div class="copyright">
|
||||
<p>© 2024 上海丙维数字科技有限公司. 保留所有权利.</p>
|
||||
</div>
|
||||
<div class="footer-extra">
|
||||
<div class="beian">
|
||||
<img :src="require('@/assets/img/beian_icon.png')" alt="备案" class="beian-icon">
|
||||
<span>沪ICP备XXXXXXXX号</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 返回顶部按钮 -->
|
||||
<div class="back-to-top" @click="scrollToTop" v-show="showBackToTop">
|
||||
<span class="arrow">↑</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ifooter',
|
||||
data() {
|
||||
return {
|
||||
menus: window.config.menus,
|
||||
contactData: [
|
||||
{ name: '地址', value: '上海市宝山区' },
|
||||
{ name: '手机', value: '13817819452' },
|
||||
{ name: '邮箱', value: 'Zhp@bimwe.com' }
|
||||
]
|
||||
showBackToTop: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initScrollListener()
|
||||
},
|
||||
methods: {
|
||||
initScrollListener() {
|
||||
window.addEventListener('scroll', () => {
|
||||
this.showBackToTop = window.pageYOffset > 300
|
||||
})
|
||||
},
|
||||
|
||||
scrollToTop() {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.quickLinks li {
|
||||
float: left;
|
||||
margin: 5px 20px;
|
||||
|
||||
<style scoped>
|
||||
.footer {
|
||||
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
|
||||
color: white;
|
||||
position: relative;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
.beian-box {
|
||||
.footer-content {
|
||||
padding: 60px 0 0 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/* 主要页脚区域 */
|
||||
.footer-main {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
gap: 40px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.footer-section h4 {
|
||||
font-size: 1.3rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 20px;
|
||||
color: #ecf0f1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.footer-section h4::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -8px;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 2px;
|
||||
background: #3498db;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
/* Logo区域 */
|
||||
.footer-logo .logo {
|
||||
height: 50px;
|
||||
margin-bottom: 15px;
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
|
||||
.footer-logo h3 {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 10px;
|
||||
color: #ecf0f1;
|
||||
}
|
||||
|
||||
.company-desc {
|
||||
color: #bdc3c7;
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* 链接列表 */
|
||||
.footer-links {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer-links li {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.footer-links a {
|
||||
color: #bdc3c7;
|
||||
text-decoration: none;
|
||||
transition: all 0.3s ease;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.footer-links a:hover {
|
||||
color: #3498db;
|
||||
transform: translateX(5px);
|
||||
}
|
||||
|
||||
.footer-links a::before {
|
||||
content: '→';
|
||||
position: absolute;
|
||||
left: -20px;
|
||||
opacity: 0;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.footer-links a:hover::before {
|
||||
opacity: 1;
|
||||
left: -15px;
|
||||
}
|
||||
|
||||
/* 联系信息 */
|
||||
.contact-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.contact-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
color: #bdc3c7;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.contact-icon {
|
||||
font-size: 1.2rem;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 页脚底部 */
|
||||
.footer-bottom {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
padding: 25px 0;
|
||||
}
|
||||
|
||||
.footer-bottom-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.copyright p {
|
||||
color: #95a5a6;
|
||||
font-size: 0.9rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer-extra {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.beian {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
color: #95a5a6;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.beian-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
filter: brightness(0) invert(0.6);
|
||||
}
|
||||
|
||||
/* 返回顶部按钮 */
|
||||
.back-to-top {
|
||||
position: fixed;
|
||||
bottom: 30px;
|
||||
right: 30px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background: linear-gradient(135deg, #3498db, #2980b9);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 5px;
|
||||
a {
|
||||
color: #fff;
|
||||
margin-left: 5px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.back-to-top:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
|
||||
}
|
||||
|
||||
.back-to-top .arrow {
|
||||
color: white;
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.footer-content {
|
||||
padding: 40px 0 0 0;
|
||||
}
|
||||
|
||||
.footer-main {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
.footer-bottom-content {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.back-to-top {
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.back-to-top .arrow {
|
||||
font-size: 1.3rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* 动画效果 */
|
||||
.footer-section {
|
||||
animation: fadeInUp 0.6s ease forwards;
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
|
||||
.footer-section:nth-child(1) { animation-delay: 0.1s; }
|
||||
.footer-section:nth-child(2) { animation-delay: 0.2s; }
|
||||
.footer-section:nth-child(3) { animation-delay: 0.3s; }
|
||||
.footer-section:nth-child(4) { animation-delay: 0.4s; }
|
||||
|
||||
@keyframes fadeInUp {
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 悬停效果增强 */
|
||||
.footer-section:hover {
|
||||
transform: translateY(-2px);
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.footer-links a:hover {
|
||||
transform: translateX(8px);
|
||||
}
|
||||
|
||||
/* 渐变背景动画 */
|
||||
.footer {
|
||||
background-size: 200% 200%;
|
||||
animation: gradientShift 10s ease infinite;
|
||||
}
|
||||
|
||||
@keyframes gradientShift {
|
||||
0% { background-position: 0% 50%; }
|
||||
50% { background-position: 100% 50%; }
|
||||
100% { background-position: 0% 50%; }
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -1,91 +1,68 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div class="header bottomShadow">
|
||||
<div class="header bottomShadow" :class="{ 'mini': isMiniHeader }">
|
||||
<div class="content pageWidth">
|
||||
<div class="top">
|
||||
<div class="content bread">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="contact contactLinks">
|
||||
<img src="../assets/img/svg/mobile.svg" class="inlineTextIcon inlineTextPhoneIcon"><span>
|
||||
<a href="tel:13817819452">13817819452</a></span> <img src="../assets/img/svg/airplane.svg" class="inlineTextIcon">
|
||||
<span><a href="mailto:bimwe@bimwe.com">bimwe@bimwe.com</a></span>
|
||||
</td>
|
||||
<td class="searchContainer desktop">
|
||||
<input type="text" class="search" placeholder="Sök" style="margin-left:1em;width:10em">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 主要导航区域 -->
|
||||
<div class="bottom desktop">
|
||||
<div class="nav-container">
|
||||
<div class="logoCell">
|
||||
<img class="logo" :src="image_paths.logo" alt="丙维科技">
|
||||
</div>
|
||||
<div class="mainMenuCell">
|
||||
<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>
|
||||
</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}}
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- BOTTOM - DESKTOP -->
|
||||
<div class="bottom desktop">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="logoCell">
|
||||
<img class="logo" src="../assets/img/logo.png">
|
||||
</td>
|
||||
<td class="mainMenuCell">
|
||||
<table class="mainMenu">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="h2" v-for="menu in menus" :key="menu.name">
|
||||
<router-link :to="menu.url">
|
||||
{{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">{{sonMenu.name}}</router-link>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- END BOTTOM - DESKTOP -->
|
||||
|
||||
<!-- 移动端导航 -->
|
||||
<div class="bottom headerBottom mobile">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="logoCell">
|
||||
<img class="logo" src="../assets/img/bimwe_logo.png">
|
||||
</td>
|
||||
<td class="mobileIconsCell">
|
||||
<!-- <img src="../assets/img/svg/ic_search.svg" /> -->
|
||||
<img src="../assets/img/svg/ic_hamburger.svg" id="hamburger">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="mobile-nav">
|
||||
<div class="logoCell">
|
||||
<img class="logo" :src="image_paths.mobile_logo" alt="丙维科技">
|
||||
</div>
|
||||
<div class="mobileIconsCell">
|
||||
<img :src="image_paths.hamburger" id="hamburger" alt="菜单">
|
||||
</div>
|
||||
</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">
|
||||
<a href="menu.url" v-if="menu.name=='首页'">{{menu.name}}</a>
|
||||
<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">
|
||||
<li v-for="sonMenu in menu.child" :key="sonMenu.name">
|
||||
<li v-for="sonMenu in menu.child" :key="sonMenu.name">
|
||||
<router-link class="hasSubmenu" :to="sonMenu.url">{{sonMenu.name}}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="goBack">
|
||||
<a href="JavaScript:void()" class="linkGoBack flexVerticalCenter">
|
||||
<img src="../assets/img/svg/ic_arrow_back.svg" alt="返回">
|
||||
<img :src="image_paths.arrow_back" alt="返回">
|
||||
<span>返回</span>
|
||||
</a>
|
||||
</div>
|
||||
@@ -94,26 +71,711 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { common } from '../static/common'
|
||||
|
||||
export default {
|
||||
name: 'ihead',
|
||||
data() {
|
||||
return {
|
||||
menus: window.config.menus
|
||||
isMiniHeader: false,
|
||||
menus: [
|
||||
{
|
||||
name: '首页',
|
||||
url: '/index',
|
||||
child: []
|
||||
},
|
||||
{
|
||||
name: '关于我们',
|
||||
url: '/aboutUs/aboutUs',
|
||||
child: []
|
||||
},
|
||||
{
|
||||
name: '我们的方案',
|
||||
url: '/ourPlan/ourPlan',
|
||||
child: [
|
||||
{ name: '智能建筑', url: '/ourPlan/estateManagement' },
|
||||
{ name: '物联网', url: '/ourPlan/iot' },
|
||||
{ name: '设施管理', url: '/ourPlan/facilityManagement' },
|
||||
{ name: 'AI解决方案', url: '/ourPlan/aiSolutions' },
|
||||
{ name: '技术集成', url: '/ourPlan/technologyIntegration' }
|
||||
]
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
common.init()
|
||||
common.initListeners()
|
||||
common.initHeader()
|
||||
common.initForms()
|
||||
common.initMobileMenu()
|
||||
common.adjustElementsForScreen()
|
||||
computed: {
|
||||
// 统一管理图片路径,提高可维护性
|
||||
image_paths() {
|
||||
return {
|
||||
logo: require('@/assets/img/logo.png'),
|
||||
mobile_logo: require('@/assets/img/bimwe_logo.png'),
|
||||
hamburger: require('@/assets/img/svg/ic_hamburger.svg'),
|
||||
arrow_back: require('@/assets/img/svg/ic_arrow_back.svg')
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initHeader()
|
||||
this.initScrollListener()
|
||||
},
|
||||
methods: {
|
||||
// 封装事件监听器创建,提高代码复用性
|
||||
add_event_listener(selector, event_type, callback, use_id = false) {
|
||||
const element = use_id ? document.getElementById(selector) : document.querySelector(selector);
|
||||
if (element) {
|
||||
element.addEventListener(event_type, callback);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// 封装类名操作,提高代码复用性
|
||||
toggle_class(selector, class_name, use_id = false) {
|
||||
const element = use_id ? document.getElementById(selector) : document.querySelector(selector);
|
||||
if (element) {
|
||||
element.classList.toggle(class_name);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// 封装类名添加,提高代码复用性
|
||||
add_class(selector, class_name, use_id = false) {
|
||||
const element = use_id ? document.getElementById(selector) : document.querySelector(selector);
|
||||
if (element) {
|
||||
element.classList.add(class_name);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
// 封装类名移除,提高代码复用性
|
||||
remove_class(selector, class_name, use_id = false) {
|
||||
const element = use_id ? document.getElementById(selector) : document.querySelector(selector);
|
||||
if (element) {
|
||||
element.classList.remove(class_name);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
initHeader() {
|
||||
// 点击logo返回首页
|
||||
this.add_event_listener(".logoCell .logo", "click", () => {
|
||||
if (window.location.href.indexOf("index") === -1) {
|
||||
window.location.href = "#/index";
|
||||
}
|
||||
});
|
||||
|
||||
// 移动端菜单切换
|
||||
this.add_event_listener("hamburger", "click", () => {
|
||||
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'
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
initScrollListener() {
|
||||
window.addEventListener('scroll', () => {
|
||||
if (window.pageYOffset > 200) {
|
||||
if (!this.isMiniHeader) {
|
||||
this.isMiniHeader = true;
|
||||
this.add_class('.header', 'mini');
|
||||
}
|
||||
} else {
|
||||
if (this.isMiniHeader) {
|
||||
this.isMiniHeader = false;
|
||||
this.remove_class('.header', 'mini');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
<style scoped>
|
||||
/* 使用更高优先级覆盖 common.css 的样式 */
|
||||
/* 重置旧表格布局样式 */
|
||||
.header table,
|
||||
.header table tbody,
|
||||
.header table tbody tr,
|
||||
.header table tbody tr td {
|
||||
display: block !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
/* 头部基础样式 - 使用 !important 覆盖 common.css */
|
||||
.header {
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
left: 0 !important;
|
||||
right: 0 !important;
|
||||
z-index: 1000 !important;
|
||||
background: rgba(255, 255, 255, 0.95) !important;
|
||||
backdrop-filter: blur(10px) !important;
|
||||
transition: all var(--transition-speed) ease !important;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
|
||||
/* 覆盖旧表格布局 */
|
||||
display: block !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
/* 主要导航区域 - 覆盖旧样式 */
|
||||
.bottom {
|
||||
padding: 15px 0 !important;
|
||||
/* 覆盖旧表格布局 */
|
||||
display: block !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.nav-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.logoCell .logo {
|
||||
height: 50px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.logoCell .logo:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
/* 主导航菜单 */
|
||||
.mainMenu {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
display: block;
|
||||
padding: 15px 25px;
|
||||
color: #2c3e50;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
transition: all 0.3s ease;
|
||||
border-radius: var(--border-radius);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-link:hover {
|
||||
color: #3498db;
|
||||
background: rgba(52, 152, 219, 0.1);
|
||||
}
|
||||
|
||||
.nav-link::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 2px;
|
||||
background: #3498db;
|
||||
transition: all 0.3s ease;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.nav-link:hover::after {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
/* 下拉菜单 */
|
||||
.dropDown {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
background: white;
|
||||
border-radius: var(--border-radius);
|
||||
box-shadow: var(--shadow-medium);
|
||||
padding: 15px 0;
|
||||
min-width: 200px;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transform: translateY(-10px);
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.nav-item:hover .dropDown {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
display: block;
|
||||
padding: 12px 25px;
|
||||
color: #2c3e50;
|
||||
text-decoration: none;
|
||||
transition: all 0.3s ease;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.dropdown-item:hover {
|
||||
background: rgba(52, 152, 219, 0.1);
|
||||
color: #3498db;
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
/* 下拉箭头 */
|
||||
.downCaret {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-item:hover .downCaret {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* 移动端导航 */
|
||||
.mobile-nav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.mobile .logo {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
#hamburger {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
#hamburger:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
/* 移动端菜单 */
|
||||
.headerMobileMenu {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
transition: left 0.3s ease;
|
||||
z-index: 1001;
|
||||
}
|
||||
|
||||
.headerMobileMenu.active {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.menuContent {
|
||||
background: white;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.menuContent ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.menuContent li {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.menuContent a,
|
||||
.menuContent label {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
color: #2c3e50;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
border-radius: var(--border-radius);
|
||||
transition: all var(--transition-speed) ease;
|
||||
}
|
||||
|
||||
.menuContent a:hover,
|
||||
.menuContent label:hover {
|
||||
background: rgba(52, 152, 219, 0.1);
|
||||
color: #3498db;
|
||||
}
|
||||
|
||||
.subMenu {
|
||||
margin-left: 20px;
|
||||
border-left: 2px solid #e9ecef;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.goBack {
|
||||
margin-top: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.linkGoBack {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
color: #6c757d;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.linkGoBack:hover {
|
||||
color: #3498db;
|
||||
}
|
||||
|
||||
/* 现代响应式设计 - 使用容器查询和逻辑属性 */
|
||||
/* 基础响应式容器 */
|
||||
.header {
|
||||
container-type: inline-size;
|
||||
container-name: header;
|
||||
}
|
||||
|
||||
/* 使用容器查询替代媒体查询 */
|
||||
@container header (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;
|
||||
}
|
||||
}
|
||||
|
||||
@container header (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;
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 CSS Grid 实现更灵活的布局 */
|
||||
.nav-container {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
gap: 2rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@container header (max-width: 768px) {
|
||||
.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);
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 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);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 使用 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;
|
||||
}
|
||||
|
||||
.nav-container {
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
/* 使用 CSS 逻辑属性实现更好的边框 */
|
||||
.header {
|
||||
border-block-end: 1px solid var(--header-border) !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>
|
||||
|
||||
Reference in New Issue
Block a user