From e2324ecbdcbf3193f22d9210e191bdb13ee59eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E7=8E=B2?= Date: Mon, 17 Mar 2025 18:43:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E9=A2=98=E4=B8=AD?= =?UTF-8?q?=E9=97=B4=E6=96=87=E5=AD=97=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ets/view/SafeView.ets | 40 ++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/main/ets/view/SafeView.ets b/src/main/ets/view/SafeView.ets index 340fe8c..e566a69 100644 --- a/src/main/ets/view/SafeView.ets +++ b/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)