|
|
@@ -1,44 +1,29 @@
|
|
|
<template>
|
|
|
<transition name="el-fade-in-linear">
|
|
|
- <div class="nav-container flex-vc" :class="{'position-change':whether,'bg-c-f':!isNavShow}">
|
|
|
- <div class="logo-warp mouse-poi" @click="goHome">
|
|
|
-
|
|
|
-
|
|
|
+ <div class="nav-container justify-content-space-between align-items-center plr-24 box-sizing-border-box">
|
|
|
+
|
|
|
+ <div class="align-items-center">
|
|
|
+ <img class="logo-box" src="@/assets/img/logo.png" alt="">
|
|
|
+ <div class="fs-18 fc-f">GIobal Merchant Center</div>
|
|
|
</div>
|
|
|
|
|
|
- <ul class="nav-block flex-vc">
|
|
|
- <li class="nav-title mouse-poi flex-vc" :class="{active:navActive === 1}" @click="navClick(1)">
|
|
|
- {{$t('nav.navText_1')}}</li>
|
|
|
- <li class="nav-title mouse-poi flex-vc" :class="{active:navActive === 2}" @click="navClick(2)">
|
|
|
- {{$t('nav.navText_2')}}</li>
|
|
|
- <li class="nav-title mouse-poi flex-vc" :class="{active:navActive === 6}" @click="navClick(6)">
|
|
|
- 项目介绍</li>
|
|
|
- <!-- <li class="nav-title mouse-poi flex-vc" :class="{active:navActive === 3}" @click="navClick(3)">
|
|
|
- {{$t('nav.navText_3')}}</li> -->
|
|
|
- <li class="nav-title mouse-poi flex-vc" :class="{active:navActive === 4}" @click="navClick(4)">
|
|
|
- {{$t('nav.navText_4')}}</li>
|
|
|
- <li class="nav-title mouse-poi flex-vc" :class="{active:navActive === 5}" @click="navClick(5)">
|
|
|
- {{$t('nav.navText_5')}}</li>
|
|
|
- </ul>
|
|
|
+ <div class="align-items-center">
|
|
|
+ <div @click="navClick(1)" class="fs-16 mr-38 fc-f hand-cursor" :class="{active:navActive === 1}">{{$t('Home')}}{{navActive}}</div>
|
|
|
+ <div @click="navClick(2)" class="fs-16 mr-38 fc-f hand-cursor" :class="{active:navActive === 2}">{{$t('Tourism')}}</div>
|
|
|
|
|
|
- <div class="lang-container" v-click-outside="clickOutside">
|
|
|
- <div class="lang-block flex-vh mouse-poi" @click="open">
|
|
|
- <span>{{langText}}</span>
|
|
|
- <span class="rotate-warp" :class="{'rotate':langShow}">
|
|
|
- <i class="el-icon-arrow-down"></i>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <transition name="el-zoom-in-top">
|
|
|
- <ul class="option-block" v-if="langShow">
|
|
|
- <li class="option flex-vc mouse-poi" v-for="(item,index) in langList" :key="index"
|
|
|
- @click="langChange(item,index)">
|
|
|
- {{item.name}}
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- </transition>
|
|
|
- </div>
|
|
|
+ <div class="align-items-center mr-38 lang-pop-f hand-cursor" v-click-outside="clickOutside">
|
|
|
+ <div class="fs-16 fc-f " @click="open()">{{langText}}</div>
|
|
|
+ <img class="lang-img" :class="langShow?'lang-img-1':'lang-img-2'" @click="open()" src="@/assets/img/lang-icon.png" alt="">
|
|
|
|
|
|
+ <img class="sanjiaoxing-icon" v-if="langShow" src="@/assets/img/sanjiaoxing.png" alt="">
|
|
|
+ <div class="lang-pop" v-if="langShow">
|
|
|
+ <div class="fs-16" v-for="(item,index) in langList" :key="index" :class="langText==item.name?'fc-7B4F6C':''"
|
|
|
+ @click="langChange(item,index)">{{item.name}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
+ <div v-if="userToken" class="out-buttom fs-16 fw-500 hand-cursor">登出</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</transition>
|
|
|
</template>
|
|
|
@@ -53,12 +38,9 @@ export default {
|
|
|
whether: false,
|
|
|
langShow: false,
|
|
|
langIndex: 0,
|
|
|
- langText: '简体中文',
|
|
|
- langList: [{ name: '简体中文', type: 'cn' }, { name: 'English', type: 'en' }],
|
|
|
- oldScrollTop: 0,
|
|
|
- isNavShow: true,
|
|
|
- isReload: true,
|
|
|
- routes: ['/NewDetail']
|
|
|
+ langText: '繁体中文',
|
|
|
+ langList: [{ name: '繁体中文', type: 'cn' }, { name: 'English', type: 'en' }],
|
|
|
+ userToken:'',
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -76,9 +58,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
+ this.userToken = window.localStorage.getItem('userToken')
|
|
|
+
|
|
|
const lang = localStorage.getItem('lang') || 'cn'
|
|
|
if (lang === 'cn') {
|
|
|
- this.langText = '简体中文'
|
|
|
+ this.langText = '繁体中文'
|
|
|
} else {
|
|
|
this.langText = 'English'
|
|
|
}
|
|
|
@@ -89,13 +73,9 @@ export default {
|
|
|
this.whether = false
|
|
|
}
|
|
|
},
|
|
|
- mounted () {
|
|
|
- window.addEventListener('scroll', this.scrolling)
|
|
|
- },
|
|
|
+
|
|
|
methods: {
|
|
|
- goHome () {
|
|
|
- this.$router.push({ path: '/Home' })
|
|
|
- },
|
|
|
+ // 导航选择
|
|
|
navClick (num) {
|
|
|
this.$store.commit('user/setNavActive', num)
|
|
|
switch (num) {
|
|
|
@@ -103,19 +83,7 @@ export default {
|
|
|
this.$router.push({ path: '/Home' })
|
|
|
break
|
|
|
case 2:
|
|
|
- this.$router.push({ path: '/AboutUs' })
|
|
|
- break
|
|
|
- // case 3:
|
|
|
- // this.$router.push({ path: '/Cooperation' })
|
|
|
- // break;
|
|
|
- case 4:
|
|
|
- this.$router.push({ path: '/News' })
|
|
|
- break
|
|
|
- case 5:
|
|
|
- this.$router.push({ path: '/Contact' })
|
|
|
- break
|
|
|
- case 6:
|
|
|
- this.$router.push({ path: '/MyProd' })
|
|
|
+ this.$router.push({ path: '/Tourism' })
|
|
|
break
|
|
|
}
|
|
|
},
|
|
|
@@ -131,190 +99,98 @@ export default {
|
|
|
this.langShow = false
|
|
|
this.$i18n.locale = item.type
|
|
|
localStorage.setItem('lang', item.type)
|
|
|
- // this.$store.commit('user/lang', item.type)
|
|
|
let companyInfo = this.$store.getters.companyInfo
|
|
|
companyInfo = this.$langFilter(companyInfo)
|
|
|
this.$store.commit('user/setCompanyInfo', companyInfo)
|
|
|
const routePath = this.$route.path
|
|
|
this.$eventBus.$emit('langChange', item.type, routePath)
|
|
|
},
|
|
|
- scrolling () {
|
|
|
- const index = this.routes.indexOf(this.$route.path)
|
|
|
- if (this.isReload) {
|
|
|
- this.isNavShow = true
|
|
|
- this.isReload = false
|
|
|
- } else {
|
|
|
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
|
|
|
- const scrollStep = scrollTop - this.oldScrollTop
|
|
|
- this.oldScrollTop = scrollTop
|
|
|
- if (scrollStep <= 0 || index > -1) {
|
|
|
- this.isNavShow = true
|
|
|
- } else {
|
|
|
- this.isNavShow = false
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
-.nav-logo{
|
|
|
- font-weight: bold;
|
|
|
- font-size: 36px;
|
|
|
- color: #333;
|
|
|
- margin-bottom: 3px;
|
|
|
-}
|
|
|
-.logo-name{
|
|
|
- font-size: 18px;
|
|
|
- color: #333;
|
|
|
-}
|
|
|
-
|
|
|
-.bgc-f80{
|
|
|
- background: rgba(255, 255, 255, 0.8);
|
|
|
-}
|
|
|
-
|
|
|
+<style lang="scss" scoped>
|
|
|
.nav-container {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
- width: 100%;
|
|
|
- height: 100px;
|
|
|
- padding-left: 375px;
|
|
|
- background: rgba(255, 255, 255, 0.8);
|
|
|
+ width: 100vw;
|
|
|
+ height: 70px;
|
|
|
+ opacity: 1;
|
|
|
+ background: rgba(123, 79, 108, 1);
|
|
|
z-index: 1003;
|
|
|
|
|
|
- .logo-warp {
|
|
|
- .logo {
|
|
|
- width: 146px;
|
|
|
- height: 78px;
|
|
|
- }
|
|
|
- .logo-zhw{
|
|
|
- width: 140px;
|
|
|
- height: 72px;
|
|
|
- }
|
|
|
- .logo-zhw-1{
|
|
|
- width: 186px;
|
|
|
- height: 140px;
|
|
|
- }
|
|
|
+ .logo-box{
|
|
|
+ width: 48px;
|
|
|
+ height: 48px;
|
|
|
+ opacity: 1;
|
|
|
+ background: rgba(255, 255, 255, 1);
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-right: 10px;
|
|
|
}
|
|
|
|
|
|
- .nav-block {
|
|
|
- height: 100%;
|
|
|
- margin-left: 285px;
|
|
|
-
|
|
|
- .nav-title {
|
|
|
- height: 100%;
|
|
|
- font-size: 16px;
|
|
|
- color: #333333;
|
|
|
- margin-right: 58px;
|
|
|
-
|
|
|
- &:hover {
|
|
|
- color: #3169FA;
|
|
|
- }
|
|
|
-
|
|
|
- &:last-child {
|
|
|
- margin: 0;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .active {
|
|
|
- position: relative;
|
|
|
- font-weight: bold;
|
|
|
- color: #3169FA;
|
|
|
-
|
|
|
- &::after {
|
|
|
- content: ' ';
|
|
|
- position: absolute;
|
|
|
- bottom: 1px;
|
|
|
- left: 50%;
|
|
|
- transform: translateX(-50%);
|
|
|
- width: 64px;
|
|
|
- height: 0px;
|
|
|
- border-bottom: 2px solid #3169FA;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .lang-container {
|
|
|
+ .active {
|
|
|
position: relative;
|
|
|
- margin-left: 111px;
|
|
|
- font-size: 16px;
|
|
|
- color: #333;
|
|
|
- }
|
|
|
-
|
|
|
- .lang-block {
|
|
|
- justify-content: space-between;
|
|
|
- width: 119px;
|
|
|
- height: 40px;
|
|
|
- padding: 0 9px 0 16px;
|
|
|
- border: 1px solid #333;
|
|
|
- border-radius: 6px;
|
|
|
-
|
|
|
- &:hover {
|
|
|
- border: 1px solid #e9e9e9;
|
|
|
- }
|
|
|
-
|
|
|
- .rotate-warp {
|
|
|
- transition: all 0.2s;
|
|
|
- }
|
|
|
-
|
|
|
- .rotate {
|
|
|
- transition: all 0.2s;
|
|
|
- transform: rotate(180deg);
|
|
|
+ &::after {
|
|
|
+ content: ' ';
|
|
|
+ position: absolute;
|
|
|
+ bottom: -5px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ width: 100%;
|
|
|
+ height: 0px;
|
|
|
+ border-bottom: 1px solid #fff;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .option-block {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 72px;
|
|
|
- width: 119px;
|
|
|
- padding: 10px 0;
|
|
|
- background: rgba(0, 0, 0, 0.39);
|
|
|
- border: 1px solid #e9e9e9;
|
|
|
- border-radius: 6px;
|
|
|
-
|
|
|
- .option {
|
|
|
- height: 40px;
|
|
|
- padding: 0 20px;
|
|
|
-
|
|
|
- &:hover {
|
|
|
- background-color: #1B74E5;
|
|
|
- }
|
|
|
- }
|
|
|
+ .lang-img{
|
|
|
+ width: 14px;
|
|
|
+ height: 8px;
|
|
|
+ margin-left: 5px;
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-.position-change {
|
|
|
- position: static;
|
|
|
- background: #fff;
|
|
|
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.09);
|
|
|
-
|
|
|
- .nav-block .nav-title {
|
|
|
- color: #333;
|
|
|
+ .lang-img-1{
|
|
|
+ transform: rotate(180deg);
|
|
|
+ transition: transform 0.5s ease;
|
|
|
}
|
|
|
-
|
|
|
- .lang-container {
|
|
|
- color: #333;
|
|
|
-
|
|
|
- .lang-block {
|
|
|
- border-color: #999999;
|
|
|
-
|
|
|
- &:hover {
|
|
|
- border-color: #888888;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .option-block {
|
|
|
- background: rgba(255, 255, 255, 0.5);
|
|
|
-
|
|
|
- .option {
|
|
|
-
|
|
|
- &:hover {
|
|
|
- background-color: #e0e0e0;
|
|
|
- }
|
|
|
+ .lang-img-2{
|
|
|
+ transform: rotate(0deg);
|
|
|
+ transition: transform 0.5s ease;
|
|
|
+ }
|
|
|
+ .lang-pop-f{
|
|
|
+ position: relative;
|
|
|
+ .sanjiaoxing-icon{
|
|
|
+ position: absolute;
|
|
|
+ z-index: 1004;
|
|
|
+ top: 25px;
|
|
|
+ right: 0px;
|
|
|
+ width: 22px;
|
|
|
+ height: 14px;
|
|
|
+ }
|
|
|
+ .lang-pop{
|
|
|
+ background-color: #fff;
|
|
|
+ width: 104px;
|
|
|
+ min-height: 32px;
|
|
|
+ opacity: 1;
|
|
|
+ z-index: 1005;
|
|
|
+ position: absolute;
|
|
|
+ top: 30px;
|
|
|
+ right: 0;
|
|
|
+ div{
|
|
|
+ width: 100%;
|
|
|
+ height: 32px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 32px;
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .out-buttom{
|
|
|
+ width: 100px;
|
|
|
+ height: 42px;
|
|
|
+ opacity: 1;
|
|
|
+ border-radius: 2px;
|
|
|
+ background: #C7AB7B;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 42px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|