From b62e2c0a5b0a2c6784a8482730da9926b15340f1 Mon Sep 17 00:00:00 2001 From: AndyChen1024 Date: Tue, 15 Sep 2026 14:49:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(entry):=20=E5=BA=95=E9=83=A8=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E5=9B=BE=E6=A0=87=E6=94=B9=E7=94=A8=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=20PNG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 2619a9e..8d66be4 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -17,22 +17,22 @@ struct Index { TabContent() { HomePage({ onGoLogin: () => { this.currentIndex = 3; } }) } - .tabBar(this.tabBarBuilder(0, '้ฆ–้กต', '๐Ÿ ')) + .tabBar(this.tabBarBuilder(0, '้ฆ–้กต', $r('app.media.home'), $r('app.media.home_active'))) TabContent() { CheckinPage({ onGoLogin: () => { this.currentIndex = 3; } }) } - .tabBar(this.tabBarBuilder(1, 'ๆ‰“ๅก', 'โœ…')) + .tabBar(this.tabBarBuilder(1, 'ๆ‰“ๅก', $r('app.media.checkin'), $r('app.media.checkin_active'))) TabContent() { PlanPage({ onGoLogin: () => { this.currentIndex = 3; } }) } - .tabBar(this.tabBarBuilder(2, '่ฎกๅˆ’', '๐Ÿ“')) + .tabBar(this.tabBarBuilder(2, '่ฎกๅˆ’', $r('app.media.plan'), $r('app.media.plan_active'))) TabContent() { ProfilePage() } - .tabBar(this.tabBarBuilder(3, 'ๆˆ‘็š„', '๐Ÿ‘ค')) + .tabBar(this.tabBarBuilder(3, 'ๆˆ‘็š„', $r('app.media.profile'), $r('app.media.profile_active'))) } .onChange((index: number) => { this.currentIndex = index; @@ -43,10 +43,12 @@ struct Index { } @Builder - tabBarBuilder(index: number, title: string, icon: string) { + tabBarBuilder(index: number, title: string, normalIcon: Resource, activeIcon: Resource) { Column({ space: 2 }) { - Text(icon) - .fontSize(20) + Image(index === this.currentIndex ? activeIcon : normalIcon) + .width(24) + .height(24) + .objectFit(ImageFit.Contain) Text(title) .fontSize(AppFontSize.caption) .fontColor(index === this.currentIndex ? AppColor.tabActive : AppColor.tabInactive)