xugenyuan

ref |> 调整有关底部组件相关页面 pageId、pageName埋点用。且已调整评论发布埋点

Showing 18 changed files with 63 additions and 21 deletions
@@ -11,6 +11,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; @@ -11,6 +11,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
11 import NoMoreLayout from '../../page/NoMoreLayout'; 11 import NoMoreLayout from '../../page/NoMoreLayout';
12 import { EmptyComponent } from '../../view/EmptyComponent'; 12 import { EmptyComponent } from '../../view/EmptyComponent';
13 import { ContentDetailDTO, Params } from 'wdBean/Index'; 13 import { ContentDetailDTO, Params } from 'wdBean/Index';
  14 +import { TrackingContent, TrackParamConvert } from 'wdTracking/Index';
14 15
15 const TAG = 'CommentComponent'; 16 const TAG = 'CommentComponent';
16 17
@@ -31,6 +32,8 @@ export struct CommentComponent { @@ -31,6 +32,8 @@ export struct CommentComponent {
31 /*必传*/ 32 /*必传*/
32 @ObjectLink publishCommentModel: publishCommentModel 33 @ObjectLink publishCommentModel: publishCommentModel
33 @Consume contentDetailData: ContentDetailDTO 34 @Consume contentDetailData: ContentDetailDTO
  35 + @Consume pageId: string
  36 + @Consume pageName: string
34 listScroller: ListScroller = new ListScroller(); // scroller控制器 37 listScroller: ListScroller = new ListScroller(); // scroller控制器
35 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset 38 historyOffset: number = 0; // 上次浏览到列表距离顶端的偏移量offset
36 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); 39 @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource();
@@ -66,6 +69,9 @@ export struct CommentComponent { @@ -66,6 +69,9 @@ export struct CommentComponent {
66 69
67 this.dialogController = new CustomDialogController({ 70 this.dialogController = new CustomDialogController({
68 builder: CommentCustomDialog({ 71 builder: CommentCustomDialog({
  72 + onPublishBtnClickTrack: () => {
  73 + TrackingContent.commentClick(this.pageId, this.pageName, TrackParamConvert.contentDetail(this.contentDetailData))
  74 + },
69 confirm: (value: Record<string, string>) => { 75 confirm: (value: Record<string, string>) => {
70 this.addCommentLocal() 76 this.addCommentLocal()
71 }, 77 },
@@ -222,6 +228,7 @@ export struct CommentComponent { @@ -222,6 +228,7 @@ export struct CommentComponent {
222 } 228 }
223 } 229 }
224 } 230 }
  231 + .scrollBar(BarState.Off)
225 .margin({ bottom: 10 }) 232 .margin({ bottom: 10 })
226 .onReachEnd(() => { 233 .onReachEnd(() => {
227 if (!this.fixedHeightMode) { 234 if (!this.fixedHeightMode) {
@@ -22,6 +22,7 @@ export struct CommentCustomDialog { @@ -22,6 +22,7 @@ export struct CommentCustomDialog {
22 22
23 // confirm 表示内部处理调用 内容评论接口 发布了评论并成功,上层只需要 通过 publishCommentModel.lastCommentModel 即可获取最新已提交的评论 23 // confirm 表示内部处理调用 内容评论接口 发布了评论并成功,上层只需要 通过 publishCommentModel.lastCommentModel 即可获取最新已提交的评论
24 confirm?: (value: Record<string, string>) => void 24 confirm?: (value: Record<string, string>) => void
  25 + onPublishBtnClickTrack?: () => void // 和confirm配套使用。当设置了onPublishBtnClick 则无效
25 26
26 @State private emojiSwitch: boolean = false 27 @State private emojiSwitch: boolean = false
27 textInputController: TextAreaController = new TextAreaController() 28 textInputController: TextAreaController = new TextAreaController()
@@ -39,6 +40,11 @@ export struct CommentCustomDialog { @@ -39,6 +40,11 @@ export struct CommentCustomDialog {
39 } 40 }
40 } 41 }
41 42
  43 + // 点击时 即可埋点
  44 + if (this.onPublishBtnClickTrack) {
  45 + this.onPublishBtnClickTrack()
  46 + }
  47 +
42 let bean: Record<string, string> = {}; 48 let bean: Record<string, string> = {};
43 // this.publishCommentModel.commentContent = this.commentText 49 // this.publishCommentModel.commentContent = this.commentText
44 //TODO 判断类型 50 //TODO 判断类型
@@ -5,6 +5,7 @@ import measure from '@ohos.measure' @@ -5,6 +5,7 @@ import measure from '@ohos.measure'
5 import { ContentDetailDTO } from 'wdBean/Index' 5 import { ContentDetailDTO } from 'wdBean/Index'
6 import { HttpUtils } from 'wdNetwork/Index' 6 import { HttpUtils } from 'wdNetwork/Index'
7 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' 7 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
  8 +import { TrackingContent, TrackParamConvert } from 'wdTracking/Index'
8 9
9 @Preview 10 @Preview
10 @Component 11 @Component
@@ -20,6 +21,8 @@ export struct CommentTabComponent { @@ -20,6 +21,8 @@ export struct CommentTabComponent {
20 @State type: number = 1 21 @State type: number = 1
21 @State placeHolder: string = '说两句...' 22 @State placeHolder: string = '说两句...'
22 @State dialogController: CustomDialogController | null = null; 23 @State dialogController: CustomDialogController | null = null;
  24 + @Consume pageId: string
  25 + @Consume pageName: string
23 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 26 styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏)
24 /*回调方法*/ 27 /*回调方法*/
25 dialogControllerConfirm: () => void = () => { 28 dialogControllerConfirm: () => void = () => {
@@ -29,6 +32,9 @@ export struct CommentTabComponent { @@ -29,6 +32,9 @@ export struct CommentTabComponent {
29 32
30 this.dialogController = new CustomDialogController({ 33 this.dialogController = new CustomDialogController({
31 builder: CommentCustomDialog({ 34 builder: CommentCustomDialog({
  35 + onPublishBtnClickTrack: () => {
  36 + TrackingContent.commentClick(this.pageId, this.pageName, TrackParamConvert.contentDetail(this.contentDetail))
  37 + },
32 confirm: (value: Record<string, string>) => { 38 confirm: (value: Record<string, string>) => {
33 this.dialogControllerConfirm(); 39 this.dialogControllerConfirm();
34 EmitterUtils.sendEvent(EmitterEventId.COMMENT_PUBLISH, this.publishCommentModel.targetId) 40 EmitterUtils.sendEvent(EmitterEventId.COMMENT_PUBLISH, this.publishCommentModel.targetId)
@@ -11,6 +11,7 @@ import { CommentCustomDialog } from './CommentCustomDialog' @@ -11,6 +11,7 @@ import { CommentCustomDialog } from './CommentCustomDialog'
11 import { publishCommentModel } from '../model/PublishCommentModel' 11 import { publishCommentModel } from '../model/PublishCommentModel'
12 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index' 12 import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'
13 import { ContentDTO, MasterDetailRes } from 'wdBean/Index' 13 import { ContentDTO, MasterDetailRes } from 'wdBean/Index'
  14 +import { TrackConstants, TrackingContent } from 'wdTracking/Index'
14 15
15 const TAG = 'QualityCommentsComponent'; 16 const TAG = 'QualityCommentsComponent';
16 17
@@ -34,6 +35,8 @@ export struct QualityCommentsComponent { @@ -34,6 +35,8 @@ export struct QualityCommentsComponent {
34 /*必传*/ 35 /*必传*/
35 @State publishCommentModel: publishCommentModel = new publishCommentModel() 36 @State publishCommentModel: publishCommentModel = new publishCommentModel()
36 37
  38 + // @Consume pageName: string
  39 +
37 aboutToDisappear(): void { 40 aboutToDisappear(): void {
38 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) 41 // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' })
39 this.dialogController = null // 将dialogController置空 42 this.dialogController = null // 将dialogController置空
@@ -57,6 +60,9 @@ export struct QualityCommentsComponent { @@ -57,6 +60,9 @@ export struct QualityCommentsComponent {
57 showAlert() { 60 showAlert() {
58 this.dialogController = new CustomDialogController({ 61 this.dialogController = new CustomDialogController({
59 builder: CommentCustomDialog({ 62 builder: CommentCustomDialog({
  63 + onPublishBtnClickTrack: () => {
  64 + //TrackingContent.commentClick(this.pageName, this.pageName,{})
  65 + },
60 confirm: (value: Record<string, string>) => { 66 confirm: (value: Record<string, string>) => {
61 67
62 }, 68 },
@@ -189,11 +189,6 @@ class CommentViewModel { @@ -189,11 +189,6 @@ class CommentViewModel {
189 } 189 }
190 190
191 HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => { 191 HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
192 - // fixme 埋点 评论发布点击  
193 - TrackingContent.commentClick(pageId,pageName  
194 - ,{  
195 - 'duration':0,  
196 - })  
197 if (data.code != 0) { 192 if (data.code != 0) {
198 ToastUtils.showToast(data.message, 1000); 193 ToastUtils.showToast(data.message, 1000);
199 fail() 194 fail()
1 import { WindowModel } from 'wdKit/Index'; 1 import { WindowModel } from 'wdKit/Index';
  2 +import { TrackConstants } from 'wdTracking/Index';
2 import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent'; 3 import { QualityCommentsComponent } from '../comment/view/QualityCommentsComponent';
3 4
4 @Entry 5 @Entry
5 @Component 6 @Component
6 struct QualityCommentsPage { 7 struct QualityCommentsPage {
  8 + @Provide pageName: string = TrackConstants.PageName.Best_Comment
  9 + @Provide pageId: string = TrackConstants.PageName.Best_Comment
  10 +
7 onPageShow(): void { 11 onPageShow(): void {
8 // WindowModel.shared.setWindowLayoutFullScreen(true) 12 // WindowModel.shared.setWindowLayoutFullScreen(true)
9 } 13 }
@@ -11,7 +11,6 @@ import { @@ -11,7 +11,6 @@ import {
11 import router from '@ohos.router'; 11 import router from '@ohos.router';
12 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; 12 import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel';
13 import { LiveLikeComponent } from './LiveLikeComponent'; 13 import { LiveLikeComponent } from './LiveLikeComponent';
14 -import { CommentTabComponent, CommentIconComponent, } from '../comment/view/CommentTabComponent';  
15 import { publishCommentModel } from '../comment/model/PublishCommentModel' 14 import { publishCommentModel } from '../comment/model/PublishCommentModel'
16 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 15 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
17 import { PageRepository } from '../../repository/PageRepository'; 16 import { PageRepository } from '../../repository/PageRepository';
@@ -36,6 +36,8 @@ export struct DetailPlayLiveCommon { @@ -36,6 +36,8 @@ export struct DetailPlayLiveCommon {
36 @Provide pageBackPress: number = -1 36 @Provide pageBackPress: number = -1
37 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO 37 @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
38 @Provide publishCommentModel: publishCommentModel = new publishCommentModel() 38 @Provide publishCommentModel: publishCommentModel = new publishCommentModel()
  39 + @Provide pageId: string = TrackConstants.PageName.Live_Detail
  40 + @Provide pageName: string = TrackConstants.PageName.Live_Detail
39 // 横屏或竖屏 general-竖屏,news-横屏 41 // 横屏或竖屏 general-竖屏,news-横屏
40 @State liveLandscape: string = '' 42 @State liveLandscape: string = ''
41 @State isLoading: boolean = false 43 @State isLoading: boolean = false
@@ -9,7 +9,7 @@ import { router, window } from '@kit.ArkUI'; @@ -9,7 +9,7 @@ import { router, window } from '@kit.ArkUI';
9 import { WDAliPlayerController } from 'wdPlayer/Index'; 9 import { WDAliPlayerController } from 'wdPlayer/Index';
10 import { LiveOperRowListView } from 'wdComponent'; 10 import { LiveOperRowListView } from 'wdComponent';
11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; 11 import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
12 -import { TrackConstants, TrackingContent } from 'wdTracking/Index'; 12 +import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
13 13
14 let TAG: string = 'DetailPlayLivePage'; 14 let TAG: string = 'DetailPlayLivePage';
15 15
@@ -98,12 +98,9 @@ export struct DetailPlayLivePage { @@ -98,12 +98,9 @@ export struct DetailPlayLivePage {
98 this.lastInputedChatComment = result 98 this.lastInputedChatComment = result
99 } 99 }
100 // 发布评论埋点 100 // 发布评论埋点
101 - TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,  
102 - {  
103 - 'contentType': `${this.contentDetailData.newsType}`,  
104 - 'contentId': `${this.contentDetailData.newsId}`,  
105 - 'contentName': `${this.contentDetailData.newsTitle || ''}`,  
106 - }); 101 + TrackingContent.commentClick(TrackConstants.PageName.Live_Detail,
  102 + TrackConstants.PageName.Live_Detail,
  103 + TrackParamConvert.contentDetail(this.contentDetailData));
107 }) 104 })
108 } 105 }
109 } 106 }
@@ -11,7 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent' @@ -11,7 +11,7 @@ import { ChartItemCompereComponent } from './ChartItemCompereComponent'
11 import { ChatItemComponent } from './ChartItemComponent' 11 import { ChatItemComponent } from './ChartItemComponent'
12 import { router } from '@kit.ArkUI' 12 import { router } from '@kit.ArkUI'
13 import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index' 13 import { EmitterEventId, EmitterUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'
14 -import { TrackConstants, TrackingContent } from 'wdTracking/Index' 14 +import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index'
15 15
16 const TAG = "PlayerCommentComponent" 16 const TAG = "PlayerCommentComponent"
17 /** 17 /**
@@ -120,12 +120,9 @@ export struct PlayerCommentComponent { @@ -120,12 +120,9 @@ export struct PlayerCommentComponent {
120 }) 120 })
121 121
122 // 发布评论埋点 122 // 发布评论埋点
123 - TrackingContent.commentClick(TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,  
124 - {  
125 - 'contentType': `${this.contentDetailData.newsType}`,  
126 - 'contentId': `${this.contentDetailData.newsId}`,  
127 - 'contentName': `${this.contentDetailData.newsTitle || ''}`,  
128 - }); 123 + TrackingContent.commentClick(TrackConstants.PageName.Live_Detail,
  124 + TrackConstants.PageName.Live_Detail,
  125 + TrackParamConvert.contentDetail(this.contentDetailData));
129 } 126 }
130 }, 127 },
131 onBack: () => { 128 onBack: () => {
@@ -31,6 +31,8 @@ export struct DetailVideoListPage { @@ -31,6 +31,8 @@ export struct DetailVideoListPage {
31 @Provide switchVideoStatus: boolean = true 31 @Provide switchVideoStatus: boolean = true
32 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL 32 @Provide displayDirection: DisplayDirection = DisplayDirection.VERTICAL
33 @Provide showCommentList: boolean = false 33 @Provide showCommentList: boolean = false
  34 + @Provide pageName: string = TrackConstants.PageName.VideoDetail
  35 + @Provide pageId: string = TrackConstants.PageName.VideoDetail
34 @State data: ContentDetailDTO[] = [] 36 @State data: ContentDetailDTO[] = []
35 @State currentIndex: number = 0 37 @State currentIndex: number = 0
36 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 38 @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@@ -30,7 +30,8 @@ const storage = LocalStorage.getShared(); @@ -30,7 +30,8 @@ const storage = LocalStorage.getShared();
30 @Component 30 @Component
31 export struct VideoChannelDetail { 31 export struct VideoChannelDetail {
32 private groupId: string = '' // 楼层id 32 private groupId: string = '' // 楼层id
33 - private pageId: string = '' //页面id 33 + @Provide private pageId: string = '' //页面id
  34 + @Provide private pageName: string = ''
34 private pageNum: number = 1 35 private pageNum: number = 1
35 private pageSize: number = 5 36 private pageSize: number = 5
36 private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down 37 private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down
@@ -2,6 +2,7 @@ import { Action } from 'wdBean'; @@ -2,6 +2,7 @@ import { Action } from 'wdBean';
2 import { ImageAndTextPageComponent } from 'wdComponent' 2 import { ImageAndTextPageComponent } from 'wdComponent'
3 import { Logger } from 'wdKit' 3 import { Logger } from 'wdKit'
4 import router from '@ohos.router'; 4 import router from '@ohos.router';
  5 +import { TrackConstants } from 'wdTracking/Index';
5 6
6 const TAG = 'ImageAndTextDetailPage'; 7 const TAG = 'ImageAndTextDetailPage';
7 8
@@ -10,6 +11,9 @@ const TAG = 'ImageAndTextDetailPage'; @@ -10,6 +11,9 @@ const TAG = 'ImageAndTextDetailPage';
10 struct ImageAndTextDetailPage { 11 struct ImageAndTextDetailPage {
11 action: Action = {} as Action 12 action: Action = {} as Action
12 13
  14 + @Provide pageName: string = TrackConstants.PageName.Article_Detail
  15 + @Provide pageId: string = TrackConstants.PageName.Article_Detail
  16 +
13 build() { 17 build() {
14 Column() { 18 Column() {
15 ImageAndTextPageComponent({action: this.action}) 19 ImageAndTextPageComponent({action: this.action})
@@ -3,6 +3,7 @@ import { SpacialTopicPageComponent } from 'wdComponent' @@ -3,6 +3,7 @@ import { SpacialTopicPageComponent } from 'wdComponent'
3 import { CommonConstants } from 'wdConstant' 3 import { CommonConstants } from 'wdConstant'
4 import { Logger } from 'wdKit' 4 import { Logger } from 'wdKit'
5 import router from '@ohos.router'; 5 import router from '@ohos.router';
  6 +import { TrackConstants } from 'wdTracking/Index';
6 7
7 const TAG = 'SpacialTopicPage'; 8 const TAG = 'SpacialTopicPage';
8 9
@@ -12,6 +13,10 @@ struct SpacialTopicPage { @@ -12,6 +13,10 @@ struct SpacialTopicPage {
12 @State action: Action = {} as Action 13 @State action: Action = {} as Action
13 @State reload: number = 0 14 @State reload: number = 0
14 @State count: number = 0 15 @State count: number = 0
  16 +
  17 + @Provide pageName: string = TrackConstants.PageName.Summary_Detail
  18 + @Provide pageId: string = TrackConstants.PageName.Summary_Detail
  19 +
15 build() { 20 build() {
16 Column() { 21 Column() {
17 SpacialTopicPageComponent({ action: this.action ,reload:this.reload }) 22 SpacialTopicPageComponent({ action: this.action ,reload:this.reload })
@@ -2,6 +2,8 @@ import { Logger } from 'wdKit'; @@ -2,6 +2,8 @@ import { Logger } from 'wdKit';
2 import { AudioDetailComponent } from 'wdComponent'; 2 import { AudioDetailComponent } from 'wdComponent';
3 import router from '@ohos.router'; 3 import router from '@ohos.router';
4 import { Params, Action } from 'wdBean'; 4 import { Params, Action } from 'wdBean';
  5 +import { TrackConstants } from 'wdTracking/Index';
  6 +
5 const TAG = 'AudioDetail'; 7 const TAG = 'AudioDetail';
6 @Entry 8 @Entry
7 @Component 9 @Component
@@ -11,6 +13,9 @@ struct AudioDetail { @@ -11,6 +13,9 @@ struct AudioDetail {
11 @State contentId: string = '' 13 @State contentId: string = ''
12 @State relType: string = '' 14 @State relType: string = ''
13 15
  16 + @Provide pageId: string = TrackConstants.PageName.Audio_Detail
  17 + @Provide pageName: string = TrackConstants.PageName.Audio_Detail
  18 +
14 build() { 19 build() {
15 Column() { 20 Column() {
16 AudioDetailComponent({ 21 AudioDetailComponent({
@@ -13,6 +13,9 @@ struct DynamicDetailPage { @@ -13,6 +13,9 @@ struct DynamicDetailPage {
13 @State contentId: string = '' 13 @State contentId: string = ''
14 @State relType: string = '' 14 @State relType: string = ''
15 15
  16 + @Provide pageName: string = TrackConstants.PageName.DynamicDetail
  17 + @Provide pageId: string = TrackConstants.PageName.DynamicDetail
  18 +
16 build() { 19 build() {
17 Column() { 20 Column() {
18 DynamicDetailComponent({ 21 DynamicDetailComponent({
@@ -19,6 +19,8 @@ struct MultiPictureDetailPage { @@ -19,6 +19,8 @@ struct MultiPictureDetailPage {
19 @State relType: string = '' 19 @State relType: string = ''
20 pageShowTime:number = 0; 20 pageShowTime:number = 0;
21 pageHideTime:number = 0; 21 pageHideTime:number = 0;
  22 + @Provide pageId: string = TrackConstants.PageName.Atlas_Detail
  23 + @Provide pageName: string = TrackConstants.PageName.Atlas_Detail
22 24
23 build() { 25 build() {
24 Row() { 26 Row() {
@@ -167,6 +167,7 @@ export struct VideoChannelPage { @@ -167,6 +167,7 @@ export struct VideoChannelPage {
167 topNavIndex: $currentTopNavSelectedIndex, 167 topNavIndex: $currentTopNavSelectedIndex,
168 groupId: this.groupId + '', 168 groupId: this.groupId + '',
169 pageId: item.pageId + '', 169 pageId: item.pageId + '',
  170 + pageName: item.name + '',
170 channelId: item.channelId + '', 171 channelId: item.channelId + '',
171 autoRefresh: this.autoRefresh, 172 autoRefresh: this.autoRefresh,
172 }) 173 })