Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangyong_wd
2024-04-13 22:10:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3e286344a95b522d15873e6b5f1d7e3887aa1c72
3e286344
1 parent
f6d52b5e
卡片右下角样式组件优化
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
35 deletions
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
3e28634
...
...
@@ -67,6 +67,6 @@ export interface ContentDTO {
voiceInfo: VoiceInfoDTO;
tagWord: number;
rmhInfo: RmhInfoDTO; // 人民号信息
photoNum:
string
;
photoNum:
number
;
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/cardCommon/CardMediaInfo.ets
View file @
3e28634
...
...
@@ -15,37 +15,31 @@ export struct CardMediaInfo {
build() {
Row() {
if(this.contentDTO.objectType === '1') {
// 显示点播
if(this.contentDTO.objectType === '1' || this.contentDTO.objectType === '15' ) {
// 点播、动态视频
Row(){
Image($r('app.media.videoTypeIcon'))
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
.mediaLogo()
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000))
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(40)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
.mediaText()
}
.backgroundColor('#4d000000')
.borderRadius($r('app.float.button_border_radius'))
} else if(this.contentDTO.objectType === '2') {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
Row(){
if(this.contentDTO.liveInfo.liveState === 'running') {
Image($r('app.media.icon_live'))
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
.mediaLogo()
Text('直播中')
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(40)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
.mediaText()
} else if(this.contentDTO.liveInfo.liveState === 'end'){
Image($r('app.media.videoTypeIcon'))
.mediaLogo()
Text('回看')
.mediaText()
}
}
.backgroundColor('#4d000000')
.borderRadius($r('app.float.button_border_radius'))
...
...
@@ -53,16 +47,10 @@ export struct CardMediaInfo {
// 显示组图;图片数量
Row(){
Image($r('app.media.album_card_shape'))
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
Text(this.contentDTO.photoNum)
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.mediaLogo()
Text(`${this.contentDTO.photoNum}`)
.mediaText()
.width(20)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
}
.backgroundColor('#4d000000')
.borderRadius($r('app.float.button_border_radius'))
...
...
@@ -73,15 +61,25 @@ export struct CardMediaInfo {
.height(14)
.borderRadius($r('app.float.button_border_radius'))
Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000))
.mediaText()
}
}
}
.margin(6)
}
@Styles mediaLogo() {
.width(22)
.height(18)
.borderRadius($r('app.float.button_border_radius'))
}
}
@Extend(Text) function mediaText() {
.fontColor($r('app.color.color_fff'))
.fontSize($r('app.float.font_size_12'))
.width(40)
.height(18)
.textAlign(TextAlign.Center)
.margin({ left: -3 })
}
}
}
.margin(6)
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment