增加标题中间文字备注

这个提交包含在:
胡玲 2025-03-17 18:43:00 +08:00
父节点 ecfef2154b
当前提交 e2324ecbdc

查看文件

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