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
liyubing
2024-05-30 16:04:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
86df6276435cc8f621eff78fdd9bb120d461fb29
86df6276
1 parent
19c74153
feat:直播详情页面,预约和取消预约埋点
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
5 deletions
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/LiveCountdownComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabComponent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/LiveCountdownComponent.ets
View file @
86df627
...
...
@@ -4,6 +4,7 @@ import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index'
import { LiveViewModel } from '../../viewModel/LiveViewModel'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'
@Component
export struct LiveCountdownComponent {
...
...
@@ -19,6 +20,7 @@ export struct LiveCountdownComponent {
//是否预约过直播
@State isAppointmentLive: boolean = false
liveViewModel: LiveViewModel = new LiveViewModel()
pageParam: ParamType = {}
aboutToAppear(): void {
//注册字体
...
...
@@ -30,6 +32,15 @@ export struct LiveCountdownComponent {
this.textTimerController.start()
}, 0)
this.updateData()
this.contentTrackingDict()
}
contentTrackingDict() {
this.pageParam = {
'contentType': `${this.liveDetailsBean.newsType}`,
'contentId': `${this.liveDetailsBean.newsId}`,
'contentName': `${this.liveDetailsBean.newsTitle || ''}`,
}
}
build() {
...
...
@@ -141,7 +152,7 @@ export struct LiveCountdownComponent {
}
//2024-04-01 19:44:00-trim->2024-04-0119:44:00
if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) {
let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime
+
''
let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime
+
''
this.month = Number(playStartTimeTmp.substring(5, 7)).toString()
this.day = playStartTimeTmp.substring(8, 10)
this.hour = playStartTimeTmp.substring(11, 13)
...
...
@@ -152,7 +163,7 @@ export struct LiveCountdownComponent {
getLiveAppointmentStatus() {
this.liveViewModel.getLiveAppointmentStatus(
this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '',
this.liveDetailsBean.newsId
+
''
this.liveDetailsBean.newsId
+
''
).then(
(data) => {
this.isAppointmentLive = data
...
...
@@ -165,15 +176,19 @@ export struct LiveCountdownComponent {
liveAppointment() {
this.liveViewModel.liveAppointment(
this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '',
this.liveDetailsBean.newsId
+
'',
this.liveDetailsBean.newsId
+
'',
!this.isAppointmentLive).then(
(data) => {
if (data.success) {
this.isAppointmentLive = !this.isAppointmentLive
if (this.isAppointmentLive) {
ToastUtils.showToast('预约成功', 1000)
TrackingContent.subscribeClick(true, TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail, this.pageParam)
} else {
ToastUtils.showToast('取消预约成功', 1000)
TrackingContent.subscribeClick(false, TrackConstants.PageName.Live_Detail,
TrackConstants.PageName.Live_Detail, this.pageParam)
}
}
},
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/TabComponent.ets
View file @
86df627
...
...
@@ -34,7 +34,6 @@ export struct TabComponent {
build() {
Column() {
// 页签
Row() {
Scroll() {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/widgets/details/video/TopPlayComponet.ets
View file @
86df627
...
...
@@ -36,11 +36,11 @@ export struct TopPlayComponent {
aboutToAppear(): void {
if (this.playerController) {
this.playerController.onCanplay = () => {
this.isCanPlay = true
this.isLoading = true
this.playerController?.play()
}
this.playerController.onStatusChange = (status: number) => {
...
...
sight_harmony/features/wdTracking/src/main/ets/tracking/TrackingContent.ets
View file @
86df627
...
...
@@ -113,6 +113,29 @@ export class TrackingContent {
}
/**
* 直播预约埋点
* @param isSubscribeFlag
* @param pageId
* @param pageName
* @param extParams
*/
static subscribeClick(isSubscribeFlag:boolean ,pageId: string, pageName: string,extParams?: ParamType){
let params = TrackingUtils.generateParams(extParams)
if (pageId.length) {
params["pageId"] = pageId
}
if (pageName.length) {
params["pageName"] = pageName
}
let event = isSubscribeFlag?'live_subscribe_click':'cancel_live_subscribe_click'
TrackingUtils.fillPositionWith(params)
Tracking.event(event, params)
}
// 内容下载点击事件 1.图片 2.音频 3.视频
static download(donwloadContentType: number, pageId: string, pageName: string, extParams?: ParamType) {
let params = TrackingUtils.generateParams(extParams)
...
...
Please
register
or
login
to post a comment