王士厅

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

... ... @@ -86,7 +86,7 @@ export struct MorningEveningPaperComponent {
offset: { dx: 12, dy: -150 },
})
// private AudioSuspension = new AudioSuspensionModel()
private AudioSuspension = new AudioSuspensionModel()
onCancel() {
Logger.info(TAG, "cj2024 onCancel = ")
... ... @@ -149,19 +149,22 @@ export struct MorningEveningPaperComponent {
Logger.info(TAG, "pageInfoBean dateTime = " + dateTime)
Logger.info(TAG, "pageInfoBean subTitle = " + this.subTitle)
Logger.info(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean))
this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false
let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :''
this.setComponentBgColor(coverUrl)
let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId)
// this.compInfoBean = compInfoBean
Logger.info(TAG, "compInfoBean = " + JSON.stringify(compInfoBean))
if (compInfoBean?.compList[0]) {
this.compListItem = compInfoBean?.compList[0]
Logger.debug(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`)
if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) {
this.getAllContentInteractData(this.compListItem.operDataList)
}
Logger.debug('compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
Logger.debug(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList))
if (compInfoBean?.compList[0].audioDataList) {
this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0].audioUrl
this.audioTitle = compInfoBean?.compList[0].audioDataList[0].title
... ... @@ -258,12 +261,11 @@ export struct MorningEveningPaperComponent {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
}
//暂时不展示音频播报
// if (this.audioPlayUrl.length > 0){
// ListItem() {
// this.AudioBarView(this.simpleAudioDialog)
// }
// }
if (this.audioPlayUrl !== ""){
ListItem() {
this.AudioBarView()
}
}
}
ListItem() {
... ... @@ -307,7 +309,7 @@ export struct MorningEveningPaperComponent {
}
@Builder
AudioBarView(dialog: CustomDialogController) {
AudioBarView() {
Row() {
Stack({ alignContent: Alignment.Start }) {
Image($r('app.media.listen_left_bg'))
... ... @@ -320,7 +322,7 @@ export struct MorningEveningPaperComponent {
.margin({ left: 10 })
.alignSelf(ItemAlign.Start)
Text('晚上好, 请收听今日新闻播报')
Text(`${this.pageInfoBean.topicInfo.topicPattern === 1 ? '早上好' : this.pageInfoBean.topicInfo.topicPattern === 2 ? '中午好' : '晚上好'}, 请收听今日新闻播报`)
.fontSize(14)
.margin({ left: 50 })
.fontColor(Color.Black)
... ... @@ -345,7 +347,7 @@ export struct MorningEveningPaperComponent {
Logger.info("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying)
// dialog.open()
// this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle)
// this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
Logger.info(TAG, "this.audioPlayUrl = " + this.audioPlayUrl)
Logger.info("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying)
})
... ...