|
@@ -59,7 +59,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {apiVoiceList,apiVoicePlayRecord,apiVoiceDel,apiVoiceSendMsg,apiVoicePublish} from '@/api/voice'
|
|
|
+import {apiVoiceList,apiVoicePlayRecord,apiVoiceDel,apiVoiceSendMsg,apiVoicePublish,apiMyVoiceCount} from '@/api/voice'
|
|
|
import audioBox from '@/components/audioBox/audioBox.vue'
|
|
|
const moment=require('@/utils/moment-with-locales.min')
|
|
|
export default {
|
|
@@ -101,17 +101,20 @@ export default {
|
|
|
{
|
|
|
lable:'未发布',
|
|
|
count:0,
|
|
|
- value:0
|
|
|
+ value:0,
|
|
|
+ key:'Unpublished'
|
|
|
},
|
|
|
{
|
|
|
lable:'已发布',
|
|
|
count:0,
|
|
|
- value:1
|
|
|
+ value:1,
|
|
|
+ key:'Published'
|
|
|
},
|
|
|
{
|
|
|
lable:'全部',
|
|
|
count:0,
|
|
|
- value:2
|
|
|
+ value:2,
|
|
|
+ key:'All'
|
|
|
}
|
|
|
],
|
|
|
|
|
@@ -119,6 +122,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onLoad(){
|
|
|
+ this.getCount()
|
|
|
this.getList()
|
|
|
},
|
|
|
onShow(){
|
|
@@ -175,6 +179,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ //获取数量
|
|
|
+ async getCount(){
|
|
|
+ const res=await apiMyVoiceCount({author_id:this.$store.state.user.userInfo.user_id})
|
|
|
+ if(res.code===200){
|
|
|
+ this.statusOpt.forEach(item => {
|
|
|
+ item.count=res.data[item.key]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
//状态改变
|
|
|
handleOptChange(item){
|
|
|
this.status=item.value
|
|
@@ -224,11 +238,10 @@ export default {
|
|
|
message: '确定要删除该语音播报吗?',
|
|
|
confirmButtonText:'确定'
|
|
|
}).then(()=>{
|
|
|
- if(this.temAudio.item&&this.temAudio.item.id==item.BroadcastId){
|
|
|
+ if(this.curVoiceId==item.BroadcastId&&!this.curAudioPaused){
|
|
|
//删除的音频正好在播放则暂停
|
|
|
this.globalBgMusic.stop()
|
|
|
}
|
|
|
-
|
|
|
apiVoiceDel({broadcast_id:Number(item.BroadcastId)}).then(res=>{
|
|
|
if(res.code===200){
|
|
|
uni.showToast({
|
|
@@ -238,7 +251,8 @@ export default {
|
|
|
this.page=1
|
|
|
this.list=[]
|
|
|
this.finished=false
|
|
|
- this.getVoiceList()
|
|
|
+ this.getList()
|
|
|
+ this.getCount()
|
|
|
}
|
|
|
})
|
|
|
}).catch(()=>{})
|
|
@@ -266,6 +280,7 @@ export default {
|
|
|
this.list=[]
|
|
|
this.finished=false
|
|
|
this.getList()
|
|
|
+ this.getCount()
|
|
|
}else{
|
|
|
uni.showToast({
|
|
|
title:sendRes.msg,
|