wangliang_wd

feat:优化早晚报语音播报自动循环播放逻辑

@@ -144,8 +144,26 @@ export struct MorningEveningPaperComponent { @@ -144,8 +144,26 @@ export struct MorningEveningPaperComponent {
144 } 144 }
145 } 145 }
146 EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { 146 EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
147 - // console.log(TAG, 'this.currentStatus', val) 147 + console.log(TAG, 'this.currentStatus', val)
148 this.currentStatus = val 148 this.currentStatus = val
  149 +
  150 + if (this.currentStatus === 5) {
  151 + let audioIndex = 0
  152 + this.compInfoBean?.compList[0].audioDataList.forEach((item,index)=>{
  153 + if (item.audioUrl === this.audioPlayUrl) {
  154 + audioIndex = index + 1
  155 + }
  156 + })
  157 +
  158 + ///最后一个了
  159 + if (audioIndex === this.compInfoBean?.compList[0].audioDataList.length - 1) {
  160 + audioIndex = 0
  161 + }
  162 +
  163 + this.audioPlayUrl = this.compInfoBean?.compList[0].audioDataList[audioIndex]?.audioUrl
  164 + this.audioTitle = this.compInfoBean?.compList[0].audioDataList[audioIndex]?.title
  165 + this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle)
  166 + }
149 }) 167 })
150 } 168 }
151 169