张善主

feat(动态):动态详情页日期格式修改/视频标识处理

@@ -65,7 +65,7 @@ export struct DynamicDetailComponent { @@ -65,7 +65,7 @@ export struct DynamicDetailComponent {
65 .height($r('app.float.margin_28')) 65 .height($r('app.float.margin_28'))
66 .margin({ left: $r('app.float.margin_16') }) 66 .margin({ left: $r('app.float.margin_16') })
67 Blank() 67 Blank()
68 - Text(this.contentDetailData.publishTime) 68 + Text(StringUtils.isEmpty(this.contentDetailData.publishTime)?"":this.contentDetailData.publishTime.replace('-','年').replace('-','月').replace(' ','日 ').substring(0,this.contentDetailData.publishTime.length-2))
69 .fontColor($r('app.color.color_B0B0B0')) 69 .fontColor($r('app.color.color_B0B0B0'))
70 .fontSize($r('app.float.font_size_12')) 70 .fontSize($r('app.float.font_size_12'))
71 .lineHeight($r('app.float.margin_28')) 71 .lineHeight($r('app.float.margin_28'))
@@ -284,7 +284,6 @@ export struct DynamicDetailComponent { @@ -284,7 +284,6 @@ export struct DynamicDetailComponent {
284 } 284 }
285 .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')}) 285 .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
286 .onClick((event: ClickEvent) => { 286 .onClick((event: ClickEvent) => {
287 - this.mJumpInfo.objectType = ContentConstants.TYPE_VOD;  
288 ProcessUtils.processPage(this.mJumpInfo) 287 ProcessUtils.processPage(this.mJumpInfo)
289 }) 288 })
290 } 289 }
@@ -440,12 +439,14 @@ export struct DynamicDetailComponent { @@ -440,12 +439,14 @@ export struct DynamicDetailComponent {
440 439
441 //创建跳转信息 440 //创建跳转信息
442 makeJumpInfo(){ 441 makeJumpInfo(){
443 - this.mJumpInfo.pageId = 'dynamicDetailPage';  
444 - // this.mJumpInfo.from = 'dynamicDetailPage';  
445 - this.mJumpInfo.objectId = this.contentDetailData.newsId+"";  
446 - this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType+"";  
447 - this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId+"";  
448 - // this.mJumpInfo.objectType = this.contentDetailData.newsType+""; 442 + this.mJumpInfo.pageId = 'dynamicDetailPage'
  443 + this.mJumpInfo.objectId = this.contentDetailData.newsId+""
  444 + this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType+""
  445 + this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId+""
  446 + this.mJumpInfo.objectType = (this.contentDetailData.newsType+"") == ContentConstants.TYPE_FOURTEEN?this.contentDetailData.newsType+"":ContentConstants.TYPE_VOD
  447 + if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){
  448 + this.mJumpInfo.videoInfo = this.contentDetailData.videoInfo[0]
  449 + }
449 } 450 }
450 451
451 452
@@ -21,9 +21,11 @@ export struct CardMediaInfo { @@ -21,9 +21,11 @@ export struct CardMediaInfo {
21 Row() { 21 Row() {
22 Image($r('app.media.card_play')) 22 Image($r('app.media.card_play'))
23 .mediaLogo() 23 .mediaLogo()
  24 + if(this.contentDTO.videoInfo!=null){
24 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) 25 Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
25 .mediaText() 26 .mediaText()
26 } 27 }
  28 + }
27 } else if (this.contentDTO.objectType === '2') { 29 } else if (this.contentDTO.objectType === '2') {
28 // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 30 // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
29 // 显示直播信息 31 // 显示直播信息