|
@@ -70,7 +70,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {apiVoiceList,apiVoiceSectionList,apiVoicePlayRecord} from '@/api/voice'
|
|
|
+import {apiVoiceList,apiVoiceSectionList,apiVoicePlayRecord,apiVoiceDel} from '@/api/voice'
|
|
|
import {apiGetSceneToParams} from '@/api/common'
|
|
|
import noAuth from './components/noAuth.vue'
|
|
|
const moment=require('@/utils/moment-with-locales.min')
|
|
@@ -120,7 +120,11 @@ export default {
|
|
|
this.init(options)
|
|
|
this.getOptionsList()
|
|
|
this.listenAudio()
|
|
|
+ this.addListenVoiceSuccess()
|
|
|
},
|
|
|
+ onUnload(){
|
|
|
+ uni.$off('addVoiceSuccess')
|
|
|
+ },
|
|
|
onShareAppMessage({from,target}) {
|
|
|
console.log(from,target);
|
|
|
let path='/pages/voice/voice?voiceId=0'
|
|
@@ -129,7 +133,7 @@ export default {
|
|
|
if(from=='button'){
|
|
|
title=`${target.dataset.item.SectionName}:${target.dataset.item.BroadcastName}`
|
|
|
path=`/pages/voice/voice?voiceId=${target.dataset.item.BroadcastId}`
|
|
|
- imageUrl=''
|
|
|
+ imageUrl=target.dataset.item.ImgUrl
|
|
|
}
|
|
|
return {
|
|
|
title:title,
|
|
@@ -155,6 +159,18 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // 监听添加音频成功刷新列表
|
|
|
+ addListenVoiceSuccess(){
|
|
|
+ uni.$on('addVoiceSuccess',()=>{
|
|
|
+ this.voiceId=0
|
|
|
+ this.page=1
|
|
|
+ this.list=[]
|
|
|
+ this.finished=false
|
|
|
+ this.getVoiceList()
|
|
|
+ this.getOptionsList()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
async init(options){
|
|
|
if(options.scene){
|
|
|
const res=await apiGetSceneToParams({scene_key:options.scene})
|
|
@@ -183,6 +199,22 @@ export default {
|
|
|
if(arr.length===0){
|
|
|
this.finished=true
|
|
|
}
|
|
|
+
|
|
|
+ // 如果有voiceId 则说明是分享进入的 如果没有数据则提示
|
|
|
+ if(this.voiceId!=0&&arr.length===0){
|
|
|
+ uni.showToast({
|
|
|
+ title:'该语音播报不存在',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.voiceId=0
|
|
|
+ this.page=1
|
|
|
+ this.list=[]
|
|
|
+ this.finished=false
|
|
|
+ this.getVoiceList()
|
|
|
+ this.getOptionsList()
|
|
|
+ }, 1500);
|
|
|
+ }
|
|
|
}else if(res.code===403){
|
|
|
//无权限用户
|
|
|
this.isAuth=false
|
|
@@ -257,6 +289,7 @@ export default {
|
|
|
|
|
|
//没有初始化时
|
|
|
if(!innerAudioContext.src){
|
|
|
+ this.listenAudio()
|
|
|
this.temAudio.id=item.BroadcastId
|
|
|
this.temAudio.duration=item.VoicePlaySeconds
|
|
|
this.temAudio.curTime=item.VoicePlaySeconds
|