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
xugenyuan
2024-06-11 16:25:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
488332d1fedc6e7741d3e192215b477276ed9de9
488332d1
1 parent
0b942991
ref |> 解决从精选评论、我的评论进入对应文章稿件详情时,自动跳转至稿件详情评论区问题
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
6 deletions
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
488332d
...
...
@@ -163,7 +163,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
@@ -232,7 +233,8 @@ export class ProcessUtils {
relId: content?.relId,
channelId: content?.channelId,
pageId: content?.pageId
} as ExtraDTO
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
@@ -300,7 +302,8 @@ export class ProcessUtils {
channelId: content?.channelId,
sourcePage: '5',
commentId: content?.commentInfo?.commentId
} as ExtraDTO
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
@@ -316,7 +319,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
@@ -352,7 +356,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
@@ -394,7 +399,8 @@ export class ProcessUtils {
extra: {
relType: content?.relType,
relId: content?.relId,
} as ExtraDTO
} as ExtraDTO,
targetLayout: content.customParamTargetLayout
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
488332d
...
...
@@ -116,6 +116,9 @@ export class ContentDTO implements BaseDTO {
timeBlurred:number = 0
top:number = 0
// 自定义参数,用于跳转对应页面时 传递targetLayout参数用
customParamTargetLayout?: string
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
content.liveType = old.liveType;
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
View file @
488332d
...
...
@@ -24,4 +24,6 @@ export interface Params {
videoCoverUrl
?:
string
;
pageId
?:
string
;
backVisibility
?:
boolean
;
//展示顶部返回栏
targetLayout
?:
string
;
// "comment" 表示进入对应页面后,跳转至评论区
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
488332d
...
...
@@ -66,6 +66,7 @@ export struct ImageAndTextPageComponent {
@State offsetY: number = 0
pageShowTime:number = 0;
pageHideTime:number = 0;
lastTimeoutId?: number
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
...
...
@@ -152,6 +153,8 @@ export struct ImageAndTextPageComponent {
.onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
this.checkToScrollCommentArea()
})
// .onMeasureSize()
...
...
@@ -413,6 +416,7 @@ export struct ImageAndTextPageComponent {
if (this.info) {
// let height = DisplayUtils.getDeviceHeight() / 2
let offSetY = this.info?.globalPosition.y as number
Logger.debug(TAG, "滚动至yOffset: " + (offSetY - 100))
//头部距离48
this.scroller.scrollTo({
yOffset: offSetY - 100,
...
...
@@ -427,4 +431,27 @@ export struct ImageAndTextPageComponent {
aboutToDisappear() {
}
checkToScrollCommentArea() {
if (!this.info) {
// 需要评论区位置,调用前 请确保它有值
return
}
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))
//头部距离48
this.scroller.scrollTo({
yOffset: offSetY - 100,
xOffset: 0,
animation: { duration: 1000, curve: Curve.Ease }
})
this.action.params!.targetLayout = undefined
}, 600)
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
View file @
488332d
...
...
@@ -498,6 +498,7 @@ struct QualityCommentItem {
content.relType = this.item.targetRelType;
content.pageId = this.item.pageId;
content.linkUrl = this.item.h5Url;
content.customParamTargetLayout = "comment"
ProcessUtils.processPage(content)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
View file @
488332d
...
...
@@ -93,6 +93,7 @@ export struct HomePageBottomCommentComponent {
.onClick(()=>{
let content = getParams(item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
content.customParamTargetLayout = "comment"
ProcessUtils.processPage(content)
})
.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
...
...
Please
register
or
login
to post a comment