chore(多语言): 将isEnEnv计算属性挂载到全局Vue组件上,针对商品名称优化英文显示

This commit is contained in:
2025-12-26 17:54:20 +08:00
parent d36e7f6bba
commit 31623e6667
23 changed files with 52 additions and 58 deletions

View File

@@ -5,7 +5,7 @@ export default {
themeColor: '' //''--base-color:#fa5d14;--base-help-color:#ff7e00;'
}
},
onLoad() {},
onLoad() { },
onShow() {
// 刷新多语言
this.$langConfig.refresh();
@@ -18,6 +18,10 @@ export default {
}, 50);
},
computed: {
// 是否是英文环境
isEnEnv() {
return uni.getStorageSync('lang') === 'en-us';
},
themeStyle() {
return this.$store.state.themeStyle;
},
@@ -113,11 +117,11 @@ export default {
if (this.tabBarHeight != '56px') this.themeColor += `--tab-bar-height:${this.tabBarHeight};`
Object.keys(theme).forEach(key => {
let data = theme[key];
if (typeof(data) == "object") {
if (typeof (data) == "object") {
Object.keys(data).forEach(k => {
this.themeColor += '--' + k.replace(/_/g, "-") + ':' + data[k] + ';';
});
} else if (typeof(key) == "string" && key) {
} else if (typeof (key) == "string" && key) {
this.themeColor += '--' + key.replace(/_/g, "-") + ':' + data + ';';
}
});