|
@@ -1,15 +1,18 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="header">
|
|
|
|
|
- <div class="conBox header-content">
|
|
|
|
|
- <a class="logo" href="/">
|
|
|
|
|
|
|
+ <div class="header w-screen h-12 pad:h-32 static pad:fixed flex justify-center flex-col items-center">
|
|
|
|
|
+ <div class="container
|
|
|
|
|
+ flex-shrink
|
|
|
|
|
+ flex h-10 pad:h-24 justify-center items-center
|
|
|
|
|
+ pad:justify-start pad:items-start
|
|
|
|
|
+ ">
|
|
|
|
|
+ <a class="w-48 pad:w-64 pc:w-72 flex-shrink-0 z-50" href="/">
|
|
|
<img src="/headerLogo.png" alt="" class="logo">
|
|
<img src="/headerLogo.png" alt="" class="logo">
|
|
|
-
|
|
|
|
|
</a>
|
|
</a>
|
|
|
- <div class="right-header">
|
|
|
|
|
- <div class="top">
|
|
|
|
|
|
|
+ <div class="hidden pad:flex w-full h-full items-center ">
|
|
|
|
|
+ <div class="">
|
|
|
<img src="/image/logotext2.png" alt="">
|
|
<img src="/image/logotext2.png" alt="">
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="menus">
|
|
|
|
|
|
|
+ <div class="menus w-full">
|
|
|
<div class="top-menu">
|
|
<div class="top-menu">
|
|
|
<a class="menu" href="/">{{ lang===langType.cn?"首页":getLangText("首页") }}</a>
|
|
<a class="menu" href="/">{{ lang===langType.cn?"首页":getLangText("首页") }}</a>
|
|
|
<a class="menu" @click="switchLangClickHandle">
|
|
<a class="menu" @click="switchLangClickHandle">
|
|
@@ -26,8 +29,11 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="conBox header-main">
|
|
|
|
|
- <ul class="main-menus">
|
|
|
|
|
|
|
+ <div :class="`container header-menu ${isPhone?'header-menu-phone':''}`">
|
|
|
|
|
+ <div class="menu-btn" @click="switchMenu" @touch="switchMenu">
|
|
|
|
|
+ <svg-icon icon-class="more"/>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <ul :class="`main-menus ${isShow?'':'main-menus-hide'}`" >
|
|
|
<li class="main-menu"
|
|
<li class="main-menu"
|
|
|
v-for="(item,i) in mainMenus"
|
|
v-for="(item,i) in mainMenus"
|
|
|
:key="`main-${item.path}-${i}`"
|
|
:key="`main-${item.path}-${i}`"
|
|
@@ -45,16 +51,18 @@
|
|
|
/>
|
|
/>
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
|
- <div class="search-box">
|
|
|
|
|
|
|
+ <div :class="`search-box absolute right-0 top-0 ${searchShow?'search-box-show':''}`"
|
|
|
|
|
+ v-click-outside="hideSearch"
|
|
|
|
|
+
|
|
|
|
|
+ >
|
|
|
<div class="search">
|
|
<div class="search">
|
|
|
<input type="text" v-model="searchKey"
|
|
<input type="text" v-model="searchKey"
|
|
|
placeholder="搜索咨询与产品">
|
|
placeholder="搜索咨询与产品">
|
|
|
<button @click="searchItem" >
|
|
<button @click="searchItem" >
|
|
|
- <img src="/image/search.png" alt="搜索">
|
|
|
|
|
|
|
+ <svg-icon icon-class="search" />
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -71,7 +79,9 @@ export default {
|
|
|
pageKey:{
|
|
pageKey:{
|
|
|
default: "index"
|
|
default: "index"
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ isPhone: {
|
|
|
|
|
+ default: true
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
components:{
|
|
components:{
|
|
|
menuDrop
|
|
menuDrop
|
|
@@ -156,9 +166,34 @@ export default {
|
|
|
searchKey: "",
|
|
searchKey: "",
|
|
|
nowSub: "",
|
|
nowSub: "",
|
|
|
hideTimer: null,
|
|
hideTimer: null,
|
|
|
|
|
+ isShow: false,
|
|
|
|
|
+ searchShow: false,
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ },
|
|
|
|
|
+ // 指令
|
|
|
|
|
+ directives: {
|
|
|
|
|
+ // 点击外部,执行隐藏
|
|
|
|
|
+ clickOutside: {
|
|
|
|
|
+ bind(el, binding, vnode) {
|
|
|
|
|
+ function documentHandler(e) {
|
|
|
|
|
+ if (el.contains(e.target)) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (binding.expression) {
|
|
|
|
|
+ binding.value(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ el.__vueClickOutside__ = documentHandler;
|
|
|
|
|
+ document.addEventListener('click', documentHandler);
|
|
|
|
|
+ },
|
|
|
|
|
+ unbind(el, binding) {
|
|
|
|
|
+ document.removeEventListener('click', el.__vueClickOutside__);
|
|
|
|
|
+ delete el.__vueClickOutside__;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
methods:{
|
|
methods:{
|
|
|
getLangText(str){
|
|
getLangText(str){
|
|
|
return langMap.getText(this.lang,str);
|
|
return langMap.getText(this.lang,str);
|
|
@@ -208,6 +243,12 @@ export default {
|
|
|
clearTimeout(this.hideTimer);
|
|
clearTimeout(this.hideTimer);
|
|
|
this.hideTimer = null;
|
|
this.hideTimer = null;
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ switchMenu(){
|
|
|
|
|
+ if(this.isPhone){
|
|
|
|
|
+ console.log('切换按钮显示隐藏')
|
|
|
|
|
+ this.isShow = !this.isShow;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -216,13 +257,10 @@ export default {
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
.header{
|
|
.header{
|
|
|
backdrop-filter: blur(5px);
|
|
backdrop-filter: blur(5px);
|
|
|
- box-shadow: 0px 2px 6px 0px rgb(0 0 0 / 20%) ;
|
|
|
|
|
|
|
+ box-shadow: 0px 2px 6px 0px rgb(0 0 0 / 20%);
|
|
|
/*text-shadow: 0 0 5px skyblue;*/
|
|
/*text-shadow: 0 0 5px skyblue;*/
|
|
|
}
|
|
}
|
|
|
-.header-content {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- height: 70px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
.header-content > .logo{
|
|
.header-content > .logo{
|
|
|
display: block;
|
|
display: block;
|
|
|
width: 260px;
|
|
width: 260px;
|
|
@@ -234,40 +272,23 @@ export default {
|
|
|
width: auto;
|
|
width: auto;
|
|
|
height: 65px;
|
|
height: 65px;
|
|
|
}
|
|
}
|
|
|
-.header-content .right-header{
|
|
|
|
|
- width: 1060px;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- margin-left: 11px;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- top: -35px;
|
|
|
|
|
-}
|
|
|
|
|
-.right-header .top{
|
|
|
|
|
- margin-top: 35px;
|
|
|
|
|
- height: 63px;
|
|
|
|
|
-
|
|
|
|
|
-}
|
|
|
|
|
-.right-header .top img{
|
|
|
|
|
- display: block;
|
|
|
|
|
- width: 253px;
|
|
|
|
|
- height: 63px;
|
|
|
|
|
-}
|
|
|
|
|
.menus{
|
|
.menus{
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: flex-end;
|
|
align-items: flex-end;
|
|
|
- margin-top: -28px;
|
|
|
|
|
|
|
+ /*margin-top: -28px;*/
|
|
|
}
|
|
}
|
|
|
.menus .top-menu{
|
|
.menus .top-menu{
|
|
|
width: auto;
|
|
width: auto;
|
|
|
height: 30px;
|
|
height: 30px;
|
|
|
right: 0;
|
|
right: 0;
|
|
|
- top: -30px;
|
|
|
|
|
|
|
+ top: -20px;
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
}
|
|
}
|
|
|
.menus .menu{
|
|
.menus .menu{
|
|
|
- padding: 0 8px;
|
|
|
|
|
|
|
+ padding: 0 5px;
|
|
|
list-style: none;
|
|
list-style: none;
|
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
|
color: #16a0d7;
|
|
color: #16a0d7;
|
|
@@ -278,7 +299,7 @@ export default {
|
|
|
color: skyblue !important;
|
|
color: skyblue !important;
|
|
|
}
|
|
}
|
|
|
.menus .subMenu{
|
|
.menus .subMenu{
|
|
|
- max-width: 90%;
|
|
|
|
|
|
|
+ max-width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
list-style: none;
|
|
list-style: none;
|
|
@@ -291,18 +312,53 @@ export default {
|
|
|
color: #343434;
|
|
color: #343434;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
-.header-main{
|
|
|
|
|
- height: 40px;
|
|
|
|
|
|
|
+
|
|
|
|
|
+.header-menu{
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ height: 2rem;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
|
|
|
|
+ /*justify-content: space-between;*/
|
|
|
|
|
+}
|
|
|
|
|
+.header-menu-phone{
|
|
|
|
|
+ position: absolute;
|
|
|
}
|
|
}
|
|
|
-.header-main .main-menus{
|
|
|
|
|
|
|
+.header-menu .menu-btn{
|
|
|
|
|
+ display: none;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.header-menu .main-menus{
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
list-style: none;
|
|
list-style: none;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: flex-end;
|
|
align-items: flex-end;
|
|
|
font-size: 1.15em;
|
|
font-size: 1.15em;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.header-menu-phone .menu-btn{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ font-size: 1.2rem;
|
|
|
|
|
+ padding: 0 15px;
|
|
|
|
|
+ color: paleturquoise;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+.header-menu-phone .main-menus{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ height: auto;
|
|
|
|
|
+ padding: 5px;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ top: 100%;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.header-menu-phone .main-menus-hide{
|
|
|
|
|
+ left: -100%;
|
|
|
|
|
+}
|
|
|
.main-menus .main-menu{
|
|
.main-menus .main-menu{
|
|
|
width: auto;
|
|
width: auto;
|
|
|
height: auto;
|
|
height: auto;
|
|
@@ -313,7 +369,10 @@ export default {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
.main-menus .main-menu:first-child{
|
|
.main-menus .main-menu:first-child{
|
|
|
- margin-left: 0px;
|
|
|
|
|
|
|
+ margin-left: 0;
|
|
|
|
|
+}
|
|
|
|
|
+.header-menu-phone .main-menus .main-menu:first-child{
|
|
|
|
|
+ margin-left: 15px;
|
|
|
}
|
|
}
|
|
|
.main-menus .main-menu > a{
|
|
.main-menus .main-menu > a{
|
|
|
display: block;
|
|
display: block;
|
|
@@ -348,12 +407,18 @@ export default {
|
|
|
left: 0;
|
|
left: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
.search-box{
|
|
.search-box{
|
|
|
- height: 100%;
|
|
|
|
|
|
|
+ height: 26px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- /*border-radius: 50%;*/
|
|
|
|
|
|
|
+ border-radius: 50%;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
font-size: 0.9em;
|
|
font-size: 0.9em;
|
|
|
|
|
+ width: 26px;
|
|
|
|
|
+ transition: width 0.6s;
|
|
|
|
|
+ box-shadow: 1px 1px 4px red ;
|
|
|
}
|
|
}
|
|
|
.search-box .search{
|
|
.search-box .search{
|
|
|
height: 26px;
|
|
height: 26px;
|
|
@@ -362,9 +427,9 @@ export default {
|
|
|
border: 1px solid gray;
|
|
border: 1px solid gray;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
- margin-top: 8px;
|
|
|
|
|
|
|
+ background-color: transparent;
|
|
|
}
|
|
}
|
|
|
-.search-box .search > *{
|
|
|
|
|
|
|
+.search > * {
|
|
|
outline: none;
|
|
outline: none;
|
|
|
}
|
|
}
|
|
|
.search > input{
|
|
.search > input{
|