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
chenjun
2024-08-28 11:13:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3976b7315f1f37cf5d14a1a337a2c7992c2cc993
3976b731
1 parent
1af386ca
使用ios样式
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
104 deletions
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerTitleView.ets
View file @
3976b73
...
...
@@ -94,8 +94,7 @@ export struct PlayerTitleView {
}
clipStr += strArr[i]
}
clipStr += this.isOverLines ? '...' : '';
console.log(TAG, 'clipStr2:', clipStr)
console.log(TAG, 'clipStr:', clipStr)
return clipStr
}
...
...
@@ -131,8 +130,7 @@ export struct PlayerTitleView {
}
clipStr += strArr[i]
}
console.log(TAG, 'clipTitleText clipStr1:', clipStr)
clipStr += this.isTitleOverLines ? '...' : '';
console.log(TAG, 'clipTitleText clipStr:', clipStr)
return clipStr
}
...
...
@@ -219,54 +217,7 @@ export struct PlayerTitleView {
// })
// }
// } else {
this.detailDesc()
// }
Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),
DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
.lineHeight(16)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.margin({ top: 8, bottom: 8 })
}
.width(this.windowWidth - 150 + 'px')
.padding({ left: 16, right: 22 })
.alignItems(HorizontalAlign.Start)
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
}
@Builder
detailDesc() {
/**
* 标题大于三行或存在简介显示查看详情按钮
*/
// if (this.rmhPlatform == 1) {
// if (this.titleHeight > 200 || this.summary) {
// Text('查看详情 > ')
// .padding({
// left: 6,
// right: 6,
// top: 4,
// bottom: 4
// })
// .borderRadius(2)
// .backgroundColor('#99636363')
// .fontFamily('PingFang SC-Regular')
// .fontColor(Color.White)
// .fontSize(12)
// .lineHeight(14)
// .fontWeight(400)
// .onClick(() => {
// this.isOpenDetail = true
// this.dialogController?.open()
// })
// }
// } else {
if (this.summary && this.titleLines < 4) {
Stack({ alignContent: Alignment.TopStart }) {
Text() {
Span(this.clipText(this.summary, 14, this.summaryLines, this.windowWidth - 150 - vp2px(50)))
.fontSize(14)
...
...
@@ -278,17 +229,8 @@ export struct PlayerTitleView {
this.isOpenDetail = true
this.dialogController?.open()
})
}
// .position({ x: 0, y: 0 })
.padding({
left: 0,
right: 6,
top: 0,
bottom: 8
})
if (this.isOverLines) {
Text() {
Span('全文')
Span('... 全文')
.fontColor('#99FFFFFF')
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
...
...
@@ -309,31 +251,37 @@ export struct PlayerTitleView {
this.isOpenDetail = true
this.dialogController?.open()
})
}
}
.textAlign(TextAlign.Center)
// .width('100%')
.position({ x: '100%', y: this.summaryLines*23 }) //行高+margin
.translate({ x: '-100%', y: '-100%' })
// .markAnchor({ x: '100%', y: '100%' })
.padding({
left: 0,
left: 0, //6
right: 6,
top: 0,
bottom: 6
top: 0, //4
bottom: 8
})
}
// }
Text(DateTimeUtils.formatDate(new Date(this.contentDetailData?.publishTime).getTime(),
DateTimeUtils.PATTERN_DATE_TIME_HYPHEN_MM))
.fontSize(12)
.fontColor(Color.White)
.opacity(0.7)
.lineHeight(16)
.fontWeight(400)
.fontFamily('PingFang SC-Regular')
.margin({ top: 8, bottom: 8 })
}
.width('100%')
}
.width(this.windowWidth - 150 + 'px')
.padding({ left: 16, right: 22 })
.alignItems(HorizontalAlign.Start)
.visibility(this.isOpenDetail || this.isDragging ? Visibility.None : Visibility.Visible)
}
/**
* 标题
* */
@Builder
titleBuilder() {
// Stack({ alignContent: this.isTitleOverLines ? Alignment.BottomEnd : Alignment.Start }) {
Stack({ alignContent: Alignment.TopStart }) {
Text() {
Span(this.clipTitleText(this.getTitle(), 16, 4, this.windowWidth - 234 - vp2px(50)))
.fontSize(16)
...
...
@@ -341,27 +289,8 @@ export struct PlayerTitleView {
.lineHeight(22)
.fontWeight(600)
.fontFamily('PingFang SC-Regular')
}
// .position({ x: 0, y: 0 })
.onAreaChange((oldArea: Area, newArea: Area) => {
//console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高
//console.info(`cj2024 titleLines = ${this.titleLines}`)
this.updateSummaryLines()
})
.maxLines(4)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.padding({
left: 0, //6
right: 6,
top: 0, //4
bottom: 8
})
Text() {
if (this.isTitleOverLines) {
Span('
全文')
Span('...
全文')
.fontColor('#99FFFFFF')
.fontWeight(600)
.fontFamily('PingFang SC-Regular')
...
...
@@ -382,14 +311,15 @@ export struct PlayerTitleView {
this.isOpenDetail = true
this.dialogController?.open()
})
}
}
.textAlign(TextAlign.Center)
// .width('100%')
.position({ x: '100%', y: this.titleLines*23 }) //行高+margin
.translate({ x: '-100%', y: '-100%' })
// .position({ x: '100%', y: '100%' })
// .markAnchor({ x: '100%', y: '100%' })
.onAreaChange((oldArea: Area, newArea: Area) => {
//console.info(`cj2024 titleLines = ${newArea.height as number} line = ${(newArea.height as number) / 20}`)
this.titleLines = Math.floor((newArea.height as number) / 22) // 22是行高
//console.info(`cj2024 titleLines = ${this.titleLines}`)
this.updateSummaryLines()
})
.padding({
left: 0, //6
right: 6,
...
...
@@ -397,6 +327,4 @@ export struct PlayerTitleView {
bottom: 8
})
}
.width('100%')
}
}
...
...
Please
register
or
login
to post a comment