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-31 15:14:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b0476d2e39b7b90b19dbd8bd7b9b8d79e9ad99b5
b0476d2e
1 parent
1027b49f
互动组件@Consume pageName: string @Consume pageId: string
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
64 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveLikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
View file @
b0476d2
...
...
@@ -7,6 +7,7 @@ import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailView
import { SpConstants } from 'wdConstant/Index';
import { WDShare } from 'wdShare/Index';
import { LikeComponent } from './view/LikeComponent'
import { TrackConstants } from 'wdTracking/Index';
const TAG = 'CarderInteraction'
...
...
@@ -22,6 +23,8 @@ export struct CarderInteraction {
@State likeBean: Record<string, string> = {}
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@Provide pageName: string = TrackConstants.PageName.DynamicDetail
@Provide pageId: string = TrackConstants.PageName.DynamicDetail
async aboutToAppear() {
await this.getContentDetailData()
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
View file @
b0476d2
...
...
@@ -33,7 +33,8 @@ export struct LikeComponent {
styleType: number = 1 //1: 白色背景(图文底部栏) 2: 黑色背景(图集底部栏) 3 透明背景
@State likeCount: number = 0 //点赞数
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
...
...
@@ -81,19 +82,6 @@ export struct LikeComponent {
'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() {
...
...
@@ -378,16 +366,16 @@ export struct LikeComponent {
if (this.contentDetailData.liveInfo) {
this.likeStatus = true
this.likeCount++
TrackingContent.like(true,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.like(true,this.
pageId,this.p
ageName,this.pageParam)
} else {
this.likeStatus = !this.likeStatus
//点赞和取消点赞成功后更新点赞数
if (this.likeStatus) {
this.likeCount++
TrackingContent.like(true,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.like(true,this.
pageId,this.p
ageName,this.pageParam)
} else {
this.likeCount--
TrackingContent.like(false,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.like(false,this.
pageId,this.p
ageName,this.pageParam)
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveLikeComponent.ets
View file @
b0476d2
...
...
@@ -29,7 +29,6 @@ export struct LiveLikeComponent {
@State likeCount: number = 0 //点赞数
@State likeBean: Record<string, string> = {}
pageParam: ParamType = {}
PageName: string = ''
//上层传值 样例
// this.data['contentId'] = '30035444649' //必须
...
...
@@ -66,9 +65,6 @@ export struct LiveLikeComponent {
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if (this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
}
}
build() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
View file @
b0476d2
...
...
@@ -64,7 +64,8 @@ export struct LiveOperRowListView {
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State dialogController: CustomDialogController | null = null;
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
@State likesStyle: number | string = "love" // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
...
...
@@ -88,9 +89,6 @@ export struct LiveOperRowListView {
'contentId': `${this.contentDetailData.newsId}`,
'contentName': `${this.contentDetailData.newsTitle || ''}`,
}
if(this.contentDetailData.newsType == 2) {
this.PageName = TrackConstants.PageName.Live_Detail // 直播
}
}
async onDetailUpdated() {
...
...
@@ -425,9 +423,9 @@ export struct LiveOperRowListView {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
promptAction.showToast({ message: '收藏成功' })
TrackingContent.collect(true,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.collect(true,this.
pageId,this.p
ageName,this.pageParam)
} else {
TrackingContent.collect(false,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.collect(false,this.
pageId,this.p
ageName,this.pageParam)
}
this.queryContentInteractCount()
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
b0476d2
...
...
@@ -89,7 +89,8 @@ export struct OperRowListView {
@State name: string = 'audio_recommend_status_wait'
@State dialogController: CustomDialogController | null = null;
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
...
...
@@ -119,19 +120,6 @@ export struct OperRowListView {
'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() {
...
...
@@ -376,7 +364,7 @@ export struct OperRowListView {
TapGesture()
.onAction((event: GestureEvent) => {
this.AudioSuspension.setPlayerUrl(this.audioUrl, this.audioTitle)
TrackingButton.click('suspendedWindow',this.
PageName,this.P
ageName)
TrackingButton.click('suspendedWindow',this.
pageId,this.p
ageName)
}))
}
.height(36)
...
...
@@ -473,9 +461,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.P
ageName,this.pageParam)
TrackingContent.collect(true,this.
pageId,this.p
ageName,this.pageParam)
} else {
TrackingContent.collect(false,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.collect(false,this.
pageId,this.p
ageName,this.pageParam)
}
this.queryContentInteractCount()
}
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/PlayerRightView.ets
View file @
b0476d2
...
...
@@ -41,7 +41,8 @@ export struct PlayerRightView {
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
pageParam: ParamType = {}
PageName: string = ''
@Consume pageName: string
@Consume pageId: string
followUserId: string = ''
followUserName: string = ''
...
...
@@ -59,19 +60,6 @@ export struct PlayerRightView {
'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 || ''
}
...
...
@@ -104,11 +92,11 @@ 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.P
ageName,this.pageParam)
TrackingContent.like(true,this.
pageId,this.p
ageName,this.pageParam)
console.log(TAG, '点赞')
} else {
this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1)
TrackingContent.like(false,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.like(false,this.
pageId,this.p
ageName,this.pageParam)
console.log(TAG, '取消点赞')
}
console.log(TAG, '点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactData?.likeNum)
...
...
@@ -144,11 +132,11 @@ 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.P
ageName,this.pageParam)
TrackingContent.collect(true,this.
pageId,this.p
ageName,this.pageParam)
console.log(TAG, '收藏')
} else {
this.interactData.collectNum = Math.max(0, Number(this.interactData.collectNum || 0) - 1)
TrackingContent.collect(false,this.
PageName,this.P
ageName,this.pageParam)
TrackingContent.collect(false,this.
pageId,this.p
ageName,this.pageParam)
console.log(TAG, '取消收藏')
}
console.log(TAG, '收藏、取消收藏==', this.newsStatusOfUser?.collectStatus, this.interactData?.collectNum)
...
...
@@ -212,7 +200,7 @@ export struct PlayerRightView {
}
})
console.log(TAG, '关注号主')
TrackingContent.follow(true,this.followUserId,this.followUserName,
TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail
,this.pageParam)
TrackingContent.follow(true,this.followUserId,this.followUserName,
this.pageId,this.pageName
,this.pageParam)
}
})
}
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
b0476d2
...
...
@@ -179,7 +179,9 @@ export struct VideoChannelPage {
pageId: item.pageId + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh
}).margin({ top: 40 })
})
.margin({ top: 40 })
.backgroundColor(Color.White)
}
}, (item: TopNavDTO) => item.channelId + '')
}
...
...
Please
register
or
login
to post a comment