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-25 17:28:20 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
c7f34c0f497a258de109fd68f2fbf966760b7fb1
c7f34c0f
2 parents
aa10c475
39de1581
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
292 additions
and
26 deletions
sight_harmony/AppScope/resources/base/element/float.json
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/ChildCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomCommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeAttentionComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/resources/base/element/float.json
sight_harmony/features/wdPlayer/src/main/ets/controller/WDPlayerController.ets
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
sight_harmony/products/phone/src/main/ets/pages/detail/MultiPictureDetailPage.ets
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/AppScope/resources/base/element/float.json
View file @
c7f34c0
...
...
@@ -181,6 +181,10 @@
"value"
:
"40vp"
},
{
"name"
:
"top_tab_bar_height_common"
,
"value"
:
"44vp"
},
{
"name"
:
"top_tab_item_max_width"
,
"value"
:
"300vp"
},
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
c7f34c0
...
...
@@ -16,6 +16,8 @@ import { Card19Component } from './cardview/Card19Component';
import { Card20Component } from './cardview/Card20Component';
import { Card21Component } from './cardview/Card21Component';
import { SearchContentComponent } from './cardview/SearchContentComponent';
import { DateTimeUtils } from 'wdKit/Index';
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
/**
* card适配器,卡片样式汇总,依据ContentDTO#appStyle
...
...
@@ -27,6 +29,20 @@ export struct CardParser {
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
//内容浏览Tracking
onPageHide(): void {
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)
}
build() {
this.contentBuilder(this.contentDTO);
...
...
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
c7f34c0
...
...
@@ -33,6 +33,7 @@ import { HttpUtils } from 'wdNetwork/Index';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { componentUtils, window } from '@kit.ArkUI';
import { TrackConstants, TrackingButton, TrackingContent, TrackingPageBrowse } from 'wdTracking/Index';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
...
...
@@ -62,6 +63,20 @@ export struct ImageAndTextPageComponent {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
//内容浏览Tracking
onPageHide(): void {
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)
}
build() {
Stack({ alignContent: Alignment.Top }) {
...
...
@@ -359,6 +374,8 @@ export struct ImageAndTextPageComponent {
PageRepository.postExecuteLike(params).then(res => {
console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
if (this.newsStatusOfUser) {
//内容点赞、取消点赞Tracking 1点赞 0取消点赞
TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
this.queryContentInteractCount()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card9Component.ets
View file @
c7f34c0
...
...
@@ -6,6 +6,7 @@ import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
import { TrackConstants, TrackingPageBrowse } from 'wdTracking/Index';
/**
* 时间链卡--CompStyle: 09
...
...
@@ -24,6 +25,20 @@ export struct Card9Component {
@State str01: string = '';
@State str02: string = '';
@State str03: string = '';
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
//内容浏览Tracking
onPageHide(): void {
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)
}
async aboutToAppear(): Promise<void> {
console.log('Card9Component', JSON.stringify(this.contentDTO))
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
View file @
c7f34c0
...
...
@@ -17,8 +17,6 @@ export struct CommentCustomDialog {
@State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 }
aboutToAppear(): void {
// this.textInputController.caretPosition(0)
}
publishCommentRequest() {
...
...
@@ -51,12 +49,20 @@ export struct CommentCustomDialog {
controller: this.textInputController,
text: this.publishCommentModel.commentContent
})
.id("textAreaId")
.defaultFocus(true) // 获取默认焦点
.enableKeyboardOnFocus(true)
.height('100%')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.onChange(value => {
this.publishCommentModel.commentContent = value;
})
.onFocus(() => {
if (this.emojiSwitch) {
this.emojiSwitch = false
}
})
}
.backgroundColor('#F9F9F9')
// .width('100%')
...
...
@@ -81,6 +87,7 @@ export struct CommentCustomDialog {
if (this.emojiSwitch) {
this.textInputController.stopEditing()
} else {
focusControl.requestFocus("textAreaId") // 弹起键盘
// this.textInputController.caretPosition(this.textInputController.getTextContentRect().x)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListUI.ets
View file @
c7f34c0
...
...
@@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
import { LazyDataSource, StringUtils } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { EmptyComponent } from '../../view/EmptyComponent';
import { Action } from 'wdBean/Index';
import { Action
, ContentDTO
} from 'wdBean/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { TrackingContent, TrackConstants, TrackParamConvert, ParamType } from 'wdTracking/Index';
import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils';
const TAG = "AppointmentListUI"
...
...
@@ -77,7 +79,9 @@ export struct AppointmentListUI {
AppointmentListChildComponent({ item: item })
}
.onClick(() => {
//TODO 跳转
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live,TrackParamConvert.program(contentDTO))
let action = {
type:"2",
params:{
...
...
@@ -90,6 +94,12 @@ export struct AppointmentListUI {
} as Action
WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
})
.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live, TrackParamConvert.program(contentDTO))
}
})
}, (item: MineAppointmentItem, index: number) => index.toString())
//没有更多数据 显示提示
...
...
@@ -175,4 +185,15 @@ export struct AppointmentListUI {
console.log(TAG, JSON.stringify(dealData))
return dealData
}
}
\ No newline at end of file
}
function getParams(item: MineAppointmentItem) : ContentDTO{
let contentDTO = new ContentDTO();
contentDTO.objectType = item.relType + ""
contentDTO.objectId = item.liveId + ""
contentDTO.newsTitle = item.title
// contentDTO.channelId =
// contentDTO.rmhPlatform
return contentDTO
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/ChildCommentComponent.ets
View file @
c7f34c0
...
...
@@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
import { CommentListItem } from '../../../viewmodel/CommentListItem'
import measure from '@ohos.measure'
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'
@Component
export struct ChildCommentComponent {
...
...
@@ -16,6 +17,7 @@ export struct ChildCommentComponent {
@State isOverLines: boolean = false
@State isOverLinesParent: boolean = false
testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸"
@Link fromPage:number
build() {
Column() {
...
...
@@ -195,11 +197,12 @@ export struct ChildCommentComponent {
}.height('69lpx')
.justifyContent(FlexAlign.Center)
.onClick(() => {
let content = new ContentDTO()
content.objectId = this.data.targetId;
content.relType = this.data.targetRelType + "";
content.relId = this.data.targetRelId;
content.objectType = this.data.targetType + "";
let content = getParams(this.data)
if(this.fromPage === 0 ){
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
}else{
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
}
ProcessUtils.processPage(content)
})
}
...
...
@@ -284,3 +287,20 @@ function textStyle() {
.lineHeight('46lpx')
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/HomePageBottomCommentComponent.ets
View file @
c7f34c0
...
...
@@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent';
import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
const TAG = "HomePageBottomCommentComponent"
...
...
@@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent {
ChildCommentComponent({
data: item,
levelHead: UserDataLocal.getUserLevelHeaderUrl(),
isLastItem: index === this.data_comment.totalCount() - 1
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:0
})
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO))
}
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
...
...
@@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent {
this.isGetRequest = true
})
}
}
\ No newline at end of file
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/mine/home/OtherHomePageBottomCommentComponent.ets
View file @
c7f34c0
...
...
@@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU
import { ChildCommentComponent } from './ChildCommentComponent';
import { EmptyComponent } from '../../view/EmptyComponent';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
const TAG = "HomePageBottomComponent"
/**
...
...
@@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent {
ChildCommentComponent({
data: item,
levelHead: this.levelHead,
isLastItem: index === this.data_comment.totalCount() - 1
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:1
})
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO))
}
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
...
...
@@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent {
this.isGetRequest = true
})
}
}
\ No newline at end of file
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
c7f34c0
...
...
@@ -172,7 +172,8 @@ export struct TopNavigationComponentNew {
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
...
...
@@ -240,7 +241,7 @@ export struct TopNavigationComponentNew {
.width('24vp')
.height('24vp')
}
.height(
'40vp'
)
.height(
$r('app.float.top_tab_bar_height_common')
)
.width('40vp')
.margin({ right: 10 })
.alignItems(VerticalAlign.Center)
...
...
@@ -251,9 +252,9 @@ export struct TopNavigationComponentNew {
'right': { 'anchor': '__container__', 'align': HorizontalAlign.End }
})
.onClick(() => {
TrackingButton.searchClick(
TrackConstants.PageName.Search, "PEOPLE")
TrackingButton.searchClick(TrackConstants.PageName.Search, "PEOPLE")
let params = { 'tabName': "PEOPLE" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
WDRouterRule.jumpWithPage(WDRouterPage.searchPage,
params)
})
List({ scroller: this.listScroller }) {
...
...
@@ -266,9 +267,9 @@ export struct TopNavigationComponentNew {
.listDirection(Axis.Horizontal)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.height($r('app.float.top_tab_bar_height'))
.height($r('app.float.top_tab_bar_height
_common
'))
.backgroundColor(this.barBackgroundColor)
.
padding({ top: 6
})
.
margin({top:10
})
.onAreaChange((oldValue: Area, newValue: Area) => {
let width = Number.parseFloat(newValue.width.toString())
this.tabsWidth = Number.isNaN(width) ? 0 : width
...
...
sight_harmony/features/wdComponent/src/main/ets/components/peopleShipHomePage/PeopleShipHomeAttentionComponent.ets
View file @
c7f34c0
...
...
@@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Button({type: ButtonType.Normal, stateEffect: false } ) {
Stack() {
Image(this.isAttention == '0'? $r('app.media.home_attention_no_left') : $r('app.media.home_attention_left')
)
Row(
)
.width('100%')
.height('100%')
.objectFit(ImageFit.Cover)
.backgroundColor(this.isAttention == '0'? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5'))
.borderRadius("5lpx")
Row() {
if(this.isAttention == '0') {
if(this.isLoadingAttention) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
View file @
c7f34c0
...
...
@@ -10,6 +10,7 @@ import {
postExecuteLikeParams,
batchLikeAndCollectParams,
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
const TAG = 'LikeComponent';
...
...
@@ -30,6 +31,8 @@ export struct LikeComponent {
componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口
styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景
@State likeCount: number = 0 //点赞数
pageParam: ParamType = {}
PageName: string = ''
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
...
...
@@ -50,6 +53,7 @@ export struct LikeComponent {
this.likesStyle = this.contentDetailData.likesStyle
}
this.onDataUpdated()
this.contentTrackingDict()
}
onDataUpdated() {
...
...
@@ -64,6 +68,27 @@ export struct LikeComponent {
}
}
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 // 动态图文/动态视频
}
}
build() {
if (this.componentType == 2) {
...
...
@@ -346,13 +371,16 @@ export struct LikeComponent {
if (this.contentDetailData.liveInfo) {
this.likeStatus = true
this.likeCount++
TrackingContent.like(true,this.PageName,this.PageName,this.pageParam)
} else {
this.likeStatus = !this.likeStatus
//点赞和取消点赞成功后更新点赞数
if (this.likeStatus) {
this.likeCount++
TrackingContent.like(true,this.PageName,this.PageName,this.pageParam)
} else {
this.likeCount--
TrackingContent.like(false,this.PageName,this.PageName,this.pageParam)
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
c7f34c0
...
...
@@ -23,6 +23,7 @@ import { WDShare } from 'wdShare/Index';
import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel'
import { EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { PlayerConstants } from 'wdPlayer'
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
const TAG = 'OperRowListView';
...
...
@@ -91,6 +92,8 @@ export struct OperRowListView {
@State currentStatus: number | string | undefined = 0;
@State name: string = 'audio_recommend_status_wait'
@State dialogController: CustomDialogController | null = null;
pageParam: ParamType = {}
PageName: string = ''
async aboutToAppear() {
console.info(TAG, 'this.needLike', this.needLike)
...
...
@@ -109,6 +112,28 @@ export struct OperRowListView {
}
}
})
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 // 动态图文/动态视频
}
}
async onDetailUpdated() {
...
...
@@ -440,6 +465,9 @@ export struct OperRowListView {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.PageName,this.PageName,this.pageParam)
} else {
TrackingContent.collect(false,this.PageName,this.PageName,this.pageParam)
}
this.queryContentInteractCount()
}
...
...
sight_harmony/features/wdComponent/src/main/resources/base/element/float.json
View file @
c7f34c0
...
...
@@ -181,6 +181,10 @@
"value"
:
"40vp"
},
{
"name"
:
"top_tab_bar_height_common"
,
"value"
:
"44vp"
},
{
"name"
:
"top_tab_item_max_width"
,
"value"
:
"300vp"
},
...
...
sight_harmony/features/wdPlayer/src/main/ets/controller/WDPlayerController.ets
View file @
c7f34c0
...
...
@@ -259,6 +259,11 @@ export class WDPlayerController {
// this.seekTime = value * 1000;
// this.avPlayer?.seek(this.seekTime, media.SeekMode.SEEK_PREV_SYNC);
// }
// 防止seek报错
if (this.avPlayer && PlayerConstants.OPERATE_STATE.indexOf(this.avPlayer?.state) === -1) {
return;
}
if (mode === SliderChangeMode.Moving) {
// this.progressThis.progressVal = value;
// this.progressThis.currentTime = DateFormatUtil.secondToTime(Math.floor(value * this.duration /
...
...
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
View file @
c7f34c0
...
...
@@ -108,7 +108,19 @@ export class TrackingContent {
// 内容下载点击事件 1.图片 2.音频 3.视频
static download(donwloadContentType: number, pageId: string, pageName: string, extParams?: ParamType) {
let params = TrackingUtils.generateParams(extParams)
if (donwloadContentType) {
params["donwloadContentType"] = donwloadContentType
}
if (pageId.length) {
params["pageId"] = pageId
}
if (pageName.length) {
params["pageName"] = pageName
}
params["action"] =TrackConstants.ActionType.Download
TrackingUtils.fillPositionWith(params)
Tracking.event("download_click", params)
}
}
\ No newline at end of file
...
...
sight_harmony/products/phone/src/main/ets/pages/detail/MultiPictureDetailPage.ets
View file @
c7f34c0
import { Logger } from 'wdKit';
import {
DateTimeUtils, NetworkUtil, StringUtils,
Logger } from 'wdKit';
import router from '@ohos.router';
import { Params, Action } from 'wdBean';
import { WindowModel } from 'wdKit/Index';
import { MultiPictureDetailPageComponent } from '../view/MultiPictureDetailPageComponent';
import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index';
const TAG = 'MultiPictureDetailPage';
...
...
@@ -16,6 +17,8 @@ struct MultiPictureDetailPage {
@State relId: string = ''
@State contentId: string = ''
@State relType: string = ''
pageShowTime:number = 0;
pageHideTime:number = 0;
build() {
Row() {
...
...
@@ -68,12 +71,17 @@ struct MultiPictureDetailPage {
onPageShow(): void {
console.log(TAG, 'onPageShow')
this.pageShowTime = DateTimeUtils.getTimeStamp()
this.openFullScreen()
}
onPageHide(): void {
console.log(TAG, 'onPageHide')
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,duration)
this.closeFullScreen()
}
...
...
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
View file @
c7f34c0
...
...
@@ -23,6 +23,7 @@ import { EmptyComponent,
PageRepository,
publishCommentModel,
viewBlogItemInsightIntentShare} from 'wdComponent/Index';
import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
const TAG = 'MultiPictureDetailPageComponent';
/**
...
...
@@ -58,6 +59,9 @@ export struct MultiPictureDetailPageComponent {
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@State currentOffset: number = 0
@State duration: number = 0
pageParam: ParamType = {}
followUserId: string = ''
followUserName: string = ''
//watch监听页码回调
onCurrentPageNumUpdated(): void {
...
...
@@ -88,6 +92,17 @@ export struct MultiPictureDetailPageComponent {
// 无网络
this.netStatus = 1
}
this.contentTrackingDict()
}
contentTrackingDict(){
this.pageParam = {
'contentType': `${this.contentDetailData.newsType}`,
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
this.followUserId = this.contentDetailData?.rmhInfo?.rmhId || ''
this.followUserName = this.contentDetailData?.rmhInfo?.rmhName || ''
}
aboutToDisappear() {
...
...
@@ -426,6 +441,11 @@ export struct MultiPictureDetailPageComponent {
bottom: 24,
right: 18
})
.parallelGesture(
TapGesture()
.onAction((event: GestureEvent) => {
TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
}))
}
}
}
...
...
@@ -560,8 +580,10 @@ export struct MultiPictureDetailPageComponent {
console.log(TAG, '关注号主==', JSON.stringify(res.data))
if (this.followStatus == '1') {
this.followStatus = '0'
TrackingContent.follow(true,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
} else {
this.followStatus = '1'
TrackingContent.follow(false,this.followUserId,this.followUserName,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam)
}
})
}
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
c7f34c0
...
...
@@ -111,6 +111,7 @@ export struct VideoChannelPage {
}, (item: TopNavDTO) => item.channelId + '')
}
.width('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White)
...
...
@@ -136,6 +137,8 @@ export struct VideoChannelPage {
}
.zIndex(20)
.height($r('app.float.top_tab_bar_height_common'))
.margin({top:10})
.visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
...
...
@@ -173,6 +176,7 @@ export struct VideoChannelPage {
.cachedCount(-1)
.displayCount(1, true)
.alignSelf(ItemAlign.Start)
.effectMode(EdgeEffect.None)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
.onChange((index: number) => {
this.currentTopNavSelectedIndex = index
...
...
Please
register
or
login
to post a comment