Showing
2 changed files
with
9 additions
and
1 deletions
| @@ -14,6 +14,8 @@ import font from '@ohos.font'; | @@ -14,6 +14,8 @@ import font from '@ohos.font'; | ||
| 14 | export struct CardMediaInfo { | 14 | export struct CardMediaInfo { |
| 15 | 15 | ||
| 16 | @State livePeopleNum :boolean = true | 16 | @State livePeopleNum :boolean = true |
| 17 | + //@ObjectLink compDTO: CompDTO | ||
| 18 | + @State beused: string = ''; // 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空 | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 | 19 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 |
| 18 | @State joinPeopleNum: number = 0; | 20 | @State joinPeopleNum: number = 0; |
| 19 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, | 21 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, |
| @@ -154,12 +156,17 @@ export struct CardMediaInfo { | @@ -154,12 +156,17 @@ export struct CardMediaInfo { | ||
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | } | 158 | } |
| 159 | + // 备注直播间观看人数在轮播图卡不显示 | ||
| 160 | + if(this.beused !== 'Zh_Carousel_Layout_01'){ | ||
| 157 | if (!!this.joinPeopleNum) { | 161 | if (!!this.joinPeopleNum) { |
| 158 | Text(' | ') | 162 | Text(' | ') |
| 159 | .mediaText() | 163 | .mediaText() |
| 160 | Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`) | 164 | Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`) |
| 161 | .mediaText() | 165 | .mediaText() |
| 162 | } | 166 | } |
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 163 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | 170 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo |
| 164 | // ?.replayUri) { | 171 | // ?.replayUri) { |
| 165 | // // Image($r('app.media.card_live')) | 172 | // // Image($r('app.media.card_live')) |
| @@ -204,7 +204,8 @@ struct CarouselLayout01CardView { | @@ -204,7 +204,8 @@ struct CarouselLayout01CardView { | ||
| 204 | Column() { | 204 | Column() { |
| 205 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 | 205 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 |
| 206 | if (this.item.objectType === '2' || this.item.objectType === '4') { | 206 | if (this.item.objectType === '2' || this.item.objectType === '4') { |
| 207 | - CardMediaInfo({ contentDTO: this.item,livePeopleNum:false }) | 207 | + // 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空 |
| 208 | + CardMediaInfo({ contentDTO: this.item,livePeopleNum:false ,beused:'Zh_Carousel_Layout_01'}) | ||
| 208 | .width(CommonConstants.FULL_PARENT) | 209 | .width(CommonConstants.FULL_PARENT) |
| 209 | } | 210 | } |
| 210 | Blank() | 211 | Blank() |
-
Please register or login to post a comment