Showing
23 changed files
with
172 additions
and
50 deletions
| @@ -203,6 +203,7 @@ export class ProcessUtils { | @@ -203,6 +203,7 @@ export class ProcessUtils { | ||
| 203 | relType: content?.relType, | 203 | relType: content?.relType, |
| 204 | relId: content?.relId, | 204 | relId: content?.relId, |
| 205 | channelId: content?.channelId, | 205 | channelId: content?.channelId, |
| 206 | + pageId: content?.pageId | ||
| 206 | } as ExtraDTO | 207 | } as ExtraDTO |
| 207 | } as Params, | 208 | } as Params, |
| 208 | }; | 209 | }; |
| @@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO { | @@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO { | ||
| 10 | topicId: string; | 10 | topicId: string; |
| 11 | channelId: string; | 11 | channelId: string; |
| 12 | compId: string; | 12 | compId: string; |
| 13 | + pageId: string; | ||
| 13 | sourcePage: string; | 14 | sourcePage: string; |
| 14 | relId: string; | 15 | relId: string; |
| 15 | relType: string; | 16 | relType: string; |
| @@ -25,5 +25,6 @@ export interface Params { | @@ -25,5 +25,6 @@ export interface Params { | ||
| 25 | creatorId?: string; //号主id | 25 | creatorId?: string; //号主id |
| 26 | videoUrl?: string; | 26 | videoUrl?: string; |
| 27 | videoCoverUrl?: string; | 27 | videoCoverUrl?: string; |
| 28 | + pageId?: string; | ||
| 28 | backVisibility?: boolean; //展示顶部返回栏 | 29 | backVisibility?: boolean; //展示顶部返回栏 |
| 29 | } | 30 | } |
| @@ -601,6 +601,8 @@ export struct DynamicDetailComponent { | @@ -601,6 +601,8 @@ export struct DynamicDetailComponent { | ||
| 601 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '') | 601 | this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '') |
| 602 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | 602 | this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') |
| 603 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | 603 | this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') |
| 604 | + this.publishCommentModel.pageId = TrackConstants.PageName.DynamicDetail | ||
| 605 | + this.publishCommentModel.pageName = TrackConstants.PageName.DynamicDetail | ||
| 604 | } | 606 | } |
| 605 | 607 | ||
| 606 | this.operationButtonList = ['comment', 'collect', 'share'] | 608 | this.operationButtonList = ['comment', 'collect', 'share'] |
| @@ -680,7 +682,7 @@ export struct DynamicDetailComponent { | @@ -680,7 +682,7 @@ export struct DynamicDetailComponent { | ||
| 680 | 682 | ||
| 681 | //创建跳转信息 | 683 | //创建跳转信息 |
| 682 | makeJumpInfo() { | 684 | makeJumpInfo() { |
| 683 | - this.mJumpInfo.pageId = 'dynamicDetailPage' | 685 | + this.mJumpInfo.pageId = TrackConstants.PageName.DynamicDetail |
| 684 | this.mJumpInfo.objectId = this.contentDetailData.newsId + "" | 686 | this.mJumpInfo.objectId = this.contentDetailData.newsId + "" |
| 685 | this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType + "" | 687 | this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType + "" |
| 686 | this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId + "" | 688 | this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId + "" |
| @@ -86,7 +86,7 @@ export struct ENewspaperItemComponent { | @@ -86,7 +86,7 @@ export struct ENewspaperItemComponent { | ||
| 86 | } as ContentDTO | 86 | } as ContentDTO |
| 87 | ProcessUtils.processPage(content) | 87 | ProcessUtils.processPage(content) |
| 88 | //内容点击 | 88 | //内容点击 |
| 89 | - TrackingContent.commentClickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage | 89 | + TrackingContent.clickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage |
| 90 | ,{ | 90 | ,{ |
| 91 | 'contentName':this.itemBeanClicked.title, | 91 | 'contentName':this.itemBeanClicked.title, |
| 92 | 'contentType':this.itemBeanClicked.newsType, | 92 | 'contentType':this.itemBeanClicked.newsType, |
| @@ -36,7 +36,7 @@ export struct ENewspaperPageComponent { | @@ -36,7 +36,7 @@ export struct ENewspaperPageComponent { | ||
| 36 | this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex | 36 | this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex |
| 37 | 37 | ||
| 38 | //电子报--版面序号选择点击 | 38 | //电子报--版面序号选择点击 |
| 39 | - TrackingContent.commentClickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage | 39 | + TrackingContent.clickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage |
| 40 | ,{ | 40 | ,{ |
| 41 | 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, | 41 | 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, |
| 42 | 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, | 42 | 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, |
| @@ -61,7 +61,7 @@ export struct ENewspaperPageComponent { | @@ -61,7 +61,7 @@ export struct ENewspaperPageComponent { | ||
| 61 | new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) | 61 | new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0) |
| 62 | } | 62 | } |
| 63 | //日历选择点击 | 63 | //日历选择点击 |
| 64 | - TrackingContent.commentClickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage | 64 | + TrackingContent.clickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage |
| 65 | ,{ | 65 | ,{ |
| 66 | 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, | 66 | 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, |
| 67 | 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, | 67 | 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, |
| @@ -340,7 +340,7 @@ export struct ENewspaperPageComponent { | @@ -340,7 +340,7 @@ export struct ENewspaperPageComponent { | ||
| 340 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 340 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 341 | this.isOpenListDialog = true | 341 | this.isOpenListDialog = true |
| 342 | //电子报--读报纸点击 | 342 | //电子报--读报纸点击 |
| 343 | - TrackingContent.commentClickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage | 343 | + TrackingContent.clickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage |
| 344 | ,{ | 344 | ,{ |
| 345 | 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, | 345 | 'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum, |
| 346 | 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, | 346 | 'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName, |
| @@ -295,7 +295,7 @@ export struct MorningEveningPaperComponent { | @@ -295,7 +295,7 @@ export struct MorningEveningPaperComponent { | ||
| 295 | topPaperTitle(){ | 295 | topPaperTitle(){ |
| 296 | Column(){ | 296 | Column(){ |
| 297 | PaperTitleComponent().margin({top:this.topSafeHeight}) | 297 | PaperTitleComponent().margin({top:this.topSafeHeight}) |
| 298 | - }.height(44+this.topSafeHeight).backgroundColor(this.scrollOffset > 100?this.mixedBgColor:'') | 298 | + }.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor) |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | @Builder | 301 | @Builder |
| @@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean'; | @@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean'; | ||
| 3 | import { BreakpointConstants } from 'wdConstant'; | 3 | import { BreakpointConstants } from 'wdConstant'; |
| 4 | import { Logger } from 'wdKit'; | 4 | import { Logger } from 'wdKit'; |
| 5 | import { PaperSingleColumn999CardView } from '../page/CardView'; | 5 | import { PaperSingleColumn999CardView } from '../page/CardView'; |
| 6 | -import { EmptyComponent } from '../view/EmptyComponent'; | 6 | +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; |
| 7 | 7 | ||
| 8 | const TAG = 'SingleColumn999Component'; | 8 | const TAG = 'SingleColumn999Component'; |
| 9 | 9 | ||
| @@ -153,9 +153,8 @@ export struct SingleColumn999Component { | @@ -153,9 +153,8 @@ export struct SingleColumn999Component { | ||
| 153 | }) | 153 | }) |
| 154 | } else { | 154 | } else { |
| 155 | if (this.compListItem && this.compListItem?.operDataList) { | 155 | if (this.compListItem && this.compListItem?.operDataList) { |
| 156 | - EmptyComponent({ emptyHeight: 200 }) | 156 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent}) |
| 157 | } | 157 | } |
| 158 | - | ||
| 159 | } | 158 | } |
| 160 | } | 159 | } |
| 161 | 160 |
| @@ -32,9 +32,9 @@ export struct topicInfoView { | @@ -32,9 +32,9 @@ export struct topicInfoView { | ||
| 32 | }) | 32 | }) |
| 33 | .id('img_cover') | 33 | .id('img_cover') |
| 34 | 34 | ||
| 35 | - if (this.frontLinkObject) { | 35 | + if (this.frontLinkObject.linkUrl.length > 0) { |
| 36 | Row() { | 36 | Row() { |
| 37 | - Text(this.frontLinkObject.linkUrl.length > 0?"查看详情":'') | 37 | + Text("查看详情") |
| 38 | .fontSize(14) | 38 | .fontSize(14) |
| 39 | .fontColor($r('app.color.white')) | 39 | .fontColor($r('app.color.white')) |
| 40 | .maxLines(1) | 40 | .maxLines(1) |
| @@ -50,14 +50,14 @@ export struct topicInfoView { | @@ -50,14 +50,14 @@ export struct topicInfoView { | ||
| 50 | .margin({ top: 8, left: 16, right: 16, bottom: 16 }) | 50 | .margin({ top: 8, left: 16, right: 16, bottom: 16 }) |
| 51 | .borderRadius(2) | 51 | .borderRadius(2) |
| 52 | .onClick(()=>{ | 52 | .onClick(()=>{ |
| 53 | - if (this.frontLinkObject.linkUrl.length === 0) return | ||
| 54 | let contentDTO :ContentDTO = new ContentDTO(); | 53 | let contentDTO :ContentDTO = new ContentDTO(); |
| 55 | contentDTO.objectType = this.frontLinkObject?.newsType.toString() | 54 | contentDTO.objectType = this.frontLinkObject?.newsType.toString() |
| 56 | contentDTO.objectId = this.frontLinkObject?.newsId | 55 | contentDTO.objectId = this.frontLinkObject?.newsId |
| 57 | contentDTO.linkUrl = this.frontLinkObject?.linkUrl | 56 | contentDTO.linkUrl = this.frontLinkObject?.linkUrl |
| 58 | ProcessUtils.processPage(contentDTO) | 57 | ProcessUtils.processPage(contentDTO) |
| 59 | 58 | ||
| 60 | - }).width(80) | 59 | + }) |
| 60 | + .width(80) | ||
| 61 | .alignRules({ | 61 | .alignRules({ |
| 62 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 62 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 63 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } | 63 | bottom: { anchor: "__container__", align: VerticalAlign.Bottom } |
| @@ -73,9 +73,9 @@ export struct topicInfoView { | @@ -73,9 +73,9 @@ export struct topicInfoView { | ||
| 73 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 73 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 74 | .alignRules({ | 74 | .alignRules({ |
| 75 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 75 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| 76 | - bottom: { anchor: "row_detail", align: VerticalAlign.Top } | 76 | + bottom: this.frontLinkObject.linkUrl.length > 0?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom } |
| 77 | }) | 77 | }) |
| 78 | - .margin({ left: 16, right: 16 }) | 78 | + .margin({ left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0?0:16}) |
| 79 | .id('txt_summary') | 79 | .id('txt_summary') |
| 80 | 80 | ||
| 81 | Text(this.frontLinkObject?.title ?? "") | 81 | Text(this.frontLinkObject?.title ?? "") |
| @@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent'; | @@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent'; | ||
| 12 | import { NetworkUtil, WindowModel } from 'wdKit'; | 12 | import { NetworkUtil, WindowModel } from 'wdKit'; |
| 13 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | 13 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' |
| 14 | import { common } from '@kit.AbilityKit'; | 14 | import { common } from '@kit.AbilityKit'; |
| 15 | +import { PageRepository } from '../repository/PageRepository'; | ||
| 15 | 16 | ||
| 16 | const TAG: string = 'SpacialTopicPageComponent' | 17 | const TAG: string = 'SpacialTopicPageComponent' |
| 17 | 18 | ||
| @@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent { | @@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent { | ||
| 59 | 60 | ||
| 60 | private async getDetail() { | 61 | private async getDetail() { |
| 61 | this.isNetConnected = NetworkUtil.isNetConnected() | 62 | this.isNetConnected = NetworkUtil.isNetConnected() |
| 62 | - | ||
| 63 | let contentId: string = '' | 63 | let contentId: string = '' |
| 64 | let relId: string = '' | 64 | let relId: string = '' |
| 65 | let relType: string = '' | 65 | let relType: string = '' |
| @@ -74,11 +74,14 @@ export struct SpacialTopicPageComponent { | @@ -74,11 +74,14 @@ export struct SpacialTopicPageComponent { | ||
| 74 | if (this.action.params.extra.relType) { | 74 | if (this.action.params.extra.relType) { |
| 75 | relType = this.action.params.extra.relType | 75 | relType = this.action.params.extra.relType |
| 76 | } | 76 | } |
| 77 | - | ||
| 78 | } | 77 | } |
| 78 | + let pageId = this.action.params.extra?.pageId | ||
| 79 | + console.log('pageIdpageId',pageId) | ||
| 80 | + if(pageId){ | ||
| 81 | + let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId) | ||
| 79 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) | 82 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) |
| 80 | - if (detailBeans && detailBeans.length > 0) { | ||
| 81 | - this.contentDetailData = detailBeans[0]; | 83 | + if (detailBeans?.length > 0) { |
| 84 | + this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0])); | ||
| 82 | this.viewBlogInsightIntentShare() | 85 | this.viewBlogInsightIntentShare() |
| 83 | // if (this.contentDetailData[0]?.openComment) { | 86 | // if (this.contentDetailData[0]?.openComment) { |
| 84 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | 87 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') |
| @@ -92,6 +95,11 @@ export struct SpacialTopicPageComponent { | @@ -92,6 +95,11 @@ export struct SpacialTopicPageComponent { | ||
| 92 | // } | 95 | // } |
| 93 | this.trySendData2H5() | 96 | this.trySendData2H5() |
| 94 | } | 97 | } |
| 98 | + if(pageInfoMsg && pageInfoMsg.data){ | ||
| 99 | + this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag) | ||
| 100 | + this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag) | ||
| 101 | + } | ||
| 102 | + } | ||
| 95 | } | 103 | } |
| 96 | } | 104 | } |
| 97 | 105 |
| @@ -41,7 +41,8 @@ export class publishCommentModel { | @@ -41,7 +41,8 @@ export class publishCommentModel { | ||
| 41 | 41 | ||
| 42 | //最新发布的评论 | 42 | //最新发布的评论 |
| 43 | lastCommentModel: commentItemModel = new commentItemModel() | 43 | lastCommentModel: commentItemModel = new commentItemModel() |
| 44 | - | 44 | + pageId: string = '' |
| 45 | + pageName: string = '' | ||
| 45 | 46 | ||
| 46 | } | 47 | } |
| 47 | 48 |
| @@ -16,7 +16,7 @@ const TAG = 'CommentComponent'; | @@ -16,7 +16,7 @@ const TAG = 'CommentComponent'; | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸' | 18 | const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸' |
| 19 | - | 19 | +//评论组件 |
| 20 | // @Entry | 20 | // @Entry |
| 21 | @Preview | 21 | @Preview |
| 22 | @Component | 22 | @Component |
| @@ -4,14 +4,25 @@ import { commentItemModel } from '../model/CommentModel' | @@ -4,14 +4,25 @@ import { commentItemModel } from '../model/CommentModel' | ||
| 4 | import { publishCommentModel } from '../model/PublishCommentModel' | 4 | import { publishCommentModel } from '../model/PublishCommentModel' |
| 5 | import commentViewModel from '../viewmodel/CommentViewModel' | 5 | import commentViewModel from '../viewmodel/CommentViewModel' |
| 6 | 6 | ||
| 7 | +export interface CommentDialogInputContent { | ||
| 8 | + comment?: string | ||
| 9 | + imageUrl?: string | ||
| 10 | +} | ||
| 11 | + | ||
| 7 | /// 评论输入框 | 12 | /// 评论输入框 |
| 8 | @Preview | 13 | @Preview |
| 9 | @CustomDialog | 14 | @CustomDialog |
| 10 | export struct CommentCustomDialog { | 15 | export struct CommentCustomDialog { |
| 11 | @ObjectLink publishCommentModel: publishCommentModel | 16 | @ObjectLink publishCommentModel: publishCommentModel |
| 12 | controller?: CustomDialogController | 17 | controller?: CustomDialogController |
| 13 | - confirm: (value: Record<string, string>) => void = () => { | ||
| 14 | - } | 18 | + |
| 19 | + // 发布按钮点击事件。如果上层传了该值,切返回了true,表示上层已处理,则 confirm 回调不生效 | ||
| 20 | + // 可以用这里在上层做埋点 | ||
| 21 | + onPublishBtnClick?: (content: CommentDialogInputContent) => boolean | ||
| 22 | + | ||
| 23 | + // confirm 表示内部处理调用 内容评论接口 发布了评论并成功,上层只需要 通过 publishCommentModel.lastCommentModel 即可获取最新已提交的评论 | ||
| 24 | + confirm?: (value: Record<string, string>) => void | ||
| 25 | + | ||
| 15 | @State private emojiSwitch: boolean = false | 26 | @State private emojiSwitch: boolean = false |
| 16 | textInputController: TextAreaController = new TextAreaController() | 27 | textInputController: TextAreaController = new TextAreaController() |
| 17 | @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } | 28 | @State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 } |
| @@ -21,6 +32,13 @@ export struct CommentCustomDialog { | @@ -21,6 +32,13 @@ export struct CommentCustomDialog { | ||
| 21 | } | 32 | } |
| 22 | 33 | ||
| 23 | publishCommentRequest() { | 34 | publishCommentRequest() { |
| 35 | + if (this.onPublishBtnClick) { | ||
| 36 | + let content: CommentDialogInputContent = { comment: this.publishCommentModel.commentContent } | ||
| 37 | + if (this.onPublishBtnClick(content)) { | ||
| 38 | + return | ||
| 39 | + } | ||
| 40 | + } | ||
| 41 | + | ||
| 24 | let bean: Record<string, string> = {}; | 42 | let bean: Record<string, string> = {}; |
| 25 | // this.publishCommentModel.commentContent = this.commentText | 43 | // this.publishCommentModel.commentContent = this.commentText |
| 26 | //TODO 判断类型 | 44 | //TODO 判断类型 |
| @@ -34,7 +52,9 @@ export struct CommentCustomDialog { | @@ -34,7 +52,9 @@ export struct CommentCustomDialog { | ||
| 34 | if (this.controller != null) { | 52 | if (this.controller != null) { |
| 35 | this.controller.close() | 53 | this.controller.close() |
| 36 | } | 54 | } |
| 55 | + if (this.confirm) { | ||
| 37 | this.confirm(bean) | 56 | this.confirm(bean) |
| 57 | + } | ||
| 38 | }).catch(() => { | 58 | }).catch(() => { |
| 39 | if (this.controller != null) { | 59 | if (this.controller != null) { |
| 40 | this.controller.close() | 60 | this.controller.close() |
| @@ -6,6 +6,7 @@ import { | @@ -6,6 +6,7 @@ import { | ||
| 6 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; | 6 | import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; |
| 7 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 7 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 8 | import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 8 | import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 9 | +import { TrackConstants, TrackingContent } from 'wdTracking/Index'; | ||
| 9 | import { | 10 | import { |
| 10 | commentItemModel, | 11 | commentItemModel, |
| 11 | commentListModel, | 12 | commentListModel, |
| @@ -16,7 +17,7 @@ import { | @@ -16,7 +17,7 @@ import { | ||
| 16 | import { publishCommentModel } from '../model/PublishCommentModel'; | 17 | import { publishCommentModel } from '../model/PublishCommentModel'; |
| 17 | 18 | ||
| 18 | const TAG = "CommentViewModel" | 19 | const TAG = "CommentViewModel" |
| 19 | - | 20 | +//评论model |
| 20 | class CommentViewModel { | 21 | class CommentViewModel { |
| 21 | private static instance: CommentViewModel | 22 | private static instance: CommentViewModel |
| 22 | 23 | ||
| @@ -166,9 +167,9 @@ class CommentViewModel { | @@ -166,9 +167,9 @@ class CommentViewModel { | ||
| 166 | return new Promise<commentItemModel>((success, fail) => { | 167 | return new Promise<commentItemModel>((success, fail) => { |
| 167 | const visitorMode = model.visitorComment == "1" && HttpUtils.isLogin() == false | 168 | const visitorMode = model.visitorComment == "1" && HttpUtils.isLogin() == false |
| 168 | let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl() | 169 | let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl() |
| 169 | - | 170 | + let pageId = model.pageId; |
| 171 | + let pageName = model.pageName; | ||
| 170 | let bean: Record<string, string> = {}; | 172 | let bean: Record<string, string> = {}; |
| 171 | - | ||
| 172 | bean['targetId'] = model.targetId; | 173 | bean['targetId'] = model.targetId; |
| 173 | bean['targetRelId'] = model.targetRelId; | 174 | bean['targetRelId'] = model.targetRelId; |
| 174 | bean['commentType'] = model.commentType; | 175 | bean['commentType'] = model.commentType; |
| @@ -188,6 +189,11 @@ class CommentViewModel { | @@ -188,6 +189,11 @@ class CommentViewModel { | ||
| 188 | } | 189 | } |
| 189 | 190 | ||
| 190 | 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 | + }) | ||
| 191 | if (data.code != 0) { | 197 | if (data.code != 0) { |
| 192 | ToastUtils.showToast(data.message, 1000); | 198 | ToastUtils.showToast(data.message, 1000); |
| 193 | fail() | 199 | fail() |
| @@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI { | @@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 16 | Grid(){ | 16 | Grid(){ |
| 17 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ | 17 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ |
| 18 | GridItem(){ | 18 | GridItem(){ |
| 19 | - PagePersonFunction({ item: item, noDivider : (index % 4 < 3 && index != this.personalData.length-1) ? false : true}) | 19 | + PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true}) |
| 20 | }.onClick(()=>{ | 20 | }.onClick(()=>{ |
| 21 | console.log(index+"") | 21 | console.log(index+"") |
| 22 | switch (item.msg){ | 22 | switch (item.msg){ |
| @@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI { | @@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI { | ||
| 77 | break; | 77 | break; |
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | - }).width('169lpx') | 80 | + }).width('142lpx') |
| 81 | .height('117lpx') | 81 | .height('117lpx') |
| 82 | }) | 82 | }) |
| 83 | } | 83 | } |
| 84 | - .rowsTemplate('1fr 1fr') | ||
| 85 | - .columnsTemplate('1fr 1fr 1fr 1fr') | ||
| 86 | - .height('234lpx') | ||
| 87 | - .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) | 84 | + .rowsTemplate('1fr') |
| 85 | + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') | ||
| 86 | + .height('117lpx') | ||
| 87 | + .margin({top:'31lpx'}) | ||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | messageClick(){ | 90 | messageClick(){ |
| @@ -2,7 +2,7 @@ import { AppointmentListChildComponent } from './AppointmentListChildComponent'; | @@ -2,7 +2,7 @@ import { AppointmentListChildComponent } from './AppointmentListChildComponent'; | ||
| 2 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 2 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| 3 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; | 3 | import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI'; |
| 4 | import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; | 4 | import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; |
| 5 | -import { LazyDataSource, StringUtils } from 'wdKit'; | 5 | +import { LazyDataSource, NetworkUtil, 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, ContentDTO } from 'wdBean/Index'; | 8 | import { Action, ContentDTO } from 'wdBean/Index'; |
| @@ -23,6 +23,7 @@ export struct AppointmentListUI { | @@ -23,6 +23,7 @@ export struct AppointmentListUI { | ||
| 23 | curPageNum: number = 1; | 23 | curPageNum: number = 1; |
| 24 | @State isGetRequest: boolean = false | 24 | @State isGetRequest: boolean = false |
| 25 | private scroller: Scroller = new Scroller(); | 25 | private scroller: Scroller = new Scroller(); |
| 26 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 26 | 27 | ||
| 27 | aboutToAppear() { | 28 | aboutToAppear() { |
| 28 | this.getNewPageData() | 29 | this.getNewPageData() |
| @@ -34,13 +35,29 @@ export struct AppointmentListUI { | @@ -34,13 +35,29 @@ export struct AppointmentListUI { | ||
| 34 | CustomTitleUI({ titleName: "我的预约" }) | 35 | CustomTitleUI({ titleName: "我的预约" }) |
| 35 | if (this.count == 0) { | 36 | if (this.count == 0) { |
| 36 | if (this.isGetRequest == true) { | 37 | if (this.isGetRequest == true) { |
| 38 | + if(this.isConnectNetwork){ | ||
| 37 | EmptyComponent({ emptyType: 10 }) | 39 | EmptyComponent({ emptyType: 10 }) |
| 38 | .height('100%') | 40 | .height('100%') |
| 39 | .width('100%') | 41 | .width('100%') |
| 40 | - } | 42 | + }else{ |
| 43 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 44 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 45 | + if(this.isConnectNetwork){ | ||
| 46 | + this.curPageNum = 1; | ||
| 47 | + this.hasMore = true | ||
| 48 | + this.isGetRequest = false | ||
| 49 | + this.data.clear() | ||
| 41 | 50 | ||
| 51 | + if (!this.isLoading) { | ||
| 52 | + this.getNewPageData() | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + },}) | ||
| 56 | + .layoutWeight(1) | ||
| 57 | + .width('100%') | ||
| 58 | + } | ||
| 59 | + } | ||
| 42 | } else { | 60 | } else { |
| 43 | - | ||
| 44 | CustomPullToRefresh({ | 61 | CustomPullToRefresh({ |
| 45 | alldata:this.data, | 62 | alldata:this.data, |
| 46 | scroller:this.scroller, | 63 | scroller:this.scroller, |
| @@ -62,8 +62,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -62,8 +62,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 62 | commentCount: _item?.interactData?.commentNum || 0, | 62 | commentCount: _item?.interactData?.commentNum || 0, |
| 63 | favorites: _item?.interactData?.collectNum || 0, | 63 | favorites: _item?.interactData?.collectNum || 0, |
| 64 | viewCount: _item?.interactData?.readNum || 0, | 64 | viewCount: _item?.interactData?.readNum || 0, |
| 65 | - rankingHint: 99, | ||
| 66 | - isPublicData: true | 65 | + rankingHint: 99 |
| 67 | } | 66 | } |
| 68 | } | 67 | } |
| 69 | insightIntentArray.push(viewBlogInsightIntentItem) | 68 | insightIntentArray.push(viewBlogInsightIntentItem) |
| @@ -113,8 +112,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | @@ -113,8 +112,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | ||
| 113 | forwardCount: interactData?.shareNum || 0, | 112 | forwardCount: interactData?.shareNum || 0, |
| 114 | commentCount: interactData?.commentNum || 0, | 113 | commentCount: interactData?.commentNum || 0, |
| 115 | favorites: interactData?.collectNum || 0, | 114 | favorites: interactData?.collectNum || 0, |
| 116 | - rankingHint: 99, | ||
| 117 | - isPublicData: true | 115 | + rankingHint: 99 |
| 118 | } | 116 | } |
| 119 | } | 117 | } |
| 120 | 118 | ||
| @@ -147,8 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | @@ -147,8 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | ||
| 147 | activityType: ['RecentViews'], | 145 | activityType: ['RecentViews'], |
| 148 | columnTitle: pageInfoBean?.topicInfo?.title, | 146 | columnTitle: pageInfoBean?.topicInfo?.title, |
| 149 | columnSubTitle: pageInfoBean?.shareSummary, | 147 | columnSubTitle: pageInfoBean?.shareSummary, |
| 150 | - rankingHint: 99, | ||
| 151 | - isPublicData: true | 148 | + rankingHint: 99 |
| 152 | } | 149 | } |
| 153 | } | 150 | } |
| 154 | console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewColumInsightIntentItem)) | 151 | console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewColumInsightIntentItem)) |
| @@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
| 16 | "wdConstant": "file:../../commons/wdConstant", | 16 | "wdConstant": "file:../../commons/wdConstant", |
| 17 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", | 17 | "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", |
| 18 | "wdComponent": "file:../../features/wdComponent", | 18 | "wdComponent": "file:../../features/wdComponent", |
| 19 | - "wdShare": "file:../../features/wdShare" | 19 | + "wdShare": "file:../../features/wdShare", |
| 20 | + "wdTracking": "file:../../features/wdTracking" | ||
| 20 | } | 21 | } |
| 21 | } | 22 | } |
| @@ -8,6 +8,8 @@ import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentD | @@ -8,6 +8,8 @@ import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentD | ||
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { window } from '@kit.ArkUI'; | 9 | import { window } from '@kit.ArkUI'; |
| 10 | import { EmptyComponent } from 'wdComponent/Index'; | 10 | import { EmptyComponent } from 'wdComponent/Index'; |
| 11 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 12 | +import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 11 | 13 | ||
| 12 | const storage = LocalStorage.getShared(); | 14 | const storage = LocalStorage.getShared(); |
| 13 | const TAG = 'DetailVideoListPage' | 15 | const TAG = 'DetailVideoListPage' |
| @@ -33,6 +35,8 @@ export struct DetailVideoListPage { | @@ -33,6 +35,8 @@ export struct DetailVideoListPage { | ||
| 33 | @State currentIndex: number = 0 | 35 | @State currentIndex: number = 0 |
| 34 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 | 36 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 |
| 35 | @State interactDataList: InteractDataDTO[] = [] | 37 | @State interactDataList: InteractDataDTO[] = [] |
| 38 | + pageShowTime:number = 0; | ||
| 39 | + pageHideTime:number = 0; | ||
| 36 | 40 | ||
| 37 | async aboutToAppear(): Promise<void> { | 41 | async aboutToAppear(): Promise<void> { |
| 38 | // 注册监听网络连接 | 42 | // 注册监听网络连接 |
| @@ -70,12 +74,18 @@ export struct DetailVideoListPage { | @@ -70,12 +74,18 @@ export struct DetailVideoListPage { | ||
| 70 | this.switchVideoStatus = true | 74 | this.switchVideoStatus = true |
| 71 | this.openFullScreen() | 75 | this.openFullScreen() |
| 72 | 76 | ||
| 77 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 73 | } | 78 | } |
| 74 | 79 | ||
| 75 | onPageHide(): void { | 80 | onPageHide(): void { |
| 76 | console.log(TAG, 'onPageHide') | 81 | console.log(TAG, 'onPageHide') |
| 77 | this.switchVideoStatus = false | 82 | this.switchVideoStatus = false |
| 78 | this.closeFullScreen() | 83 | this.closeFullScreen() |
| 84 | + | ||
| 85 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 86 | + let duration = 0 | ||
| 87 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 88 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 79 | } | 89 | } |
| 80 | 90 | ||
| 81 | /** | 91 | /** |
| @@ -14,6 +14,8 @@ import { PictureLoading } from './PictureLoading'; | @@ -14,6 +14,8 @@ import { PictureLoading } from './PictureLoading'; | ||
| 14 | import { DisplayDirection } from 'wdConstant/Index'; | 14 | import { DisplayDirection } from 'wdConstant/Index'; |
| 15 | import { window } from '@kit.ArkUI'; | 15 | import { window } from '@kit.ArkUI'; |
| 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; | 16 | import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index'; |
| 17 | +import { DateTimeUtils } from 'wdKit/Index'; | ||
| 18 | +import {TrackConstants,TrackingPageBrowse } from 'wdTracking/Index'; | ||
| 17 | 19 | ||
| 18 | interface loadMoreData { | 20 | interface loadMoreData { |
| 19 | pageNum: number; | 21 | pageNum: number; |
| @@ -59,6 +61,8 @@ export struct VideoChannelDetail { | @@ -59,6 +61,8 @@ export struct VideoChannelDetail { | ||
| 59 | @State totalCount: number = 0 | 61 | @State totalCount: number = 0 |
| 60 | @State isMouted: boolean = false | 62 | @State isMouted: boolean = false |
| 61 | @State isRequestError: boolean = false | 63 | @State isRequestError: boolean = false |
| 64 | + pageShowTime:number = 0; | ||
| 65 | + pageHideTime:number = 0; | ||
| 62 | 66 | ||
| 63 | autoRefreshChange() { | 67 | autoRefreshChange() { |
| 64 | if (this.topNavIndex === 0) { | 68 | if (this.topNavIndex === 0) { |
| @@ -78,12 +82,21 @@ export struct VideoChannelDetail { | @@ -78,12 +82,21 @@ export struct VideoChannelDetail { | ||
| 78 | this.switchVideoStatus = true | 82 | this.switchVideoStatus = true |
| 79 | this.openFullScreen() | 83 | this.openFullScreen() |
| 80 | } | 84 | } |
| 85 | + | ||
| 86 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 87 | + console.log(TAG, '一级视频显示') | ||
| 81 | } | 88 | } |
| 82 | 89 | ||
| 83 | pageHideChange() { | 90 | pageHideChange() { |
| 84 | this.barBackgroundColor = Color.Transparent | 91 | this.barBackgroundColor = Color.Transparent |
| 85 | this.switchVideoStatus = false | 92 | this.switchVideoStatus = false |
| 86 | this.closeFullScreen() | 93 | this.closeFullScreen() |
| 94 | + | ||
| 95 | + console.log(TAG, '一级视频隐藏') | ||
| 96 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 97 | + let duration = 0 | ||
| 98 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 99 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration) | ||
| 87 | } | 100 | } |
| 88 | 101 | ||
| 89 | /** | 102 | /** |
| @@ -255,7 +268,6 @@ export struct VideoChannelDetail { | @@ -255,7 +268,6 @@ export struct VideoChannelDetail { | ||
| 255 | }) | 268 | }) |
| 256 | } | 269 | } |
| 257 | } | 270 | } |
| 258 | - | ||
| 259 | build() { | 271 | build() { |
| 260 | Column() { | 272 | Column() { |
| 261 | if (this.isRequestError) { | 273 | if (this.isRequestError) { |
| @@ -18,7 +18,7 @@ export struct PlayerCommentView { | @@ -18,7 +18,7 @@ export struct PlayerCommentView { | ||
| 18 | router.back(); | 18 | router.back(); |
| 19 | }) | 19 | }) |
| 20 | 20 | ||
| 21 | - if (this.contentDetailData.openComment === 1) { | 21 | + if (this.contentDetailData.openComment == 1) { |
| 22 | TextInput({ placeholder: '说两句...', text: this.comment }) | 22 | TextInput({ placeholder: '说两句...', text: this.comment }) |
| 23 | .placeholderColor('#999999') | 23 | .placeholderColor('#999999') |
| 24 | .placeholderFont({ size: 14 }) | 24 | .placeholderFont({ size: 14 }) |
| @@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 14 | import { DisplayDirection, SpConstants } from 'wdConstant/Index' | 14 | import { DisplayDirection, SpConstants } from 'wdConstant/Index' |
| 15 | import { WDShare } from "wdShare" | 15 | import { WDShare } from "wdShare" |
| 16 | import { publishCommentModel } from 'wdComponent/Index'; | 16 | import { publishCommentModel } from 'wdComponent/Index'; |
| 17 | +import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; | ||
| 17 | 18 | ||
| 18 | interface ILikeStyleResp { | 19 | interface ILikeStyleResp { |
| 19 | url: Resource; | 20 | url: Resource; |
| @@ -37,16 +38,44 @@ export struct PlayerRightView { | @@ -37,16 +38,44 @@ export struct PlayerRightView { | ||
| 37 | @Consume showCommentList: boolean | 38 | @Consume showCommentList: boolean |
| 38 | @Consume displayDirection: DisplayDirection | 39 | @Consume displayDirection: DisplayDirection |
| 39 | @Consume publishCommentModel: publishCommentModel | 40 | @Consume publishCommentModel: publishCommentModel |
| 40 | - @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 41 | + // @State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 41 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 | 42 | @State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以 |
| 43 | + @State likesStyle: number | string = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | ||
| 44 | + pageParam: ParamType = {} | ||
| 45 | + PageName: string = '' | ||
| 46 | + followUserId: string = '' | ||
| 47 | + followUserName: string = '' | ||
| 48 | + | ||
| 42 | aboutToAppear() { | 49 | aboutToAppear() { |
| 43 | // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 50 | // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 44 | this.likesStyle = this.contentDetailData.likesStyle | 51 | this.likesStyle = this.contentDetailData.likesStyle |
| 45 | this.openLikes = this.contentDetailData.openLikes == 1 ? true : false | 52 | this.openLikes = this.contentDetailData.openLikes == 1 ? true : false |
| 46 | // console.log(TAG, 'this.likesStyle', this.likesStyle) | 53 | // console.log(TAG, 'this.likesStyle', this.likesStyle) |
| 47 | // console.log(TAG, 'this.openLikes', this.openLikes) | 54 | // console.log(TAG, 'this.openLikes', this.openLikes) |
| 55 | + this.contentTrackingDict() | ||
| 56 | + } | ||
| 57 | + contentTrackingDict(){ | ||
| 58 | + this.pageParam = { | ||
| 59 | + 'contentType': `${this.contentDetailData.newsType}`, | ||
| 60 | + 'contentId': `${this.contentDetailData.newsId}`, | ||
| 61 | + 'contentName': `${this.contentDetailData.newsTitle || ''}`, | ||
| 62 | + } | ||
| 63 | + if(this.contentDetailData.newsType == 1) { | ||
| 64 | + this.PageName = TrackConstants.PageName.VideoDetail // 点播 | ||
| 65 | + } else if(this.contentDetailData.newsType == 2) { | ||
| 66 | + this.PageName = TrackConstants.PageName.Live_Detail // 直播 | ||
| 67 | + } else if(this.contentDetailData.newsType == 5) { | ||
| 68 | + this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页 | ||
| 69 | + } else if(this.contentDetailData.newsType == 8) { | ||
| 70 | + this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页 | ||
| 71 | + } else if(this.contentDetailData.newsType == 9) { | ||
| 72 | + this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页 | ||
| 73 | + } else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) { | ||
| 74 | + this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频 | ||
| 75 | + } | ||
| 76 | + this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || '' | ||
| 77 | + this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || '' | ||
| 48 | } | 78 | } |
| 49 | - | ||
| 50 | /** | 79 | /** |
| 51 | * 点赞、取消点赞 | 80 | * 点赞、取消点赞 |
| 52 | */ | 81 | */ |
| @@ -76,8 +105,12 @@ export struct PlayerRightView { | @@ -76,8 +105,12 @@ export struct PlayerRightView { | ||
| 76 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' | 105 | this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 77 | if (this.newsStatusOfUser.likeStatus == '1') { | 106 | if (this.newsStatusOfUser.likeStatus == '1') { |
| 78 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 | 107 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 |
| 108 | + TrackingContent.like(true,this.PageName,this.PageName,this.pageParam) | ||
| 109 | + console.log(TAG, '点赞') | ||
| 79 | } else { | 110 | } else { |
| 80 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) | 111 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) |
| 112 | + TrackingContent.like(false,this.PageName,this.PageName,this.pageParam) | ||
| 113 | + console.log(TAG, '取消点赞') | ||
| 81 | } | 114 | } |
| 82 | console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) | 115 | console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum) |
| 83 | // this.queryContentInteractCount() | 116 | // this.queryContentInteractCount() |
| @@ -112,8 +145,12 @@ export struct PlayerRightView { | @@ -112,8 +145,12 @@ export struct PlayerRightView { | ||
| 112 | // this.queryContentInteractCount() | 145 | // this.queryContentInteractCount() |
| 113 | if (this.newsStatusOfUser.collectStatus === 1) { | 146 | if (this.newsStatusOfUser.collectStatus === 1) { |
| 114 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 | 147 | this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1 |
| 148 | + TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam) | ||
| 149 | + console.log(TAG, '收藏') | ||
| 115 | } else { | 150 | } else { |
| 116 | this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) | 151 | this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1) |
| 152 | + TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam) | ||
| 153 | + console.log(TAG, '取消收藏') | ||
| 117 | } | 154 | } |
| 118 | console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) | 155 | console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum) |
| 119 | } | 156 | } |
| @@ -175,6 +212,8 @@ export struct PlayerRightView { | @@ -175,6 +212,8 @@ export struct PlayerRightView { | ||
| 175 | ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); | 212 | ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000); |
| 176 | } | 213 | } |
| 177 | }) | 214 | }) |
| 215 | + console.log(TAG, '关注号主') | ||
| 216 | + TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) | ||
| 178 | } | 217 | } |
| 179 | }) | 218 | }) |
| 180 | } | 219 | } |
| @@ -184,7 +223,7 @@ export struct PlayerRightView { | @@ -184,7 +223,7 @@ export struct PlayerRightView { | ||
| 184 | this.userBuilderView() | 223 | this.userBuilderView() |
| 185 | this.likeBuilderView() | 224 | this.likeBuilderView() |
| 186 | this.collectBuilderView() | 225 | this.collectBuilderView() |
| 187 | - if (this.contentDetailData.openComment === 1) { | 226 | + if (this.contentDetailData.openComment == 1) { |
| 188 | this.commentBuilderView() | 227 | this.commentBuilderView() |
| 189 | } | 228 | } |
| 190 | this.shareBuilderView() | 229 | this.shareBuilderView() |
| @@ -3,6 +3,7 @@ import { TrackConstants } from "../common/TrackConstants" | @@ -3,6 +3,7 @@ import { TrackConstants } from "../common/TrackConstants" | ||
| 3 | import { TrackingUtils } from '../common/TrackingUtils' | 3 | import { TrackingUtils } from '../common/TrackingUtils' |
| 4 | import { Tracking } from './Tracking' | 4 | import { Tracking } from './Tracking' |
| 5 | import { PointerMatrix } from '@kit.TestKit' | 5 | import { PointerMatrix } from '@kit.TestKit' |
| 6 | +import { StringUtils } from 'wdKit/Index' | ||
| 6 | 7 | ||
| 7 | export class TrackingContent { | 8 | export class TrackingContent { |
| 8 | 9 | ||
| @@ -86,10 +87,10 @@ export class TrackingContent { | @@ -86,10 +87,10 @@ export class TrackingContent { | ||
| 86 | } | 87 | } |
| 87 | 88 | ||
| 88 | static commentClick(pageId: string, pageName: string, extParams?: ParamType) { | 89 | static commentClick(pageId: string, pageName: string, extParams?: ParamType) { |
| 89 | - TrackingContent.commentClickWithEvent("content_comment_click",pageId,pageName,extParams); | 90 | + TrackingContent.clickWithEventAction("content_comment_click",pageId,pageName,TrackConstants.ActionType.Comment,extParams); |
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | - static commentClickWithEvent(event: string,pageId: string, pageName: string, extParams?: ParamType) { | 93 | + static clickWithEventAction(event: string,pageId: string, pageName: string,action: string, extParams?: ParamType) { |
| 93 | let params = TrackingUtils.generateParams(extParams) | 94 | let params = TrackingUtils.generateParams(extParams) |
| 94 | if (pageId.length) { | 95 | if (pageId.length) { |
| 95 | params["pageId"] = pageId | 96 | params["pageId"] = pageId |
| @@ -97,11 +98,17 @@ export class TrackingContent { | @@ -97,11 +98,17 @@ export class TrackingContent { | ||
| 97 | if (pageName.length) { | 98 | if (pageName.length) { |
| 98 | params["pageName"] = pageName | 99 | params["pageName"] = pageName |
| 99 | } | 100 | } |
| 100 | - params["action"] =TrackConstants.ActionType.Comment | 101 | + if(!StringUtils.isEmpty(action)){ |
| 102 | + params["action"] =action | ||
| 103 | + } | ||
| 101 | TrackingUtils.fillPositionWith(params) | 104 | TrackingUtils.fillPositionWith(params) |
| 102 | Tracking.event(event, params) | 105 | Tracking.event(event, params) |
| 103 | } | 106 | } |
| 104 | 107 | ||
| 108 | + static clickWithEvent(event: string,pageId: string, pageName: string,extParams?: ParamType) { | ||
| 109 | + TrackingContent.clickWithEventAction(event,pageId,pageName,'',extParams); | ||
| 110 | + } | ||
| 111 | + | ||
| 105 | static commentShare(pageId: string, pageName: string, extParams?: ParamType) { | 112 | static commentShare(pageId: string, pageName: string, extParams?: ParamType) { |
| 106 | 113 | ||
| 107 | } | 114 | } |
-
Please register or login to post a comment