feat(tabbar): 更新底部导航栏配置和国际化文本

- 在 pages.json 中添加 icon 和 iconType 字段
- 将 tabbarList.ts 中的文本改为国际化占位符
- 在 about.vue 页面添加跳转到国际化页面的按钮
This commit is contained in:
feige996 2025-06-21 15:26:27 +08:00
parent b154a44987
commit 28f38ce122
4 changed files with 2019 additions and 5776 deletions

7770
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ export const tabbarList = [
iconPath: 'static/tabbar/home.png', iconPath: 'static/tabbar/home.png',
selectedIconPath: 'static/tabbar/homeHL.png', selectedIconPath: 'static/tabbar/homeHL.png',
pagePath: 'pages/index/index', pagePath: 'pages/index/index',
text: '首页', text: '%tabbar.home%',
icon: 'home', icon: 'home',
iconType: 'wot', iconType: 'wot',
}, },
@ -30,7 +30,7 @@ export const tabbarList = [
iconPath: 'static/tabbar/example.png', iconPath: 'static/tabbar/example.png',
selectedIconPath: 'static/tabbar/exampleHL.png', selectedIconPath: 'static/tabbar/exampleHL.png',
pagePath: 'pages/about/about', pagePath: 'pages/about/about',
text: '关于', text: '%tabbar.about%',
icon: 'i-carbon-code', icon: 'i-carbon-code',
// 注意 unocss 的图标需要在 页面上引入一下,或者配置到 unocss.config.ts 的 safelist 中 // 注意 unocss 的图标需要在 页面上引入一下,或者配置到 unocss.config.ts 的 safelist 中
iconType: 'unocss', iconType: 'unocss',

View File

@ -28,13 +28,17 @@
"iconPath": "static/tabbar/home.png", "iconPath": "static/tabbar/home.png",
"selectedIconPath": "static/tabbar/homeHL.png", "selectedIconPath": "static/tabbar/homeHL.png",
"pagePath": "pages/index/index", "pagePath": "pages/index/index",
"text": "%tabbar.home%" "text": "首页",
"icon": "home",
"iconType": "wot"
}, },
{ {
"iconPath": "static/tabbar/example.png", "iconPath": "static/tabbar/example.png",
"selectedIconPath": "static/tabbar/exampleHL.png", "selectedIconPath": "static/tabbar/exampleHL.png",
"pagePath": "pages/about/about", "pagePath": "pages/about/about",
"text": "%tabbar.about%" "text": "关于",
"icon": "i-carbon-code",
"iconType": "unocss"
} }
] ]
}, },

View File

@ -8,7 +8,7 @@
</route> </route>
<template> <template>
<view> <view class="py-3">
<view <view
class="bg-white overflow-hidden pt-2 px-4" class="bg-white overflow-hidden pt-2 px-4"
:style="{ marginTop: safeAreaInsets?.top + 'px' }" :style="{ marginTop: safeAreaInsets?.top + 'px' }"
@ -22,8 +22,9 @@
<RequestComp /> <RequestComp />
<UploadComp /> <UploadComp />
</view> </view>
<RequestComp /> <view class="text-center">
<UploadComp /> <wd-button @click="gotoI18nPage()">去I18n页面</wd-button>
</view>
</view> </view>
</template> </template>
@ -39,6 +40,12 @@ const toSubPage = () => {
}) })
} }
const gotoI18nPage = () => {
uni.navigateTo({
url: '/pages/about/i18n',
})
}
// vue .ts // vue .ts
// const testOxlint = (name: string) => { // const testOxlint = (name: string) => {
// console.log('oxlint') // console.log('oxlint')