yuzhilin

fix:CardMediaInfo取值兼容

... ... @@ -16,7 +16,7 @@ export struct CardMediaInfo {
build() {
Row() {
if (this.contentDTO.objectType === '1' || this.contentDTO.objectType === '15') {
if (this.contentDTO?.objectType === '1' || this.contentDTO?.objectType === '15') {
// 点播、动态视频
Row() {
Image($r('app.media.card_play'))
... ... @@ -30,23 +30,23 @@ export struct CardMediaInfo {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
Row() {
if (this.contentDTO.liveInfo.liveState === 'wait') {
if (this.contentDTO?.liveInfo?.liveState === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
.mediaText()
} else if (this.contentDTO.liveInfo.liveState === 'running') {
} else if (this.contentDTO?.liveInfo?.liveState === 'running') {
Image($r('app.media.card_live'))
.mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo.replayUri) {
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
Image($r('app.media.card_play'))
.mediaLogo()
Text('回看')
.mediaText()
} else if (this.contentDTO.liveInfo.liveState === 'end' && this.contentDTO.liveInfo
.replayUri) {
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo
?.replayUri) {
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播结束')
... ...