chengen02

-fix 进入文章专题页面_评论框及评论组件元素未展现

@@ -203,6 +203,7 @@ export class ProcessUtils { @@ -203,6 +203,7 @@ export class ProcessUtils {
203 relType: content?.relType, 203 relType: content?.relType,
204 relId: content?.relId, 204 relId: content?.relId,
205 channelId: content?.channelId, 205 channelId: content?.channelId,
  206 + pageId: content?.pageId
206 } as ExtraDTO 207 } as ExtraDTO
207 } as Params, 208 } as Params,
208 }; 209 };
@@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO { @@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO {
10 topicId: string; 10 topicId: string;
11 channelId: string; 11 channelId: string;
12 compId: string; 12 compId: string;
  13 + pageId: string;
13 sourcePage: string; 14 sourcePage: string;
14 relId: string; 15 relId: string;
15 relType: string; 16 relType: string;
@@ -25,5 +25,6 @@ export interface Params { @@ -25,5 +25,6 @@ export interface Params {
25 creatorId?: string; //号主id 25 creatorId?: string; //号主id
26 videoUrl?: string; 26 videoUrl?: string;
27 videoCoverUrl?: string; 27 videoCoverUrl?: string;
  28 + pageId?: string;
28 backVisibility?: boolean; //展示顶部返回栏 29 backVisibility?: boolean; //展示顶部返回栏
29 } 30 }
@@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent'; @@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent';
12 import { NetworkUtil, WindowModel } from 'wdKit'; 12 import { NetworkUtil, WindowModel } from 'wdKit';
13 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' 13 import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
14 import { common } from '@kit.AbilityKit'; 14 import { common } from '@kit.AbilityKit';
  15 +import { PageRepository } from '../repository/PageRepository';
15 16
16 const TAG: string = 'SpacialTopicPageComponent' 17 const TAG: string = 'SpacialTopicPageComponent'
17 18
@@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent { @@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent {
59 60
60 private async getDetail() { 61 private async getDetail() {
61 this.isNetConnected = NetworkUtil.isNetConnected() 62 this.isNetConnected = NetworkUtil.isNetConnected()
62 -  
63 let contentId: string = '' 63 let contentId: string = ''
64 let relId: string = '' 64 let relId: string = ''
65 let relType: string = '' 65 let relType: string = ''
@@ -74,23 +74,31 @@ export struct SpacialTopicPageComponent { @@ -74,23 +74,31 @@ export struct SpacialTopicPageComponent {
74 if (this.action.params.extra.relType) { 74 if (this.action.params.extra.relType) {
75 relType = this.action.params.extra.relType 75 relType = this.action.params.extra.relType
76 } 76 }
77 -  
78 } 77 }
79 - let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)  
80 - if (detailBeans && detailBeans.length > 0) {  
81 - this.contentDetailData = detailBeans[0];  
82 - this.viewBlogInsightIntentShare()  
83 - // if (this.contentDetailData[0]?.openComment) {  
84 - this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')  
85 - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')  
86 - this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle  
87 - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')  
88 - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')  
89 - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')  
90 - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')  
91 - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')  
92 - // }  
93 - this.trySendData2H5() 78 + let pageId = this.action.params.extra?.pageId
  79 + console.log('pageIdpageId',pageId)
  80 + if(pageId){
  81 + let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId)
  82 + let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
  83 + if (detailBeans?.length > 0) {
  84 + this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0]));
  85 + this.viewBlogInsightIntentShare()
  86 + // if (this.contentDetailData[0]?.openComment) {
  87 + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
  88 + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
  89 + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
  90 + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
  91 + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
  92 + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
  93 + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
  94 + this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
  95 + // }
  96 + this.trySendData2H5()
  97 + }
  98 + if(pageInfoMsg && pageInfoMsg.data){
  99 + this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag)
  100 + this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag)
  101 + }
94 } 102 }
95 } 103 }
96 } 104 }