Showing
11 changed files
with
109 additions
and
21 deletions
| @@ -32,12 +32,6 @@ export struct CardParser { | @@ -32,12 +32,6 @@ export struct CardParser { | ||
| 32 | pageShowTime:number = 0; | 32 | pageShowTime:number = 0; |
| 33 | pageHideTime:number = 0; | 33 | pageHideTime:number = 0; |
| 34 | 34 | ||
| 35 | - aboutToAppear(): void { | ||
| 36 | - | ||
| 37 | - console.log('CardParser-contentDTO', JSON.stringify(this.contentDTO)) | ||
| 38 | - console.log('CardParser-compDTO', JSON.stringify(this.compDTO)) | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | onPageShow() { | 35 | onPageShow() { |
| 42 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 36 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 43 | } | 37 | } |
| @@ -42,6 +42,9 @@ export struct CompParser { | @@ -42,6 +42,9 @@ export struct CompParser { | ||
| 42 | @State noneAudioItems: ContentDTO[] = []; | 42 | @State noneAudioItems: ContentDTO[] = []; |
| 43 | 43 | ||
| 44 | aboutToAppear(): void { | 44 | aboutToAppear(): void { |
| 45 | + | ||
| 46 | + | ||
| 47 | + console.log('CompParser-compDTO', JSON.stringify(this.compDTO)) | ||
| 45 | // 轮播图屏蔽音频类型稿件 | 48 | // 轮播图屏蔽音频类型稿件 |
| 46 | if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 49 | if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| 47 | this.audioItems = this.compDTO.operDataList.filter(item => { | 50 | this.audioItems = this.compDTO.operDataList.filter(item => { |
| @@ -5,7 +5,7 @@ import { | @@ -5,7 +5,7 @@ import { | ||
| 5 | ContentDetailRequest, | 5 | ContentDetailRequest, |
| 6 | postInteractAccentionOperateParams | 6 | postInteractAccentionOperateParams |
| 7 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 7 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 8 | -import { RmhInfoDTO } from 'wdBean' | 8 | +import { RmhInfoDTO, CompDTO, ContentDTO } from 'wdBean' |
| 9 | import { CommonConstants } from 'wdConstant/Index'; | 9 | import { CommonConstants } from 'wdConstant/Index'; |
| 10 | import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit'; | 10 | import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit'; |
| 11 | import { SpConstants } from 'wdConstant/Index' | 11 | import { SpConstants } from 'wdConstant/Index' |
| @@ -14,9 +14,14 @@ import router from '@ohos.router' | @@ -14,9 +14,14 @@ import router from '@ohos.router' | ||
| 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; | 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; |
| 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' | 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' |
| 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 17 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 17 | 18 | ||
| 18 | @Component | 19 | @Component |
| 19 | export struct RmhTitle { | 20 | export struct RmhTitle { |
| 21 | + @State compDTO: CompDTO = new CompDTO() | ||
| 22 | + @State contentDTO: ContentDTO = new ContentDTO(); | ||
| 23 | + @State pageId: string = ''; | ||
| 24 | + @State pageName: string = ''; | ||
| 20 | @Prop rmhInfo: RmhInfoDTO | 25 | @Prop rmhInfo: RmhInfoDTO |
| 21 | @Prop publishTime: string | undefined | 26 | @Prop publishTime: string | undefined |
| 22 | @State loadImg: boolean = false; | 27 | @State loadImg: boolean = false; |
| @@ -48,6 +53,16 @@ export struct RmhTitle { | @@ -48,6 +53,16 @@ export struct RmhTitle { | ||
| 48 | } | 53 | } |
| 49 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { | 54 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { |
| 50 | console.log('rmhTitle-data', JSON.stringify(res.data)) | 55 | console.log('rmhTitle-data', JSON.stringify(res.data)) |
| 56 | + | ||
| 57 | + InfomationCardClick.track( | ||
| 58 | + this.compDTO, | ||
| 59 | + this.contentDTO, | ||
| 60 | + this.pageId, | ||
| 61 | + this.pageName, | ||
| 62 | + 'follow', // like, commentClick, follow | ||
| 63 | + this.followStatus == '0' ? true : false, | ||
| 64 | + ) | ||
| 65 | + | ||
| 51 | if (this.followStatus == '1') { | 66 | if (this.followStatus == '1') { |
| 52 | this.followStatus = '0' | 67 | this.followStatus = '0' |
| 53 | } else { | 68 | } else { |
| @@ -38,7 +38,16 @@ export struct Card12Component { | @@ -38,7 +38,16 @@ export struct Card12Component { | ||
| 38 | Column() { | 38 | Column() { |
| 39 | // rmh信息 | 39 | // rmh信息 |
| 40 | if (this.contentDTO.rmhInfo) { | 40 | if (this.contentDTO.rmhInfo) { |
| 41 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 41 | + RmhTitle( |
| 42 | + { | ||
| 43 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 44 | + publishTime: this.contentDTO.publishTime, | ||
| 45 | + contentDTO: this.contentDTO, | ||
| 46 | + compDTO: this.compDTO, | ||
| 47 | + pageId: this.pageId, | ||
| 48 | + pageName: this.pageName | ||
| 49 | + } | ||
| 50 | + ) | ||
| 42 | } | 51 | } |
| 43 | // 标题 | 52 | // 标题 |
| 44 | if (this.contentDTO.newsTitle) { | 53 | if (this.contentDTO.newsTitle) { |
| @@ -41,7 +41,16 @@ export struct Card14Component { | @@ -41,7 +41,16 @@ export struct Card14Component { | ||
| 41 | Column() { | 41 | Column() { |
| 42 | // rmh信息 | 42 | // rmh信息 |
| 43 | if (this.contentDTO.rmhInfo) { | 43 | if (this.contentDTO.rmhInfo) { |
| 44 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 44 | + RmhTitle( |
| 45 | + { | ||
| 46 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 47 | + publishTime: this.contentDTO.publishTime, | ||
| 48 | + contentDTO: this.contentDTO, | ||
| 49 | + compDTO: this.compDTO, | ||
| 50 | + pageId: this.pageId, | ||
| 51 | + pageName: this.pageName | ||
| 52 | + } | ||
| 53 | + ) | ||
| 45 | } | 54 | } |
| 46 | // 左标题,右图 | 55 | // 左标题,右图 |
| 47 | Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { | 56 | Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { |
| @@ -44,8 +44,16 @@ export struct Card15Component { | @@ -44,8 +44,16 @@ export struct Card15Component { | ||
| 44 | build() { | 44 | build() { |
| 45 | Column() { | 45 | Column() { |
| 46 | // rmh信息 | 46 | // rmh信息 |
| 47 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 48 | - //新闻标题 | 47 | + RmhTitle( |
| 48 | + { | ||
| 49 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 50 | + publishTime: this.contentDTO.publishTime, | ||
| 51 | + contentDTO: this.contentDTO, | ||
| 52 | + compDTO: this.compDTO, | ||
| 53 | + pageId: this.pageId, | ||
| 54 | + pageName: this.pageName | ||
| 55 | + } | ||
| 56 | + ) //新闻标题 | ||
| 49 | if (this.contentDTO.newsTitle) { | 57 | if (this.contentDTO.newsTitle) { |
| 50 | Text() { | 58 | Text() { |
| 51 | if (this.titleMarked) { | 59 | if (this.titleMarked) { |
| @@ -46,7 +46,16 @@ export struct Card16Component { | @@ -46,7 +46,16 @@ export struct Card16Component { | ||
| 46 | Column() { | 46 | Column() { |
| 47 | // rmh信息 | 47 | // rmh信息 |
| 48 | if (this.contentDTO.rmhInfo) { | 48 | if (this.contentDTO.rmhInfo) { |
| 49 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 49 | + RmhTitle( |
| 50 | + { | ||
| 51 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 52 | + publishTime: this.contentDTO.publishTime, | ||
| 53 | + contentDTO: this.contentDTO, | ||
| 54 | + compDTO: this.compDTO, | ||
| 55 | + pageId: this.pageId, | ||
| 56 | + pageName: this.pageName | ||
| 57 | + } | ||
| 58 | + ) | ||
| 50 | } | 59 | } |
| 51 | // 标题 | 60 | // 标题 |
| 52 | if (this.contentDTO.newsTitle) { | 61 | if (this.contentDTO.newsTitle) { |
| @@ -38,8 +38,16 @@ export struct Card19Component { | @@ -38,8 +38,16 @@ export struct Card19Component { | ||
| 38 | build() { | 38 | build() { |
| 39 | Column() { | 39 | Column() { |
| 40 | // rmh信息 | 40 | // rmh信息 |
| 41 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 42 | - // 标题 | 41 | + RmhTitle( |
| 42 | + { | ||
| 43 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 44 | + publishTime: this.contentDTO.publishTime, | ||
| 45 | + contentDTO: this.contentDTO, | ||
| 46 | + compDTO: this.compDTO, | ||
| 47 | + pageId: this.pageId, | ||
| 48 | + pageName: this.pageName | ||
| 49 | + } | ||
| 50 | + ) // 标题 | ||
| 43 | if (this.contentDTO.newsTitle) { | 51 | if (this.contentDTO.newsTitle) { |
| 44 | Text() { | 52 | Text() { |
| 45 | if (this.titleMarked) { | 53 | if (this.titleMarked) { |
| @@ -38,8 +38,16 @@ export struct Card20Component { | @@ -38,8 +38,16 @@ export struct Card20Component { | ||
| 38 | build() { | 38 | build() { |
| 39 | Column() { | 39 | Column() { |
| 40 | // rmh信息 | 40 | // rmh信息 |
| 41 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 42 | - // 标题 | 41 | + RmhTitle( |
| 42 | + { | ||
| 43 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 44 | + publishTime: this.contentDTO.publishTime, | ||
| 45 | + contentDTO: this.contentDTO, | ||
| 46 | + compDTO: this.compDTO, | ||
| 47 | + pageId: this.pageId, | ||
| 48 | + pageName: this.pageName | ||
| 49 | + } | ||
| 50 | + ) // 标题 | ||
| 43 | if (this.contentDTO.newsTitle) { | 51 | if (this.contentDTO.newsTitle) { |
| 44 | Text() { | 52 | Text() { |
| 45 | 53 |
| @@ -40,8 +40,16 @@ export struct Card21Component { | @@ -40,8 +40,16 @@ export struct Card21Component { | ||
| 40 | build() { | 40 | build() { |
| 41 | Column() { | 41 | Column() { |
| 42 | // 顶部 rmh信息 | 42 | // 顶部 rmh信息 |
| 43 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 44 | - // 中间内容 | 43 | + RmhTitle( |
| 44 | + { | ||
| 45 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 46 | + publishTime: this.contentDTO.publishTime, | ||
| 47 | + contentDTO: this.contentDTO, | ||
| 48 | + compDTO: this.compDTO, | ||
| 49 | + pageId: this.pageId, | ||
| 50 | + pageName: this.pageName | ||
| 51 | + } | ||
| 52 | + ) // 中间内容 | ||
| 45 | Grid() { | 53 | Grid() { |
| 46 | GridItem() { | 54 | GridItem() { |
| 47 | Text() { | 55 | Text() { |
| @@ -43,10 +43,19 @@ export class InfomationCardClick { | @@ -43,10 +43,19 @@ export class InfomationCardClick { | ||
| 43 | return summaryType; | 43 | return summaryType; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | - public static track(compDTO: CompDTO, contentDTO: ContentDTO, pageId: string, pageName: string): void { | 46 | + public static track( |
| 47 | + compDTO: CompDTO, | ||
| 48 | + contentDTO: ContentDTO, | ||
| 49 | + pageId: string, | ||
| 50 | + pageName: string, | ||
| 51 | + action = 'detailPageShow', // like, commentClick, follow | ||
| 52 | + bl = false, | ||
| 53 | + followUserId = '', | ||
| 54 | + followUserName = '' | ||
| 55 | + ): void { | ||
| 47 | try { | 56 | try { |
| 48 | const extParams: ParamType = { | 57 | const extParams: ParamType = { |
| 49 | - 'action': 'detailPageShow', | 58 | + 'action': action, |
| 50 | 'shareChannel': '', | 59 | 'shareChannel': '', |
| 51 | 'duration': 0, | 60 | 'duration': 0, |
| 52 | 'contentName': contentDTO.newsTitle, | 61 | 'contentName': contentDTO.newsTitle, |
| @@ -87,7 +96,15 @@ export class InfomationCardClick { | @@ -87,7 +96,15 @@ export class InfomationCardClick { | ||
| 87 | extParams['saAuthorName'] = contentDTO.source; | 96 | extParams['saAuthorName'] = contentDTO.source; |
| 88 | } | 97 | } |
| 89 | console.log('InfomationCardClick-params:', JSON.stringify(extParams)) | 98 | console.log('InfomationCardClick-params:', JSON.stringify(extParams)) |
| 90 | - TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams) | 99 | + if (action === 'detailPageShow') { |
| 100 | + TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams); | ||
| 101 | + } else if (action === 'like') { | ||
| 102 | + TrackingContent.like(bl, pageId, pageName, extParams); | ||
| 103 | + } else if (action === 'commentClick') { | ||
| 104 | + TrackingContent.commentClick(pageId, pageName, extParams); | ||
| 105 | + } else if (action === 'follow') { | ||
| 106 | + TrackingContent.follow(bl, followUserId, followUserName, pageId, pageName, extParams) | ||
| 107 | + } | ||
| 91 | } catch (err) { | 108 | } catch (err) { |
| 92 | console.log('InfomationCardClick-err', JSON.stringify(err)) | 109 | console.log('InfomationCardClick-err', JSON.stringify(err)) |
| 93 | } | 110 | } |
-
Please register or login to post a comment