From bae56a147be85be57ad1c64e9766c9aca750d187 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 04 三月 2025 16:04:12 +0800 Subject: [PATCH] 2025-03-04 --- src/components/header.vue | 783 +++++++++++++++++++------------------------------------ 1 files changed, 272 insertions(+), 511 deletions(-) diff --git a/src/components/header.vue b/src/components/header.vue index 0b9495d..b50b3c6 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -1,81 +1,78 @@ <template> - <div class="header" :class="!isShow ? '' : 'h_height'"> - <div class="wrapper"> - <a class="logo"><img src="../img/index_logo.png" alt=""></a> + <div class="header-wrap"> + <div class="pc-wrapper"> + <a class="logo" @click="jumpview('home')"><img src="../img/index_logo.png" alt=""></a> <div class="nav"> - <router-link tag="span" class="homeico m_hide" to="/"><img src="../img/homeico.png" alt=""></router-link> - <span class="homeico p_hide" @click="jump('/')"><img src="../img/homeico.png" alt=""></span> - <span class="navico" v-if="!isShow" @click="showNav"><img src="../img/navico.png" alt=""></span> - <span class="navico" v-else @click="showNav"><img src="../img/close.png" alt=""></span> - <ul class="nav_ul" ref="nav_ul"> - <router-link tag="li" v-for="(menu,index) in menus" :key="index" :to="menu.url" :class="{active1:cur==index}"> - <span @mouseover="add(index)">{{ menu.text }}</span> - </router-link> - <div class="list1 list3" :class="{active:this.menus[1].flag==true}" @click="menus[1].flag = false" v-if="menus[1].flag"></div> - <div :class="{active:this.menus[1].flag==true}" class="list1" @click="adda(1)" v-if="menus[1].flag"> - <ul class="abloutMingKe_ul"> - <router-link @click="add1($event,index)" tag="li" v-for="(secondMenus,index) in secondMenus" :key="index" :to="secondMenus.url">{{secondMenus.text}}</router-link> - </ul> - <ul class="abloutMingKe_ul1"> - <router-link tag="li" v-for="(secondMenus,index) in secondMenus1" :key="index" :to="secondMenus.url">{{secondMenus.text}}</router-link> - </ul> - </div> - <div class="list1 list33" :class="{active:this.menus[1].flag==true}" @click="menus[1].flag = false" v-if="menus[1].flag">5646546</div> - <div :class="{active:this.menus[5].flag==true}" class="list1 list33" @click="menus[5].flag = false" v-if="menus[5].flag"></div> - <div :class="{active:this.menus[5].flag==true}" class="list2" @click="adda(5)" v-if="menus[5].flag"> - <ul class="abloutMingKe_ul2"> - <li v-for="(secondMenus,index) in secondMenus2" @click="add5(secondMenus.url,index+1)" :key="index">{{secondMenus.text}}</li> - </ul> - </div> - <!-- <div :class="{active:this.menus[5].flag==true}" class="list2 list5" @click="menus[5].flag = false" v-if="menus[5].flag"></div> --> - </ul> + <el-menu :default-active="activeKey" mode="horizontal"> + <el-menu-item index="home" @click="jumpview('home')">棣栭〉</el-menu-item> + <el-submenu index="product" popper-class="header-dubble-menu"> + <template slot="title">浜у搧涓績</template> + <div class="dubble-ul-wrap"> + <div class="dubble-ul"> + <el-menu-item :index="'product-p' + index" :key="index" @click="jumpview(product.url, product.Id, 'submenu')" v-for="(product, index) in products">{{product.text}}</el-menu-item> + </div> + <div class="dubble-ul"> + <el-menu-item :index="'product-s' + index" :key="index" @click="jumpview(solution.url, solution.Id, 'submenu')" v-for="(solution, index) in solutions">{{solution.text}}</el-menu-item> + </div> + </div> + </el-submenu> + <el-menu-item index="successcase" @click="jumpview('SuccessCase')">鎴愬姛妗堜緥</el-menu-item> + <el-menu-item index="partner" @click="jumpview('Partner')">娓犻亾鍚堜綔</el-menu-item> + <el-menu-item index="news" @click="jumpview('News')">鏂伴椈璧勮</el-menu-item> + <el-submenu index="companyprofile" popper-class="header-menu"> + <template slot="title"><span @click="jumpview('Company')">鍏充簬鏄庣</span></template> + <el-menu-item index="companyProfile-1" @click="jumpview('CompanyProfile', 'culture.html')">浼佷笟鏂囧寲</el-menu-item> + <el-menu-item index="companyProfile-2" @click="jumpview('CompanyProfile', 'aptitude.html')">鑽h獕璧勮川</el-menu-item> + <el-menu-item index="companyProfile-3" @click="jumpview('CompanyProfile', 'contact.html')">鑱旂郴鏄庣</el-menu-item> + <el-menu-item index="companyProfile-4" @click="jumpview('joinMingKe')">鍔犲叆鏄庣</el-menu-item> + </el-submenu> + <el-menu-item index="word"><a href="http://mk9h.cn/a.asp?a=9CCB" ref="nofollow" target="_blank">鏂囨。涓績</a></el-menu-item> + </el-menu> + </div> + <div class="pc-tel"> + <img src="../img/add3.png" alt class="footer_img" /> + <span>400-189-1819</span> + </div> + <div class="register"> + <span @click="jumpview('signup')">娉ㄥ唽</span> + <a href="https://cloud.mk9h.cn/index.html" ref="nofollow" target="_blank">鐧诲綍</a> </div> </div> - - <div :class="!isShow ? 'nav_ul' : 'plane'" style="height: 100%;background-color: #282830;display: none;margin-top:0.3rem"> - <el-collapse accordion> - <el-collapse-item> - <template slot="title"> - <span class="title_s">浜у搧涓績</span> - </template> - <div class="menu3" @click="jump('center')" style="color: #fff;">浜у搧涓績</div> - <div class="menu3" @click="jump('productCenter')">MingKeOS</div> - <div class="menu3" @click="jump('productCenter')">鏅烘収浠撳偍</div> - <div class="menu3 more" @click="jump('center')">鏇村 <img src="../img/more.png" alt=""></div> - <div style="clear: both;"></div> - <div class="menu3" @click="jump('caseSolution')" style="color: #fff;">瑙e喅鏂规</div> - <div class="menu3" @click="jump('caseDetail')">鐢靛姩宸ュ叿琛屼笟瑙e喅鏂规</div> - <div class="menu3" @click="jump('caseDetail')">绯荤粺闆嗘垚琛屼笟瑙e喅鏂规</div> - <div class="menu3" @click="jump('caseDetail')">鐢靛瓙鍟嗗姟琛屼笟瑙e喅鏂规</div> - <div class="menu3" @click="jump('caseDetail')">鍒惰嵂琛屼笟瑙e喅鏂规</div> - <div class="menu3 more" @click="jump('caseSolution')">鏇村 <img src="../img/more.png" alt=""></div> - <div style="clear: both;"></div> - </el-collapse-item> - <el-collapse-item class="el_coll"> - <template slot="title"> - <span @click="jump('successCase')" class="title_s">鎴愬姛妗堜緥</span> - </template> - </el-collapse-item> - <el-collapse-item class="el_coll"> - <template slot="title"> - <span @click="jump('partner')" class="title_s">娓犻亾鍚堜綔</span> - </template> - </el-collapse-item> - <el-collapse-item class="el_coll"> - <template slot="title"> - <span @click="jump('news')" class="title_s">鏂伴椈璧勮</span> - </template> - </el-collapse-item> - <el-collapse-item> - <template slot="title"> - <span @click="jump('companyProfile')" class="title_s">鍏充簬鏄庣</span> - </template> - <div class="menu2" @click="jump('companyProfile#anchor-1')">浼佷笟鏂囧寲</div> - <div class="menu2" @click="jump('companyProfile#anchor-2')">鑽h獕璧勮川</div> - <div class="menu2" @click="jump('companyProfile#anchor-3')">鑱旂郴鏄庣</div> - <div class="menu2" @click="jump('joinMingKe')">鍔犲叆鏄庣</div> - </el-collapse-item> - </el-collapse> + <div class="mob-wrapper"> + <a class="logo"><img src="../img/index_logo.png" alt=""></a> + <div class="nav"> + <span class="homeico" @click="jumpview('Index')"><img src="../img/homeico.png" alt=""></span> + <span class="navico" v-if="!isShow" @click="isShow = !isShow"><img src="../img/navico.png" alt=""></span> + <span class="navico" v-else @click="isShow = !isShow"><img src="../img/close.png" alt=""></span> + </div> + <div class="register"> + <span @click="jumpview('signup')">娉ㄥ唽</span> + </div> + <div class="mob-menu" v-show="isShow"> + <el-menu :default-active="activeKey"> + <el-submenu index="product" popper-class="header-dubble-menu"> + <template slot="title">浜у搧涓績</template> + <el-menu-item-group> + <el-menu-item :index="'product-p' + index" :key="index" @click="jumpview(product.url, product.Id, 'submenu')" v-for="(product, index) in products">{{product.text}}</el-menu-item> + </el-menu-item-group> + <el-menu-item-group> + <el-menu-item :index="'product-s' + index" :key="index" @click="jumpview(solution.url, solution.Id, 'submenu')" v-for="(solution, index) in solutions">{{solution.text}}</el-menu-item> + </el-menu-item-group> + </el-submenu> + + <el-menu-item index="successcase" @click="jumpview('SuccessCase')"><div class="simple">鎴愬姛妗堜緥</div></el-menu-item> + <el-menu-item index="partner" @click="jumpview('Partner')"><div class="simple">娓犻亾鍚堜綔</div></el-menu-item> + <el-menu-item index="news" @click="jumpview('News')"><div class="simple">鏂伴椈璧勮</div></el-menu-item> + <el-submenu index="companyprofile" popper-class="header-menu"> + <template slot="title"><span @click="jumpview('Company')">鍏充簬鏄庣</span></template> + <el-menu-item index="companyProfile-1" @click="jumpview('CompanyProfile', 'culture.html')">浼佷笟鏂囧寲</el-menu-item> + <el-menu-item index="companyProfile-2" @click="jumpview('CompanyProfile', 'aptitude.html')">鑽h獕璧勮川</el-menu-item> + <el-menu-item index="companyProfile-3" @click="jumpview('CompanyProfile', 'contact.html')">鑱旂郴鏄庣</el-menu-item> + <el-menu-item index="companyProfile-4" @click="jumpview('joinMingKe')">鍔犲叆鏄庣</el-menu-item> + </el-submenu> + <el-menu-item index="word"><a href="http://mk9h.cn/a.asp?a=9CCB" ref="nofollow" target="_blank">鏂囨。涓績</a></el-menu-item> + </el-menu> + </div> </div> </div> </template> @@ -85,166 +82,109 @@ name: 'Header', data() { return { - activeNames: ['1'], - cur: 0, + activeKey: 'home', + cur: -1, + curtab: 0, isShow: false, - isShowChild: false, - menus: [{ - text: '棣栭〉', - url: '/', - }, - { - text: '浜у搧涓績', - url: '', - flag: false, - }, - { - text: '鎴愬姛妗堜緥', - url: '/successCase', - }, - { - text: '娓犻亾鍚堜綔', - url: '/partner' - }, - { - text: '鏂伴椈璧勮', - url: '/news' - }, - { - text: '鍏充簬鏄庣', - url: '/companyProfile', - flag: false, - } - ], - secondMenus: [{ - text: '浜у搧涓績', - url: 'center' - }, - { - text: 'MingKeOS', - url: 'productCenter' - }, - { - text: '鏅烘収浠撳偍', - url: 'productCenter' - }, - { - text: '璐ㄩ噺杩芥函', - url: 'productCenter' - }, - { - text: '鏇村 銆�', - url: '/center' - }, - ], - secondMenus1: [{ - text: '瑙e喅鏂规', - url: '/caseSolution' - }, - { - text: '鐢靛姩宸ュ叿琛屼笟瑙e喅鏂规', - url: '/caseDetail' - }, - { - text: '绯荤粺闆嗘垚琛屼笟瑙e喅鏂规', - url: '/caseDetail' - }, - { - text: '鐢靛瓙鍟嗗姟琛屼笟瑙e喅鏂规', - url: '/caseDetail' - }, - { - text: '鍒惰嵂琛屼笟瑙e喅鏂规', - url: '/caseDetail' - }, - { - text: '鏇村 銆�', - url: '/caseSolution' - } - ], - secondMenus2: [{ - text: '浼佷笟鏂囧寲', - url: '/companyProfile' - }, - { - text: '鑽h獕璧勮川', - url: '/companyProfile' - }, - { - text: '鑱旂郴鏄庣', - url: '/companyProfile' - }, - { - text: '鍔犲叆鏄庣', - url: '/joinMingKe' - }, - ] + selectedsubId: null, + products: null, + solutions: null } }, methods: { - goHere(path) { - this.$router.push({ - path: path - }); - }, - showNav() { - this.isShow = !this.isShow; - this.$refs.nav_ul.style.left = this.isShow ? (0 + 'px') : (-1000 + 'px') - }, - add(index) { - this.cur = index - if (index == 1) { - this.menus[index].flag = !this.menus[index].flag; - this.menus[5].flag = false; - } else if (index == 5) { - this.menus[index].flag = !this.menus[index].flag; - this.menus[1].flag = false; - } else { - this.menus[1].flag = false; - this.menus[5].flag = false; - } - }, - add5(u,i) { - if(i != 4){ - this.$router.push(`${u}#anchor-${i}`) - }else{ - this.$router.push(u) - } - }, - adda(index) { - if (index == 1 || index == 5) { - this.menus[index].flag = false; - } - }, - add1(e, index) { - console.log(index) - }, - //绉诲姩绔烦杞� - jump(u) { + jumpview (url, par, type) { + let name = url.toLowerCase() + let params = {} this.isShow = false - this.$router.push(u) + if (name === 'companyprofile') { + params.hash = par + } else if (type === 'submenu') { // 浜у搧涓績瀛愰〉闈㈣烦杞� + this.activeKey = 'product' + params.menuId = par + '.html' + } else if (name === 'signup') { + if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) { + name = 'mobsignup' + } + window.open(window.location.origin + '/' + name) + return + } + + this.$router.push({name: name, params}) }, + load () { + this.Service.getBaseData('Web_Index_GetData').then(res => { + this.products = res.Product.map(pro => { + return { + Id: pro.ID, + text: pro.Title1, + url: pro.PageType + } + }) + this.products.unshift({ + Id: 'centerview', + text: '浜у搧涓績', + url: 'center' + }) + this.products.push({ + Id: 'centerview', + text: '鏇村 >>', + url: 'center' + }) + + this.solutions = res.Solution.map(pro => { + return { + Id: pro.ID, + text: pro.Title1, + url: pro.PageType + } + }) + this.solutions.unshift({ + Id: 'casesolutionview', + text: '瑙e喅鏂规', + url: 'casesolution' + }) + this.solutions.push({ + Id: 'casesolutionview', + text: '鏇村 >>', + url: 'casesolution' + }) + }) + } + }, + created () { + this.activeKey = this.$route.name + }, + mounted () { + this.load() } } </script> <style lang="less" scoped> - .header { + .header-wrap { background: #282830; position: fixed; width: 100%; - /*padding: 0.08rem 0;*/ + padding: 0.08rem 0; -webkit-transition: 0.3s; -moz-transition: 0.3s; transition: 0.3s; -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 { + .pc-wrapper { + width: 1300px; + margin: 0 auto; display: flex; + justify-content: space-between; + position: relative; + align-items: center; + } + .mob-wrapper { + display: none; justify-content: space-between; position: relative; align-items: center; @@ -252,331 +192,152 @@ .logo { float: left; - img { - height: 0.67rem; + height: 0.4rem; } } .nav { float: right; + } - .navico { - width: 0.45rem; - - img { - height: 0.39rem; - } + .pc-tel { + display: block; + width: 155px; + img { + width: 20px; + height: 20px; + vertical-align: text-bottom; } - - .homeico { - img { - height: 0.54rem; - margin-right: 0.46rem; - } + span { + font-size: 0.16rem; + color: #fff; + cursor: default; + padding: 0 0.1rem; + } + } + .register { + flex: 0.3; + white-space: nowrap; + span, a { + display: inline-block; + font-size: 0.16rem; + color: #ffffff; + cursor: pointer; + padding: 0px; + } + a { + margin-left: 10px; } } - @media (min-width: 751px) { - .list3{ - right: 5.8rem; - width: 7rem; - height: 90vh; - } - .list33{ - right: -1.5rem; - width: 115%; - height: 90vh; - } - .list4{ - right: -1.95rem; - height: 90vh; - } - .list5{ - right: 1.17rem; - width: 4rem; - height: 90vh; - } - .plane { - display: none; - } - - li { - float: left; + li { + line-height: 0.68rem; + height: 0.68rem; + > div.el-submenu__title { line-height: 0.68rem; height: 0.68rem; } - - span { - font-size: 0.18rem; - color: #fff; - cursor: pointer; - padding: 0 0.22rem; - } - } - - .abloutMingKe_ul, - .abloutMingKe_ul1 { - width: 1.8rem; - position: absolute; - left: -0.8rem; - transition: all .3s ease 0s; - height: 2rem; - background-color: #212020; - z-index: 999; - - li { - width: 100%; - float: none; - color: #fff; - font-size: 0.14rem; - padding: 0 0.22rem; - line-height: 0.29rem; - height: 0.29rem; - } - - li:last-child { - text-align: right; - } - - li:hover { - opacity: 0.8; - cursor: pointer; - } - } - - .abloutMingKe_ul1 { - width: 1.9rem; - margin-left: 1.8rem; - } - - .abloutMingKe_ul { - border-right: 1px solid #999999; - - li:last-child { - margin-top: .3rem; - text-align: right; - } - } - - .abloutMingKe_ul2 { - width: 1.16rem; - height: 1.3rem; - position: absolute; - top:-0.08rem; - transition: all .3s ease 0s; - background-color: #212020; - - li { - width: 100%; - float: none; - color: #fff; - font-size: 0.14rem; - padding: 0 0.22rem; - line-height: 0.29rem; - height: 0.29rem; - text-align: center; - } - - li:hover { - cursor: pointer; - opacity: 0.8; - } } } - @media (max-width: 750px) and (min-width: 0) { - .title_s{ - font-size: 0.35rem; - width: 100%; - padding-left: 42%; - } - .header .logo img { - height: 0.55rem; - } - - .plane { - display: block !important; - } - - .nav_ul { - display: none; - } - - .header { - // height: 100%; - // background-color: #303030; - padding-bottom: 0.2rem; - } - - .h_height { - height: 100%; - } - - .h_none { - display: none; - } - - .header .wrapper { - padding-top: 0.3rem; - } - - .header .abloutMingKe_ul2 { - width: auto; - height: auto; - } - - .header .abloutMingKe_ul2 li { - background-color: black; - height: 0.5rem; - line-height: 0.5rem; - } - - .header .nav .nav_ul { - position: fixed; - width: 100%; - left: -10rem; - top: 1.29rem; - bottom: 0; - background: #212020; - z-index: 8888; - height: auto; - - >li { - text-align: center; - float: none; - text-align: center; - line-height: inherit; - height: auto; - + @media (max-width: 1366px) and (min-width: 750px) { + .header-wrap { + .pc-wrapper { + width: 90%; + } + .pc-tel { + img { + width: 18px; + height: 18px; + } span { - display: block; - font-size: 0.42rem; - border-bottom: 1px solid #fff; - color: #fff; - padding: 0.44rem 0; + font-size: 0.15rem; } } - - >li:first-child { - display: none; + .register { + span, a { + font-size: 0.15rem; + } } } - .header .nav .navico, - .header .nav .homeico { - display: inline-block; - padding: 0; - } - .abloutMingKe_ul, - .abloutMingKe_ul1 { - background: #303030; - - li { - border: none; - padding: .2rem .6rem .2rem 1rem; - text-align: left; - color: #7C7C7C; - } - - li:first-child { - color: #fff; - } - - li:last-child { - text-align: right; - } - } - - .abloutMingKe_ul { - border-bottom: #fff 1px solid; - } - - .menu2 { - text-align: center; - line-height: 0.75rem; - font-size: 0.32rem; - } - - .menu3 { - line-height: 0.75rem; - padding-left: 30%; - color: #7C7C7C; - font-size: 0.32rem; - - img { - width: 0.2rem; - margin-top: -0.06rem; - margin-left: 0.2rem; - } - } - - .more { - float: right; - padding-right: 0.5rem; - margin-bottom: 0.1rem; - } - } - .list1 { - display: flex; - opacity: 0; - height: auto; - width: 5rem; - position: absolute; - top: 0.65rem; - right: 0; - } - .list2 { - opacity: 0; - width: 2rem; - height: auto; - position: absolute; - top: 0.76rem; - right: -0.84rem; - } - .active { - opacity: 1; - } - .active1 { - background: #212020; - } -</style> -<style> - .el-collapse { - border-top: 0; - } - - .el-collapse-item__header { - height: 1.1rem; - line-height: 1.1rem; - background-color: #303030; - border-color: darkgray; - color: #fff; - } - - .el-collapse-item__content { - background-color: #303030; - color: #fff; - } - - .el-collapse-item__wrap { - border-color: darkgray; - } - - .el-collapse-item__arrow { - margin-right: 2rem; - } - - .el-collapse-item__header.is-active { - background-color: #49A2DD; - } - - .el-collapse-item__content { - padding-bottom: 0; } @media (max-width: 750px) and (min-width: 0) { - .el_coll .el-collapse-item__arrow { - display: none; + .header-wrap { + .pc-wrapper { + display: none; + } + .mob-wrapper { + display: flex; + padding-top: .3rem; + width: 94%; + margin: 0 auto; + } + + .logo img { + height: 0.55rem; + } + .nav { + flex: 1; + text-align: right; + .navico { + display: inline-block; + padding: 0; + width: 0.45rem; + img { + height: 0.35rem; + } + } + .homeico { + display: inline-block; + padding: 0; + img { + height: 0.45rem; + margin-right: 0.4rem; + } + } + } + .register { + text-align: right; + span { + font-size: 0.3rem; + } + } + li { + height: unset; + line-height: unset; + } + .mob-menu > .el-menu > li { + border-bottom: 1px solid #ffffff; + > div.simple { + height: 56px; + line-height: 56px; + } + > a { + display: inline-block; + height: 56px; + line-height: 56px; + } + > div.el-submenu__title { + height: 56px; + line-height: 56px; + } + } + .mob-menu { + position: fixed; + top: 1rem; + left: 0px; + right: 0px; + bottom: 0px; + background-color: #282830; + overflow-y: auto; + padding-bottom: 50px; + } + } + + .header-wrap { + padding-bottom: 0.2rem; } } </style> -- Gitblit v1.8.0