Commit decebb92 authored by zhangyanni's avatar zhangyanni

中英文切换

parent 1b582be0
......@@ -42,15 +42,15 @@
};
</script>
<style scoped>
<style scoped lang="scss">
.boxWrapper {
background: #1b2750;
width: 64px;
background: #1E1E2D;
width: 15%;
height: 100%;
color: #919dc6;
color: #A2A3B7;
position: absolute;
left: 0;
top: 0;
top: 60px;
padding-top: 60px;
z-index: 8998;
}
......
......@@ -72,6 +72,7 @@
components:{
sliderCmpt
},
inject:['reload'],
data() {
return {
activeName: "first",
......
......@@ -73,6 +73,7 @@
components:{
sliderCmpt
},
inject:['reload'],
data() {
return {
activeName: "first",
......
<template>
<div class="page-wrapper">
<page-top :initStyle="isInit"></page-top>
<!--<page-left></page-left>-->
<page-left v-if="false"></page-left>
<div class="page-content popper-boundaries">
<router-view/>
</div>
......
......@@ -62,6 +62,8 @@
import api from '../api/api';
export default {
name: "completeInfoCmpt",
inject:['reload'],
components:{
"vue-select":vSelect
},
......
......@@ -71,6 +71,8 @@
sliderCmpt,
dialogCmpt
},
inject:['reload'],
data() {
return {
activeName: "first",
......
......@@ -45,6 +45,8 @@
components:{
sliderCmpt
},
inject:['reload'],
data(){
const that = this;
return{
......
......@@ -13,7 +13,7 @@
<span :class="lang==='en'?'fontBold':''">En</span>
</div>
<div class="loginform">
<router-view></router-view>
<router-view v-if="isRouterAlive"></router-view>
</div>
<div class="bottomCopyRight">
<p>@2019 All Copyright Reserved By TechBook.com 京ICP备15012625号-1</p>
......@@ -23,6 +23,8 @@
</template>
<script>
import validate from "../../../common/validate";
export default {
name: "login",
data() {
......@@ -30,13 +32,43 @@
currentLanguage: null,
showWhich: false,
lang: this.$i18n.locale,
isRouterAlive:true
}
},
provide(){
return {
reload:this.reload
}
},
methods: {
reload(){
this.isRouterAlive = false;
this.$nextTick(()=>{
this.isRouterAlive = true;
})
},
handleToIndex(){
this.$router.push("/");
},
changeUrl(){
if (this.$route.name == "mobileLoginCmpt") {
if (this.$i18n.locale == "en") this.$router.replace('/emailLoginCmpt');
}
if (this.$route.name == "emailLoginCmpt") {
if (this.$i18n.locale == "zh-CN") this.$router.replace('/mobileLoginCmpt');
}
if (this.$route.name == "mobileRegisterCmpt") {
if (this.$i18n.locale == "en") this.$router.replace('/emailRegisterCmpt');
}
if (this.$route.name == "emailRegisterCmpt"){
if (this.$i18n.locale == "zh-CN") this.$router.replace('/mobileRegisterCmpt');
}
},
//切换语言
changeLangEvent(type) {
var that = this;
......@@ -49,18 +81,20 @@
that.lang = 'en';
that.$i18n.locale = that.lang;//关键语句
window.localStorage.setItem("language",that.lang);
// validate.i18n.locale =window.localStorage.getItem("lang");
location.reload();
that.reload();
} else {
that.lang = 'zh-CN';
that.$i18n.locale = that.lang;//关键语句
window.localStorage.setItem("language",that.lang);
// validate.i18n.locale =window.localStorage.getItem("lang");
location.reload();
that.reload();
}
that.changeUrl();
}).catch(() => {
});
......
......@@ -72,6 +72,8 @@
sliderCmpt,
dialogCmpt
},
inject:['reload'],
data() {
return {
activeName: "first",
......
......@@ -26,6 +26,8 @@
import api from '../api/api';
export default {
name: "modifyPasswordCmpt",
inject:['reload'],
data(){
return{
ruleForm:{
......
......@@ -15,6 +15,8 @@
<script>
export default {
name: "passSuccessCmpt",
inject:['reload'],
methods:{
handleToIndex(){
var userInfo = window.localStorage.getItem("userInfo") ? JSON.parse(this.Base64.decode(window.localStorage.getItem("userInfo"))) : "";
......
......@@ -17,6 +17,7 @@
<script>
export default {
name: "successCmpt",
inject:['reload'],
methods:{
handleToIndex(type){
if(type==2) this.$router.push("/")
......
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