Browse Source

优化了问题反馈的主题色

wangcy 5 months ago
parent
commit
2eb8b889b2

+ 2 - 2
features/user/src/main/ets/pages/SuggestionPage.ets

@@ -22,7 +22,7 @@ struct SuggestionPage {
           Text()
             .width(3)
             .height(10)
-            .backgroundColor('#FF95BFBF')
+            .backgroundColor($r('[basic].color.main_ac_color_dark'))
             .margin({ right: 3 })
           Text() {
             Span('问题描述 ')
@@ -69,7 +69,7 @@ struct SuggestionPage {
           Text()
             .width(3)
             .height(10)
-            .backgroundColor('#FF95BFBF')
+            .backgroundColor($r('[basic].color.main_ac_color_dark'))
             .margin({ right: 3 })
           Text() {
             Span('联系方式 ')

+ 20 - 7
products/entry/src/main/ets/pages/Index.ets

@@ -5,21 +5,23 @@ import { BasicType, YtAvoid, yTRouter, yTToast } from 'basic';
 struct Index {
   @State currentIndex: number = 0
   @StorageProp(YtAvoid.safeBottomKey) bottom: number = 0
+  //tabs展示内容
   contentList: BasicType<undefined>[] = [
     {
       text: '首页',
       src: this.currentIndex == 0 ? $r('app.media.app_icon') : $r('app.media.app_icon'),
-      index: 0
     },
     {
       text: '福利',
       src: this.currentIndex == 1 ? $r('app.media.app_icon') : $r('app.media.app_icon'),
-      index: 1
+    },
+    {
+      text: '福利',
+      src: this.currentIndex == 1 ? $r('app.media.app_icon') : $r('app.media.app_icon'),
     },
     {
       text: '我的',
       src: this.currentIndex == 2 ? $r('app.media.app_icon') : $r('app.media.app_icon'),
-      index: 2
     }
   ]
   tabsController: TabsController = new TabsController()
@@ -35,9 +37,18 @@ struct Index {
     Navigation(yTRouter) {
       Column() {
         Tabs({ controller: this.tabsController }) {
-          ForEach(this.contentList, (item: BasicType<undefined>, index) => {
+          ForEach(this.contentList, (_: BasicType<undefined>, index) => {
             TabContent() {
-              Text(item.text)
+              if (index == 0) {
+                //放对应组件
+                Text(_.text)
+              } else if (index == 1) {
+                Text(_.text)
+              } else if (index == 2) {
+                Text(_.text)
+              } else {
+                Text(_.text)
+              }
             }
           })
         }
@@ -49,7 +60,10 @@ struct Index {
 
         Row() {
           ForEach(this.contentList, (item: BasicType<undefined>, index) => {
-            this.barBuilder(item)
+            this.barBuilder((() => {
+              item.index = index
+              return item
+            })())
           })
         }
         .justifyContent(FlexAlign.SpaceAround)
@@ -81,7 +95,6 @@ struct Index {
     .onClick(() => {
       this.currentIndex = item.index!
       this.tabsController.changeIndex(this.currentIndex)
-
     })
   }
 }