fix:修复h5端与app编译报错问题

master
黄伟杰 5 days ago
parent 15912db748
commit d16f397336

21547
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -76,10 +76,11 @@
"@dcloudio/uni-cli-shared": "3.0.0-4020320240708001",
"@dcloudio/uni-stacktracey": "3.0.0-4020320240708001",
"@dcloudio/vite-plugin-uni": "3.0.0-4020320240708001",
"@types/node": "18.19.130",
"@vue/runtime-core": "^3.4.23",
"@vue/tsconfig": "^0.1.3",
"less": "^4.2.0",
"sass": "^1.77.7",
"sass": "1.56.1",
"sass-loader": "^10.1.1",
"typescript": "^4.9.5",
"vite": "5.2.8",

File diff suppressed because it is too large Load Diff

@ -34,7 +34,10 @@ const i18n = createI18n({
locale: getSavedLocale(),
fallbackLocale: DEFAULT_LOCALE,
globalInjection: true,
messages
messages,
missingWarn: false,
fallbackWarn: false,
missing: (locale, key) => key
})
const literalMap = {
@ -81,21 +84,29 @@ const literalMap = {
}
function applyTabBarLanguage() {
const labels = [
i18n.global.t('tab.home'),
i18n.global.t('tab.report'),
i18n.global.t('tab.work'),
i18n.global.t('tab.mine')
]
labels.forEach((text, index) => {
try {
try {
const pages = getCurrentPages()
if (!pages || pages.length === 0) return
const currentPage = pages[pages.length - 1]
if (!currentPage) return
const route = currentPage.route || ''
const tabBarPages = ['pages/index', 'pages/report', 'pages/work', 'pages/mine']
if (!tabBarPages.includes(route)) return
const labels = [
i18n.global.t('tab.home'),
i18n.global.t('tab.report'),
i18n.global.t('tab.work'),
i18n.global.t('tab.mine')
]
labels.forEach((text, index) => {
uni.setTabBarItem({
index,
text
})
} catch (e) {
}
})
})
} catch (e) {
}
}
export function getCurrentLocale() {
@ -106,9 +117,6 @@ export function setLocale(locale) {
const nextLocale = normalizeLocale(locale)
i18n.global.locale.value = nextLocale
uni.setStorageSync(LOCALE_STORAGE_KEY, nextLocale)
if (typeof uni.setLocale === 'function') {
uni.setLocale(nextLocale)
}
applyTabBarLanguage()
uni.$emit(LOCALE_CHANGE_EVENT, nextLocale)
return nextLocale

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save