Commit 9eaeea29 authored by zhangyanni's avatar zhangyanni

语言切换

parent 51b129aa
......@@ -54,7 +54,16 @@
<div class="buttonul">
<ul>
<li>
<p><span class="iconfont icon-renzheng"></span></p>
<p><span>个人认证</span></p>
</li>
<li>
<p><span class="iconfont icon-wenhao"></span></p>
<p><span>常见问题</span></p>
</li>
<li>
<p><span class="iconfont icon-bianji"></span></p>
<p><span>意见反馈</span></p>
</li>
</ul>
</div>
......@@ -127,6 +136,7 @@
that.$i18n.locale = that.lang;//关键语句
window.localStorage.setItem("language",that.lang);
}
location.reload();
}).catch(() => {
});
......
......@@ -37,21 +37,6 @@
this.$router.push("/");
},
changeUrl(){
if (this.$route.name == "mobileLoginCmpt") {
if (this.$i18n.locale == "en") this.$router.push('/emailLoginCmpt');
}
if (this.$route.name == "emailLoginCmpt") {
if (this.$i18n.locale == "zh-CN") this.$router.push('/mobileLoginCmpt');
}
if (this.$route.name == "mobileRegisterCmpt") {
if (this.$i18n.locale == "en") this.$router.push('/emailRegisterCmpt');
}
if (this.$route.name == "emailRegisterCmpt"){
if (this.$i18n.locale == "zh-CN") this.$router.push('/mobileRegisterCmpt');
}
},
//切换语言
changeLangEvent(type) {
var that = this;
......@@ -64,12 +49,18 @@
that.lang = 'en';
that.$i18n.locale = that.lang;//关键语句
window.localStorage.setItem("language",that.lang);
location.reload();
} else {
that.lang = 'zh-CN';
that.$i18n.locale = that.lang;//关键语句
window.localStorage.setItem("language",that.lang);
location.reload();
}
that.changeUrl();
}).catch(() => {
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment