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
yangsunyue_wd
2024-04-30 10:48:06 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b7e22b62ef0174fc6ac1d95bc74d3c438331813e
b7e22b62
1 parent
3cb5b26c
desc:评论相关,评论后自动定位评论区域
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
b7e22b6
import { Logger, NumberFormatterUtils, DateTimeUtils, EmitterUtils, EmitterEventId, NetworkUtil } from 'wdKit';
import { Logger, NumberFormatterUtils, DateTimeUtils, EmitterUtils, EmitterEventId, NetworkUtil,
DisplayUtils } from 'wdKit';
import {
Action,
ContentDetailDTO,
...
...
@@ -41,6 +42,7 @@ export struct ImageAndTextPageComponent {
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'collect', 'share']
@State isNetConnected: boolean = true
@State info: Area|null = null
build() {
Column() {
...
...
@@ -131,8 +133,11 @@ export struct ImageAndTextPageComponent {
Divider().strokeWidth(6).color('#f5f5f5')
CommentComponent({
publishCommentModel: this.publishCommentModel
}).onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
})
// .onMeasureSize()
}
}
}
...
...
@@ -144,7 +149,7 @@ export struct ImageAndTextPageComponent {
.scrollBar(BarState.Off)
.align(Alignment.Top)
if(!this.isNetConnected) {
if
(!this.isNetConnected) {
EmptyComponent({
emptyType: 1,
emptyButton: true,
...
...
@@ -152,7 +157,7 @@ export struct ImageAndTextPageComponent {
this.getDetail()
}
})
}
else
{
}
else
{
if (!this.isPageEnd) {
detailedSkeleton()
}
...
...
@@ -308,7 +313,12 @@ export struct ImageAndTextPageComponent {
if (targetId) {
if (targetId == this.publishCommentModel.targetId) {
// 滚动到评论列表
if (this.info) {
// let height = DisplayUtils.getDeviceHeight() / 2
let offSetY = this.info?.globalPosition.y as number
//头部距离48
this.scroller.scrollTo({yOffset:offSetY - 100, xOffset:0, animation:{ duration: 1000, curve: Curve.Ease}})
}
}
}
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
b7e22b6
...
...
@@ -182,9 +182,6 @@ export struct CommentComponent {
if (this.hasMore === false) NoMoreLayout()
}
}
// .onScrollFrameBegin((offset: number, state: ScrollState)=>{
//
// })
.onReachEnd(()=>{
if (this.hasMore) {
this.getData()
...
...
Please
register
or
login
to post a comment