|
@@ -5,10 +5,26 @@
|
|
|
<img :src="require(`@/assets/images/icons/logo_black_${$lang}.svg`)" alt="" />
|
|
|
</a>
|
|
|
<ul class="tab">
|
|
|
- <li @click="handleItem(item)" :class="{active:active.id==item.id}" v-for="(item, i) in tab" :key="i">
|
|
|
+ <li @click="handleItem(item)" :class="{ active: active.id == item.id }" v-for="(item, i) in tab" :key="i">
|
|
|
{{ item.name }}
|
|
|
</li>
|
|
|
</ul>
|
|
|
+
|
|
|
+ <div class="language-w">
|
|
|
+ <div class="list">
|
|
|
+ <a class="header-item" :class="{ 'is-hover': showLangList }" @touchstart="showLangList = !showLangList">
|
|
|
+ <p class="guoqi" :style="{ 'background-image': `url(${languageObj.img})` }">
|
|
|
+ {{ languageObj.name }}
|
|
|
+ </p>
|
|
|
+ <ul class="child-list">
|
|
|
+ <li v-for="item in languageList" :key="item.name" :style="{ 'background-image': `url(${item.img})` }"
|
|
|
+ @click="changeLanguage(item.value)">{{ item.name }}</li>
|
|
|
+ </ul>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ <!-- <span class="language en" :class="{'is-active': language === 'en'}" @click="changeLanguage('en')">EN</span>
|
|
|
+ <span class="language" :class="{'is-active': language !== 'en'}" @click="changeLanguage('zh')">中</span> -->
|
|
|
+ </div>
|
|
|
<user-info class="user-info"></user-info>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -16,7 +32,7 @@
|
|
|
|
|
|
<script>
|
|
|
import UserInfo from "@/components/userInfo.vue";
|
|
|
-import {i18n} from "@/lang"
|
|
|
+import { i18n } from "@/lang"
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -24,38 +40,63 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- homeLink:process.env.VUE_APP_PROXY_URL_ROOT,
|
|
|
- active:{},
|
|
|
+ homeLink: process.env.VUE_APP_PROXY_URL_ROOT,
|
|
|
+ langauge: localStorage.getItem('language'),
|
|
|
+ languageList: [
|
|
|
+ {
|
|
|
+ name: '简体中文',
|
|
|
+ img: require('@/assets/images/icons/china@2x.png'),
|
|
|
+ value: 'zh'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'English',
|
|
|
+ img: require('@/assets/images/icons/USA@2x.jpg'),
|
|
|
+ value: 'en'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ showLangList: false,
|
|
|
+ active: {},
|
|
|
tab: [
|
|
|
{
|
|
|
name: i18n.t("gather.my_works"),
|
|
|
id: "works",
|
|
|
- path:{
|
|
|
- path:'/works'
|
|
|
+ path: {
|
|
|
+ path: '/works'
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
name: i18n.t("gather.my_material"),
|
|
|
id: "material",
|
|
|
- path:{
|
|
|
- path:'/'
|
|
|
+ path: {
|
|
|
+ path: '/pano'
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
};
|
|
|
},
|
|
|
- watch:{
|
|
|
- '$route.meta':{
|
|
|
- deep:true,
|
|
|
- handler:function (newVal) {
|
|
|
- this.active = this.tab.find(item=>{
|
|
|
- return item.id == newVal.belong
|
|
|
+ computed: {
|
|
|
+ languageObj() {
|
|
|
+ console.log(i18n.locale);
|
|
|
+ return this.languageList.find(item => item.value === i18n.locale)
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$route.meta': {
|
|
|
+ deep: true,
|
|
|
+ handler: function (newVal) {
|
|
|
+ this.active = this.tab.find(item => {
|
|
|
+ return item.id == newVal.belong
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- methods:{
|
|
|
- handleItem(item){
|
|
|
+ methods: {
|
|
|
+ changeLanguage(lang) {
|
|
|
+ let arr = location.href.split('#/')
|
|
|
+ location.href = `material.html?lang=${lang}#/${arr[1]}`
|
|
|
+ localStorage.language = lang
|
|
|
+ },
|
|
|
+ handleItem(item) {
|
|
|
this.$router.push(item.path)
|
|
|
}
|
|
|
}
|
|
@@ -70,6 +111,7 @@ export default {
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
z-index: 999;
|
|
|
+
|
|
|
.con {
|
|
|
color: #000;
|
|
|
max-width: 1280px;
|
|
@@ -79,31 +121,37 @@ export default {
|
|
|
margin: 0 auto;
|
|
|
position: relative;
|
|
|
padding: 0;
|
|
|
+
|
|
|
.logo {
|
|
|
font-size: 24px;
|
|
|
font-weight: bold;
|
|
|
height: 100%;
|
|
|
- >img{
|
|
|
+
|
|
|
+ >img {
|
|
|
height: 100%;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.tab {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin-left: 116px;
|
|
|
- > li {
|
|
|
+
|
|
|
+ >li {
|
|
|
cursor: pointer;
|
|
|
margin-right: 50px;
|
|
|
text-align: left;
|
|
|
font-size: 16px;
|
|
|
color: #909090;
|
|
|
- &.active{
|
|
|
+
|
|
|
+ &.active {
|
|
|
font-size: 16px;
|
|
|
font-weight: bold;
|
|
|
color: #0076F6;
|
|
|
position: relative;
|
|
|
- &::before{
|
|
|
+
|
|
|
+ &::before {
|
|
|
content: '';
|
|
|
width: 20px;
|
|
|
height: 2px;
|
|
@@ -117,8 +165,107 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .user-info {
|
|
|
+
|
|
|
+ .language-w {
|
|
|
margin-left: auto;
|
|
|
+ .list{
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+
|
|
|
+ .header-item {
|
|
|
+ margin-right: 20px !important;
|
|
|
+
|
|
|
+ &:hover,
|
|
|
+ &.is-hover {
|
|
|
+ position: relative;
|
|
|
+ color: #202020;
|
|
|
+
|
|
|
+ .child-list {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ p {
|
|
|
+ color: #323233;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: normal;
|
|
|
+ cursor: pointer;
|
|
|
+ background: url(~@/assets/images/icons/china.png) no-repeat left center;
|
|
|
+ background-size: 20px 14px;
|
|
|
+ padding: 10px 0 10px 28px;
|
|
|
+
|
|
|
+ .iconfont {
|
|
|
+ font-size: 10px;
|
|
|
+ color: rgb(144, 144, 144);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ &:hover p .iconfont::before {
|
|
|
+ content: "\E744";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .child-list {
|
|
|
+ position: absolute;
|
|
|
+ // width: 112px;
|
|
|
+ box-shadow: 0px -2px 6px rgba(113, 113, 113, 0.16);
|
|
|
+ margin-top: 0;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ z-index: 0;
|
|
|
+ display: none;
|
|
|
+ transition: all linear 0.5s;
|
|
|
+ padding-top: 6px;
|
|
|
+ background: #fff;
|
|
|
+
|
|
|
+ &::before {
|
|
|
+ position: absolute;
|
|
|
+ display: block;
|
|
|
+ top: -5px;
|
|
|
+ left: 50%;
|
|
|
+ margin-left: -2px;
|
|
|
+ width: 0;
|
|
|
+ height: 0px;
|
|
|
+ content: '';
|
|
|
+ background: #fff;
|
|
|
+ border-style: solid;
|
|
|
+ border-width: 4px;
|
|
|
+ border-color: #fff #fff transparent transparent;
|
|
|
+ transform: rotate(-45deg);
|
|
|
+ box-shadow: 1px -1px 0px rgba(113, 113, 113, 0.16);
|
|
|
+ z-index: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ li {
|
|
|
+ height: 48px;
|
|
|
+ line-height: 48px;
|
|
|
+ font-size: 16px;
|
|
|
+ text-align: center;
|
|
|
+ position: relative;
|
|
|
+ background: #fff;
|
|
|
+ cursor: pointer;
|
|
|
+ z-index: 2;
|
|
|
+ padding: 0 25px;
|
|
|
+ white-space: nowrap;
|
|
|
+ color: #909090;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: normal;
|
|
|
+ padding: 0 13px 0 40px;
|
|
|
+ background: url(~@/assets/images/icons/china.png) no-repeat 13px center;
|
|
|
+ background-size: 20px 14px;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ background-color: #EBEBEB;
|
|
|
+ color: #202020;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .user-info {
|
|
|
margin-right: 0;
|
|
|
}
|
|
|
}
|