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
陈剑华
2024-05-28 10:45:56 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
65ed96340f54278c1c40cc1ccc64f64ef19b3ff6
65ed9634
2 parents
a88aff1b
88a10a34
Merge remote-tracking branch 'origin/main'
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
172 additions
and
50 deletions
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
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/SpacialTopicPageComponent.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/view/CommentCustomDialog.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/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.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/PlayerCommentView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
sight_harmony/commons/wdRouter/src/main/ets/utils/ProcessUtils.ets
View file @
65ed963
...
...
@@ -203,6 +203,7 @@ export class ProcessUtils {
relType: content?.relType,
relId: content?.relId,
channelId: content?.channelId,
pageId: content?.pageId
} as ExtraDTO
} as Params,
};
...
...
sight_harmony/features/wdBean/src/main/ets/bean/component/extra/ExtraDTO.ts
View file @
65ed963
...
...
@@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO {
topicId
:
string
;
channelId
:
string
;
compId
:
string
;
pageId
:
string
;
sourcePage
:
string
;
relId
:
string
;
relType
:
string
;
...
...
sight_harmony/features/wdBean/src/main/ets/bean/content/Params.ts
View file @
65ed963
...
...
@@ -25,5 +25,6 @@ export interface Params {
creatorId
?:
string
;
//号主id
videoUrl
?:
string
;
videoCoverUrl
?:
string
;
pageId
?:
string
;
backVisibility
?:
boolean
;
//展示顶部返回栏
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -32,9 +32,9 @@ export struct topicInfoView {
})
.id('img_cover')
if (this.frontLinkObject) {
if (this.frontLinkObject
.linkUrl.length > 0
) {
Row() {
Text(
this.frontLinkObject.linkUrl.length > 0?"查看详情":''
)
Text(
"查看详情"
)
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(1)
...
...
@@ -50,14 +50,14 @@ export struct topicInfoView {
.margin({ top: 8, left: 16, right: 16, bottom: 16 })
.borderRadius(2)
.onClick(()=>{
if (this.frontLinkObject.linkUrl.length === 0) return
let contentDTO :ContentDTO = new ContentDTO();
contentDTO.objectType = this.frontLinkObject?.newsType.toString()
contentDTO.objectId = this.frontLinkObject?.newsId
contentDTO.linkUrl = this.frontLinkObject?.linkUrl
ProcessUtils.processPage(contentDTO)
}).width(80)
})
.width(80)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
...
...
@@ -73,9 +73,9 @@ export struct topicInfoView {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom:
{ anchor: "row_detail", align: VerticalAlign.Top
}
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/SpacialTopicPageComponent.ets
View file @
65ed963
...
...
@@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent';
import { NetworkUtil, WindowModel } from 'wdKit';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
const TAG: string = 'SpacialTopicPageComponent'
...
...
@@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent {
private async getDetail() {
this.isNetConnected = NetworkUtil.isNetConnected()
let contentId: string = ''
let relId: string = ''
let relType: string = ''
...
...
@@ -74,11 +74,14 @@ export struct SpacialTopicPageComponent {
if (this.action.params.extra.relType) {
relType = this.action.params.extra.relType
}
}
let pageId = this.action.params.extra?.pageId
console.log('pageIdpageId',pageId)
if(pageId){
let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId)
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans[0];
if (detailBeans?.length > 0) {
this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0]));
this.viewBlogInsightIntentShare()
// if (this.contentDetailData[0]?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
...
...
@@ -92,6 +95,11 @@ export struct SpacialTopicPageComponent {
// }
this.trySendData2H5()
}
if(pageInfoMsg && pageInfoMsg.data){
this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag)
this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag)
}
}
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/model/PublishCommentModel.ets
View file @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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/view/CommentCustomDialog.ets
View file @
65ed963
...
...
@@ -4,14 +4,25 @@ import { commentItemModel } from '../model/CommentModel'
import { publishCommentModel } from '../model/PublishCommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
export interface CommentDialogInputContent {
comment?: string
imageUrl?: string
}
/// 评论输入框
@Preview
@CustomDialog
export struct CommentCustomDialog {
@ObjectLink publishCommentModel: publishCommentModel
controller?: CustomDialogController
confirm: (value: Record<string, string>) => void = () => {
}
// 发布按钮点击事件。如果上层传了该值,切返回了true,表示上层已处理,则 confirm 回调不生效
// 可以用这里在上层做埋点
onPublishBtnClick?: (content: CommentDialogInputContent) => boolean
// confirm 表示内部处理调用 内容评论接口 发布了评论并成功,上层只需要 通过 publishCommentModel.lastCommentModel 即可获取最新已提交的评论
confirm?: (value: Record<string, string>) => void
@State private emojiSwitch: boolean = false
textInputController: TextAreaController = new TextAreaController()
@State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 }
...
...
@@ -21,6 +32,13 @@ export struct CommentCustomDialog {
}
publishCommentRequest() {
if (this.onPublishBtnClick) {
let content: CommentDialogInputContent = { comment: this.publishCommentModel.commentContent }
if (this.onPublishBtnClick(content)) {
return
}
}
let bean: Record<string, string> = {};
// this.publishCommentModel.commentContent = this.commentText
//TODO 判断类型
...
...
@@ -34,7 +52,9 @@ export struct CommentCustomDialog {
if (this.controller != null) {
this.controller.close()
}
if (this.confirm) {
this.confirm(bean)
}
}).catch(() => {
if (this.controller != null) {
this.controller.close()
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/viewmodel/CommentViewModel.ets
View file @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
View file @
65ed963
...
...
@@ -2,7 +2,7 @@ import { AppointmentListChildComponent } from './AppointmentListChildComponent';
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
import { ListHasNoMoreDataUI } from '../../reusable/ListHasNoMoreDataUI';
import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
import { LazyDataSource, StringUtils } from 'wdKit';
import { LazyDataSource,
NetworkUtil,
StringUtils } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { EmptyComponent } from '../../view/EmptyComponent';
import { Action, ContentDTO } from 'wdBean/Index';
...
...
@@ -23,6 +23,7 @@ export struct AppointmentListUI {
curPageNum: number = 1;
@State isGetRequest: boolean = false
private scroller: Scroller = new Scroller();
@State isConnectNetwork : boolean = NetworkUtil.isNetConnected()
aboutToAppear() {
this.getNewPageData()
...
...
@@ -34,13 +35,29 @@ export struct AppointmentListUI {
CustomTitleUI({ titleName: "我的预约" })
if (this.count == 0) {
if (this.isGetRequest == true) {
if(this.isConnectNetwork){
EmptyComponent({ emptyType: 10 })
.height('100%')
.width('100%')
}
}else{
EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => {
this.isConnectNetwork = NetworkUtil.isNetConnected()
if(this.isConnectNetwork){
this.curPageNum = 1;
this.hasMore = true
this.isGetRequest = false
this.data.clear()
if (!this.isLoading) {
this.getNewPageData()
}
}
},})
.layoutWeight(1)
.width('100%')
}
}
} else {
CustomPullToRefresh({
alldata:this.data,
scroller:this.scroller,
...
...
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
View file @
65ed963
...
...
@@ -62,8 +62,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
commentCount: _item?.interactData?.commentNum || 0,
favorites: _item?.interactData?.collectNum || 0,
viewCount: _item?.interactData?.readNum || 0,
rankingHint: 99,
isPublicData: true
rankingHint: 99
}
}
insightIntentArray.push(viewBlogInsightIntentItem)
...
...
@@ -113,8 +112,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
forwardCount: interactData?.shareNum || 0,
commentCount: interactData?.commentNum || 0,
favorites: interactData?.collectNum || 0,
rankingHint: 99,
isPublicData: true
rankingHint: 99
}
}
...
...
@@ -147,8 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
activityType: ['RecentViews'],
columnTitle: pageInfoBean?.topicInfo?.title,
columnSubTitle: pageInfoBean?.shareSummary,
rankingHint: 99,
isPublicData: true
rankingHint: 99
}
}
console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewColumInsightIntentItem))
...
...
sight_harmony/features/wdDetailPlayShortVideo/oh-package.json5
View file @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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 @
65ed963
...
...
@@ -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/PlayerCommentView.ets
View file @
65ed963
...
...
@@ -18,7 +18,7 @@ export struct PlayerCommentView {
router.back();
})
if (this.contentDetailData.openComment ==
=
1) {
if (this.contentDetailData.openComment == 1) {
TextInput({ placeholder: '说两句...', text: this.comment })
.placeholderColor('#999999')
.placeholderFont({ size: 14 })
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
View file @
65ed963
...
...
@@ -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)
}
})
}
...
...
@@ -184,7 +223,7 @@ export struct PlayerRightView {
this.userBuilderView()
this.likeBuilderView()
this.collectBuilderView()
if (this.contentDetailData.openComment ==
=
1) {
if (this.contentDetailData.openComment == 1) {
this.commentBuilderView()
}
this.shareBuilderView()
...
...
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
View file @
65ed963
...
...
@@ -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