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-05-24 17:59:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c736435c4f2a899035ad0667839badebc6f46e47
c736435c
1 parent
d418f5a7
feat:优化早晚报展示
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
c736435
...
...
@@ -67,6 +67,7 @@ export struct MorningEveningPaperComponent {
// 顶部安全高度赋值
@State topSafeHeight: number = 0;
@State bottomSafeHeight: number = 0;
@State isHasTopView: boolean = false;
private audioDataList: AudioDataList[] = []
private playerController: WDPlayerController = new WDPlayerController();
...
...
@@ -145,7 +146,9 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
this.setComponentBgColor(this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string)
this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
this.setComponentBgColor(coverUrl)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
...
...
@@ -202,11 +205,9 @@ export struct MorningEveningPaperComponent {
// const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl)
if (imageUrl.length > 0 && this.pageInfoBean.topicInfo.frontFlag === 1) {
const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
if (imageSource && this.pageInfoBean.topicInfo.frontFlag === 1) {
this.pickColor(imageSource)
} else {
if (this.pageInfoBean.topicInfo.topicPattern === 1) {
this.mixedBgColor = '#66BDBD'
...
...
@@ -271,15 +272,21 @@ export struct MorningEveningPaperComponent {
}
}
.height(`calc(100% - ${this.bottomSafeHeight + this.topSafeHeight + 'vp'})`).scrollBar(BarState.Off)
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (persent > 1) {
persent = 1
}
})
PaperTitleComponent().margin({top:this.
topSafeHeight}
)
PaperTitleComponent().margin({top:this.
isHasTopView?this.topSafeHeight:0}).backgroundColor(this.mixedBgColor).opacity(this.isHasTopView?0:1
)
}
.width('100%')
.height('100%')
// .padding({
// top: this.topSafeHeight,
.padding({
top: this.isHasTopView?0:this.topSafeHeight,
// bottom: this.bottomSafeHeight
//
})
})
// .backgroundColor(Color.Black)
// .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black)
.backgroundColor(this.mixedBgColor ?? Color.Black)
...
...
Please
register
or
login
to post a comment