Showing
2 changed files
with
11 additions
and
21 deletions
| @@ -248,34 +248,24 @@ export struct ImageAndTextPageComponent { | @@ -248,34 +248,24 @@ export struct ImageAndTextPageComponent { | ||
| 248 | console.log(TAG, "点击滑动页面", JSON.stringify(info)) | 248 | console.log(TAG, "点击滑动页面", JSON.stringify(info)) |
| 249 | 249 | ||
| 250 | //评论区当前位置 | 250 | //评论区当前位置 |
| 251 | - // let currentCommonentOffSetY = this.info?.globalPosition.y as number | ||
| 252 | - // let offSetY = 0 | ||
| 253 | - // if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { | ||
| 254 | - // offSetY = currentCommonentOffSetY-200 | ||
| 255 | - // this.showMainText = true | ||
| 256 | - // }else { | ||
| 257 | - // this.showMainText = false | ||
| 258 | - // } | ||
| 259 | - // this.scroller.scrollTo({ | ||
| 260 | - // yOffset: offSetY, | ||
| 261 | - // xOffset: 0, | ||
| 262 | - // animation: { duration: 1000, curve: Curve.Ease } | ||
| 263 | - // }) | ||
| 264 | - | ||
| 265 | - if (!this.offsetY) { | ||
| 266 | - this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y | 251 | + let currentCommonentOffSetY = this.info?.globalPosition.y as number |
| 252 | + let offSetY = 0 | ||
| 253 | + if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) { | ||
| 254 | + offSetY = currentCommonentOffSetY-200 | ||
| 267 | } | 255 | } |
| 256 | + | ||
| 257 | + // if (!this.offsetY) { | ||
| 258 | + // this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y | ||
| 259 | + // } | ||
| 268 | // 定位到评论区域 | 260 | // 定位到评论区域 |
| 269 | if (this.isScrollTop) { | 261 | if (this.isScrollTop) { |
| 270 | this.scroller.scrollTo({ | 262 | this.scroller.scrollTo({ |
| 271 | xOffset: 0, | 263 | xOffset: 0, |
| 272 | - yOffset: this.offsetY, | 264 | + yOffset: offSetY, |
| 273 | animation: { duration: 1000, curve: Curve.Ease } | 265 | animation: { duration: 1000, curve: Curve.Ease } |
| 274 | }) | 266 | }) |
| 275 | - // this.showMainText = true | ||
| 276 | } else { | 267 | } else { |
| 277 | this.scroller.scrollEdge(Edge.Top) | 268 | this.scroller.scrollEdge(Edge.Top) |
| 278 | - // this.showMainText = false | ||
| 279 | } | 269 | } |
| 280 | this.isScrollTop = !this.isScrollTop | 270 | this.isScrollTop = !this.isScrollTop |
| 281 | } | 271 | } |
| @@ -489,7 +489,7 @@ struct ChildCommentItem { | @@ -489,7 +489,7 @@ struct ChildCommentItem { | ||
| 489 | fontWeight: FontWeight.Regular, | 489 | fontWeight: FontWeight.Regular, |
| 490 | marginWidth: (95 + 16) | 490 | marginWidth: (95 + 16) |
| 491 | }) | 491 | }) |
| 492 | - .margin({ left: 95, right: 16, top: -12 }) | 492 | + .margin({ left: 95, right: 16, top: -15 }) |
| 493 | .onClick(() => { | 493 | .onClick(() => { |
| 494 | this.replyComment() | 494 | this.replyComment() |
| 495 | }) | 495 | }) |
| @@ -702,7 +702,7 @@ struct commentHeaderView { | @@ -702,7 +702,7 @@ struct commentHeaderView { | ||
| 702 | fontWeight: FontWeight.Regular, | 702 | fontWeight: FontWeight.Regular, |
| 703 | marginWidth: (59 + 16) | 703 | marginWidth: (59 + 16) |
| 704 | }) | 704 | }) |
| 705 | - .margin({ left: 60, right: 16,top:-12 }) | 705 | + .margin({ left: 60, right: 16,top:-15 }) |
| 706 | .onClick(() => { | 706 | .onClick(() => { |
| 707 | this.replyComment() | 707 | this.replyComment() |
| 708 | }) | 708 | }) |
-
Please register or login to post a comment