yuzhilin

习惯推 entityId 改成参数拼接方案、习惯推默认 logo

@@ -44,10 +44,10 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent @@ -44,10 +44,10 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
44 }, 44 },
45 intentEntityInfo: { 45 intentEntityInfo: {
46 entityName: 'Blog', 46 entityName: 'Blog',
47 - entityId: item?.objectId || '',//必传 47 + entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '',//必传
48 displayName: item?.newsTitle || '', //必传 48 displayName: item?.newsTitle || '', //必传
49 entityGroupId, //channelId 49 entityGroupId, //channelId
50 - logoURL: item?.coverUrl, 50 + logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
51 metadataModificationTime: Number(item?.publishTime) || 0,//int 51 metadataModificationTime: Number(item?.publishTime) || 0,//int
52 blogTitle: item?.newsTitle, 52 blogTitle: item?.newsTitle,
53 blogType: 'Normal', 53 blogType: 'Normal',
@@ -99,7 +99,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, @@ -99,7 +99,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext,
99 entityId: String(item?.newsId) || '', 99 entityId: String(item?.newsId) || '',
100 displayName: item?.newsTitle || '', 100 displayName: item?.newsTitle || '',
101 entityGroupId: String(item?.reLInfo?.channelId), //channelId 101 entityGroupId: String(item?.reLInfo?.channelId), //channelId
102 - logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri, 102 + logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png',
103 metadataModificationTime: new Date(item.publishTime).getTime() || 0, 103 metadataModificationTime: new Date(item.publishTime).getTime() || 0,
104 blogTitle: item?.newsTitle, 104 blogTitle: item?.newsTitle,
105 blogType: 'Normal', 105 blogType: 'Normal',
  1 +import Url from '@ohos.url'
1 import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit'; 2 import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit';
2 import { window } from '@kit.ArkUI'; 3 import { window } from '@kit.ArkUI';
3 import { BusinessError } from '@kit.BasicServicesKit'; 4 import { BusinessError } from '@kit.BasicServicesKit';
4 import { NetworkUtil, SPHelper, ToastUtils, FastClickUtil } from 'wdKit'; 5 import { NetworkUtil, SPHelper, ToastUtils, FastClickUtil } from 'wdKit';
  6 +import { ContentDTO } from 'wdBean';
5 import { ProcessUtils } from 'wdRouter'; 7 import { ProcessUtils } from 'wdRouter';
6 import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel' 8 import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel'
7 9
@@ -52,6 +54,12 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { @@ -52,6 +54,12 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
52 // TODO 热启动是否切到主页 54 // TODO 热启动是否切到主页
53 pageLoader.loadContent('pages/MainPage') 55 pageLoader.loadContent('pages/MainPage')
54 .then(() => { 56 .then(() => {
  57 + let url: string = param?.entityId as string || ''
  58 + let urlParams = new Url.URLParams(url);
  59 + let content = new ContentDTO()
  60 + content.objectId = urlParams.get('objectId') || ''
  61 + content.objectType = urlParams.get('objectType') || ''
  62 + ProcessUtils.processPage(content)
55 resolve({ 63 resolve({
56 code: 0, 64 code: 0,
57 result: { 65 result: {
@@ -79,7 +87,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { @@ -79,7 +87,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
79 pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> { 87 pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> {
80 return new Promise((resolve, reject) => { 88 return new Promise((resolve, reject) => {
81 pageLoader.loadContent('pages/MainPage') 89 pageLoader.loadContent('pages/MainPage')
82 - .then( async () => { 90 + .then(async () => {
83 if (NetworkUtil.isNetConnected()) { 91 if (NetworkUtil.isNetConnected()) {
84 if (await FastClickUtil.isMinDelayTime()) { 92 if (await FastClickUtil.isMinDelayTime()) {
85 return 93 return
@@ -92,7 +100,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { @@ -92,7 +100,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
92 ToastUtils.showToast('暂无早晚报信息', 1000) 100 ToastUtils.showToast('暂无早晚报信息', 1000)
93 } 101 }
94 }).catch((err: string) => { 102 }).catch((err: string) => {
95 - console.log('yzlerr',JSON.stringify(err)) 103 + console.log('yzlerr', JSON.stringify(err))
96 ToastUtils.showToast('暂无早晚报信息', 1000) 104 ToastUtils.showToast('暂无早晚报信息', 1000)
97 }) 105 })
98 } else { 106 } else {