Showing
5 changed files
with
74 additions
and
28 deletions
| @@ -11,6 +11,8 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean'; | @@ -11,6 +11,8 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean'; | ||
| 11 | 11 | ||
| 12 | @Observed | 12 | @Observed |
| 13 | export class ContentDTO implements BaseDTO { | 13 | export class ContentDTO implements BaseDTO { |
| 14 | + seoTags?:string; | ||
| 15 | + liveType?: string; // 直播新闻-直播状态 | ||
| 14 | shareFlag?: string = '1'; | 16 | shareFlag?: string = '1'; |
| 15 | appStyle: string = ''; | 17 | appStyle: string = ''; |
| 16 | cityCode: string = ''; | 18 | cityCode: string = ''; |
| @@ -94,6 +96,8 @@ export class ContentDTO implements BaseDTO { | @@ -94,6 +96,8 @@ export class ContentDTO implements BaseDTO { | ||
| 94 | 96 | ||
| 95 | static clone(old: ContentDTO): ContentDTO { | 97 | static clone(old: ContentDTO): ContentDTO { |
| 96 | let content = new ContentDTO(); | 98 | let content = new ContentDTO(); |
| 99 | + content.liveType = old.liveType; | ||
| 100 | + content.seoTags = old.seoTags; | ||
| 97 | content.appStyle = old.appStyle; | 101 | content.appStyle = old.appStyle; |
| 98 | content.cityCode = old.cityCode; | 102 | content.cityCode = old.cityCode; |
| 99 | content.coverSize = old.coverSize; | 103 | content.coverSize = old.coverSize; |
| @@ -79,36 +79,74 @@ export struct CardMediaInfo { | @@ -79,36 +79,74 @@ export struct CardMediaInfo { | ||
| 79 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 79 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 80 | // 显示直播信息 | 80 | // 显示直播信息 |
| 81 | Row() { | 81 | Row() { |
| 82 | - if (this.contentDTO?.liveInfo?.liveState === 'wait') { | ||
| 83 | - Image($r('app.media.card_wait')) | ||
| 84 | - .mediaLogo() | ||
| 85 | - Text('预约') | ||
| 86 | - .mediaText() | ||
| 87 | - } else if (this.contentDTO?.liveInfo?.liveState === 'running') { | ||
| 88 | - LottieView({ | ||
| 89 | - name: 'live_status_wait', | ||
| 90 | - path: "lottie/live_detail_living.json", | ||
| 91 | - lottieWidth: 14, | ||
| 92 | - lottieHeight: 14, | ||
| 93 | - autoplay: true, | ||
| 94 | - loop: true, | 82 | + // 搜索接口没有返回liveInfo字段所以得做个区分 |
| 83 | + if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') { | ||
| 84 | + // 当liveInfo不存在的时候 | ||
| 85 | + if (this.contentDTO?.liveType === 'wait') { | ||
| 86 | + Image($r('app.media.card_wait')) | ||
| 87 | + .mediaLogo() | ||
| 88 | + Text('预约') | ||
| 89 | + .mediaText() | ||
| 90 | + } else if (this.contentDTO?.liveType === 'running') { | ||
| 91 | + LottieView({ | ||
| 92 | + name: 'live_status_wait', | ||
| 93 | + path: "lottie/live_detail_living.json", | ||
| 94 | + lottieWidth: 14, | ||
| 95 | + lottieHeight: 14, | ||
| 96 | + autoplay: true, | ||
| 97 | + loop: true, | ||
| 95 | }) | 98 | }) |
| 96 | - .margin({ | ||
| 97 | - right: '2vp' | 99 | + .margin({ |
| 100 | + right: '2vp' | ||
| 98 | }) | 101 | }) |
| 99 | - // Image($r('app.media.card_live')) | ||
| 100 | - // .mediaLogo() | ||
| 101 | - Text('直播中') | ||
| 102 | - .mediaText() | ||
| 103 | - } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { | ||
| 104 | - Image($r('app.media.card_play')) | ||
| 105 | - .mediaLogo() | ||
| 106 | - Text('回看') | ||
| 107 | - .mediaText() | ||
| 108 | - }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo | ||
| 109 | - ?.replayUri){ | 102 | + // Image($r('app.media.card_live')) |
| 103 | + // .mediaLogo() | ||
| 104 | + Text('直播中') | ||
| 105 | + .mediaText() | ||
| 106 | + } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) { | ||
| 107 | + Image($r('app.media.card_play')) | ||
| 108 | + .mediaLogo() | ||
| 109 | + Text('回看') | ||
| 110 | + .mediaText() | ||
| 111 | + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.linkUrl){ | ||
| 110 | Text('已结束') | 112 | Text('已结束') |
| 111 | .mediaText() | 113 | .mediaText() |
| 114 | + } | ||
| 115 | + }else { | ||
| 116 | + // 当liveInfo存在时后 | ||
| 117 | + | ||
| 118 | + if (this.contentDTO?.liveInfo?.liveState === 'wait') { | ||
| 119 | + Image($r('app.media.card_wait')) | ||
| 120 | + .mediaLogo() | ||
| 121 | + Text('预约') | ||
| 122 | + .mediaText() | ||
| 123 | + } else if (this.contentDTO?.liveInfo?.liveState === 'running') { | ||
| 124 | + LottieView({ | ||
| 125 | + name: 'live_status_wait', | ||
| 126 | + path: "lottie/live_detail_living.json", | ||
| 127 | + lottieWidth: 14, | ||
| 128 | + lottieHeight: 14, | ||
| 129 | + autoplay: true, | ||
| 130 | + loop: true, | ||
| 131 | + }) | ||
| 132 | + .margin({ | ||
| 133 | + right: '2vp' | ||
| 134 | + }) | ||
| 135 | + // Image($r('app.media.card_live')) | ||
| 136 | + // .mediaLogo() | ||
| 137 | + Text('直播中') | ||
| 138 | + .mediaText() | ||
| 139 | + } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { | ||
| 140 | + Image($r('app.media.card_play')) | ||
| 141 | + .mediaLogo() | ||
| 142 | + Text('回看') | ||
| 143 | + .mediaText() | ||
| 144 | + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo | ||
| 145 | + ?.replayUri){ | ||
| 146 | + Text('已结束') | ||
| 147 | + .mediaText() | ||
| 148 | + } | ||
| 149 | + | ||
| 112 | } | 150 | } |
| 113 | if (!!this.joinPeopleNum) { | 151 | if (!!this.joinPeopleNum) { |
| 114 | Text(' | ') | 152 | Text(' | ') |
| @@ -55,7 +55,6 @@ export struct Card2Component { | @@ -55,7 +55,6 @@ export struct Card2Component { | ||
| 55 | Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) | 55 | Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) |
| 56 | //Notes({ objectType: this.contentDTO.objectType }) | 56 | //Notes({ objectType: this.contentDTO.objectType }) |
| 57 | } | 57 | } |
| 58 | - | ||
| 59 | Text() { | 58 | Text() { |
| 60 | if (this.titleMarked) { | 59 | if (this.titleMarked) { |
| 61 | Span(this.str01) | 60 | Span(this.str01) |
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | export struct Notes { | 9 | export struct Notes { |
| 10 | @State objectType: number | string = 5 | 10 | @State objectType: number | string = 5 |
| 11 | @State newTags: string = '' | 11 | @State newTags: string = '' |
| 12 | - | 12 | + @State seoTags: string = '' |
| 13 | build() { | 13 | build() { |
| 14 | if (this.returnTypeTitleFn()) { | 14 | if (this.returnTypeTitleFn()) { |
| 15 | Text(this.returnTypeTitleFn()) | 15 | Text(this.returnTypeTitleFn()) |
| @@ -458,7 +458,12 @@ export struct SearchResultContentComponent { | @@ -458,7 +458,12 @@ export struct SearchResultContentComponent { | ||
| 458 | let rmhInfo = this.getRmhInfo(rem,value) | 458 | let rmhInfo = this.getRmhInfo(rem,value) |
| 459 | console.log('获取photos',JSON.stringify(photos)) | 459 | console.log('获取photos',JSON.stringify(photos)) |
| 460 | console.log('获取value2',JSON.stringify(value)) | 460 | console.log('获取value2',JSON.stringify(value)) |
| 461 | + let liveType = value.data?.liveType; | ||
| 462 | + let seoTags = value.data?.seoTags | ||
| 461 | let contentDTO = new ContentDTO(); | 463 | let contentDTO = new ContentDTO(); |
| 464 | + contentDTO.liveType = liveType?liveType: "" | ||
| 465 | + contentDTO.seoTags = seoTags?seoTags: "" | ||
| 466 | + // console.log('获取value333333333',JSON.stringify(contentDTO.liveType)) | ||
| 462 | contentDTO.appStyle = value.data.appStyle + "" | 467 | contentDTO.appStyle = value.data.appStyle + "" |
| 463 | contentDTO.cityCode = value.data.cityCode | 468 | contentDTO.cityCode = value.data.cityCode |
| 464 | contentDTO.coverSize = "" | 469 | contentDTO.coverSize = "" |
-
Please register or login to post a comment