Showing
19 changed files
with
287 additions
and
21 deletions
| @@ -181,6 +181,10 @@ | @@ -181,6 +181,10 @@ | ||
| 181 | "value": "40vp" | 181 | "value": "40vp" |
| 182 | }, | 182 | }, |
| 183 | { | 183 | { |
| 184 | + "name": "top_tab_bar_height_common", | ||
| 185 | + "value": "44vp" | ||
| 186 | + }, | ||
| 187 | + { | ||
| 184 | "name": "top_tab_item_max_width", | 188 | "name": "top_tab_item_max_width", |
| 185 | "value": "300vp" | 189 | "value": "300vp" |
| 186 | }, | 190 | }, |
| @@ -16,6 +16,8 @@ import { Card19Component } from './cardview/Card19Component'; | @@ -16,6 +16,8 @@ import { Card19Component } from './cardview/Card19Component'; | ||
| 16 | import { Card20Component } from './cardview/Card20Component'; | 16 | import { Card20Component } from './cardview/Card20Component'; |
| 17 | import { Card21Component } from './cardview/Card21Component'; | 17 | import { Card21Component } from './cardview/Card21Component'; |
| 18 | import { SearchContentComponent } from './cardview/SearchContentComponent'; | 18 | import { SearchContentComponent } from './cardview/SearchContentComponent'; |
| 19 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 20 | +import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 19 | 21 | ||
| 20 | /** | 22 | /** |
| 21 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle | 23 | * card适配器,卡片样式汇总,依据ContentDTO#appStyle |
| @@ -27,6 +29,20 @@ export struct CardParser { | @@ -27,6 +29,20 @@ export struct CardParser { | ||
| 27 | @State pageName: string = ''; | 29 | @State pageName: string = ''; |
| 28 | @State contentDTO: ContentDTO = new ContentDTO(); | 30 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 29 | @ObjectLink compDTO: CompDTO | 31 | @ObjectLink compDTO: CompDTO |
| 32 | + pageShowTime:number = 0; | ||
| 33 | + pageHideTime:number = 0; | ||
| 34 | + | ||
| 35 | + onPageShow() { | ||
| 36 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + //内容浏览Tracking | ||
| 40 | + onPageHide(): void { | ||
| 41 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 42 | + let duration = 0 | ||
| 43 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 44 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 45 | + } | ||
| 30 | 46 | ||
| 31 | build() { | 47 | build() { |
| 32 | this.contentBuilder(this.contentDTO); | 48 | this.contentBuilder(this.contentDTO); |
| @@ -33,6 +33,7 @@ import { HttpUtils } from 'wdNetwork/Index'; | @@ -33,6 +33,7 @@ import { HttpUtils } from 'wdNetwork/Index'; | ||
| 33 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | 33 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' |
| 34 | import { common } from '@kit.AbilityKit'; | 34 | import { common } from '@kit.AbilityKit'; |
| 35 | import { componentUtils, window } from '@kit.ArkUI'; | 35 | import { componentUtils, window } from '@kit.ArkUI'; |
| 36 | +import { TrackConstants, TrackingButton, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 36 | 37 | ||
| 37 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; | 38 | const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; |
| 38 | 39 | ||
| @@ -62,6 +63,20 @@ export struct ImageAndTextPageComponent { | @@ -62,6 +63,20 @@ export struct ImageAndTextPageComponent { | ||
| 62 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 63 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 63 | @State isScrollTop: boolean = true | 64 | @State isScrollTop: boolean = true |
| 64 | @State offsetY: number = 0 | 65 | @State offsetY: number = 0 |
| 66 | + pageShowTime:number = 0; | ||
| 67 | + pageHideTime:number = 0; | ||
| 68 | + | ||
| 69 | + onPageShow() { | ||
| 70 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + //内容浏览Tracking | ||
| 74 | + onPageHide(): void { | ||
| 75 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 76 | + let duration = 0 | ||
| 77 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 78 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 79 | + } | ||
| 65 | 80 | ||
| 66 | build() { | 81 | build() { |
| 67 | Stack({ alignContent: Alignment.Top }) { | 82 | Stack({ alignContent: Alignment.Top }) { |
| @@ -359,6 +374,8 @@ export struct ImageAndTextPageComponent { | @@ -359,6 +374,8 @@ export struct ImageAndTextPageComponent { | ||
| 359 | PageRepository.postExecuteLike(params).then(res => { | 374 | PageRepository.postExecuteLike(params).then(res => { |
| 360 | console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) | 375 | console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) |
| 361 | if (this.newsStatusOfUser) { | 376 | if (this.newsStatusOfUser) { |
| 377 | + //内容点赞、取消点赞Tracking 1点赞 0取消点赞 | ||
| 378 | + TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.My, TrackConstants.PageName.My) | ||
| 362 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 379 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 363 | this.queryContentInteractCount() | 380 | this.queryContentInteractCount() |
| 364 | } | 381 | } |
| @@ -6,6 +6,7 @@ import { Notes } from './notes'; | @@ -6,6 +6,7 @@ import { Notes } from './notes'; | ||
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' | 8 | import { InfomationCardClick } from '../../utils/infomationCardClick' |
| 9 | +import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 时间链卡--CompStyle: 09 | 12 | * 时间链卡--CompStyle: 09 |
| @@ -24,6 +25,20 @@ export struct Card9Component { | @@ -24,6 +25,20 @@ export struct Card9Component { | ||
| 24 | @State str01: string = ''; | 25 | @State str01: string = ''; |
| 25 | @State str02: string = ''; | 26 | @State str02: string = ''; |
| 26 | @State str03: string = ''; | 27 | @State str03: string = ''; |
| 28 | + pageShowTime:number = 0; | ||
| 29 | + pageHideTime:number = 0; | ||
| 30 | + | ||
| 31 | + onPageShow() { | ||
| 32 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + //内容浏览Tracking | ||
| 36 | + onPageHide(): void { | ||
| 37 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 38 | + let duration = 0 | ||
| 39 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 40 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 41 | + } | ||
| 27 | 42 | ||
| 28 | async aboutToAppear(): Promise<void> { | 43 | async aboutToAppear(): Promise<void> { |
| 29 | console.log('Card9Component', JSON.stringify(this.contentDTO)) | 44 | console.log('Card9Component', JSON.stringify(this.contentDTO)) |
| @@ -17,8 +17,6 @@ export struct CommentCustomDialog { | @@ -17,8 +17,6 @@ export struct CommentCustomDialog { | ||
| 17 | @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } | 17 | @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } |
| 18 | 18 | ||
| 19 | aboutToAppear(): void { | 19 | aboutToAppear(): void { |
| 20 | - | ||
| 21 | - // this.textInputController.caretPosition(0) | ||
| 22 | } | 20 | } |
| 23 | 21 | ||
| 24 | publishCommentRequest() { | 22 | publishCommentRequest() { |
| @@ -51,12 +49,20 @@ export struct CommentCustomDialog { | @@ -51,12 +49,20 @@ export struct CommentCustomDialog { | ||
| 51 | controller: this.textInputController, | 49 | controller: this.textInputController, |
| 52 | text: this.publishCommentModel.commentContent | 50 | text: this.publishCommentModel.commentContent |
| 53 | }) | 51 | }) |
| 52 | + .id("textAreaId") | ||
| 53 | + .defaultFocus(true) // 获取默认焦点 | ||
| 54 | + .enableKeyboardOnFocus(true) | ||
| 54 | .height('100%') | 55 | .height('100%') |
| 55 | .width('100%') | 56 | .width('100%') |
| 56 | .backgroundColor($r('app.color.color_transparent')) | 57 | .backgroundColor($r('app.color.color_transparent')) |
| 57 | .onChange(value => { | 58 | .onChange(value => { |
| 58 | this.publishCommentModel.commentContent = value; | 59 | this.publishCommentModel.commentContent = value; |
| 59 | }) | 60 | }) |
| 61 | + .onFocus(() => { | ||
| 62 | + if (this.emojiSwitch) { | ||
| 63 | + this.emojiSwitch = false | ||
| 64 | + } | ||
| 65 | + }) | ||
| 60 | } | 66 | } |
| 61 | .backgroundColor('#F9F9F9') | 67 | .backgroundColor('#F9F9F9') |
| 62 | // .width('100%') | 68 | // .width('100%') |
| @@ -81,6 +87,7 @@ export struct CommentCustomDialog { | @@ -81,6 +87,7 @@ export struct CommentCustomDialog { | ||
| 81 | if (this.emojiSwitch) { | 87 | if (this.emojiSwitch) { |
| 82 | this.textInputController.stopEditing() | 88 | this.textInputController.stopEditing() |
| 83 | } else { | 89 | } else { |
| 90 | + focusControl.requestFocus("textAreaId") // 弹起键盘 | ||
| 84 | // this.textInputController.caretPosition(this.textInputController.getTextContentRect().x) | 91 | // this.textInputController.caretPosition(this.textInputController.getTextContentRect().x) |
| 85 | } | 92 | } |
| 86 | 93 |
| @@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; | @@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; | ||
| 5 | import { LazyDataSource, StringUtils } from 'wdKit'; | 5 | import { LazyDataSource, StringUtils } from 'wdKit'; |
| 6 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 6 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 7 | import { EmptyComponent } from '../../view/EmptyComponent'; | 7 | import { EmptyComponent } from '../../view/EmptyComponent'; |
| 8 | -import { Action } from 'wdBean/Index'; | 8 | +import { Action, ContentDTO } from 'wdBean/Index'; |
| 9 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 9 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 10 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; | 10 | import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; |
| 11 | +import { TrackingContent, TrackConstants, TrackParamConvert, ParamType } from 'wdTracking/Index'; | ||
| 12 | +import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils'; | ||
| 11 | 13 | ||
| 12 | const TAG = "AppointmentListUI" | 14 | const TAG = "AppointmentListUI" |
| 13 | 15 | ||
| @@ -77,7 +79,9 @@ export struct AppointmentListUI { | @@ -77,7 +79,9 @@ export struct AppointmentListUI { | ||
| 77 | AppointmentListChildComponent({ item: item }) | 79 | AppointmentListChildComponent({ item: item }) |
| 78 | } | 80 | } |
| 79 | .onClick(() => { | 81 | .onClick(() => { |
| 80 | - //TODO 跳转 | 82 | + let contentDTO = getParams(item) |
| 83 | + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live,TrackParamConvert.program(contentDTO)) | ||
| 84 | + | ||
| 81 | let action = { | 85 | let action = { |
| 82 | type:"2", | 86 | type:"2", |
| 83 | params:{ | 87 | params:{ |
| @@ -90,6 +94,12 @@ export struct AppointmentListUI { | @@ -90,6 +94,12 @@ export struct AppointmentListUI { | ||
| 90 | } as Action | 94 | } as Action |
| 91 | WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) | 95 | WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) |
| 92 | }) | 96 | }) |
| 97 | + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | ||
| 98 | + if (isVisible) { | ||
| 99 | + let contentDTO = getParams(item) | ||
| 100 | + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live, TrackParamConvert.program(contentDTO)) | ||
| 101 | + } | ||
| 102 | + }) | ||
| 93 | }, (item: MineAppointmentItem, index: number) => index.toString()) | 103 | }, (item: MineAppointmentItem, index: number) => index.toString()) |
| 94 | 104 | ||
| 95 | //没有更多数据 显示提示 | 105 | //没有更多数据 显示提示 |
| @@ -176,3 +186,14 @@ export struct AppointmentListUI { | @@ -176,3 +186,14 @@ export struct AppointmentListUI { | ||
| 176 | return dealData | 186 | return dealData |
| 177 | } | 187 | } |
| 178 | } | 188 | } |
| 189 | + | ||
| 190 | + function getParams(item: MineAppointmentItem) : ContentDTO{ | ||
| 191 | + let contentDTO = new ContentDTO(); | ||
| 192 | + | ||
| 193 | + contentDTO.objectType = item.relType + "" | ||
| 194 | + contentDTO.objectId = item.liveId + "" | ||
| 195 | + contentDTO.newsTitle = item.title | ||
| 196 | + // contentDTO.channelId = | ||
| 197 | + // contentDTO.rmhPlatform | ||
| 198 | + return contentDTO | ||
| 199 | + } |
| @@ -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 | }) |
| 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)) | ||
| 88 | } | 95 | } |
| 96 | + }) | ||
| 89 | }, (item: CommentListItem, index: number) => index.toString()) | 97 | }, (item: CommentListItem, index: number) => index.toString()) |
| 90 | 98 | ||
| 91 | //没有更多数据 显示提示 | 99 | //没有更多数据 显示提示 |
| @@ -218,3 +226,22 @@ export struct HomePageBottomCommentComponent { | @@ -218,3 +226,22 @@ export struct HomePageBottomCommentComponent { | ||
| 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 | }) |
| 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)) | ||
| 89 | } | 96 | } |
| 97 | + }) | ||
| 90 | }, (item: CommentListItem, index: number) => index.toString()) | 98 | }, (item: CommentListItem, index: number) => index.toString()) |
| 91 | 99 | ||
| 92 | //没有更多数据 显示提示 | 100 | //没有更多数据 显示提示 |
| @@ -215,3 +223,21 @@ export struct OtherHomePageBottomCommentComponent { | @@ -215,3 +223,21 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 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 | +} |
| @@ -172,7 +172,8 @@ export struct TopNavigationComponentNew { | @@ -172,7 +172,8 @@ export struct TopNavigationComponentNew { | ||
| 172 | .onClick(() => { | 172 | .onClick(() => { |
| 173 | if (NetworkUtil.isNetConnected()) { | 173 | if (NetworkUtil.isNetConnected()) { |
| 174 | ProcessUtils.gotoMorningEveningPaper() | 174 | ProcessUtils.gotoMorningEveningPaper() |
| 175 | - TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews) | 175 | + TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews, |
| 176 | + TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 176 | } else { | 177 | } else { |
| 177 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 178 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) |
| 178 | } | 179 | } |
| @@ -240,7 +241,7 @@ export struct TopNavigationComponentNew { | @@ -240,7 +241,7 @@ export struct TopNavigationComponentNew { | ||
| 240 | .width('24vp') | 241 | .width('24vp') |
| 241 | .height('24vp') | 242 | .height('24vp') |
| 242 | } | 243 | } |
| 243 | - .height('40vp') | 244 | + .height($r('app.float.top_tab_bar_height_common')) |
| 244 | .width('40vp') | 245 | .width('40vp') |
| 245 | .margin({ right: 10 }) | 246 | .margin({ right: 10 }) |
| 246 | .alignItems(VerticalAlign.Center) | 247 | .alignItems(VerticalAlign.Center) |
| @@ -251,9 +252,9 @@ export struct TopNavigationComponentNew { | @@ -251,9 +252,9 @@ export struct TopNavigationComponentNew { | ||
| 251 | 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End } | 252 | 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End } |
| 252 | }) | 253 | }) |
| 253 | .onClick(() => { | 254 | .onClick(() => { |
| 254 | - TrackingButton.searchClick( TrackConstants.PageName.Search, "PEOPLE") | 255 | + TrackingButton.searchClick(TrackConstants.PageName.Search, "PEOPLE") |
| 255 | let params = { 'tabName': "PEOPLE" } as Record<string, string> | 256 | let params = { 'tabName': "PEOPLE" } as Record<string, string> |
| 256 | - WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params) | 257 | + WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params) |
| 257 | }) | 258 | }) |
| 258 | 259 | ||
| 259 | List({ scroller: this.listScroller }) { | 260 | List({ scroller: this.listScroller }) { |
| @@ -266,9 +267,9 @@ export struct TopNavigationComponentNew { | @@ -266,9 +267,9 @@ export struct TopNavigationComponentNew { | ||
| 266 | .listDirection(Axis.Horizontal) | 267 | .listDirection(Axis.Horizontal) |
| 267 | .scrollBar(BarState.Off) | 268 | .scrollBar(BarState.Off) |
| 268 | .edgeEffect(EdgeEffect.None) | 269 | .edgeEffect(EdgeEffect.None) |
| 269 | - .height($r('app.float.top_tab_bar_height')) | 270 | + .height($r('app.float.top_tab_bar_height_common')) |
| 270 | .backgroundColor(this.barBackgroundColor) | 271 | .backgroundColor(this.barBackgroundColor) |
| 271 | - .padding({ top: 6 }) | 272 | + .margin({top:10}) |
| 272 | .onAreaChange((oldValue: Area, newValue: Area) => { | 273 | .onAreaChange((oldValue: Area, newValue: Area) => { |
| 273 | let width = Number.parseFloat(newValue.width.toString()) | 274 | let width = Number.parseFloat(newValue.width.toString()) |
| 274 | this.tabsWidth = Number.isNaN(width) ? 0 : width | 275 | this.tabsWidth = Number.isNaN(width) ? 0 : width |
| @@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent { | @@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent { | ||
| 8 | Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { | 8 | Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { |
| 9 | Button({type: ButtonType.Normal, stateEffect: false } ) { | 9 | Button({type: ButtonType.Normal, stateEffect: false } ) { |
| 10 | Stack() { | 10 | Stack() { |
| 11 | - Image(this.isAttention == '0'? $r('app.media.home_attention_no_left') : $r('app.media.home_attention_left')) | 11 | + Row() |
| 12 | .width('100%') | 12 | .width('100%') |
| 13 | .height('100%') | 13 | .height('100%') |
| 14 | - .objectFit(ImageFit.Cover) | 14 | + .backgroundColor(this.isAttention == '0'? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5')) |
| 15 | + .borderRadius("5lpx") | ||
| 15 | Row() { | 16 | Row() { |
| 16 | if(this.isAttention == '0') { | 17 | if(this.isAttention == '0') { |
| 17 | if(this.isLoadingAttention) { | 18 | if(this.isLoadingAttention) { |
| @@ -10,6 +10,7 @@ import { | @@ -10,6 +10,7 @@ import { | ||
| 10 | postExecuteLikeParams, | 10 | postExecuteLikeParams, |
| 11 | batchLikeAndCollectParams, | 11 | batchLikeAndCollectParams, |
| 12 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 12 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 13 | +import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; | ||
| 13 | 14 | ||
| 14 | const TAG = 'LikeComponent'; | 15 | const TAG = 'LikeComponent'; |
| 15 | 16 | ||
| @@ -30,6 +31,8 @@ export struct LikeComponent { | @@ -30,6 +31,8 @@ export struct LikeComponent { | ||
| 30 | componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 | 31 | componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 |
| 31 | styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景 | 32 | styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景 |
| 32 | @State likeCount: number = 0 //点赞数 | 33 | @State likeCount: number = 0 //点赞数 |
| 34 | + pageParam: ParamType = {} | ||
| 35 | + PageName: string = '' | ||
| 33 | 36 | ||
| 34 | //上层传值 样例 | 37 | //上层传值 样例 |
| 35 | // this.data['contentId'] = '30035444649' //必须 | 38 | // this.data['contentId'] = '30035444649' //必须 |
| @@ -50,6 +53,7 @@ export struct LikeComponent { | @@ -50,6 +53,7 @@ export struct LikeComponent { | ||
| 50 | this.likesStyle = this.contentDetailData.likesStyle | 53 | this.likesStyle = this.contentDetailData.likesStyle |
| 51 | } | 54 | } |
| 52 | this.onDataUpdated() | 55 | this.onDataUpdated() |
| 56 | + this.contentTrackingDict() | ||
| 53 | } | 57 | } |
| 54 | 58 | ||
| 55 | onDataUpdated() { | 59 | onDataUpdated() { |
| @@ -64,6 +68,27 @@ export struct LikeComponent { | @@ -64,6 +68,27 @@ export struct LikeComponent { | ||
| 64 | } | 68 | } |
| 65 | } | 69 | } |
| 66 | 70 | ||
| 71 | + contentTrackingDict(){ | ||
| 72 | + this.pageParam = { | ||
| 73 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 74 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 75 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 76 | + } | ||
| 77 | + if(this.contentDetailData.newsType == 1) { | ||
| 78 | + this.PageName = TrackConstants.PageName.VideoDetail // 点播 | ||
| 79 | + } else if(this.contentDetailData.newsType == 2) { | ||
| 80 | + this.PageName = TrackConstants.PageName.Live_Detail // 直播 | ||
| 81 | + } else if(this.contentDetailData.newsType == 5) { | ||
| 82 | + this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页 | ||
| 83 | + } else if(this.contentDetailData.newsType == 8) { | ||
| 84 | + this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页 | ||
| 85 | + } else if(this.contentDetailData.newsType == 9) { | ||
| 86 | + this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页 | ||
| 87 | + } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { | ||
| 88 | + this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + | ||
| 67 | build() { | 92 | build() { |
| 68 | 93 | ||
| 69 | if (this.componentType == 2) { | 94 | if (this.componentType == 2) { |
| @@ -346,13 +371,16 @@ export struct LikeComponent { | @@ -346,13 +371,16 @@ export struct LikeComponent { | ||
| 346 | if (this.contentDetailData.liveInfo) { | 371 | if (this.contentDetailData.liveInfo) { |
| 347 | this.likeStatus = true | 372 | this.likeStatus = true |
| 348 | this.likeCount++ | 373 | this.likeCount++ |
| 374 | + TrackingContent.like(true,this.PageName,this.PageName,this.pageParam) | ||
| 349 | } else { | 375 | } else { |
| 350 | this.likeStatus = !this.likeStatus | 376 | this.likeStatus = !this.likeStatus |
| 351 | //点赞和取消点赞成功后更新点赞数 | 377 | //点赞和取消点赞成功后更新点赞数 |
| 352 | if (this.likeStatus) { | 378 | if (this.likeStatus) { |
| 353 | this.likeCount++ | 379 | this.likeCount++ |
| 380 | + TrackingContent.like(true,this.PageName,this.PageName,this.pageParam) | ||
| 354 | } else { | 381 | } else { |
| 355 | this.likeCount-- | 382 | this.likeCount-- |
| 383 | + TrackingContent.like(false,this.PageName,this.PageName,this.pageParam) | ||
| 356 | } | 384 | } |
| 357 | } | 385 | } |
| 358 | 386 |
| @@ -23,6 +23,7 @@ import { WDShare } from 'wdShare/Index'; | @@ -23,6 +23,7 @@ import { WDShare } from 'wdShare/Index'; | ||
| 23 | import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' | 23 | import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' |
| 24 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | 24 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' |
| 25 | import { PlayerConstants } from 'wdPlayer' | 25 | import { PlayerConstants } from 'wdPlayer' |
| 26 | +import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; | ||
| 26 | 27 | ||
| 27 | const TAG = 'OperRowListView'; | 28 | const TAG = 'OperRowListView'; |
| 28 | 29 | ||
| @@ -91,6 +92,8 @@ export struct OperRowListView { | @@ -91,6 +92,8 @@ export struct OperRowListView { | ||
| 91 | @State currentStatus: number | string | undefined = 0; | 92 | @State currentStatus: number | string | undefined = 0; |
| 92 | @State name: string = 'audio_recommend_status_wait' | 93 | @State name: string = 'audio_recommend_status_wait' |
| 93 | @State dialogController: CustomDialogController | null = null; | 94 | @State dialogController: CustomDialogController | null = null; |
| 95 | + pageParam: ParamType = {} | ||
| 96 | + PageName: string = '' | ||
| 94 | 97 | ||
| 95 | async aboutToAppear() { | 98 | async aboutToAppear() { |
| 96 | console.info(TAG, 'this.needLike', this.needLike) | 99 | console.info(TAG, 'this.needLike', this.needLike) |
| @@ -109,6 +112,28 @@ export struct OperRowListView { | @@ -109,6 +112,28 @@ export struct OperRowListView { | ||
| 109 | } | 112 | } |
| 110 | } | 113 | } |
| 111 | }) | 114 | }) |
| 115 | + this.contentTrackingDict() | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + contentTrackingDict(){ | ||
| 119 | + this.pageParam = { | ||
| 120 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 121 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 122 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 123 | + } | ||
| 124 | + if(this.contentDetailData.newsType == 1) { | ||
| 125 | + this.PageName = TrackConstants.PageName.VideoDetail // 点播 | ||
| 126 | + } else if(this.contentDetailData.newsType == 2) { | ||
| 127 | + this.PageName = TrackConstants.PageName.Live_Detail // 直播 | ||
| 128 | + } else if(this.contentDetailData.newsType == 5) { | ||
| 129 | + this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页 | ||
| 130 | + } else if(this.contentDetailData.newsType == 8) { | ||
| 131 | + this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页 | ||
| 132 | + } else if(this.contentDetailData.newsType == 9) { | ||
| 133 | + this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页 | ||
| 134 | + } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { | ||
| 135 | + this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 | ||
| 136 | + } | ||
| 112 | } | 137 | } |
| 113 | 138 | ||
| 114 | async onDetailUpdated() { | 139 | async onDetailUpdated() { |
| @@ -440,6 +465,9 @@ export struct OperRowListView { | @@ -440,6 +465,9 @@ export struct OperRowListView { | ||
| 440 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 465 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 441 | if (this.newsStatusOfUser.collectStatus === 1) { | 466 | if (this.newsStatusOfUser.collectStatus === 1) { |
| 442 | promptAction.showToast({ message: '收藏成功' }) | 467 | promptAction.showToast({ message: '收藏成功' }) |
| 468 | + TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam) | ||
| 469 | + } else { | ||
| 470 | + TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam) | ||
| 443 | } | 471 | } |
| 444 | this.queryContentInteractCount() | 472 | this.queryContentInteractCount() |
| 445 | } | 473 | } |
| @@ -181,6 +181,10 @@ | @@ -181,6 +181,10 @@ | ||
| 181 | "value": "40vp" | 181 | "value": "40vp" |
| 182 | }, | 182 | }, |
| 183 | { | 183 | { |
| 184 | + "name": "top_tab_bar_height_common", | ||
| 185 | + "value": "44vp" | ||
| 186 | + }, | ||
| 187 | + { | ||
| 184 | "name": "top_tab_item_max_width", | 188 | "name": "top_tab_item_max_width", |
| 185 | "value": "300vp" | 189 | "value": "300vp" |
| 186 | }, | 190 | }, |
| @@ -259,6 +259,11 @@ export class WDPlayerController { | @@ -259,6 +259,11 @@ export class WDPlayerController { | ||
| 259 | // this.seekTime = value * 1000; | 259 | // this.seekTime = value * 1000; |
| 260 | // this.avPlayer?.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC); | 260 | // this.avPlayer?.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC); |
| 261 | // } | 261 | // } |
| 262 | + // 防止seek报错 | ||
| 263 | + if (this.avPlayer && PlayerConstants.OPERATE_STATE.indexOf(this.avPlayer?.state) === -1) { | ||
| 264 | + return; | ||
| 265 | + } | ||
| 266 | + | ||
| 262 | if (mode === SliderChangeMode.Moving) { | 267 | if (mode === SliderChangeMode.Moving) { |
| 263 | // this.progressThis.progressVal = value; | 268 | // this.progressThis.progressVal = value; |
| 264 | // this.progressThis.currentTime = DateFormatUtil.secondToTime(Math.floor(value * this.duration / | 269 | // this.progressThis.currentTime = DateFormatUtil.secondToTime(Math.floor(value * this.duration / |
| @@ -108,7 +108,19 @@ export class TrackingContent { | @@ -108,7 +108,19 @@ export class TrackingContent { | ||
| 108 | 108 | ||
| 109 | // 内容下载点击事件 1.图片 2.音频 3.视频 | 109 | // 内容下载点击事件 1.图片 2.音频 3.视频 |
| 110 | static download(donwloadContentType: number, pageId: string, pageName: string, extParams?: ParamType) { | 110 | static download(donwloadContentType: number, pageId: string, pageName: string, extParams?: ParamType) { |
| 111 | - | 111 | + let params = TrackingUtils.generateParams(extParams) |
| 112 | + if (donwloadContentType) { | ||
| 113 | + params["donwloadContentType"] = donwloadContentType | ||
| 114 | + } | ||
| 115 | + if (pageId.length) { | ||
| 116 | + params["pageId"] = pageId | ||
| 117 | + } | ||
| 118 | + if (pageName.length) { | ||
| 119 | + params["pageName"] = pageName | ||
| 120 | + } | ||
| 121 | + params["action"] =TrackConstants.ActionType.Download | ||
| 122 | + TrackingUtils.fillPositionWith(params) | ||
| 123 | + Tracking.event("download_click", params) | ||
| 112 | } | 124 | } |
| 113 | 125 | ||
| 114 | } | 126 | } |
| 1 | -import { Logger } from 'wdKit'; | 1 | +import { DateTimeUtils, NetworkUtil, StringUtils, Logger } from 'wdKit'; |
| 2 | import router from '@ohos.router'; | 2 | import router from '@ohos.router'; |
| 3 | import { Params, Action } from 'wdBean'; | 3 | import { Params, Action } from 'wdBean'; |
| 4 | import { WindowModel } from 'wdKit/Index'; | 4 | import { WindowModel } from 'wdKit/Index'; |
| 5 | import { MultiPictureDetailPageComponent } from '../view/MultiPictureDetailPageComponent'; | 5 | import { MultiPictureDetailPageComponent } from '../view/MultiPictureDetailPageComponent'; |
| 6 | +import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; | ||
| 6 | 7 | ||
| 7 | const TAG = 'MultiPictureDetailPage'; | 8 | const TAG = 'MultiPictureDetailPage'; |
| 8 | 9 | ||
| @@ -16,6 +17,8 @@ struct MultiPictureDetailPage { | @@ -16,6 +17,8 @@ struct MultiPictureDetailPage { | ||
| 16 | @State relId: string = '' | 17 | @State relId: string = '' |
| 17 | @State contentId: string = '' | 18 | @State contentId: string = '' |
| 18 | @State relType: string = '' | 19 | @State relType: string = '' |
| 20 | + pageShowTime:number = 0; | ||
| 21 | + pageHideTime:number = 0; | ||
| 19 | 22 | ||
| 20 | build() { | 23 | build() { |
| 21 | Row() { | 24 | Row() { |
| @@ -68,12 +71,17 @@ struct MultiPictureDetailPage { | @@ -68,12 +71,17 @@ struct MultiPictureDetailPage { | ||
| 68 | 71 | ||
| 69 | onPageShow(): void { | 72 | onPageShow(): void { |
| 70 | console.log(TAG, 'onPageShow') | 73 | console.log(TAG, 'onPageShow') |
| 74 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 71 | this.openFullScreen() | 75 | this.openFullScreen() |
| 72 | 76 | ||
| 73 | } | 77 | } |
| 74 | 78 | ||
| 75 | onPageHide(): void { | 79 | onPageHide(): void { |
| 76 | console.log(TAG, 'onPageHide') | 80 | console.log(TAG, 'onPageHide') |
| 81 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 82 | + let duration = 0 | ||
| 83 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 84 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,duration) | ||
| 77 | this.closeFullScreen() | 85 | this.closeFullScreen() |
| 78 | } | 86 | } |
| 79 | 87 |
| @@ -23,6 +23,7 @@ import { EmptyComponent, | @@ -23,6 +23,7 @@ import { EmptyComponent, | ||
| 23 | PageRepository, | 23 | PageRepository, |
| 24 | publishCommentModel, | 24 | publishCommentModel, |
| 25 | viewBlogItemInsightIntentShare} from 'wdComponent/Index'; | 25 | viewBlogItemInsightIntentShare} from 'wdComponent/Index'; |
| 26 | +import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; | ||
| 26 | 27 | ||
| 27 | const TAG = 'MultiPictureDetailPageComponent'; | 28 | const TAG = 'MultiPictureDetailPageComponent'; |
| 28 | /** | 29 | /** |
| @@ -58,6 +59,9 @@ export struct MultiPictureDetailPageComponent { | @@ -58,6 +59,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 58 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | 59 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] |
| 59 | @State currentOffset: number = 0 | 60 | @State currentOffset: number = 0 |
| 60 | @State duration: number = 0 | 61 | @State duration: number = 0 |
| 62 | + pageParam: ParamType = {} | ||
| 63 | + followUserId: string = '' | ||
| 64 | + followUserName: string = '' | ||
| 61 | 65 | ||
| 62 | //watch监听页码回调 | 66 | //watch监听页码回调 |
| 63 | onCurrentPageNumUpdated(): void { | 67 | onCurrentPageNumUpdated(): void { |
| @@ -88,6 +92,17 @@ export struct MultiPictureDetailPageComponent { | @@ -88,6 +92,17 @@ export struct MultiPictureDetailPageComponent { | ||
| 88 | // 无网络 | 92 | // 无网络 |
| 89 | this.netStatus = 1 | 93 | this.netStatus = 1 |
| 90 | } | 94 | } |
| 95 | + this.contentTrackingDict() | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + contentTrackingDict(){ | ||
| 99 | + this.pageParam = { | ||
| 100 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 101 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 102 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 103 | + } | ||
| 104 | + this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || '' | ||
| 105 | + this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || '' | ||
| 91 | } | 106 | } |
| 92 | 107 | ||
| 93 | aboutToDisappear() { | 108 | aboutToDisappear() { |
| @@ -426,6 +441,11 @@ export struct MultiPictureDetailPageComponent { | @@ -426,6 +441,11 @@ export struct MultiPictureDetailPageComponent { | ||
| 426 | bottom: 24, | 441 | bottom: 24, |
| 427 | right: 18 | 442 | right: 18 |
| 428 | }) | 443 | }) |
| 444 | + .parallelGesture( | ||
| 445 | + TapGesture() | ||
| 446 | + .onAction((event: GestureEvent) => { | ||
| 447 | + TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) | ||
| 448 | + })) | ||
| 429 | } | 449 | } |
| 430 | } | 450 | } |
| 431 | } | 451 | } |
| @@ -560,8 +580,10 @@ export struct MultiPictureDetailPageComponent { | @@ -560,8 +580,10 @@ export struct MultiPictureDetailPageComponent { | ||
| 560 | console.log(TAG, '关注号主==', JSON.stringify(res.data)) | 580 | console.log(TAG, '关注号主==', JSON.stringify(res.data)) |
| 561 | if (this.followStatus == '1') { | 581 | if (this.followStatus == '1') { |
| 562 | this.followStatus = '0' | 582 | this.followStatus = '0' |
| 583 | + TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) | ||
| 563 | } else { | 584 | } else { |
| 564 | this.followStatus = '1' | 585 | this.followStatus = '1' |
| 586 | + TrackingContent.follow(false,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) | ||
| 565 | } | 587 | } |
| 566 | }) | 588 | }) |
| 567 | } | 589 | } |
| @@ -111,6 +111,7 @@ export struct VideoChannelPage { | @@ -111,6 +111,7 @@ export struct VideoChannelPage { | ||
| 111 | }, (item: TopNavDTO) => item.channelId + '') | 111 | }, (item: TopNavDTO) => item.channelId + '') |
| 112 | } | 112 | } |
| 113 | .width('100%') | 113 | .width('100%') |
| 114 | + | ||
| 114 | .justifyContent(FlexAlign.Center) | 115 | .justifyContent(FlexAlign.Center) |
| 115 | .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White) | 116 | .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White) |
| 116 | 117 | ||
| @@ -136,6 +137,8 @@ export struct VideoChannelPage { | @@ -136,6 +137,8 @@ export struct VideoChannelPage { | ||
| 136 | 137 | ||
| 137 | } | 138 | } |
| 138 | .zIndex(20) | 139 | .zIndex(20) |
| 140 | + .height($r('app.float.top_tab_bar_height_common')) | ||
| 141 | + .margin({top:10}) | ||
| 139 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 142 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 140 | 143 | ||
| 141 | } | 144 | } |
| @@ -173,6 +176,7 @@ export struct VideoChannelPage { | @@ -173,6 +176,7 @@ export struct VideoChannelPage { | ||
| 173 | .cachedCount(-1) | 176 | .cachedCount(-1) |
| 174 | .displayCount(1, true) | 177 | .displayCount(1, true) |
| 175 | .alignSelf(ItemAlign.Start) | 178 | .alignSelf(ItemAlign.Start) |
| 179 | + .effectMode(EdgeEffect.None) | ||
| 176 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 180 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) |
| 177 | .onChange((index: number) => { | 181 | .onChange((index: number) => { |
| 178 | this.currentTopNavSelectedIndex = index | 182 | this.currentTopNavSelectedIndex = index |
-
Please register or login to post a comment