yanlu

fix:16680 功能缺陷--大家聊,鸿蒙版字体间距与安卓不一致

... ... @@ -96,10 +96,10 @@ export struct RmhTitle {
build() {
Flex() {
Stack() {
Image(this.rmhInfo.rmhHeadUrl)
Image(this.rmhInfo?.rmhHeadUrl)
.width(36)
.height(36).borderRadius(50)
Image(this.rmhInfo.authIcon)
Image(this.rmhInfo?.authIcon)
.width(14)
.height(14)
.borderRadius(50)
... ... @@ -109,7 +109,7 @@ export struct RmhTitle {
.flexShrink(0)
Column() {
Text(this.rmhInfo.rmhName)
Text(this.rmhInfo?.rmhName)
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
... ... @@ -122,13 +122,13 @@ export struct RmhTitle {
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
}
if (this.publishTime && this.rmhInfo.rmhDesc) {
if (this.publishTime && this.rmhInfo?.rmhDesc) {
Image($r('app.media.point'))
.width(16)
.height(16)
}
}
Text(this.rmhInfo.rmhDesc)
Text(this.rmhInfo?.rmhDesc)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
... ... @@ -141,7 +141,7 @@ export struct RmhTitle {
}
Blank()
if (this.rmhInfo.cnIsAttention) {
if (this.rmhInfo?.cnIsAttention) {
Row() {
if (Number(this.followStatus) === 0) {
Image($r('app.media.rmh_follow'))
... ...
... ... @@ -49,7 +49,7 @@ export class LiveModel {
success(data.data)
}, (error: Error) => {
fail(error.message)
Logger.debug(TAG + ":error ", error.toString())
Logger.debug(TAG + ":error ", error.message)
})
})
}
... ...
... ... @@ -26,6 +26,7 @@ export struct TabComponent {
}
build() {
Stack({alignContent: Alignment.TopStart}) {
Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) {
ForEach(this.tabs, (item: string, index: number) => {
TabContent() {
... ... @@ -36,7 +37,7 @@ export struct TabComponent {
} else if ('大家聊' === item) {
TabChatComponent()
}
}.tabBar(this.tabBuilder(index, item))
}
.backgroundColor('#F5F5F5')
}, (item: string, index: number) => {
return item + index
... ... @@ -45,13 +46,37 @@ export struct TabComponent {
.layoutWeight(1)
.vertical(false)
.barMode(BarMode.Fixed)
.barWidth(70 * this.tabs.length)
.barHeight(48)
.animationDuration(100)
.onChange((index: number) => {
this.currentIndex = index
})
.backgroundColor(Color.White)
// 页签
Row() {
Scroll() {
Row({space: '24vp'}) {
ForEach(this.tabs, (item: string, index: number) => {
this.tabBuilder(index, item)
})
}
.width('100%')
.justifyContent(FlexAlign.Center)
}
.backgroundColor(Color.White)
.align(Alignment.Start)
.scrollable(ScrollDirection.Horizontal)
.scrollBar(BarState.Off)
.width('100%')
}
.backgroundColor(Color.White)
.height('48vp')
.alignItems(VerticalAlign.Bottom)
.width('100%')
}.layoutWeight(1)
}
@Builder
... ... @@ -60,7 +85,7 @@ export struct TabComponent {
Text(name)
.margin({ top: 6 })
.fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor)
.fontSize('18fp')
.fontSize('18vp')
.fontWeight(this.currentIndex === index ? 600 : 400)
Divider()
.strokeWidth(2)
... ... @@ -68,7 +93,13 @@ export struct TabComponent {
.width(15)
.color('#CB0000')
.visibility(this.currentIndex === index ? Visibility.Visible : Visibility.Hidden)
}.width('100%')
}.justifyContent(FlexAlign.Center)
.constraintSize({ minWidth: 35 })
.height('48vp')
.onClick(() => {
this.controller.changeIndex(index)
this.currentIndex = index
})
}
aboutToDisappear(): void {
... ...