diff --git a/RuoYi-App-master/App.vue b/RuoYi-App-master/App.vue index 656874c..5ad698f 100644 --- a/RuoYi-App-master/App.vue +++ b/RuoYi-App-master/App.vue @@ -8,12 +8,23 @@ config: {} }, onLaunch: function() { - this.initApp() + this.initApp(), + // 初始化 tabBar 文本 + this.updateTabBarText() + + // 监听语言变化事件 + uni.$on('languageChanged', () => { + this.updateTabBarText() + }) }, onShow: function() { // 检查应用状态,确保从后台恢复时状态一致 this.checkAppState() }, + onDestroy() { + // 移除事件监听器 + uni.$off('languageChanged') + }, methods: { // 初始化应用 initApp() { @@ -62,6 +73,32 @@ } + }, + updateTabBarText() { + // 使用 nextTick 确保 DOM 更新完成 + this.$nextTick(() => { + try { + // 设置工作台 tabBar 项 + uni.setTabBarItem({ + index: 0, + text: this.$t('tabBar.workbench') + }) + + // 设置任务 tabBar 项 + uni.setTabBarItem({ + index: 1, + text: this.$t('tabBar.task') + }) + + // 设置我的 tabBar 项 + uni.setTabBarItem({ + index: 2, + text: this.$t('tabBar.mine') + }) + } catch (error) { + console.error('更新 tabBar 文本失败:', error) + } + }) } } diff --git a/RuoYi-App-master/api/login.js b/RuoYi-App-master/api/login.js index 38bb282..161fedd 100644 --- a/RuoYi-App-master/api/login.js +++ b/RuoYi-App-master/api/login.js @@ -56,3 +56,11 @@ export function getCodeImg() { timeout: 20000 }) } + +//检查更新 +export function updateUrl(){ + return request({ + url: '/system/app/version', + method: 'get' + }) +} diff --git a/RuoYi-App-master/components/language-switcher/language-switcher.vue b/RuoYi-App-master/components/language-switcher/language-switcher.vue index 5dd6458..60c9051 100644 --- a/RuoYi-App-master/components/language-switcher/language-switcher.vue +++ b/RuoYi-App-master/components/language-switcher/language-switcher.vue @@ -37,6 +37,10 @@ export default { // 切换语言 this.$i18n.locale = selectedLang this.currentIndex = index + + + // 通知 App.vue 更新 tabBar + uni.$emit('languageChanged'); // 提示用户 uni.showToast({ diff --git a/RuoYi-App-master/locales/en-US.json b/RuoYi-App-master/locales/en-US.json index 99e6767..5db1676 100644 --- a/RuoYi-App-master/locales/en-US.json +++ b/RuoYi-App-master/locales/en-US.json @@ -1,4 +1,12 @@ { + + + "tabBar": { + "workbench": "workbench", + "task": "task", + "mine": "mine" + }, + "dict":{ "port_type": { "a1": "Cache Point", diff --git a/RuoYi-App-master/locales/zh-CN.json b/RuoYi-App-master/locales/zh-CN.json index cedb262..c3b1c2e 100644 --- a/RuoYi-App-master/locales/zh-CN.json +++ b/RuoYi-App-master/locales/zh-CN.json @@ -1,4 +1,12 @@ { + + + "tabBar": { + "workbench": "工作台", + "task": "任务", + "mine": "我的" + }, + "dict": { "port_type": { "a1": "缓存点位", diff --git a/RuoYi-App-master/manifest.json b/RuoYi-App-master/manifest.json index e76addc..c3d285d 100644 --- a/RuoYi-App-master/manifest.json +++ b/RuoYi-App-master/manifest.json @@ -14,7 +14,10 @@ "autoclose" : true, "delay" : 0 }, - "modules" : {}, + "modules" : { + "Camera" : {}, + "Barcode" : {} + }, "distribute" : { "android" : { "permissions" : [ @@ -32,7 +35,11 @@ "", "", "", - "" + "", + "", + "", + "", + "" ] }, "ios" : { diff --git a/RuoYi-App-master/pages/index.vue b/RuoYi-App-master/pages/index.vue index 9c2866c..532f959 100644 --- a/RuoYi-App-master/pages/index.vue +++ b/RuoYi-App-master/pages/index.vue @@ -111,6 +111,14 @@ export default { // 获取待处理任务数量 this.getPendingTaskCount() }, + onShow() { + // 根据当前语言动态设置标题 + const currentLanguage = this.$i18n.locale; + const title = this.$t('tabBar.workbench'); + uni.setNavigationBarTitle({ + title: title + }); + }, methods: { navigateTo(url) { uni.navigateTo({ diff --git a/RuoYi-App-master/pages/mine/index.vue b/RuoYi-App-master/pages/mine/index.vue index fee0565..bfdf908 100644 --- a/RuoYi-App-master/pages/mine/index.vue +++ b/RuoYi-App-master/pages/mine/index.vue @@ -93,6 +93,14 @@ return uni.getSystemInfoSync().windowHeight - 50 } }, + onShow() { + // 根据当前语言动态设置标题 + const currentLanguage = this.$i18n.locale; + const title = this.$t('tabBar.mine'); + uni.setNavigationBarTitle({ + title: title + }); + }, methods: { handleToInfo() { this.$tab.navigateTo('/pages/mine/info/index') diff --git a/RuoYi-App-master/pages/mine/setting/index.vue b/RuoYi-App-master/pages/mine/setting/index.vue index 930a037..2be2476 100644 --- a/RuoYi-App-master/pages/mine/setting/index.vue +++ b/RuoYi-App-master/pages/mine/setting/index.vue @@ -1,19 +1,19 @@ - + - - - + +