yumaochao

fix:somebug

@@ -89,72 +89,79 @@ export struct CardMediaInfo { @@ -89,72 +89,79 @@ export struct CardMediaInfo {
89 Row() { 89 Row() {
90 // 搜索接口没有返回liveInfo字段所以得做个区分 90 // 搜索接口没有返回liveInfo字段所以得做个区分
91 if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') { 91 if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') {
92 - // 当liveInfo不存在的时候  
93 - if (this.contentDTO?.liveType === 'wait') {  
94 - Image($r('app.media.card_wait'))  
95 - .mediaLogo()  
96 - Text('预约')  
97 - .mediaText()  
98 - } else if (this.contentDTO?.liveType === 'running') {  
99 - LottieView({  
100 - name: 'live_status_wait',  
101 - path: "lottie/live_detail_living.json",  
102 - lottieWidth: 14,  
103 - lottieHeight: 14,  
104 - autoplay: true,  
105 - loop: true,  
106 - })  
107 - .margin({  
108 - right: '2vp' 92 + Text(JSON.stringify(this.contentDTO?.linkUrl))
  93 + Text(JSON.stringify(this.contentDTO?.liveType))
  94 + // 当liveInfo不存在的时候
  95 + if (this.contentDTO?.liveType === 'wait') {
  96 + Image($r('app.media.card_wait'))
  97 + .mediaLogo()
  98 + Text('预约')
  99 + .mediaText()
  100 + } else if (this.contentDTO?.liveType === 'running') {
  101 + LottieView({
  102 + name: 'live_status_wait',
  103 + path: "lottie/live_detail_living.json",
  104 + lottieWidth: 14,
  105 + lottieHeight: 14,
  106 + autoplay: true,
  107 + loop: true,
109 }) 108 })
110 - // Image($r('app.media.card_live'))  
111 - // .mediaLogo()  
112 - Text('直播中')  
113 - .mediaText()  
114 - } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) {  
115 - Image($r('app.media.card_play'))  
116 - .mediaLogo()  
117 - Text('回看')  
118 - .mediaText()  
119 - }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.linkUrl){  
120 - Text('已结束')  
121 - .mediaText()  
122 - } 109 + .margin({
  110 + right: '2vp'
  111 + })
  112 + Text('直播中')
  113 + .mediaText()
  114 + } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) {
  115 + Image($r('app.media.card_play'))
  116 + .mediaLogo()
  117 + Text('回看')
  118 + .mediaText()
  119 + }else if(this.contentDTO?.liveType === 'end' && !this.contentDTO?.linkUrl){
  120 + Text('已结束')
  121 + .mediaText()
  122 + }else if(!this.contentDTO?.liveType && this.contentDTO?.linkUrl){
  123 + // 加个防护,生产有出现这样的特例
  124 + Image($r('app.media.card_play'))
  125 + .mediaLogo()
  126 + Text('回看')
  127 + .mediaText()
  128 + }
  129 +
123 }else { 130 }else {
124 // 当liveInfo存在时后 131 // 当liveInfo存在时后
125 132
126 - if (this.contentDTO?.liveInfo?.liveState === 'wait') {  
127 - Image($r('app.media.card_wait'))  
128 - .mediaLogo()  
129 - Text('预约')  
130 - .mediaText()  
131 - } else if (this.contentDTO?.liveInfo?.liveState === 'running') {  
132 - LottieView({  
133 - name: 'live_status_wait',  
134 - path: "lottie/live_detail_living.json",  
135 - lottieWidth: 14,  
136 - lottieHeight: 14,  
137 - autoplay: true,  
138 - loop: true,  
139 - })  
140 - .margin({  
141 - right: '2vp'  
142 - })  
143 - // Image($r('app.media.card_live'))  
144 - // .mediaLogo()  
145 - Text('直播中')  
146 - .mediaText()  
147 - } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {  
148 - Image($r('app.media.card_play'))  
149 - .mediaLogo()  
150 - Text('回看')  
151 - .mediaText()  
152 - }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo  
153 - ?.replayUri){  
154 - Text('已结束')  
155 - .mediaText()  
156 - }  
157 - 133 + if (this.contentDTO?.liveInfo?.liveState === 'wait') {
  134 + Image($r('app.media.card_wait'))
  135 + .mediaLogo()
  136 + Text('预约')
  137 + .mediaText()
  138 + } else if (this.contentDTO?.liveInfo?.liveState === 'running') {
  139 + Row(){
  140 + LottieView({
  141 + name: 'live_status_wait',
  142 + path: "lottie/live_detail_living.json",
  143 + lottieWidth: 14,
  144 + lottieHeight: 14,
  145 + autoplay: true,
  146 + loop: true,
  147 + }).margin({
  148 + right: '2vp'
  149 + })
  150 + Text('直播中')
  151 + .mediaText()
  152 +
  153 + }
  154 +
  155 + } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
  156 + Image($r('app.media.card_play'))
  157 + .mediaLogo()
  158 + Text('回看')
  159 + .mediaText()
  160 + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo
  161 + ?.replayUri){
  162 + Text('已结束')
  163 + .mediaText()
  164 + }
158 } 165 }
159 // 备注直播间观看人数在轮播图卡不显示 166 // 备注直播间观看人数在轮播图卡不显示
160 if(this.beused !== 'Zh_Carousel_Layout_01'){ 167 if(this.beused !== 'Zh_Carousel_Layout_01'){
@@ -165,15 +172,6 @@ export struct CardMediaInfo { @@ -165,15 +172,6 @@ export struct CardMediaInfo {
165 .mediaText() 172 .mediaText()
166 } 173 }
167 } 174 }
168 -  
169 -  
170 - // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo  
171 - // ?.replayUri) {  
172 - // // Image($r('app.media.card_live'))  
173 - // // .mediaLogo()  
174 - // Text('直播结束')  
175 - // .mediaText()  
176 - // }  
177 } 175 }
178 } else if (this.contentDTO.objectType === '9') { 176 } else if (this.contentDTO.objectType === '9') {
179 // 显示组图;图片数量 177 // 显示组图;图片数量