张善主

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

... ... @@ -41,7 +41,7 @@ export struct DynamicDetailComponent {
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
//跳转
private mJumpInfo: ContentDTO = {} as ContentDTO;
private mJumpInfo: ContentDTO = {} as ContentDTO;
// 获取当前所有的display对象
promise: Promise<Array<display.Display>> = display.getAllDisplays()
... ... @@ -65,7 +65,7 @@ export struct DynamicDetailComponent {
.height($r('app.float.margin_28'))
.margin({ left: $r('app.float.margin_16') })
Blank()
Text(this.contentDetailData.publishTime)
Text(StringUtils.isEmpty(this.contentDetailData.publishTime)?"":this.contentDetailData.publishTime.replace('-','年').replace('-','月').replace(' ','日 ').substring(0,this.contentDetailData.publishTime.length-2))
.fontColor($r('app.color.color_B0B0B0'))
.fontSize($r('app.float.font_size_12'))
.lineHeight($r('app.float.margin_28'))
... ... @@ -284,7 +284,6 @@ export struct DynamicDetailComponent {
}
.margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
.onClick((event: ClickEvent) => {
this.mJumpInfo.objectType = ContentConstants.TYPE_VOD;
ProcessUtils.processPage(this.mJumpInfo)
})
}
... ... @@ -440,12 +439,14 @@ export struct DynamicDetailComponent {
//创建跳转信息
makeJumpInfo(){
this.mJumpInfo.pageId = 'dynamicDetailPage';
// this.mJumpInfo.from = 'dynamicDetailPage';
this.mJumpInfo.objectId = this.contentDetailData.newsId+"";
this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType+"";
this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId+"";
// this.mJumpInfo.objectType = this.contentDetailData.newsType+"";
this.mJumpInfo.pageId = 'dynamicDetailPage'
this.mJumpInfo.objectId = this.contentDetailData.newsId+""
this.mJumpInfo.relType = this.contentDetailData.reLInfo?.relType+""
this.mJumpInfo.relId = this.contentDetailData.reLInfo?.relId+""
this.mJumpInfo.objectType = (this.contentDetailData.newsType+"") == ContentConstants.TYPE_FOURTEEN?this.contentDetailData.newsType+"":ContentConstants.TYPE_VOD
if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){
this.mJumpInfo.videoInfo = this.contentDetailData.videoInfo[0]
}
}
... ...
... ... @@ -21,8 +21,10 @@ export struct CardMediaInfo {
Row() {
Image($r('app.media.card_play'))
.mediaLogo()
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
.mediaText()
if(this.contentDTO.videoInfo!=null){
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
.mediaText()
}
}
} else if (this.contentDTO.objectType === '2') {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
... ...