2 Commits ecfef2154b ... e25d5af4b6

Autore SHA1 Messaggio Data
  xuqm e25d5af4b6 feat(app): 优化聊天页面功能和布局 3 settimane fa
  胡玲 e2324ecbdc 增加标题中间文字备注 1 mese fa
2 ha cambiato i file con 31 aggiunte e 16 eliminazioni
  1. 7 0
      src/main/ets/utils/WindowHelper.ets
  2. 24 16
      src/main/ets/view/SafeView.ets

+ 7 - 0
src/main/ets/utils/WindowHelper.ets

@@ -114,6 +114,13 @@ export class WindowHelper {
     return WindowHelper._isFullScreen ? WindowHelper._topRectHeight : 0
   }
 
+  public static get windowsWidth(){
+    return px2vp(display.getDefaultDisplaySync().width)
+  }
+
+  public static get windowsHeight(){
+    return px2vp(display.getDefaultDisplaySync().height)
+  }
 
   /**
    * 设置是否全屏

+ 24 - 16
src/main/ets/view/SafeView.ets

@@ -44,6 +44,8 @@ export struct SafeView {
   // 设置返回按钮事件
   @Prop onClickLeft: TitleBarBtn
   @Prop onClickRight: TitleBarBtn
+  // 设置导航栏底下标题
+  @Prop bottomTitleText: ResourceStr
 
   @Builder
   doNothingBuilder() {
@@ -90,18 +92,24 @@ export struct SafeView {
               }
             })
 
-            Text(this.titleText ?? '')
-              .maxLines(1)
-              .fontColor(this.titleColor ?? '#11102C')
-              .fontSize(16)
-              .fontWeight(FontWeight.Medium)
-              .ellipsisMode(EllipsisMode.CENTER)
-              .textOverflow({
-                overflow: TextOverflow.Ellipsis
-              })
-              .constraintSize({
-                maxWidth: 200
-              })
+            Column() {
+              Text(this.titleText ?? '')
+                .maxLines(1)
+                .fontColor(this.titleColor ?? '#11102C')
+                .fontSize(16)
+                .fontWeight(FontWeight.Medium)
+                .ellipsisMode(EllipsisMode.CENTER)
+                .textOverflow({
+                  overflow: TextOverflow.Ellipsis
+                })
+                .constraintSize({
+                  maxWidth: 200
+                })
+
+              if (this.bottomTitleText) {
+                Text(this.bottomTitleText ?? '').fontColor('#CB8204').fontSize(12).margin({ top: 4 })
+              }
+            }
 
             Row() {
               if (!this.onClickLeft?.img && this.onClickLeft) {
@@ -110,7 +118,7 @@ export struct SafeView {
                   style: {
                     badgeSize: 6,
                     badgeColor: Color.Red,
-                    fontSize:1,
+                    fontSize: 1,
                     color: '#FF6500',
                   }
                 }) {
@@ -128,7 +136,7 @@ export struct SafeView {
                     badgeSize: 6,
                     badgeColor: '#FF6500',
                     color: '#FF6500',
-                    fontSize:1
+                    fontSize: 1
                   }
                 }) {
                   Image(this.onClickLeft.img)
@@ -147,7 +155,7 @@ export struct SafeView {
                     badgeSize: 6,
                     badgeColor: '#FF6500',
                     color: '#FF6500',
-                    fontSize:1
+                    fontSize: 1
                   }
                 }) {
                   Text(this.onClickRight?.text ?? '确定')
@@ -167,7 +175,7 @@ export struct SafeView {
                     badgeSize: 6,
                     badgeColor: '#FF6500',
                     color: '#FF6500',
-                    fontSize:1
+                    fontSize: 1
                   }
                 }) {
                   Image(this.onClickRight.img)