Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
chengen02
2024-05-28 10:30:19 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
f95c6fcda41211d7e90b871b3c748cefd9de9370
f95c6fcd
2 parents
65a580e4
45dd955a
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
105 additions
and
28 deletions
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/model/PublishCommentModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/viewmodel/CommentViewModel.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePagePersonFunctionUI.ets
sight_harmony/features/wdDetailPlayShortVideo/oh-package.json5
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
f95c6fc
...
...
@@ -601,6 +601,8 @@ export struct DynamicDetailComponent {
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
this.publishCommentModel.pageId = TrackConstants.PageName.DynamicDetail
this.publishCommentModel.pageName = TrackConstants.PageName.DynamicDetail
}
this.operationButtonList = ['comment', 'collect', 'share']
...
...
@@ -680,7 +682,7 @@ export struct DynamicDetailComponent {
//创建跳转信息
makeJumpInfo() {
this.mJumpInfo.pageId =
'dynamicDetailPage'
this.mJumpInfo.pageId =
TrackConstants.PageName.DynamicDetail
this.mJumpInfo.objectId = this.contentDetailData.newsId + ""
this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType + ""
this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId + ""
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperItemComponent.ets
View file @
f95c6fc
...
...
@@ -86,7 +86,7 @@ export struct ENewspaperItemComponent {
} as ContentDTO
ProcessUtils.processPage(content)
//内容点击
TrackingContent.c
ommentC
lickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
TrackingContent.clickWithEvent('current_Number_Panel_content_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'contentName':this.itemBeanClicked.title,
'contentType':this.itemBeanClicked.newsType,
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ENewspaperPageComponent.ets
View file @
f95c6fc
...
...
@@ -36,7 +36,7 @@ export struct ENewspaperPageComponent {
this.swiperIndex = _swiperIndex > 0 ? _swiperIndex - 1 : _swiperIndex
//电子报--版面序号选择点击
TrackingContent.c
ommentC
lickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
TrackingContent.clickWithEvent('panel_number_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
...
...
@@ -61,7 +61,7 @@ export struct ENewspaperPageComponent {
new Date(date.fullYear ? date.fullYear : 0, date.month ? date.month : 0, date.date ? date.date : 0)
}
//日历选择点击
TrackingContent.c
ommentC
lickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
TrackingContent.clickWithEvent('date_selection_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
...
...
@@ -340,7 +340,7 @@ export struct ENewspaperPageComponent {
if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) {
this.isOpenListDialog = true
//电子报--读报纸点击
TrackingContent.c
ommentC
lickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
TrackingContent.clickWithEvent('read_newspaper_click',TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage
,{
'panelNumber':this.newspaperListBean?.list[this.swiperIndex].pageNum,
'panelName':this.newspaperListBean?.list[this.swiperIndex].pageName,
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/MorningEveningPaperComponent.ets
View file @
f95c6fc
...
...
@@ -295,7 +295,7 @@ export struct MorningEveningPaperComponent {
topPaperTitle(){
Column(){
PaperTitleComponent().margin({top:this.topSafeHeight})
}.height(44+this.topSafeHeight).backgroundColor(this.
scrollOffset > 100?this.mixedBgColor:''
)
}.height(44+this.topSafeHeight).backgroundColor(this.
isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor
)
}
@Builder
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/SingleColumn999Component.ets
View file @
f95c6fc
...
...
@@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean';
import { BreakpointConstants } from 'wdConstant';
import { Logger } from 'wdKit';
import { PaperSingleColumn999CardView } from '../page/CardView';
import { EmptyComponent } from '../view/EmptyComponent';
import { EmptyComponent
,WDViewDefaultType
} from '../view/EmptyComponent';
const TAG = 'SingleColumn999Component';
...
...
@@ -153,9 +153,8 @@ export struct SingleColumn999Component {
})
} else {
if (this.compListItem && this.compListItem?.operDataList) {
EmptyComponent({
emptyHeight: 200
})
EmptyComponent({
emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent
})
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/MorningEveningPaper/topicInfoView.ets
View file @
f95c6fc
...
...
@@ -75,7 +75,7 @@ export struct topicInfoView {
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: this.frontLinkObject.linkUrl.length > 0?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom }
})
.margin({ left: 16, right: 16
})
.margin({ left: 16, right: 16
, bottom: this.frontLinkObject.linkUrl.length > 0?0:16
})
.id('txt_summary')
Text(this.frontLinkObject?.title ?? "")
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/model/PublishCommentModel.ets
View file @
f95c6fc
...
...
@@ -41,7 +41,8 @@ export class publishCommentModel {
//最新发布的评论
lastCommentModel: commentItemModel = new commentItemModel()
pageId: string = ''
pageName: string = ''
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
f95c6fc
...
...
@@ -16,7 +16,7 @@ const TAG = 'CommentComponent';
const testString = '因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸'
//评论组件
// @Entry
@Preview
@Component
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/viewmodel/CommentViewModel.ets
View file @
f95c6fc
...
...
@@ -6,6 +6,7 @@ import {
import { HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { TrackConstants, TrackingContent } from 'wdTracking/Index';
import {
commentItemModel,
commentListModel,
...
...
@@ -16,7 +17,7 @@ import {
import { publishCommentModel } from '../model/PublishCommentModel';
const TAG = "CommentViewModel"
//评论model
class CommentViewModel {
private static instance: CommentViewModel
...
...
@@ -166,9 +167,9 @@ class CommentViewModel {
return new Promise<commentItemModel>((success, fail) => {
const visitorMode = model.visitorComment == "1" && HttpUtils.isLogin() == false
let url = visitorMode ? HttpUrlUtils.getNoUserPublishCommentUrl() : HttpUrlUtils.getPublishCommentUrl()
let pageId = model.pageId;
let pageName = model.pageName;
let bean: Record<string, string> = {};
bean['targetId'] = model.targetId;
bean['targetRelId'] = model.targetRelId;
bean['commentType'] = model.commentType;
...
...
@@ -188,6 +189,11 @@ class CommentViewModel {
}
HttpRequest.post<ResponseDTO<commentItemModel>>(url, bean).then((data: ResponseDTO<commentItemModel>) => {
// fixme 埋点 评论发布点击
TrackingContent.commentClick(pageId,pageName
,{
'duration':0,
})
if (data.code != 0) {
ToastUtils.showToast(data.message, 1000);
fail()
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/MinePagePersonFunctionUI.ets
View file @
f95c6fc
...
...
@@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI {
Grid(){
ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{
GridItem(){
PagePersonFunction({ item: item, noDivider : (index %
4 < 3
&& index != this.personalData.length-1) ? false : true})
PagePersonFunction({ item: item, noDivider : (index %
5 < 4
&& index != this.personalData.length-1) ? false : true})
}.onClick(()=>{
console.log(index+"")
switch (item.msg){
...
...
@@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI {
break;
}
}
}).width('1
69
lpx')
}).width('1
42
lpx')
.height('117lpx')
})
}
.rowsTemplate('1fr 1fr')
.columnsTemplate('1fr 1fr 1fr 1fr')
.height('234lpx')
.margin({top:'31lpx',left:'23lpx',right:'23lpx' })
.rowsTemplate('1fr')
.columnsTemplate('1fr 1fr 1fr 1fr 1fr')
.height('117lpx')
.margin({top:'31lpx'})
}
messageClick(){
...
...
sight_harmony/features/wdDetailPlayShortVideo/oh-package.json5
View file @
f95c6fc
...
...
@@ -16,6 +16,7 @@
"wdConstant"
:
"file:../../commons/wdConstant"
,
"wdDetailPlayApi"
:
"file:../../features/wdDetailPlayApi"
,
"wdComponent"
:
"file:../../features/wdComponent"
,
"wdShare"
:
"file:../../features/wdShare"
"wdShare"
:
"file:../../features/wdShare"
,
"wdTracking"
:
"file:../../features/wdTracking"
}
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/DetailVideoListPage.ets
View file @
f95c6fc
...
...
@@ -8,6 +8,8 @@ import { contentListParams } from 'wdDetailPlayApi/src/main/ets/request/ContentD
import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
import { EmptyComponent } from 'wdComponent/Index';
import { DateTimeUtils } from 'wdKit/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
const storage = LocalStorage.getShared();
const TAG = 'DetailVideoListPage'
...
...
@@ -33,6 +35,8 @@ export struct DetailVideoListPage {
@State currentIndex: number = 0
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State interactDataList: InteractDataDTO[] = []
pageShowTime:number = 0;
pageHideTime:number = 0;
async aboutToAppear(): Promise<void> {
// 注册监听网络连接
...
...
@@ -70,12 +74,18 @@ export struct DetailVideoListPage {
this.switchVideoStatus = true
this.openFullScreen()
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide(): void {
console.log(TAG, 'onPageHide')
this.switchVideoStatus = false
this.closeFullScreen()
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration)
}
/**
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/pages/VideoChannelDetail.ets
View file @
f95c6fc
...
...
@@ -14,6 +14,8 @@ import { PictureLoading } from './PictureLoading';
import { DisplayDirection } from 'wdConstant/Index';
import { window } from '@kit.ArkUI';
import { EmptyComponent, WDViewDefaultType } from 'wdComponent/Index';
import { DateTimeUtils } from 'wdKit/Index';
import {TrackConstants,TrackingPageBrowse } from 'wdTracking/Index';
interface loadMoreData {
pageNum: number;
...
...
@@ -59,6 +61,8 @@ export struct VideoChannelDetail {
@State totalCount: number = 0
@State isMouted: boolean = false
@State isRequestError: boolean = false
pageShowTime:number = 0;
pageHideTime:number = 0;
autoRefreshChange() {
if (this.topNavIndex === 0) {
...
...
@@ -78,12 +82,21 @@ export struct VideoChannelDetail {
this.switchVideoStatus = true
this.openFullScreen()
}
this.pageShowTime = DateTimeUtils.getTimeStamp()
console.log(TAG, '一级视频显示')
}
pageHideChange() {
this.barBackgroundColor = Color.Transparent
this.switchVideoStatus = false
this.closeFullScreen()
console.log(TAG, '一级视频隐藏')
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,duration)
}
/**
...
...
@@ -255,7 +268,6 @@ export struct VideoChannelDetail {
})
}
}
build() {
Column() {
if (this.isRequestError) {
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
View file @
f95c6fc
...
...
@@ -14,6 +14,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { DisplayDirection, SpConstants } from 'wdConstant/Index'
import { WDShare } from "wdShare"
import { publishCommentModel } from 'wdComponent/Index';
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
interface ILikeStyleResp {
url: Resource;
...
...
@@ -37,16 +38,44 @@ export struct PlayerRightView {
@Consume showCommentList: boolean
@Consume displayDirection: DisplayDirection
@Consume publishCommentModel: publishCommentModel
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
//
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@State likesStyle: number | string = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
pageParam: ParamType = {}
PageName: string = ''
followUserId: string = ''
followUserName: string = ''
aboutToAppear() {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
// console.log(TAG, 'this.likesStyle', this.likesStyle)
// console.log(TAG, 'this.openLikes', this.openLikes)
this.contentTrackingDict()
}
contentTrackingDict(){
this.pageParam = {
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if(this.contentDetailData.newsType == 1) {
this.PageName = TrackConstants.PageName.VideoDetail // 点播
} else if(this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
} else if(this.contentDetailData.newsType == 5) {
this.PageName = TrackConstants.PageName.Summary_Detail // 专题详情页
} else if(this.contentDetailData.newsType == 8) {
this.PageName = TrackConstants.PageName.Article_Detail // 图文详情页
} else if(this.contentDetailData.newsType == 9) {
this.PageName = TrackConstants.PageName.Atlas_Detail // 图集详情页
} else if(this.contentDetailData.newsType == 14 || this.contentDetailData.newsType == 15) {
this.PageName = TrackConstants.PageName.DynamicDetail // 动态图文/动态视频
}
this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || ''
this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || ''
}
/**
* 点赞、取消点赞
*/
...
...
@@ -76,8 +105,12 @@ export struct PlayerRightView {
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
if (this.newsStatusOfUser.likeStatus == '1') {
this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1
TrackingContent.like(true,this.PageName,this.PageName,this.pageParam)
console.log(TAG, '点赞')
} else {
this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1)
TrackingContent.like(false,this.PageName,this.PageName,this.pageParam)
console.log(TAG, '取消点赞')
}
console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
// this.queryContentInteractCount()
...
...
@@ -112,8 +145,12 @@ export struct PlayerRightView {
// this.queryContentInteractCount()
if (this.newsStatusOfUser.collectStatus === 1) {
this.interactData.collectNum = Number(this.interactData.collectNum || 0) + 1
TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam)
console.log(TAG, '收藏')
} else {
this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1)
TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam)
console.log(TAG, '取消收藏')
}
console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum)
}
...
...
@@ -175,6 +212,8 @@ export struct PlayerRightView {
ToastUtils.showToast(res.data.ruleName + '+' + res.data.rulePoint + '积分', 1000);
}
})
console.log(TAG, '关注号主')
TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
}
})
}
...
...
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
View file @
f95c6fc
...
...
@@ -3,6 +3,7 @@ import { TrackConstants } from "../common/TrackConstants"
import { TrackingUtils } from '../common/TrackingUtils'
import { Tracking } from './Tracking'
import { PointerMatrix } from '@kit.TestKit'
import { StringUtils } from 'wdKit/Index'
export class TrackingContent {
...
...
@@ -86,10 +87,10 @@ export class TrackingContent {
}
static commentClick(pageId: string, pageName: string, extParams?: ParamType) {
TrackingContent.c
ommentClickWithEvent("content_comment_click",pageId,pageName
,extParams);
TrackingContent.c
lickWithEventAction("content_comment_click",pageId,pageName,TrackConstants.ActionType.Comment
,extParams);
}
static c
ommentClickWithEvent(event: string,pageId: string, pageName
: string, extParams?: ParamType) {
static c
lickWithEventAction(event: string,pageId: string, pageName: string,action
: string, extParams?: ParamType) {
let params = TrackingUtils.generateParams(extParams)
if (pageId.length) {
params["pageId"] = pageId
...
...
@@ -97,11 +98,17 @@ export class TrackingContent {
if (pageName.length) {
params["pageName"] = pageName
}
params["action"] =TrackConstants.ActionType.Comment
if(!StringUtils.isEmpty(action)){
params["action"] =action
}
TrackingUtils.fillPositionWith(params)
Tracking.event(event, params)
}
static clickWithEvent(event: string,pageId: string, pageName: string,extParams?: ParamType) {
TrackingContent.clickWithEventAction(event,pageId,pageName,'',extParams);
}
static commentShare(pageId: string, pageName: string, extParams?: ParamType) {
}
...
...
Please
register
or
login
to post a comment