提交 2faa9184 authored 作者: lihuihui's avatar lihuihui

修改中英文切换按钮位置

上级 28fe5be8
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
</header> </header>
<app-search v-if="searchVisible"></app-search> <app-search v-if="searchVisible"></app-search>
<app-menu v-show="menuVisible" @showApplyForm="showApplyForm"></app-menu> <app-menu v-show="menuVisible" @showApplyForm="showApplyForm"></app-menu>
<div v-show="menuVisible" class="tool-box" @click="switchLocale"> <!-- <div v-show="menuVisible" class="tool-box" @click="switchLocale">
<div class="item"> <div class="item">
<div class="icon"></div> <div class="icon"></div>
<div class="text">中文/EN</div> <div class="text">中文/EN</div>
</div> </div>
</div> </div> -->
<right-aside ref="rightAside"></right-aside> <right-aside ref="rightAside"></right-aside>
</div> </div>
</template> </template>
...@@ -55,11 +55,6 @@ export default { ...@@ -55,11 +55,6 @@ export default {
} }
}, },
methods: { methods: {
switchLocale() {
const lang = this.$cookies.get('lang') === 'zh-CN' ? 'en-US' : 'zh-CN'
this.$store.dispatch('switchLocale', lang)
location.reload()
},
toggleSearch() { toggleSearch() {
this.$store.commit('toggleMenu', false) this.$store.commit('toggleMenu', false)
this.$store.commit('toggleSearch', !this.searchVisible) this.$store.commit('toggleSearch', !this.searchVisible)
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
<nav class="app-menu"> <nav class="app-menu">
<ul> <ul>
<tree-item :item="item" v-for="(item, index) in list" :key="index" class="first"></tree-item> <tree-item :item="item" v-for="(item, index) in list" :key="index" class="first"></tree-item>
<div class="tool-box" @click="switchLocale">
<div class="item">
<div class="icon"></div>
<div class="text">中文/EN</div>
</div>
</div>
</ul> </ul>
</nav> </nav>
</template> </template>
...@@ -102,6 +108,11 @@ export default { ...@@ -102,6 +108,11 @@ export default {
methods: { methods: {
showTips() { showTips() {
this.$notify({ type: 'primary', message: '暂未开通,尽请期待' }) this.$notify({ type: 'primary', message: '暂未开通,尽请期待' })
},
switchLocale() {
const lang = this.$cookies.get('lang') === 'zh-CN' ? 'en-US' : 'zh-CN'
this.$store.dispatch('switchLocale', lang)
location.reload()
} }
} }
} }
...@@ -125,4 +136,26 @@ export default { ...@@ -125,4 +136,26 @@ export default {
padding: 0; padding: 0;
} }
} }
.tool-box{
padding: .85rem 0;
display: flex;
justify-content: center;
background: #fff;
.item{
.icon{
width: .5rem;
height: .5rem;
background: url(https://webapp-pub.oss-cn-beijing.aliyuncs.com/www/h5/images/change-lang.png);
background-size: 100% 100%;
margin: 0 auto;
}
.text{
font-size: .14rem;
line-height: 100%;
color: #999999;
margin-top: .1rem;
text-align: center;
}
}
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论