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
王士厅
2024-06-11 19:45:46 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
98eaf6661c632c296219b7e7bad3b8c4b64eafde
98eaf666
2 parents
2a10b7af
d75bbd23
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86 additions
and
23 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/DynamicDetailComponent.ets
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/products/phone/src/main/ets/pages/detail/DynamicDetailPage.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
98eaf66
...
...
@@ -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 @
98eaf66
...
...
@@ -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 @
98eaf66
...
...
@@ -24,4 +24,6 @@ export interface Params {
videoCoverUrl
?:
string
;
pageId
?:
string
;
backVisibility
?:
boolean
;
//展示顶部返回栏
targetLayout
?:
string
;
// "comment" 表示进入对应页面后,跳转至评论区
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
98eaf66
...
...
@@ -17,6 +17,7 @@ import {
batchLikeAndCollectResult,
RmhInfoDTO,
InteractDataDTO,
Action,
} from 'wdBean';
import media from '@ohos.multimedia.media';
import { OperRowListView } from './view/OperRowListView';
...
...
@@ -56,9 +57,7 @@ const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
@Component
export struct DynamicDetailComponent {
//入参
private relId: string = ''
private contentId: string = ''
private relType: string = ''
action: Action = {} as Action
//出参
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
//UI
...
...
@@ -82,6 +81,8 @@ export struct DynamicDetailComponent {
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
pageParam: ParamType = {}
commentListAreaInfo?: Area
lastTimeoutId?: number
// @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
...
...
@@ -553,6 +554,12 @@ export struct DynamicDetailComponent {
CommentComponent({
publishCommentModel: this.publishCommentModel
})
.id("comment")
.onAreaChange((oldValue: Area, newValue: Area) => {
this.commentListAreaInfo = newValue
this.checkToScrollCommentArea()
})
}
Blank().layoutWeight(1)
}
...
...
@@ -587,7 +594,10 @@ export struct DynamicDetailComponent {
private async getContentDetailData() {
this.isNetConnected = NetworkUtil.isNetConnected()
try {
let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
const relId = this.action.params?.extra?.relId || '';
const relType = this.action.params?.extra?.relType || '';
const contentId = this.action.params?.contentID || '';
let data = await MultiPictureDetailViewModel.getDetailData(relId, contentId, relType)
this.isPageEnd = true;
this.contentDetailData = data[0];
let dateTime =
...
...
@@ -804,6 +814,29 @@ export struct DynamicDetailComponent {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactDataDTO)
}
checkToScrollCommentArea() {
if (!this.commentListAreaInfo) {
// 需要评论区位置,调用前 请确保它有值
return
}
if (this.action.params?.targetLayout && this.action.params.targetLayout == "comment") {
if (this.lastTimeoutId) {
clearTimeout(this.lastTimeoutId)
}
this.lastTimeoutId = setTimeout(() => {
let offSetY = this.commentListAreaInfo?.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)
}
}
}
interface radiusType {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
98eaf66
...
...
@@ -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 @
98eaf66
...
...
@@ -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 @
98eaf66
...
...
@@ -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) => {
...
...
sight_harmony/products/phone/src/main/ets/pages/detail/DynamicDetailPage.ets
View file @
98eaf66
...
...
@@ -9,35 +9,25 @@ const TAG = 'DynamicDetailPage';
@Component
struct DynamicDetailPage {
pageShowTime:number = 0;
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
@Provide pageName: string = TrackConstants.PageName.DynamicDetail
@Provide pageId: string = TrackConstants.PageName.DynamicDetail
build() {
Column() {
DynamicDetailComponent({
relId: this.relId,
contentId: this.contentId,
relType: this.relType
})
DynamicDetailComponent({action: router.getParams() as Action })
}
.height('100%')
.width('100%')
.backgroundColor('#20272E')
}
aboutToAppear() {
let par:Action = router.getParams() as Action;
let params = par?.params;
this.relId = params?.extra?.relId || '';
this.relType = params?.extra?.relType || '';
this.contentId = params?.contentID || '';
}
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
//页面浏览
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000))
...
...
Please
register
or
login
to post a comment