Commit 488936c5 authored by Smile's avatar Smile Committed by wux

fix:解决切换语言,刷新页面或切换页面,语言选择被重置,不是选择的语言。以及picker选择框的确认取消按钮多语言不跟随系统问题

parent 97655819
...@@ -196,12 +196,17 @@ export default { ...@@ -196,12 +196,17 @@ export default {
this.watchWork() this.watchWork()
this.Country() this.Country()
this.getLeviteData() this.getLeviteData()
this.showLangView()
//#ifdef APP-PLUS //#ifdef APP-PLUS
this.getVersion() this.getVersion()
this.getVeData() this.getVeData()
//#endif //#endif
}, },
methods: { methods: {
showLangView() {
const lang=uni.getStorageSync('locale')||'zh';
this.index=this.languages.findIndex(item => item.value === lang);
},
showUser() { showUser() {
this.$refs.userment.open() this.$refs.userment.open()
}, },
...@@ -230,6 +235,7 @@ export default { ...@@ -230,6 +235,7 @@ export default {
this.locale = data this.locale = data
this.getLeviteData() this.getLeviteData()
uni.setStorageSync('locale', data) uni.setStorageSync('locale', data)
uni.setLocale(data);
this.$lang.setLang(data) this.$lang.setLang(data)
}, },
getLeviteData() { getLeviteData() {
......
...@@ -273,6 +273,7 @@ export default { ...@@ -273,6 +273,7 @@ export default {
onLoad() { onLoad() {
this.getVersion() this.getVersion()
this.getStatusData() this.getStatusData()
this.showLangView()
//#ifdef APP-PLUS //#ifdef APP-PLUS
this.getAdData(2) this.getAdData(2)
//#endif //#endif
...@@ -285,6 +286,10 @@ export default { ...@@ -285,6 +286,10 @@ export default {
}, 500) }, 500)
}, },
methods: { methods: {
showLangView() {
const lang=uni.getStorageSync('locale')||'zh';
this.index=this.languages.findIndex(item => item.value === lang);
},
toupdate() { toupdate() {
let that = this let that = this
if (that.showdownLine) return if (that.showdownLine) return
......
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