yuzhilin

意图框架事件推防抖

... ... @@ -27,8 +27,9 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
let insightIntentArray: insightIntent.InsightIntent [] = []
let identifier = generateUUID()
if (compList?.length > 0) {
compList?.forEach((item: CompDTO | CompList) => {
item.operDataList.forEach((_item: ContentDTO) => {
compList?.forEach((comp: CompDTO | CompList) => {
comp.operDataList.forEach((item: ContentDTO) => {
console.log('zzzz',JSON.stringify(item))
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
... ... @@ -43,25 +44,26 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
},
intentEntityInfo: {
entityName: 'Blog',
entityId: _item?.objectId,
displayName: _item?.newsTitle,
entityId: item?.objectId || '',//必传
displayName: item?.newsTitle || '', //必传
entityGroupId, //channelId
logoURL: _item?.coverUrl,
metadataModificationTime: _item?.publishTimestamp,
blogTitle: _item?.newsTitle,
logoURL: item?.coverUrl,
metadataModificationTime: Number(item?.publishTime) || 0,//int
blogTitle: item?.newsTitle,
blogType: 'Normal',
blogCategory: item.name,
categoryDisplayName: item.name,
blogSubTitle: _item?.newsSummary.length > 20 ?
_item?.newsSummary.substring(0, 20) : _item?.newsSummary,
blogAuthor: _item?.source,
blogPublishTime: _item?.publishTimestamp,
tag: _item?.newTags.split(','),
likeCount: _item?.interactData?.likeNum || 0,
forwardCount: _item?.interactData?.shareNum || 0,
commentCount: _item?.interactData?.commentNum || 0,
favorites: _item?.interactData?.collectNum || 0,
viewCount: _item?.interactData?.readNum || 0,
blogCategory: entityGroupId === '2001' ? '推荐' : '热点',
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
tag: item?.newTags.split(','),
likeCount: item?.interactData?.likeNum || 0,
forwardCount: item?.interactData?.shareNum || 0,
commentCount: item?.interactData?.commentNum || 0,
favorites: item?.interactData?.collectNum || 0,
viewCount: item?.interactData?.readNum || 0,
rankingHint: 99
}
}
... ... @@ -84,6 +86,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))
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
... ... @@ -93,19 +96,20 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
},
intentEntityInfo: {
entityName: 'Blog',
entityId: String(item?.newsId),
displayName: item?.newsTitle,
entityId: String(item?.newsId) || '',
displayName: item?.newsTitle || '',
entityGroupId: String(item?.reLInfo?.channelId), //channelId
logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri,
metadataModificationTime: item?.publishTime,
metadataModificationTime: new Date(item.publishTime).getTime() || 0,
blogTitle: item?.newsTitle,
blogType: 'Normal',
blogCategory: item,
categoryDisplayName: '', //TODO 分类名称
blogCategory: item?.reLInfo?.channelId === 2001 ? '推荐' : '热点',
categoryDisplayName: item.newsTitle || '',
blogSubTitle: item?.newsSummary.length > 20 ?
item?.newsSummary.substring(0, 20) : item?.newsSummary,
description: item?.newsSummary || '',//必传
blogAuthor: item?.newsSourceName,
blogPublishTime: item?.publishTime,
blogPublishTime: `${new Date(item.publishTime).getTime()}` || '',
tag: item?.newsTags.split(','),
viewCount: item?.viewCount || 0,
likeCount: interactData?.likeNum || 0,
... ...