Files
smart_storage_app/App.vue
2026-01-30 09:35:52 +08:00

56 lines
2.1 KiB
Vue

<script>
import VueI18n from '@/common/vue-i18n.min.js'
import Vue from 'vue'
export default {
async onShow() {
const res = await this.$u.api.GetLanguageConfig('zh')
const res2 = await this.$u.api.GetLanguageConfig('en')
const res3 = await this.$u.api.GetLanguageConfig('fr')
const res4 = await this.$u.api.GetLanguageConfig('es')
const res5 = await this.$u.api.GetLanguageConfig('ar')
const res6 = await this.$u.api.GetLanguageConfig('de')
const res7 = await this.$u.api.GetLanguageConfig('pl')
const result = JSON.parse(res.data[0].content)
const result2 = JSON.parse(res2.data[0].content)
const result3 = JSON.parse(res3.data[0].content)
const result4 = JSON.parse(res4.data[0].content)
const result5 = JSON.parse(res5.data[0].content)
const result6 = JSON.parse(res6.data[0].content)
const result7 = JSON.parse(res7.data[0].content)
this.$i18n.mergeLocaleMessage('en_US', result2) //添加英文
this.$i18n.mergeLocaleMessage('zh_CN', result) //添加中文
this.$i18n.mergeLocaleMessage('fr_FR', result3) //添加法语
this.$i18n.mergeLocaleMessage('es_ES', result4) //添加西班牙语
this.$i18n.mergeLocaleMessage('ar_EG', result5) //添加阿拉伯语
this.$i18n.mergeLocaleMessage('de_DE', result6) //添加德语
this.$i18n.mergeLocaleMessage('pl_PL', result7) //添加波兰语
},
onLaunch() {
// 国际化,设置当前语言
// if (this.vuex_locale) {
// this.$i18n.locale = this.vuex_locale;
// this.$u.api.lang({ lang: this.vuex_locale });
// }
// 设置底部导航栏角标
// uni.setTabBarBadge({
// index: 0,
// text: '3'
// });
// uni.removeTabBarBadge({
// index: 0
// });
},
globalData: {
update: {
wordOrder:false // 工单页面是否刷新
},
},
};
</script>
<style lang="scss">
@import "@/static/scss/init.scss";
@import "uview-ui/index.scss";
page{
background: #f8f8f8;
}
</style>