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
chenquansheng
2024-08-27 19:03:58 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
509d3edcc504f8de8fae4754a83955bf55981b6d
509d3edc
1 parent
266f65fa
fix |> 修复点击切换后滚动页面底部评论角标样式没有变化问题
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
36 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
509d3ed
...
...
@@ -248,34 +248,36 @@ export struct ImageAndTextPageComponent {
console.log(TAG, "点击滑动页面", JSON.stringify(info))
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentCommonentOffSetY-200
this.showMainText = true
}else {
this.showMainText = false
}
this.scroller.scrollTo({
yOffset: offSetY,
xOffset: 0,
animation: { duration: 1000, curve: Curve.Ease }
})
// if (!this.offsetY) {
// this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
// }
// // 定位到评论区域
// if (this.isScrollTop) {
// this.scroller.scrollTo({
// xOffset: 0,
// yOffset: this.offsetY,
// animation: true
// })
// } else {
// this.scroller.scrollEdge(Edge.Top)
// let currentCommonentOffSetY = this.info?.globalPosition.y as number
// let offSetY = 0
// if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
// offSetY = currentCommonentOffSetY-200
// this.showMainText = true
// }else {
// this.showMainText = false
// }
// this.isScrollTop = !this.isScrollTop
// this.scroller.scrollTo({
// yOffset: offSetY,
// xOffset: 0,
// animation: { duration: 1000, curve: Curve.Ease }
// })
if (!this.offsetY) {
this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
}
// 定位到评论区域
if (this.isScrollTop) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: this.offsetY,
animation: { duration: 1000, curve: Curve.Ease }
})
// this.showMainText = true
} else {
this.scroller.scrollEdge(Edge.Top)
// this.showMainText = false
}
this.isScrollTop = !this.isScrollTop
}
})
}
...
...
@@ -357,7 +359,6 @@ export struct ImageAndTextPageComponent {
if (this.detailContentEmpty) {
this.emptyType = 18
}
console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0]))
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans[0];
let dateTime =
...
...
@@ -560,21 +561,22 @@ export struct ImageAndTextPageComponent {
// 需要评论区位置,调用前 请确保它有值
return
}
let offSetY = this.info?.globalPosition.y as number -60
Logger.debug(TAG, "即将滚动至yOffset: " + offSetY)
if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
this.showMainText = false
}else {
this.showMainText = true
}
if (this.action.params?.targetLayout && this.action.params.targetLayout == "comment") {
if (this.lastTimeoutId) {
clearTimeout(this.lastTimeoutId)
}
this.lastTimeoutId = setTimeout(() => {
let offSetY = this.info?.globalPosition.y as number
Logger.debug(TAG, "即将滚动至yOffset: " + (offSetY - 100))
if (offSetY >= (this.screenHeight-this.bottomHeight) ) {
this.showMainText = true
}else {
this.showMainText = false
}
//头部距离48
this.scroller.scrollTo({
yOffset: offSetY
- 100
,
yOffset: offSetY,
xOffset: 0,
animation: { duration: 1000, curve: Curve.Ease }
})
...
...
Please
register
or
login
to post a comment