|
|
@@ -1,11 +1,11 @@
|
|
|
<template>
|
|
|
- <div class="header w-screen h-12 pad:h-32 static pad:fixed flex justify-center flex-col items-center">
|
|
|
+ <div class="header w-screen pad:w-full 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="/">
|
|
|
+ <a class="w-48 pad:w-64 pc:w-72 flex-shrink-0 z-40" href="/">
|
|
|
<img src="/headerLogo.png" alt="" class="logo">
|
|
|
</a>
|
|
|
<div class="hidden pad:flex w-full h-full items-center ">
|
|
|
@@ -51,16 +51,18 @@
|
|
|
/>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <div :class="`search-box absolute right-0 top-0 ${searchShow?'search-box-show':''}`"
|
|
|
+ <div :class="`search-box absolute right-0 top-0 z-50 ${searchShow?'search-box-show':''}`"
|
|
|
v-click-outside="hideSearch"
|
|
|
-
|
|
|
>
|
|
|
- <div class="search">
|
|
|
+ <div class="search" @click="switchSearch">
|
|
|
<input type="text" v-model="searchKey"
|
|
|
placeholder="搜索咨询与产品">
|
|
|
<button @click="searchItem" >
|
|
|
<svg-icon icon-class="search" />
|
|
|
</button>
|
|
|
+ <div class="phoneClose" @click.stop="hideSearch">
|
|
|
+ <svg-icon icon-class="close" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -208,7 +210,7 @@ export default {
|
|
|
this.$root.$emit('changeLang');
|
|
|
},
|
|
|
searchItem(){
|
|
|
-
|
|
|
+ console.log('searching....')
|
|
|
},
|
|
|
showSubMenu(item){
|
|
|
// console.log("0000000")
|
|
|
@@ -249,6 +251,18 @@ export default {
|
|
|
console.log('切换按钮显示隐藏')
|
|
|
this.isShow = !this.isShow;
|
|
|
}
|
|
|
+ },
|
|
|
+ hideSearch(){
|
|
|
+ console.log('hide search')
|
|
|
+ this.searchShow = false;
|
|
|
+ },
|
|
|
+ showSearch(){
|
|
|
+ this.searchShow = true;
|
|
|
+ },
|
|
|
+ switchSearch(){
|
|
|
+ if(!this.searchShow){
|
|
|
+ this.showSearch();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -420,6 +434,12 @@ export default {
|
|
|
transition: width 0.6s;
|
|
|
box-shadow: 1px 1px 4px red ;
|
|
|
}
|
|
|
+.search-box-show{
|
|
|
+ width: 200px;
|
|
|
+}
|
|
|
+.header-menu-phone .search-box-show{
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
.search-box .search{
|
|
|
height: 26px;
|
|
|
width: 100%;
|
|
|
@@ -429,6 +449,30 @@ export default {
|
|
|
position: relative;
|
|
|
background-color: transparent;
|
|
|
}
|
|
|
+.header-menu-phone .search-box-show .search{
|
|
|
+ background-color: #fff;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 30px;
|
|
|
+}
|
|
|
+.search-box .search .phoneClose{
|
|
|
+ width: 26px;
|
|
|
+ height: 26px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ color: #1a1a1a;
|
|
|
+ cursor: pointer;
|
|
|
+ display: none;
|
|
|
+}
|
|
|
+.header-menu-phone .search-box-show .search .phoneClose{
|
|
|
+ display: flex;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ font-size: 1.2rem;
|
|
|
+}
|
|
|
+
|
|
|
.search > * {
|
|
|
outline: none;
|
|
|
}
|
|
|
@@ -441,15 +485,29 @@ export default {
|
|
|
padding-right: 15px;
|
|
|
font-size: 0.85em;
|
|
|
}
|
|
|
+.header-menu-phone .search-box-show .search > input{
|
|
|
+ padding-left: 30px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 30px;
|
|
|
+}
|
|
|
.search > button{
|
|
|
- display: block;
|
|
|
+ display: flex;
|
|
|
width: 24px;
|
|
|
height: 24px;
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
right: 3px;
|
|
|
+ font-size: 1.2rem;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.header-menu-phone .search-box-show .search > button{
|
|
|
+ left: 2px;
|
|
|
+ right: auto;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
}
|
|
|
-.search > button:hover{
|
|
|
+.search:hover > button{
|
|
|
color: orange;
|
|
|
}
|
|
|
</style>
|