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
yuzhilin
2024-07-05 16:15:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a3cdab9c5ace399679fb285bebf03da53a4ed357
a3cdab9c
1 parent
8542a3ad
增加意图上报白名单
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
sight_harmony/features/wdComponent/src/main/ets/utils/InsightIntentShare.ets
View file @
a3cdab9
...
...
@@ -20,6 +20,9 @@ export const enum ActionMode {
EXECUTED = 'EXECUTED',
}
// 上报节目类型白名单
const shareWhiteist = ['1', '2', '5', '8', '9', '14', '15'] //跳转类型:0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 */
//ViewBlog意图共享-频道列表
export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string,
compList: CompDTO[] | CompList[], actionMode: ActionMode) {
...
...
@@ -29,7 +32,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
if (compList?.length > 0) {
compList?.forEach((comp: CompDTO | CompList) => {
comp.operDataList.forEach((item: ContentDTO) => {
console.log('zzzz',JSON.stringify(item))
if (shareWhiteist.indexOf(item.objectType) > -1) {
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
...
...
@@ -44,20 +47,20 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
},
intentEntityInfo: {
entityName: 'Blog',
entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '',
//必传
entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '',
//必传
displayName: item?.newsTitle || '', //必传
entityGroupId, //channelId
logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
metadataModificationTime: Number(item?.publishTime) || 0,
//int
metadataModificationTime: Number(item?.publishTime) || 0,
//int
blogTitle: item?.newsTitle,
blogType: 'Normal',
blogCategory: entityGroupId === '2001' ? '推荐' : '热点',
categoryDisplayName: item.newsTitle,//卡片上的主标题
description: item?.newsSummary || '',//必传
categoryDisplayName: item.newsTitle, //卡片上的主标题
description: item?.newsSummary || '', //必传
blogSubTitle: item?.newsSummary.length > 20 ?
item?.newsSummary.substring(0, 20) : item?.newsSummary,
blogAuthor: item?.source,
blogPublishTime: item?.publishTime,
//string
blogPublishTime: item?.publishTime,
//string
tag: item?.newTags.split(','),
likeCount: item?.interactData?.likeNum || 0,
forwardCount: item?.interactData?.shareNum || 0,
...
...
@@ -68,8 +71,8 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
}
}
insightIntentArray.push(viewBlogInsightIntentItem)
}
})
})
console.log('yzl', JSON.stringify(insightIntentArray[0]))
// 共享数据
...
...
@@ -86,7 +89,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO,
interactData?: InteractDataDTO) {
let identifier = generateUUID()
console.log('zzzz',JSON.stringify(item))
console.log('zzzz',
JSON.stringify(item))
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
...
...
@@ -99,7 +102,8 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
entityId: `objectId=${item?.newsId}&objectType=${item?.newsType}` || '',
displayName: item?.newsTitle || '',
entityGroupId: String(item?.reLInfo?.channelId), //channelId
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url :
item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
metadataModificationTime: new Date(item.publishTime).getTime() || 0,
blogTitle: item?.newsTitle,
blogType: 'Normal',
...
...
@@ -107,7 +111,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
categoryDisplayName: item.newsTitle || '',
blogSubTitle: item?.newsSummary.length > 20 ?
item?.newsSummary.substring(0, 20) : item?.newsSummary,
description: item?.newsSummary || '',//必传
description: item?.newsSummary || '',
//必传
blogAuthor: item?.newsSourceName,
blogPublishTime: `${new Date(item.publishTime).getTime()}` || '',
tag: item?.newsTags.split(','),
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
View file @
a3cdab9
...
...
@@ -463,7 +463,7 @@ export class PageHelper {
// 刷新,替换所有数据
this.resetInteract(data, pageModel.compList)
if (pageModel?.channelId === '2001' || pageModel?.channelId === '2002') {
//
早晚报意图上报
//
首页节目将来时意图上报,只上报热点和推荐频道下的节目
let context = getContext(this) as common.UIAbilityContext;
viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED)
}
...
...
Please
register
or
login
to post a comment