Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-08-08 17:51:08 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b8c79aac01396a0f8762671e9dfd136259e372ff
b8c79aac
1 parent
30efdd3b
feat:优化早晚报标题背景
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
27 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
b8c79aa
...
...
@@ -65,7 +65,7 @@ export struct MorningEveningPaperComponent {
@Provide currentTime: string = "00:00";
@Provide totalTime: string = "00:00";
@Provide progressVal: number = 0;
@
Stat
e mixedBgColor: string = ''
@
Provid
e mixedBgColor: string = ''
// 顶部安全高度赋值
@State topSafeHeight: number = px2vp(AppStorage.get<number>('topSafeHeight') || 0)
@State bottomSafeHeight: number = px2vp(AppStorage.get<number>('bottomSafeHeight') || 0)
...
...
@@ -269,7 +269,7 @@ export struct MorningEveningPaperComponent {
if (this.pageInfoBean?.topicInfo?.frontLinkObject) {
ListItem() {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject
})
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject})
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
View file @
b8c79aa
...
...
@@ -20,19 +20,38 @@ export struct topicInfoView {
frontLinkObject: FrontLinkObject = {} as FrontLinkObject
@State isExpansion:boolean = false
@Consume mixedBgColor: string
aboutToAppear() {
}
build() {
RelativeContainer() {
Image(this.frontLinkObject?.coverUrl)
Stack(){
Image(this.frontLinkObject?.coverUrl)
.width("100%")
.height("100%")
Stack(){
Image('')
.width("100%")
.height("40%")
.linearGradient({
direction: GradientDirection.Bottom, // 渐变方向
repeating: false, // 渐变颜色是否重复
colors: [[Color.Transparent, 0.0],[this.mixedBgColor,1]] // 数组末尾元素占比小于1时满足重复着色效果
})
}
.align(Alignment.Bottom)
.width("100%")
.height("100%")
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
left: { anchor: '__container__', align: HorizontalAlign.Start }
})
.id('img_cover')
}
.width("100%")
.height("100%")
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
left: { anchor: '__container__', align: HorizontalAlign.Start }
})
.id('img_cover')
if (this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0) {
Row() {
...
...
@@ -71,25 +90,7 @@ export struct topicInfoView {
Row(){
CommentText({longMessage:this.frontLinkObject?.summary ?? "",fontSize:14,fontColor:'#CCFFFFFF',isMorningEveningPaper:true})
// Text(this.frontLinkObject?.summary ?? "")
// .fontSize(14)
// .fontColor('#CCFFFFFF')
// .maxLines(this.isExpansion?999:3)
// .textOverflow({ overflow: TextOverflow.Ellipsis })
// .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
// Logger.debug('TAG', `当前屏幕可见区域大小: currentRatio:' +${currentRatio}`)
// if (!isVisible && currentRatio <= 0.0) {
//
// }
// })
//
// Text(this.isExpansion?'收起':'展开').onClick(()=>{
// this.isExpansion = !this.isExpansion
// })
// .fontSize(14)
// .fontColor($r('app.color.white'))
}.alignItems(VerticalAlign.Bottom)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
...
...
@@ -99,7 +100,7 @@ export struct topicInfoView {
.id('txt_summary')
Text(this.frontLinkObject?.title ?? "")
.fontSize(2
4
)
.fontSize(2
0
)
.fontColor($r('app.color.white'))
.maxLines(2)
.alignRules({
...
...
Please
register
or
login
to post a comment