lucencyHeader.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <template>
  2. <div class="header">
  3. <div class="conBox header-content">
  4. <a class="logo" href="/">
  5. <img src="headerLogo.png" alt="" class="logo">
  6. </a>
  7. <div class="right-header">
  8. <div class="top">
  9. <img src="image/logotext2.png" alt="">
  10. </div>
  11. <div class="menus">
  12. <div class="top-menu">
  13. <a class="menu" href="/">{{ lang===langType.cn?"首页":getLangText("首页") }}</a>
  14. <a class="menu" @click="switchLangClickHandle">
  15. {{ lang===langType.cn?"English":getLangText("English") }}
  16. </a>
  17. </div>
  18. <ul class="subMenu">
  19. <li class="menu" v-for="(item,i) in menus" :key="item.url+'_'+i"
  20. :title="lang===langType.cn?item.text:getLangText(item.text)">
  21. <a :href="item.url" >{{lang===langType.cn?item.text:getAbbrText(item.text)}}</a>
  22. </li>
  23. </ul>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="conBox header-main">
  28. <ul class="main-menus">
  29. <li class="main-menu" v-for="(item,i) in mainMenus"
  30. :key="`main-${item.path}-${i}`"
  31. :title="lang===langType.cn?item.text:getLangText(item.text)"
  32. @mouseenter="showSubMenu(item)"
  33. >
  34. <a :href="item.url" >{{lang===langType.cn?item.text:getAbbrText(item.text)}}</a>
  35. <span class="now" v-if="pageKey===item.key"></span>
  36. <produce-drop
  37. v-show="item.showSub"
  38. v-if="item.isSub&&item.subKey==='product'"></produce-drop>
  39. </li>
  40. </ul>
  41. <div class="search-box">
  42. <div class="search">
  43. <input type="text" v-model="searchKey"
  44. placeholder="搜索咨询与产品">
  45. <button @click="searchItem" >
  46. <img src="image/search.png" alt="搜索">
  47. </button>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import langMap from "~/map/langMap";
  55. import produceDrop from "@/components/header/menuDrops/produceDrop";
  56. export default {
  57. name: "lucencyHeader",
  58. props: {
  59. lang:{
  60. default: langMap.lang.cn
  61. },
  62. pageKey:{
  63. default: "index"
  64. }
  65. },
  66. components:{
  67. produceDrop
  68. },
  69. data(){
  70. return {
  71. langType: langMap.lang,
  72. menus: [
  73. {
  74. url:'https://gpscore.net/',
  75. text: '合方圆管理平台'
  76. },
  77. {
  78. url:'/',
  79. text: '智慧能源'
  80. },
  81. {
  82. url:'/',
  83. text: '输电线路摄像头'
  84. },
  85. {
  86. url:'https://gpscore.net/',
  87. text: '4G低功耗摄像头'
  88. },
  89. {
  90. url:'https://gpscore.net/',
  91. text: '自动变焦双目协同摄像头'
  92. },
  93. {
  94. url:'https://gpscore.net/',
  95. text: 'M2M产品'
  96. },
  97. {
  98. url:'https://gpscore.net/',
  99. text: '智能终端'
  100. },
  101. ],
  102. mainMenus:[
  103. {
  104. key: "index",
  105. path: "/",
  106. text: "首页"
  107. },
  108. {
  109. key: "product",
  110. path: "/product.html",
  111. text: "产品中心",
  112. isSub: true,
  113. subKey: "product",
  114. showSub: false
  115. },
  116. {
  117. key: "solution",
  118. path: "/solution.html",
  119. text: "解决方案",
  120. isSub: true,
  121. subKey: "solution",
  122. showSub: false
  123. },
  124. {
  125. key: "new",
  126. path: "/new.html",
  127. text: "新闻中心"
  128. },
  129. {
  130. key: "support",
  131. path: "/technicalSupport.html",
  132. text: "技术支持",
  133. sub:{
  134. type: "about",
  135. }
  136. },
  137. {
  138. key: "about",
  139. path: "/about.html",
  140. text: "关于我们",
  141. sub:{
  142. type: "about",
  143. }
  144. }
  145. ],
  146. searchKey: "",
  147. }
  148. },
  149. methods:{
  150. getLangText(str){
  151. return langMap.getText(this.lang,str);
  152. },
  153. getAbbrText(str){
  154. return langMap.getAbbrText(this.lang,str);
  155. },
  156. switchLangClickHandle(){
  157. this.$root.$emit('changeLang');
  158. },
  159. searchItem(){
  160. },
  161. showSubMenu(item){
  162. console.log("0000000")
  163. if(item.isSub){
  164. item.showSub = true;
  165. }
  166. }
  167. }
  168. }
  169. </script>
  170. <style scoped>
  171. .header{
  172. backdrop-filter: blur(8px);
  173. box-shadow: 0px 2px 6px 0px rgb(0 0 0 / 20%) ;
  174. }
  175. .header-content {
  176. display: flex;
  177. height: 70px;
  178. }
  179. .header-content > .logo{
  180. display: block;
  181. width: 260px;
  182. height: 70px;
  183. margin-top: 7.5px;
  184. }
  185. .header-content > .logo img{
  186. display: block;
  187. width: auto;
  188. height: 65px;
  189. }
  190. .header-content .right-header{
  191. width: 940px;
  192. height: 100%;
  193. margin-left: 11px;
  194. position: relative;
  195. top: -35px;
  196. }
  197. .right-header .top{
  198. margin-top: 35px;
  199. height: 63px;
  200. }
  201. .right-header .top img{
  202. display: block;
  203. width: 253px;
  204. height: 63px;
  205. }
  206. .menus{
  207. height: 40px;
  208. position: relative;
  209. display: flex;
  210. flex-direction: column;
  211. align-items: flex-end;
  212. margin-top: -28px;
  213. }
  214. .menus .top-menu{
  215. width: auto;
  216. height: 30px;
  217. right: 0;
  218. top: -30px;
  219. position: absolute;
  220. }
  221. .menus .menu{
  222. padding: 0 8px;
  223. list-style: none;
  224. cursor: pointer;
  225. color: #16a0d7;
  226. font-size: 1.1em;
  227. }
  228. .menus .menu:hover{
  229. color: skyblue !important;
  230. }
  231. .menus .subMenu{
  232. max-width: 90%;
  233. height: 100%;
  234. display: flex;
  235. list-style: none;
  236. align-items: center;
  237. position: relative;
  238. right: 0;
  239. }
  240. .menus .subMenu .menu{
  241. font-size: 0.85em;
  242. color: #8a8a8a;
  243. }
  244. .header-main{
  245. height: 40px;
  246. display: flex;
  247. justify-content: space-between;
  248. }
  249. .header-main .main-menus{
  250. height: 100%;
  251. list-style: none;
  252. display: flex;
  253. align-items: flex-end;
  254. font-size: 1.15em;
  255. }
  256. .main-menus .main-menu{
  257. width: auto;
  258. height: auto;
  259. color: black;
  260. margin-left: 15px;
  261. cursor: pointer;
  262. position: relative;
  263. }
  264. .main-menus .main-menu:first-child{
  265. margin-left: 0px;
  266. }
  267. .main-menus .main-menu > a{
  268. display: block;
  269. padding: 3px 20px 3px 5px;
  270. }
  271. .main-menus .main-menu > a:hover{
  272. color: orangered;
  273. }
  274. .main-menus .main-menu > a::before{
  275. content: "";
  276. width: 0;
  277. margin: 0 auto;
  278. height: 2px;
  279. background-color: #1e45e7;
  280. transition: all 0.6s;
  281. position: absolute;
  282. bottom: 0;
  283. left: 50%;
  284. }
  285. .main-menus .main-menu > .now{
  286. width: 100%;
  287. height: 2px;
  288. background-color: #1e45e7;
  289. position: absolute;
  290. bottom: 0;
  291. left: 0;
  292. overflow: hidden;
  293. }
  294. .main-menus .main-menu > a:hover:before{
  295. width: 100%;
  296. left: 0;
  297. }
  298. .search-box{
  299. height: 100%;
  300. display: flex;
  301. /*border-radius: 50%;*/
  302. align-items: center;
  303. font-size: 0.9em;
  304. }
  305. .search-box .search{
  306. height: 26px;
  307. width: 100%;
  308. border-radius: 26px;
  309. border: 1px solid gray;
  310. display: flex;
  311. position: relative;
  312. margin-top: 8px;
  313. }
  314. .search-box .search > *{
  315. outline: none;
  316. }
  317. .search > input{
  318. display: block;
  319. width: 100%;
  320. height: 24px;
  321. border-radius: 24px;
  322. padding-left: 5px;
  323. padding-right: 15px;
  324. font-size: 0.85em;
  325. }
  326. .search > button{
  327. display: block;
  328. width: 24px;
  329. height: 24px;
  330. position: absolute;
  331. top: 0;
  332. right: 3px;
  333. }
  334. .search > button:hover{
  335. color: orange;
  336. }
  337. </style>