Showing
2 changed files
with
46 additions
and
42 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,47 +32,47 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -29,47 +32,47 @@ 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)) | ||
| 33 | - let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | ||
| 34 | - intentName: 'ViewBlog', | ||
| 35 | - intentVersion: '1.0.1', | ||
| 36 | - identifier, | ||
| 37 | - intentActionInfo: { | ||
| 38 | - actionMode | ||
| 39 | - //目前不考虑发生时段 | ||
| 40 | - // executedTimeSlots: { | ||
| 41 | - // executedEndTime: new Date().getTime(), | ||
| 42 | - // executedStartTime: pageModel.executedStartTime | ||
| 43 | - // } | ||
| 44 | - }, | ||
| 45 | - intentEntityInfo: { | ||
| 46 | - entityName: 'Blog', | ||
| 47 | - entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '',//必传 | ||
| 48 | - displayName: item?.newsTitle || '', //必传 | ||
| 49 | - entityGroupId, //channelId | ||
| 50 | - logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', | ||
| 51 | - metadataModificationTime: Number(item?.publishTime) || 0,//int | ||
| 52 | - blogTitle: item?.newsTitle, | ||
| 53 | - blogType: 'Normal', | ||
| 54 | - blogCategory: entityGroupId === '2001' ? '推荐' : '热点', | ||
| 55 | - categoryDisplayName: item.newsTitle,//卡片上的主标题 | ||
| 56 | - description: item?.newsSummary || '',//必传 | ||
| 57 | - blogSubTitle: item?.newsSummary.length > 20 ? | ||
| 58 | - item?.newsSummary.substring(0, 20) : item?.newsSummary, | ||
| 59 | - blogAuthor: item?.source, | ||
| 60 | - blogPublishTime: item?.publishTime,//string | ||
| 61 | - tag: item?.newTags.split(','), | ||
| 62 | - likeCount: item?.interactData?.likeNum || 0, | ||
| 63 | - forwardCount: item?.interactData?.shareNum || 0, | ||
| 64 | - commentCount: item?.interactData?.commentNum || 0, | ||
| 65 | - favorites: item?.interactData?.collectNum || 0, | ||
| 66 | - viewCount: item?.interactData?.readNum || 0, | ||
| 67 | - rankingHint: 99 | 35 | + if (shareWhiteist.indexOf(item.objectType) > -1) { |
| 36 | + let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | ||
| 37 | + intentName: 'ViewBlog', | ||
| 38 | + intentVersion: '1.0.1', | ||
| 39 | + identifier, | ||
| 40 | + intentActionInfo: { | ||
| 41 | + actionMode | ||
| 42 | + //目前不考虑发生时段 | ||
| 43 | + // executedTimeSlots: { | ||
| 44 | + // executedEndTime: new Date().getTime(), | ||
| 45 | + // executedStartTime: pageModel.executedStartTime | ||
| 46 | + // } | ||
| 47 | + }, | ||
| 48 | + intentEntityInfo: { | ||
| 49 | + entityName: 'Blog', | ||
| 50 | + entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '', //必传 | ||
| 51 | + displayName: item?.newsTitle || '', //必传 | ||
| 52 | + entityGroupId, //channelId | ||
| 53 | + logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', | ||
| 54 | + metadataModificationTime: Number(item?.publishTime) || 0, //int | ||
| 55 | + blogTitle: item?.newsTitle, | ||
| 56 | + blogType: 'Normal', | ||
| 57 | + blogCategory: entityGroupId === '2001' ? '推荐' : '热点', | ||
| 58 | + categoryDisplayName: item.newsTitle, //卡片上的主标题 | ||
| 59 | + description: item?.newsSummary || '', //必传 | ||
| 60 | + blogSubTitle: item?.newsSummary.length > 20 ? | ||
| 61 | + item?.newsSummary.substring(0, 20) : item?.newsSummary, | ||
| 62 | + blogAuthor: item?.source, | ||
| 63 | + blogPublishTime: item?.publishTime, //string | ||
| 64 | + tag: item?.newTags.split(','), | ||
| 65 | + likeCount: item?.interactData?.likeNum || 0, | ||
| 66 | + forwardCount: item?.interactData?.shareNum || 0, | ||
| 67 | + commentCount: item?.interactData?.commentNum || 0, | ||
| 68 | + favorites: item?.interactData?.collectNum || 0, | ||
| 69 | + viewCount: item?.interactData?.readNum || 0, | ||
| 70 | + rankingHint: 99 | ||
| 71 | + } | ||
| 68 | } | 72 | } |
| 73 | + insightIntentArray.push(viewBlogInsightIntentItem) | ||
| 69 | } | 74 | } |
| 70 | - insightIntentArray.push(viewBlogInsightIntentItem) | ||
| 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