jwyu %!s(int64=2) %!d(string=hai) anos
pai
achega
cc77c2688d
Modificáronse 2 ficheiros con 16 adicións e 0 borrados
  1. 1 0
      pages-voice/addVoice.vue
  2. 15 0
      pages-voice/myVoice.vue

+ 1 - 0
pages-voice/addVoice.vue

@@ -601,6 +601,7 @@ export default {
                             icon:'success'
                         })
                         setTimeout(() => {
+                            uni.$emit('addVoiceSuccess')
                             uni.navigateBack()
                         }, 1000);
                     }

+ 15 - 0
pages-voice/myVoice.vue

@@ -124,6 +124,7 @@ export default {
     onLoad(){
         this.getCount()
         this.getList()
+        this.addListenVoiceSuccess()
     },
     onShow(){
         this.showPage=true
@@ -131,6 +132,9 @@ export default {
     onHide(){
         this.showPage=false
     },
+    onUnload(){
+		uni.$off('addVoiceSuccess')
+	},
     onPullDownRefresh(){
         this.page=1
         this.list=[]
@@ -162,6 +166,17 @@ export default {
         }
     },
     methods: {  
+        // 监听添加音频成功刷新列表
+        addListenVoiceSuccess(){
+            uni.$on('addVoiceSuccess',()=>{
+                this.page=1
+                this.list=[]
+                this.finished=false
+                this.getCount()
+                this.getList()
+            })
+        },
+
         //获取列表数据
         async getList(){
             const res=await apiVoiceList({