王士厅

早晚报-引用语音读报稿件不展示语音读报按钮

@@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent { @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent {
86 offset: { dx: 12, dy: -150 }, 86 offset: { dx: 12, dy: -150 },
87 87
88 }) 88 })
89 - // private AudioSuspension = new AudioSuspensionModel() 89 + private AudioSuspension = new AudioSuspensionModel()
90 90
91 onCancel() { 91 onCancel() {
92 Logger.info(TAG, "cj2024 onCancel = ") 92 Logger.info(TAG, "cj2024 onCancel = ")
@@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent { @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent {
149 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime) 149 Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
150 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle) 150 Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
151 151
  152 + Logger.info(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
  153 +
152 this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false 154 this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
153 let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' 155 let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
154 this.setComponentBgColor(coverUrl) 156 this.setComponentBgColor(coverUrl)
155 157
156 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) 158 let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
157 // this.compInfoBean = compInfoBean 159 // this.compInfoBean = compInfoBean
  160 + Logger.info(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
158 if (compInfoBean?.compList[0]) { 161 if (compInfoBean?.compList[0]) {
159 this.compListItem = compInfoBean?.compList[0] 162 this.compListItem = compInfoBean?.compList[0]
160 Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) 163 Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
161 if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { 164 if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) {
162 this.getAllContentInteractData(this.compListItem.operDataList) 165 this.getAllContentInteractData(this.compListItem.operDataList)
163 } 166 }
164 - Logger.debug('compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) 167 + Logger.debug(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
165 if (compInfoBean?.compList[0].audioDataList) { 168 if (compInfoBean?.compList[0].audioDataList) {
166 this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl 169 this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl
167 this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title 170 this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title
@@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent { @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent {
258 topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) 261 topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
259 } 262 }
260 263
261 - //暂时不展示音频播报  
262 - // if (this.audioPlayUrl.length > 0){  
263 - // ListItem() {  
264 - // this.AudioBarView(this.simpleAudioDialog)  
265 - // }  
266 - // } 264 + if (this.audioPlayUrl !== ""){
  265 + ListItem() {
  266 + this.AudioBarView()
  267 + }
  268 + }
267 } 269 }
268 270
269 ListItem() { 271 ListItem() {
@@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent { @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent {
307 } 309 }
308 310
309 @Builder 311 @Builder
310 - AudioBarView(dialog: CustomDialogController) { 312 + AudioBarView() {
311 Row() { 313 Row() {
312 Stack({ alignContent: Alignment.Start }) { 314 Stack({ alignContent: Alignment.Start }) {
313 Image($r('app.media.listen_left_bg')) 315 Image($r('app.media.listen_left_bg'))
@@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent { @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent {
320 .margin({ left: 10 }) 322 .margin({ left: 10 })
321 .alignSelf(ItemAlign.Start) 323 .alignSelf(ItemAlign.Start)
322 324
323 - Text('晚上好, 请收听今日新闻播报') 325 + Text(`${this.pageInfoBean.topicInfo.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
324 .fontSize(14) 326 .fontSize(14)
325 .margin({ left: 50 }) 327 .margin({ left: 50 })
326 .fontColor(Color.Black) 328 .fontColor(Color.Black)
@@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent { @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent {
345 Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) 347 Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
346 // dialog.open() 348 // dialog.open()
347 // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) 349 // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
348 - // this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) 350 + this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
349 Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) 351 Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
350 Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) 352 Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
351 }) 353 })