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
yumaochao
2024-05-31 17:36:57 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5e92e65b4f1e6778ed52016cc19e795e12b07b74
5e92e65b
1 parent
f5d62cd0
fix:somobug
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
85 deletions
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveHorizontalCardComponent.ets
View file @
5e92e65
...
...
@@ -53,7 +53,8 @@ export struct LiveHorizontalCardComponent {
resetEdgeAnimation() {
if (this.moreWidth > this.initMoreWidth) {
this.moreWidth = 16
this.moreWidth = this.moreWidth - 1
this.resetEdgeAnimation();
}
this.resetMoreTips()
}
...
...
@@ -93,9 +94,9 @@ export struct LiveHorizontalCardComponent {
.fontWeight(600)
}
if (this.compDTO
?.objectType === '0' || this.compDTO?.objectType === '
') {
if (this.compDTO
.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING' || this.compDTO.dataSourceType === 'OBJECT_POS
') {
Row() {
Text("更多")
Text("更多
222222
")
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_999999"))
.margin({ right: 1 })
...
...
@@ -122,7 +123,6 @@ export struct LiveHorizontalCardComponent {
.margin({ top: 8, bottom: 8 })
.width(CommonConstants.FULL_WIDTH)
Row(){
// 多个
if (this.compDTO.operDataList.length >= 2) {
Scroll(this.scroller) {
...
...
@@ -209,87 +209,6 @@ export struct LiveHorizontalCardComponent {
.width(CommonConstants.FULL_WIDTH)
.height(this.compDTO.operDataList.length == 2 ? 180 : 136)
} else if (this.compDTO.operDataList.length) {
Row(){
LiveHorizontalCardForOneComponent({ contentDTO: this.compDTO.operDataList[0] })
}
}
}.padding({left:10})
Text(item.newsTitle)
.fontSize($r("app.float.font_size_14"))
.fontColor($r("app.color.color_212228"))
.fontWeight(400)
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.textAlign(TextAlign.Start)
.margin({ top: 8 })
.width(this.compDTO.operDataList.length == 2 ? 210 : 150)
.height(42)
.lineHeight(21)
}
.padding({ right: 16 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType != '0') {
console.log(item.objectId)
this.gotoLive(item)
}
})
})
}
if (this.compDTO.operDataList.length >= 2 && (this.compDTO?.objectType === '0' || this.compDTO?.objectType === '')) {
Row() {
Ellipse()
.width(2* (this.moreWidth - this.initMoreWidth - 1))
.height(this.compDTO.operDataList.length == 2 ? 180 : 146)
.fill(0xf1f3f4)
.position({ left: -(this.moreWidth - this.initMoreWidth - 3) * 0.8 })
Column() {
if (this.moreWidth > this.initMoreWidth + 2) {
Text(this.moreTips)
.fontSize(8)
.fontColor(0x858585)
.width(8)
}
}
.justifyContent(FlexAlign.Center)
.align(Alignment.Center)
.height(this.compDTO.operDataList.length == 2 ? 180 : 146)
.width(this.initMoreWidth)
.backgroundColor(0xf1f3f4)
.borderRadius({ topLeft: 5, bottomLeft: 5 })
}
.margin({left: 1.5 * (this.moreWidth - this.initMoreWidth)})
}
}
}
.align(Alignment.Start)
.scrollable(this.compDTO.operDataList.length >= 2 ? ScrollDirection.Horizontal : ScrollDirection.None)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.onReachEnd(() => {
this.edgeAnimation()
})
.onScrollStop(() => {
// this.resetEdgeAnimation();
})
.onScroll((xOffset: number, yOffset: number) => {
if (xOffset < 0) {
this.reverseEdgeAnimation();
}
})
.onTouch((event?: TouchEvent) => {
if(event) {
if (event.type === TouchType.Up) {
this.toMore();
this.resetEdgeAnimation();
}
}
})
.width(CommonConstants.FULL_WIDTH)
.height(this.compDTO.operDataList.length == 2 ? 180 : 136)
} else if (this.compDTO.operDataList.length) {
// 一个
LiveHorizontalCardForOneComponent({ contentDTO: this.compDTO.operDataList[0] })
}
...
...
Please
register
or
login
to post a comment