yuzhilin

意图框架事件推防抖

@@ -27,8 +27,9 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent @@ -27,8 +27,9 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
27 let insightIntentArray: insightIntent.InsightIntent [] = [] 27 let insightIntentArray: insightIntent.InsightIntent [] = []
28 let identifier = generateUUID() 28 let identifier = generateUUID()
29 if (compList?.length > 0) { 29 if (compList?.length > 0) {
30 - compList?.forEach((item: CompDTO | CompList) => {  
31 - item.operDataList.forEach((_item: ContentDTO) => { 30 + compList?.forEach((comp: CompDTO | CompList) => {
  31 + comp.operDataList.forEach((item: ContentDTO) => {
  32 + console.log('zzzz',JSON.stringify(item))
32 let viewBlogInsightIntentItem: insightIntent.InsightIntent = { 33 let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
33 intentName: 'ViewBlog', 34 intentName: 'ViewBlog',
34 intentVersion: '1.0.1', 35 intentVersion: '1.0.1',
@@ -43,25 +44,26 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent @@ -43,25 +44,26 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
43 }, 44 },
44 intentEntityInfo: { 45 intentEntityInfo: {
45 entityName: 'Blog', 46 entityName: 'Blog',
46 - entityId: _item?.objectId,  
47 - displayName: _item?.newsTitle, 47 + entityId: item?.objectId || '',//必传
  48 + displayName: item?.newsTitle || '', //必传
48 entityGroupId, //channelId 49 entityGroupId, //channelId
49 - logoURL: _item?.coverUrl,  
50 - metadataModificationTime: _item?.publishTimestamp,  
51 - blogTitle: _item?.newsTitle, 50 + logoURL: item?.coverUrl,
  51 + metadataModificationTime: Number(item?.publishTime) || 0,//int
  52 + blogTitle: item?.newsTitle,
52 blogType: 'Normal', 53 blogType: 'Normal',
53 - blogCategory: item.name,  
54 - categoryDisplayName: item.name,  
55 - blogSubTitle: _item?.newsSummary.length > 20 ?  
56 - _item?.newsSummary.substring(0, 20) : _item?.newsSummary,  
57 - blogAuthor: _item?.source,  
58 - blogPublishTime: _item?.publishTimestamp,  
59 - tag: _item?.newTags.split(','),  
60 - likeCount: _item?.interactData?.likeNum || 0,  
61 - forwardCount: _item?.interactData?.shareNum || 0,  
62 - commentCount: _item?.interactData?.commentNum || 0,  
63 - favorites: _item?.interactData?.collectNum || 0,  
64 - viewCount: _item?.interactData?.readNum || 0, 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,
65 rankingHint: 99 67 rankingHint: 99
66 } 68 }
67 } 69 }
@@ -84,6 +86,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent @@ -84,6 +86,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
84 export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO, 86 export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO,
85 interactData?: InteractDataDTO) { 87 interactData?: InteractDataDTO) {
86 let identifier = generateUUID() 88 let identifier = generateUUID()
  89 + console.log('zzzz',JSON.stringify(item))
87 let viewBlogInsightIntentItem: insightIntent.InsightIntent = { 90 let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
88 intentName: 'ViewBlog', 91 intentName: 'ViewBlog',
89 intentVersion: '1.0.1', 92 intentVersion: '1.0.1',
@@ -93,19 +96,20 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, @@ -93,19 +96,20 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
93 }, 96 },
94 intentEntityInfo: { 97 intentEntityInfo: {
95 entityName: 'Blog', 98 entityName: 'Blog',
96 - entityId: String(item?.newsId),  
97 - displayName: item?.newsTitle, 99 + entityId: String(item?.newsId) || '',
  100 + displayName: item?.newsTitle || '',
98 entityGroupId: String(item?.reLInfo?.channelId), //channelId 101 entityGroupId: String(item?.reLInfo?.channelId), //channelId
99 logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri, 102 logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri,
100 - metadataModificationTime: item?.publishTime, 103 + metadataModificationTime: new Date(item.publishTime).getTime() || 0,
101 blogTitle: item?.newsTitle, 104 blogTitle: item?.newsTitle,
102 blogType: 'Normal', 105 blogType: 'Normal',
103 - blogCategory: item,  
104 - categoryDisplayName: '', //TODO 分类名称 106 + blogCategory: item?.reLInfo?.channelId === 2001 ? '推荐' : '热点',
  107 + categoryDisplayName: item.newsTitle || '',
105 blogSubTitle: item?.newsSummary.length > 20 ? 108 blogSubTitle: item?.newsSummary.length > 20 ?
106 item?.newsSummary.substring(0, 20) : item?.newsSummary, 109 item?.newsSummary.substring(0, 20) : item?.newsSummary,
  110 + description: item?.newsSummary || '',//必传
107 blogAuthor: item?.newsSourceName, 111 blogAuthor: item?.newsSourceName,
108 - blogPublishTime: item?.publishTime, 112 + blogPublishTime: `${new Date(item.publishTime).getTime()}` || '',
109 tag: item?.newsTags.split(','), 113 tag: item?.newsTags.split(','),
110 viewCount: item?.viewCount || 0, 114 viewCount: item?.viewCount || 0,
111 likeCount: interactData?.likeNum || 0, 115 likeCount: interactData?.likeNum || 0,