From 7ab906c6c29886ac88cddc0b8dbfcbf4fc1364ad Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 27 八月 2019 11:21:36 +0800 Subject: [PATCH] 2019-08-27update --- src/components/header.vue | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/components/header.vue b/src/components/header.vue index 5c6e71d..910e5a0 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -9,7 +9,7 @@ <span class="navico" v-else @click="showNav"><img src="../img/close.png" alt=""></span> <!-- pc绔彍鍗曞垪琛� --> <ul class="nav_ul" ref="nav_ul"> - <li v-for="(menu, index) in menus" :key="index" :class="{active1: cur === index}" @click="jump(menu.url)"> + <li v-for="(menu, index) in menus" :key="index" :class="{' menu-active': curtab === index, ' menu-hover': cur === index}" @click="jump(menu.url)"> <span @mouseover="contrlSubmenu(index)">{{ menu.text }}</span> </li> <div class="list1 active" v-if="menus[1].flag"> @@ -79,8 +79,8 @@ name: 'Header', data() { return { - activeNames: ['1'], - cur: 0, + cur: -1, + curtab: 0, isShow: false, selectedsubId: null, menus: [{ @@ -136,8 +136,17 @@ if (!name) return this.selectedsubId = null this.isShow = false + name = name.toLowerCase() if (!type) { // 涓婚〉闈㈣烦杞� - if (name === 'CompanyProfile') { // 鍏充簬鏄庣,閿氱偣鍙傛暟 + let change = { + index: 0, + successcase: 2, + partner: 3, + news: 4, + companyprofile: 5 + } + this.curtab = change[name] + if (name === 'companyprofile') { // 鍏充簬鏄庣,閿氱偣鍙傛暟 this.$router.push({name: name, params: {hash: 'null'}}) } else { this.$router.push({name: name}) @@ -145,15 +154,18 @@ } else if (type === 'submenu') { // 浜у搧涓績瀛愰〉闈㈣烦杞� this.menus[1].flag = false this.menus[5].flag = false + this.curtab = 1 this.selectedsubId = index this.$router.push({name: name, params: {menuId: index}}) } else if (type === 'aboutUs') { // 鍏充簬鏄庣瀛愰〉闈㈣烦杞� + this.curtab = 5 if (index === 3) { // 鍔犲叆鏄庣 this.$router.push({name: name}) } else { - this.$router.push({name: 'CompanyProfile', params: {hash: `#anchor-${index + 1}`}}) + this.$router.push({name: 'companyprofile', params: {hash: `#anchor-${index + 1}`}}) } } + }, showNav () { this.isShow = !this.isShow @@ -173,6 +185,7 @@ } }, leave () { + this.cur = -1 this.menus[1].flag = false this.menus[5].flag = false }, @@ -185,10 +198,15 @@ url: pro.PageType } }) + this.products.unshift({ + Id: 'centerview', + text: '浜у搧涓績', + url: 'center' + }) this.products.push({ - Id: this.products[0].Id, + Id: 'centerview', text: '鏇村 >>', - url: this.products[0].url + url: 'center' }) this.solutions = res.Solution.map(pro => { @@ -198,10 +216,15 @@ url: pro.PageType } }) + this.solutions.unshift({ + Id: 'casesolutionview', + text: '瑙e喅鏂规', + url: 'casesolution' + }) this.solutions.push({ - Id: this.solutions[0].Id, + Id: 'casesolutionview', text: '鏇村 >>', - url: this.solutions[0].url + url: 'casesolution' }) }) } @@ -224,7 +247,7 @@ -webkit-animation: gupIn 1s 0.1s both; -moz-animation: gupIn 1s 0.1s both; animation: gupIn 1s 0.1s both; - z-index: 8888; + z-index: 2000; top: 0; .wrapper { @@ -309,7 +332,8 @@ position: absolute; left: -0.8rem; transition: all .3s ease 0s; - height: 2rem; + min-height: 1.5rem; + padding-bottom: 0.2rem; background-color: #212020; z-index: 999; @@ -530,7 +554,10 @@ .active { opacity: 1; } - .active1 { + .menu-hover { + background: #232323; + } + .menu-active { background: #212020; } </style> -- Gitblit v1.8.0