chenquansheng

fix |> 修复点击切换后滚动页面底部评论角标样式没有变化问题

... ... @@ -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
// 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({
yOffset: offSetY,
xOffset: 0,
yOffset: this.offsetY,
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)
// }
// this.isScrollTop = !this.isScrollTop
// 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 }
})
... ...