Showing
3 changed files
with
84 additions
and
11 deletions
| @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' | @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' | ||
| 5 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' | 5 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' |
| 6 | import { CommentListItem } from '../../../viewmodel/CommentListItem' | 6 | import { CommentListItem } from '../../../viewmodel/CommentListItem' |
| 7 | import measure from '@ohos.measure' | 7 | import measure from '@ohos.measure' |
| 8 | +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index' | ||
| 8 | 9 | ||
| 9 | @Component | 10 | @Component |
| 10 | export struct ChildCommentComponent { | 11 | export struct ChildCommentComponent { |
| @@ -16,6 +17,7 @@ export struct ChildCommentComponent { | @@ -16,6 +17,7 @@ export struct ChildCommentComponent { | ||
| 16 | @State isOverLines: boolean = false | 17 | @State isOverLines: boolean = false |
| 17 | @State isOverLinesParent: boolean = false | 18 | @State isOverLinesParent: boolean = false |
| 18 | testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸" | 19 | testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸" |
| 20 | + @Link fromPage:number | ||
| 19 | 21 | ||
| 20 | build() { | 22 | build() { |
| 21 | Column() { | 23 | Column() { |
| @@ -195,11 +197,12 @@ export struct ChildCommentComponent { | @@ -195,11 +197,12 @@ export struct ChildCommentComponent { | ||
| 195 | }.height('69lpx') | 197 | }.height('69lpx') |
| 196 | .justifyContent(FlexAlign.Center) | 198 | .justifyContent(FlexAlign.Center) |
| 197 | .onClick(() => { | 199 | .onClick(() => { |
| 198 | - let content = new ContentDTO() | ||
| 199 | - content.objectId = this.data.targetId; | ||
| 200 | - content.relType = this.data.targetRelType + ""; | ||
| 201 | - content.relId = this.data.targetRelId; | ||
| 202 | - content.objectType = this.data.targetType + ""; | 200 | + let content = getParams(this.data) |
| 201 | + if(this.fromPage === 0 ){ | ||
| 202 | + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content)) | ||
| 203 | + }else{ | ||
| 204 | + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content)) | ||
| 205 | + } | ||
| 203 | ProcessUtils.processPage(content) | 206 | ProcessUtils.processPage(content) |
| 204 | }) | 207 | }) |
| 205 | } | 208 | } |
| @@ -284,3 +287,20 @@ function textStyle() { | @@ -284,3 +287,20 @@ function textStyle() { | ||
| 284 | .lineHeight('46lpx') | 287 | .lineHeight('46lpx') |
| 285 | } | 288 | } |
| 286 | 289 | ||
| 290 | +function getParams(item: CommentListItem) : ContentDTO{ | ||
| 291 | + let contentDTO = new ContentDTO(); | ||
| 292 | + | ||
| 293 | + // contentDTO.objectType = item.targetType + "" | ||
| 294 | + // contentDTO.objectId = item.targetId + "" | ||
| 295 | + // contentDTO.newsTitle = item.targetTitle | ||
| 296 | + // contentDTO.channelId = | ||
| 297 | + // contentDTO.rmhPlatform = | ||
| 298 | + | ||
| 299 | + contentDTO.objectId = item.targetId; | ||
| 300 | + contentDTO.relType = item.targetRelType + ""; | ||
| 301 | + contentDTO.relId = item.targetRelId; | ||
| 302 | + contentDTO.objectType = item.targetType + ""; | ||
| 303 | + contentDTO.newsTitle = item.targetTitle | ||
| 304 | + | ||
| 305 | + return contentDTO | ||
| 306 | +} |
| @@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent'; | @@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent'; | ||
| 8 | import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; | 8 | import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; |
| 9 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; | 9 | import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; |
| 10 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | 10 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; |
| 11 | +import { ContentDTO } from 'wdBean/Index'; | ||
| 12 | +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'; | ||
| 11 | 13 | ||
| 12 | const TAG = "HomePageBottomCommentComponent" | 14 | const TAG = "HomePageBottomCommentComponent" |
| 13 | 15 | ||
| @@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent { | @@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent { | ||
| 83 | ChildCommentComponent({ | 85 | ChildCommentComponent({ |
| 84 | data: item, | 86 | data: item, |
| 85 | levelHead: UserDataLocal.getUserLevelHeaderUrl(), | 87 | levelHead: UserDataLocal.getUserLevelHeaderUrl(), |
| 86 | - isLastItem: index === this.data_comment.totalCount() - 1 | 88 | + isLastItem: index === this.data_comment.totalCount() - 1, |
| 89 | + fromPage:0 | ||
| 87 | }) | 90 | }) |
| 88 | - } | 91 | + }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 92 | + if (isVisible) { | ||
| 93 | + let contentDTO = getParams(item) | ||
| 94 | + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO)) | ||
| 95 | + } | ||
| 96 | + }) | ||
| 89 | }, (item: CommentListItem, index: number) => index.toString()) | 97 | }, (item: CommentListItem, index: number) => index.toString()) |
| 90 | 98 | ||
| 91 | //没有更多数据 显示提示 | 99 | //没有更多数据 显示提示 |
| @@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent { | @@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent { | ||
| 217 | this.isGetRequest = true | 225 | this.isGetRequest = true |
| 218 | }) | 226 | }) |
| 219 | } | 227 | } |
| 220 | -} | ||
| 228 | +} | ||
| 229 | + | ||
| 230 | + | ||
| 231 | +function getParams(item: CommentListItem) : ContentDTO{ | ||
| 232 | + let contentDTO = new ContentDTO(); | ||
| 233 | + | ||
| 234 | + // contentDTO.objectType = item.targetType + "" | ||
| 235 | + // contentDTO.objectId = item.targetId + "" | ||
| 236 | + // contentDTO.newsTitle = item.targetTitle | ||
| 237 | + // contentDTO.channelId = | ||
| 238 | + // contentDTO.rmhPlatform = | ||
| 239 | + | ||
| 240 | + contentDTO.objectId = item.targetId; | ||
| 241 | + contentDTO.relType = item.targetRelType + ""; | ||
| 242 | + contentDTO.relId = item.targetRelId; | ||
| 243 | + contentDTO.objectType = item.targetType + ""; | ||
| 244 | + contentDTO.newsTitle = item.targetTitle | ||
| 245 | + | ||
| 246 | + return contentDTO | ||
| 247 | +} |
| @@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU | @@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU | ||
| 8 | import { ChildCommentComponent } from './ChildCommentComponent'; | 8 | import { ChildCommentComponent } from './ChildCommentComponent'; |
| 9 | import { EmptyComponent } from '../../view/EmptyComponent'; | 9 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 10 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | 10 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; |
| 11 | +import { ContentDTO } from 'wdBean/Index'; | ||
| 12 | +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'; | ||
| 11 | 13 | ||
| 12 | const TAG = "HomePageBottomComponent" | 14 | const TAG = "HomePageBottomComponent" |
| 13 | /** | 15 | /** |
| @@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent { | @@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 84 | ChildCommentComponent({ | 86 | ChildCommentComponent({ |
| 85 | data: item, | 87 | data: item, |
| 86 | levelHead: this.levelHead, | 88 | levelHead: this.levelHead, |
| 87 | - isLastItem: index === this.data_comment.totalCount() - 1 | 89 | + isLastItem: index === this.data_comment.totalCount() - 1, |
| 90 | + fromPage:1 | ||
| 88 | }) | 91 | }) |
| 89 | - } | 92 | + }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 93 | + if (isVisible) { | ||
| 94 | + let contentDTO = getParams(item) | ||
| 95 | + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO)) | ||
| 96 | + } | ||
| 97 | + }) | ||
| 90 | }, (item: CommentListItem, index: number) => index.toString()) | 98 | }, (item: CommentListItem, index: number) => index.toString()) |
| 91 | 99 | ||
| 92 | //没有更多数据 显示提示 | 100 | //没有更多数据 显示提示 |
| @@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent { | @@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 214 | this.isGetRequest = true | 222 | this.isGetRequest = true |
| 215 | }) | 223 | }) |
| 216 | } | 224 | } |
| 217 | -} | ||
| 225 | +} | ||
| 226 | + | ||
| 227 | +function getParams(item: CommentListItem) : ContentDTO{ | ||
| 228 | + let contentDTO = new ContentDTO(); | ||
| 229 | + | ||
| 230 | + // contentDTO.objectType = item.targetType + "" | ||
| 231 | + // contentDTO.objectId = item.targetId + "" | ||
| 232 | + // contentDTO.newsTitle = item.targetTitle | ||
| 233 | + // contentDTO.channelId = | ||
| 234 | + // contentDTO.rmhPlatform = | ||
| 235 | + | ||
| 236 | + contentDTO.objectId = item.targetId; | ||
| 237 | + contentDTO.relType = item.targetRelType + ""; | ||
| 238 | + contentDTO.relId = item.targetRelId; | ||
| 239 | + contentDTO.objectType = item.targetType + ""; | ||
| 240 | + contentDTO.newsTitle = item.targetTitle | ||
| 241 | + | ||
| 242 | + return contentDTO | ||
| 243 | +} |
-
Please register or login to post a comment