wangliang_wd

feat:优化动态详情页顶部logo显示

@@ -276,7 +276,8 @@ export class ProcessUtils { @@ -276,7 +276,8 @@ export class ProcessUtils {
276 relType: content?.relType, 276 relType: content?.relType,
277 relId: content?.relId, 277 relId: content?.relId,
278 sourcePage: '5', 278 sourcePage: '5',
279 - commentId: content?.commentInfo?.commentId 279 + commentId: content?.commentInfo?.commentId,
  280 + rmhPlatform:content?.rmhPlatform
280 } as ExtraDTO, 281 } as ExtraDTO,
281 targetLayout: content.customParamTargetLayout 282 targetLayout: content.customParamTargetLayout
282 } as Params, 283 } as Params,
@@ -436,7 +437,8 @@ export class ProcessUtils { @@ -436,7 +437,8 @@ export class ProcessUtils {
436 relId: content?.relId, 437 relId: content?.relId,
437 channelId: content?.channelId, 438 channelId: content?.channelId,
438 sourcePage: '5', 439 sourcePage: '5',
439 - commentId: content?.commentInfo?.commentId 440 + commentId: content?.commentInfo?.commentId,
  441 + rmhPlatform: content?.rmhPlatform
440 } as ExtraDTO, 442 } as ExtraDTO,
441 targetLayout: content.customParamTargetLayout, 443 targetLayout: content.customParamTargetLayout,
442 } as Params, 444 } as Params,
@@ -21,4 +21,5 @@ export interface ExtraDTO extends ItemDTO { @@ -21,4 +21,5 @@ export interface ExtraDTO extends ItemDTO {
21 extra?:string 21 extra?:string
22 title: string 22 title: string
23 showComment?:boolean 23 showComment?:boolean
  24 + rmhPlatform?: number
24 } 25 }
@@ -99,6 +99,7 @@ export struct DynamicDetailComponent { @@ -99,6 +99,7 @@ export struct DynamicDetailComponent {
99 pageParam: ParamType = {} 99 pageParam: ParamType = {}
100 commentListAreaInfo?: Area 100 commentListAreaInfo?: Area
101 lastTimeoutId?: number 101 lastTimeoutId?: number
  102 + @State pageRmhPlatform: number = 0;
102 103
103 // @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 104 // @Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
104 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 105 @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@@ -107,6 +108,7 @@ export struct DynamicDetailComponent { @@ -107,6 +108,7 @@ export struct DynamicDetailComponent {
107 // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 108 // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
108 this.likesStyle = this.contentDetailData.likesStyle 109 this.likesStyle = this.contentDetailData.likesStyle
109 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false 110 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
  111 + this.pageRmhPlatform = this.action.params?.extra?.rmhPlatform || 2;
110 112
111 //注册通知,来自别的组件的评论成功通知 113 //注册通知,来自别的组件的评论成功通知
112 EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, (targetId?: string) => { 114 EmitterUtils.receiveEvent(EmitterEventId.COMMENT_PUBLISH, (targetId?: string) => {
@@ -698,7 +700,7 @@ export struct DynamicDetailComponent { @@ -698,7 +700,7 @@ export struct DynamicDetailComponent {
698 @Builder topNav() { 700 @Builder topNav() {
699 //logo、日期 701 //logo、日期
700 Row() { 702 Row() {
701 - if (this.contentDetailData.rmhPlatform == 1) { // 人民号 703 + if (this.pageRmhPlatform == 1) { // 人民号
702 if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号 704 if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号
703 Blank().height(1) 705 Blank().height(1)
704 } else { 706 } else {
@@ -707,7 +709,7 @@ export struct DynamicDetailComponent { @@ -707,7 +709,7 @@ export struct DynamicDetailComponent {
707 .height($r('app.float.margin_28')) 709 .height($r('app.float.margin_28'))
708 .margin({ left: $r('app.float.margin_16') }) 710 .margin({ left: $r('app.float.margin_16') })
709 } 711 }
710 - } else if (this.contentDetailData.rmhPlatform == 2) { // 普通用户 712 + } else if (this.pageRmhPlatform == 2) { // 普通用户
711 Blank().height(1) 713 Blank().height(1)
712 } else { 714 } else {
713 Image($r('app.media.logo_rmrb')) 715 Image($r('app.media.logo_rmrb'))
@@ -797,6 +799,7 @@ export struct DynamicDetailComponent { @@ -797,6 +799,7 @@ export struct DynamicDetailComponent {
797 let data = await MultiPictureDetailViewModel.getDetailData(relId, contentId, relType) 799 let data = await MultiPictureDetailViewModel.getDetailData(relId, contentId, relType)
798 this.isPageEnd = true; 800 this.isPageEnd = true;
799 this.contentDetailData = data[0]; 801 this.contentDetailData = data[0];
  802 + this.pageRmhPlatform = this.contentDetailData.rmhPlatform
800 let dateTime = 803 let dateTime =
801 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); 804 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
802 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) 805 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
@@ -77,6 +77,8 @@ export struct ImageAndTextPageComponent { @@ -77,6 +77,8 @@ export struct ImageAndTextPageComponent {
77 lastTimeoutId?: number 77 lastTimeoutId?: number
78 @State needAnimation: boolean = false; 78 @State needAnimation: boolean = false;
79 79
  80 + @State pageRmhPlatform: number = 0;
  81 +
80 @State @Watch("webPageIsPageEnd") isPageEnd: boolean = false 82 @State @Watch("webPageIsPageEnd") isPageEnd: boolean = false
81 @Consume @Watch('pageShowForUpdateData') pageShow :number 83 @Consume @Watch('pageShowForUpdateData') pageShow :number
82 @Consume @Watch('pageHideForUpdateData') pageHide :number 84 @Consume @Watch('pageHideForUpdateData') pageHide :number
@@ -273,13 +275,13 @@ export struct ImageAndTextPageComponent { @@ -273,13 +275,13 @@ export struct ImageAndTextPageComponent {
273 Column() { 275 Column() {
274 Row() { 276 Row() {
275 if (this.isNetConnected && !this.detailContentEmpty) { 277 if (this.isNetConnected && !this.detailContentEmpty) {
276 - if (this.contentDetailData.rmhPlatform == 1) { // 人民号 278 + if (this.pageRmhPlatform == 1) { // 人民号
277 if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号 279 if (this.contentDetailData?.rmhInfo?.userType == "5") { // 内容源账号
278 Blank().height(1) 280 Blank().height(1)
279 } else { 281 } else {
280 Image($r('app.media.logo_rmh')).width(80) .height(28) 282 Image($r('app.media.logo_rmh')).width(80) .height(28)
281 } 283 }
282 - } else if (this.contentDetailData.rmhPlatform == 2) { // 普通用户 284 + } else if (this.pageRmhPlatform == 2) { // 普通用户
283 Blank().height(1) 285 Blank().height(1)
284 } else { 286 } else {
285 Image($r('app.media.logo_rmrb')).width(80) .height(28) 287 Image($r('app.media.logo_rmrb')).width(80) .height(28)
@@ -352,6 +354,7 @@ export struct ImageAndTextPageComponent { @@ -352,6 +354,7 @@ export struct ImageAndTextPageComponent {
352 } 354 }
353 if (detailBeans && detailBeans.length > 0) { 355 if (detailBeans && detailBeans.length > 0) {
354 this.contentDetailData = detailBeans[0]; 356 this.contentDetailData = detailBeans[0];
  357 + this.pageRmhPlatform = this.contentDetailData.rmhPlatform
355 let dateTime = 358 let dateTime =
356 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); 359 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
357 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) 360 let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
@@ -518,6 +521,8 @@ export struct ImageAndTextPageComponent { @@ -518,6 +521,8 @@ export struct ImageAndTextPageComponent {
518 521
519 aboutToAppear() { 522 aboutToAppear() {
520 // Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据'); 523 // Logger.debug(TAG, '文章详情页 aboutToAppear,开始请求接口数据');
  524 + this.pageRmhPlatform = this.action.params?.extra?.rmhPlatform || 2;
  525 +
521 this.getDetail() 526 this.getDetail()
522 this.screenHeight = DisplayUtils.getDeviceHeight() 527 this.screenHeight = DisplayUtils.getDeviceHeight()
523 this.initAnimationConfig(); 528 this.initAnimationConfig();