Showing
2 changed files
with
15 additions
and
11 deletions
| @@ -20,6 +20,9 @@ export const enum ActionMode { | @@ -20,6 +20,9 @@ export const enum ActionMode { | ||
| 20 | EXECUTED = 'EXECUTED', | 20 | EXECUTED = 'EXECUTED', |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | +// 上报节目类型白名单 | ||
| 24 | +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动态视频 */ | ||
| 25 | + | ||
| 23 | //ViewBlog意图共享-频道列表 | 26 | //ViewBlog意图共享-频道列表 |
| 24 | export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string, | 27 | export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string, |
| 25 | compList: CompDTO[] | CompList[], actionMode: ActionMode) { | 28 | compList: CompDTO[] | CompList[], actionMode: ActionMode) { |
| @@ -29,7 +32,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -29,7 +32,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 29 | if (compList?.length > 0) { | 32 | if (compList?.length > 0) { |
| 30 | compList?.forEach((comp: CompDTO | CompList) => { | 33 | compList?.forEach((comp: CompDTO | CompList) => { |
| 31 | comp.operDataList.forEach((item: ContentDTO) => { | 34 | comp.operDataList.forEach((item: ContentDTO) => { |
| 32 | - console.log('zzzz',JSON.stringify(item)) | 35 | + if (shareWhiteist.indexOf(item.objectType) > -1) { |
| 33 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | 36 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { |
| 34 | intentName: 'ViewBlog', | 37 | intentName: 'ViewBlog', |
| 35 | intentVersion: '1.0.1', | 38 | intentVersion: '1.0.1', |
| @@ -44,20 +47,20 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -44,20 +47,20 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 44 | }, | 47 | }, |
| 45 | intentEntityInfo: { | 48 | intentEntityInfo: { |
| 46 | entityName: 'Blog', | 49 | entityName: 'Blog', |
| 47 | - entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '',//必传 | 50 | + entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '', //必传 |
| 48 | displayName: item?.newsTitle || '', //必传 | 51 | displayName: item?.newsTitle || '', //必传 |
| 49 | entityGroupId, //channelId | 52 | entityGroupId, //channelId |
| 50 | logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', | 53 | logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', |
| 51 | - metadataModificationTime: Number(item?.publishTime) || 0,//int | 54 | + metadataModificationTime: Number(item?.publishTime) || 0, //int |
| 52 | blogTitle: item?.newsTitle, | 55 | blogTitle: item?.newsTitle, |
| 53 | blogType: 'Normal', | 56 | blogType: 'Normal', |
| 54 | blogCategory: entityGroupId === '2001' ? '推荐' : '热点', | 57 | blogCategory: entityGroupId === '2001' ? '推荐' : '热点', |
| 55 | - categoryDisplayName: item.newsTitle,//卡片上的主标题 | ||
| 56 | - description: item?.newsSummary || '',//必传 | 58 | + categoryDisplayName: item.newsTitle, //卡片上的主标题 |
| 59 | + description: item?.newsSummary || '', //必传 | ||
| 57 | blogSubTitle: item?.newsSummary.length > 20 ? | 60 | blogSubTitle: item?.newsSummary.length > 20 ? |
| 58 | item?.newsSummary.substring(0, 20) : item?.newsSummary, | 61 | item?.newsSummary.substring(0, 20) : item?.newsSummary, |
| 59 | blogAuthor: item?.source, | 62 | blogAuthor: item?.source, |
| 60 | - blogPublishTime: item?.publishTime,//string | 63 | + blogPublishTime: item?.publishTime, //string |
| 61 | tag: item?.newTags.split(','), | 64 | tag: item?.newTags.split(','), |
| 62 | likeCount: item?.interactData?.likeNum || 0, | 65 | likeCount: item?.interactData?.likeNum || 0, |
| 63 | forwardCount: item?.interactData?.shareNum || 0, | 66 | forwardCount: item?.interactData?.shareNum || 0, |
| @@ -68,8 +71,8 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -68,8 +71,8 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 68 | } | 71 | } |
| 69 | } | 72 | } |
| 70 | insightIntentArray.push(viewBlogInsightIntentItem) | 73 | insightIntentArray.push(viewBlogInsightIntentItem) |
| 74 | + } | ||
| 71 | }) | 75 | }) |
| 72 | - | ||
| 73 | }) | 76 | }) |
| 74 | console.log('yzl', JSON.stringify(insightIntentArray[0])) | 77 | console.log('yzl', JSON.stringify(insightIntentArray[0])) |
| 75 | // 共享数据 | 78 | // 共享数据 |
| @@ -86,7 +89,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -86,7 +89,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 86 | export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO, | 89 | export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO, |
| 87 | interactData?: InteractDataDTO) { | 90 | interactData?: InteractDataDTO) { |
| 88 | let identifier = generateUUID() | 91 | let identifier = generateUUID() |
| 89 | - console.log('zzzz',JSON.stringify(item)) | 92 | + console.log('zzzz', JSON.stringify(item)) |
| 90 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | 93 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { |
| 91 | intentName: 'ViewBlog', | 94 | intentName: 'ViewBlog', |
| 92 | intentVersion: '1.0.1', | 95 | intentVersion: '1.0.1', |
| @@ -99,7 +102,8 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | @@ -99,7 +102,8 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | ||
| 99 | entityId: `objectId=${item?.newsId}&objectType=${item?.newsType}` || '', | 102 | entityId: `objectId=${item?.newsId}&objectType=${item?.newsType}` || '', |
| 100 | displayName: item?.newsTitle || '', | 103 | displayName: item?.newsTitle || '', |
| 101 | entityGroupId: String(item?.reLInfo?.channelId), //channelId | 104 | entityGroupId: String(item?.reLInfo?.channelId), //channelId |
| 102 | - logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', | 105 | + logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : |
| 106 | + item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', | ||
| 103 | metadataModificationTime: new Date(item.publishTime).getTime() || 0, | 107 | metadataModificationTime: new Date(item.publishTime).getTime() || 0, |
| 104 | blogTitle: item?.newsTitle, | 108 | blogTitle: item?.newsTitle, |
| 105 | blogType: 'Normal', | 109 | blogType: 'Normal', |
| @@ -107,7 +111,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | @@ -107,7 +111,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | ||
| 107 | categoryDisplayName: item.newsTitle || '', | 111 | categoryDisplayName: item.newsTitle || '', |
| 108 | blogSubTitle: item?.newsSummary.length > 20 ? | 112 | blogSubTitle: item?.newsSummary.length > 20 ? |
| 109 | item?.newsSummary.substring(0, 20) : item?.newsSummary, | 113 | item?.newsSummary.substring(0, 20) : item?.newsSummary, |
| 110 | - description: item?.newsSummary || '',//必传 | 114 | + description: item?.newsSummary || '', //必传 |
| 111 | blogAuthor: item?.newsSourceName, | 115 | blogAuthor: item?.newsSourceName, |
| 112 | blogPublishTime: `${new Date(item.publishTime).getTime()}` || '', | 116 | blogPublishTime: `${new Date(item.publishTime).getTime()}` || '', |
| 113 | tag: item?.newsTags.split(','), | 117 | tag: item?.newsTags.split(','), |
| @@ -463,7 +463,7 @@ export class PageHelper { | @@ -463,7 +463,7 @@ export class PageHelper { | ||
| 463 | // 刷新,替换所有数据 | 463 | // 刷新,替换所有数据 |
| 464 | this.resetInteract(data, pageModel.compList) | 464 | this.resetInteract(data, pageModel.compList) |
| 465 | if (pageModel?.channelId === '2001' || pageModel?.channelId === '2002') { | 465 | if (pageModel?.channelId === '2001' || pageModel?.channelId === '2002') { |
| 466 | - //早晚报意图上报 | 466 | + //首页节目将来时意图上报,只上报热点和推荐频道下的节目 |
| 467 | let context = getContext(this) as common.UIAbilityContext; | 467 | let context = getContext(this) as common.UIAbilityContext; |
| 468 | viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED) | 468 | viewBlogInsightIntentShare(context, pageModel?.channelId, compList, ActionMode.EXPECTED) |
| 469 | } | 469 | } |
-
Please register or login to post a comment