xugenyuan

fix |> 点击已关注号主的动态图文内容下方评论按钮,进入动态详情页,应锚定评论区

http://192.168.1.3:8080/zentao/bug-view-20393.html

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -399,22 +399,6 @@ export class ProcessUtils {
return
}
ProcessUtils.processPage(contentBean)
// let taskAction: Action = {
// type: 'JUMP_INNER_NEW_PAGE',
// params: {
// contentID: content?.newsId,
// url:content?.linkUrl,
// pageID: 'IMAGE_TEXT_DETAIL',
// extra: {
// relType: content?.relType,
// relId: content?.relId,
// sourcePage: '5',
// commentId: content?.commentId
// } as ExtraDTO
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
// Logger.debug(TAG, `commentGotoWeb, ${content.newsId}`);
}
public static gotoH5NewsWeb(content: ContentDTO) {
... ... @@ -433,7 +417,6 @@ export class ProcessUtils {
title: content?.newsTitle
} as ExtraDTO,
targetLayout: content.customParamTargetLayout,
clickComment: content.clickComment
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
... ... @@ -456,7 +439,6 @@ export class ProcessUtils {
commentId: content?.commentInfo?.commentId
} as ExtraDTO,
targetLayout: content.customParamTargetLayout,
clickComment: content.clickComment
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
... ...
... ... @@ -144,7 +144,6 @@ export class ContentDTO implements BaseDTO {
isMourning?: boolean = false;
author: string = ""; ///撰稿人
clickComment:boolean = false;
// 号主页评论列表点击跳转到视频详情判断评论弹框是否展开
showComment?:boolean = false;
... ...
... ... @@ -24,6 +24,5 @@ export interface Params {
videoCoverUrl?: string;
pageId?: string;
backVisibility?: boolean; //展示顶部返回栏
clickComment?:boolean;//点击评论按钮进入稿件详情页定位到评论区
targetLayout?: string; // "comment" 表示进入对应页面后,跳转至评论区
}
... ...
... ... @@ -125,7 +125,7 @@ export struct CarderInteraction {
}
.justifyContent(FlexAlign.Center)
.onClick(() => {
this.contentDTO.clickComment = true
this.contentDTO.customParamTargetLayout = "comment"
ProcessUtils.processPage(this.contentDTO);
})
}
... ...
... ... @@ -93,12 +93,7 @@ export struct ImageAndTextPageComponent {
}
webPageIsPageEnd() {
if (this.action.params?.clickComment) {
setTimeout(()=>{
this.pageScrollToCommonent()
},
800)
}
this.checkToScrollCommentArea()
}
build() {
... ... @@ -255,7 +250,7 @@ export struct ImageAndTextPageComponent {
showMainText:this.showMainText,
styleType: 1,
onCommentIconClick: () => {
this.pageScrollToCommonent()
this.toggleScrollToCommonentOrTop()
}
})
}
... ... @@ -502,28 +497,6 @@ export struct ImageAndTextPageComponent {
}
}
private pageScrollToCommonent() {
const info = componentUtils.getRectangleById('comment');
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
// 定位到评论区域
if (!this.showMainText) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: offSetY,
animation: { duration: 1000, curve: Curve.Ease }
})
} else {
this.scroller.scrollEdge(Edge.Top)
}
}
aboutToAppear() {
// Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
this.getDetail()
... ... @@ -582,19 +555,37 @@ export struct ImageAndTextPageComponent {
this.showMainText = true
}
if (this.action.params?.targetLayout && this.action.params.targetLayout == "comment") {
if (!this.showMainText && this.action.params?.targetLayout == "comment") {
if (this.lastTimeoutId) {
clearTimeout(this.lastTimeoutId)
}
this.lastTimeoutId = setTimeout(() => {
//头部距离48
this.scroller.scrollTo({
yOffset: offSetY,
xOffset: 0,
animation: { duration: 1000, curve: Curve.Ease }
})
this.toggleScrollToCommonentOrTop(true)
this.action.params!.targetLayout = undefined
}, 600)
}
}
private toggleScrollToCommonentOrTop(forceToComment?: boolean) {
// 定位到评论区域
if ((forceToComment == undefined || forceToComment == false) && this.showMainText) {
this.scroller.scrollEdge(Edge.Top)
return
}
//评论区当前位置
let currentCommonentOffSetY = this.info?.globalPosition.y as number - 70
// 当前页面滚动位置
let currentScrollOffSetY = this.scroller.currentOffset().yOffset
let offSetY = 0
if (currentCommonentOffSetY >= (this.screenHeight-this.bottomHeight) ) {
offSetY = currentScrollOffSetY + (currentCommonentOffSetY - this.screenHeight+this.bottomHeight) + 400
}
this.scroller.scrollTo({
xOffset: 0,
yOffset: offSetY,
animation: { duration: 1000, curve: Curve.Ease }
})
}
}
... ...