Showing
1 changed file
with
8 additions
and
2 deletions
| @@ -2,6 +2,7 @@ import { ContentDTO, joinPeopleNum } from 'wdBean/Index' | @@ -2,6 +2,7 @@ import { ContentDTO, joinPeopleNum } from 'wdBean/Index' | ||
| 2 | import { DateTimeUtils } from 'wdKit/Index' | 2 | import { DateTimeUtils } from 'wdKit/Index' |
| 3 | import { LottieView } from '../../components/lottie/LottieView'; | 3 | import { LottieView } from '../../components/lottie/LottieView'; |
| 4 | import { LiveModel } from '../../viewmodel/LiveModel' | 4 | import { LiveModel } from '../../viewmodel/LiveModel' |
| 5 | +import font from '@ohos.font'; | ||
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 这里是样式卡中,右下角显示的音视频信息 | 8 | * 这里是样式卡中,右下角显示的音视频信息 |
| @@ -18,6 +19,11 @@ export struct CardMediaInfo { | @@ -18,6 +19,11 @@ export struct CardMediaInfo { | ||
| 18 | 19 | ||
| 19 | aboutToAppear(): void { | 20 | aboutToAppear(): void { |
| 20 | this.getJoinPeopleNum(); | 21 | this.getJoinPeopleNum(); |
| 22 | + | ||
| 23 | + font.registerFont({ | ||
| 24 | + familyName: 'BebasNeue', | ||
| 25 | + familySrc: $rawfile('font/BebasNeue.ttf') | ||
| 26 | + }) | ||
| 21 | } | 27 | } |
| 22 | 28 | ||
| 23 | /** | 29 | /** |
| @@ -66,7 +72,7 @@ export struct CardMediaInfo { | @@ -66,7 +72,7 @@ export struct CardMediaInfo { | ||
| 66 | if (this.contentDTO.videoInfo != null) { | 72 | if (this.contentDTO.videoInfo != null) { |
| 67 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) | 73 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.videoInfo.videoDuration * 1000)) |
| 68 | .mediaText() | 74 | .mediaText() |
| 69 | - .fontFamily('BebasNeueBold') | 75 | + .fontFamily('BebasNeue') |
| 70 | } | 76 | } |
| 71 | } | 77 | } |
| 72 | } else if (this.contentDTO.objectType === '2') { | 78 | } else if (this.contentDTO.objectType === '2') { |
| @@ -133,7 +139,7 @@ export struct CardMediaInfo { | @@ -133,7 +139,7 @@ export struct CardMediaInfo { | ||
| 133 | .mediaLogo() | 139 | .mediaLogo() |
| 134 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) | 140 | Text(DateTimeUtils.getFormattedDuration(this.contentDTO.voiceInfo.voiceDuration * 1000)) |
| 135 | .mediaText() | 141 | .mediaText() |
| 136 | - .fontFamily('BebasNeueBold') | 142 | + .fontFamily('BebasNeue') |
| 137 | } | 143 | } |
| 138 | } else if (this.contentDTO.objectType === '4') {//广告标签 | 144 | } else if (this.contentDTO.objectType === '4') {//广告标签 |
| 139 | Text($r('app.string.comp_advertisement')) | 145 | Text($r('app.string.comp_advertisement')) |
-
Please register or login to post a comment