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
王士厅
2024-08-07 17:32:51 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
455ff6449ee338094462d5052b5bee02b645252a
455ff644
2 parents
34368680
45e1c148
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
455ff64
...
...
@@ -92,6 +92,7 @@ export struct TopNavigationComponentNew {
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page
})
.backgroundColor(Color.White)
} else {
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
if (CompUtils.isNews(this.navItem)) {
...
...
@@ -172,7 +173,8 @@ export struct TopNavigationComponentNew {
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page,
isMourning: mourningCheckFn(`${navItem.channelId}`),
});
})
.backgroundColor(CompUtils.isRMH(this.navItem)?Color.White:Color.Transparent)
}
/**
...
...
@@ -259,10 +261,11 @@ export struct TopNavigationComponentNew {
@Builder
tabBar() {
// 顶部背景图
Image(this.navItem.backgroundUrl).width('100%').height('100%')
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
if (CompUtils.isNews(this.navItem)) {
// 顶部背景图
Image(this.navItem.backgroundUrl).width('100%')
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
// 顶部搜索、日报logo、早晚报
this.topBar()
...
...
@@ -306,10 +309,10 @@ export struct TopNavigationComponentNew {
})
} else {
// 顶部背景图
Image(this.navItem.backgroundUrl)
.width('100%')
.height(this.backgroundImageH)
.grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
// Image(this.navItem.backgroundUrl)
// .width('100%')
// .height(this.backgroundImageH)
// .grayscale(this.GrayManage.get().isMourning() ? 1 : 0)
Row() {
Image($r('app.media.icon_search'))
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
View file @
455ff64
...
...
@@ -16,6 +16,11 @@ export struct PlayerTitleView {
@State rmhPlatform: number = 0 // 1是人民号
@State isOverLines: boolean = false
@State summary: string = ''
@State private titleLines: number = 0
@State private summaryLines: number = 0
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
name: this.getName(),
...
...
@@ -104,6 +109,13 @@ export struct PlayerTitleView {
this.summary = this.getSummary()
}
private updateSummaryLines() {
this.summaryLines = Math.max(1, 4 - this.titleLines)
this.isOverLines = this.summary.length > this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)).length
}
build() {
Column() {
if (this.getName()) {
...
...
@@ -133,7 +145,10 @@ export struct PlayerTitleView {
.fontFamily('PingFang SC-Regular')
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 2 }) //8
.onAreaChange((oldArea: Area, newArea: Area) => {
this.titleLines = Math.ceil((newArea.height as number) / 20) // 20是行高
this.updateSummaryLines()
})
/**
* 标题大于三行或存在简介显示查看详情按钮
*/
...
...
@@ -161,7 +176,7 @@ export struct PlayerTitleView {
// } else {
if(this.summary) {
Text() {
Span(this.clipText(this.summary, 14,
3
, this.windowWidth - 150 - vp2px(50)))
Span(this.clipText(this.summary, 14,
this.summaryLines
, this.windowWidth - 150 - vp2px(50)))
.fontSize(14)
.fontColor(Color.White)
.lineHeight(21)
...
...
Please
register
or
login
to post a comment