Browse Source

Merge branch 'master' of http://git.jihengcc.cn/liubaiyan/qjd-user-uniapp

zhaoxw 4 years ago
parent
commit
e089c5c320
1 changed files with 21 additions and 1 deletions
  1. 21 1
      jhlive/jhlive.nvue

+ 21 - 1
jhlive/jhlive.nvue

@@ -9,7 +9,9 @@
       :roomid="roomId" 
       :isAuthor="isAuthor"
       :linkMic="linkMic" 
-      :liveEvent="handleLiveEvent" />
+      @onError="onError"
+	  @onRemoteUserEnterRoom="onRemoteUserEnterRoom"
+	  @onRemoteUserLeaveRoom="onRemoteUserLeaveRoom" />
     <view class="top_left_box">
       <image class="top_left_box_img" :src="avatar"></image>
       <view class="top_left_box_text">
@@ -138,6 +140,24 @@ export default {
         });
       }
     },
+	onError: (e)=> {
+		uni.showToast({
+		  title: e.detail,
+		  duration: 2000
+		});
+        this.$emit('onError', e.detail);
+    },
+	onRemoteUserEnterRoom: (e)=> {
+		if(this.remoteUsers.find(v=>v==e.detail)) {
+			this.remoteUsers.push(e.detail);
+			this.$emit('onRemoteUser', this.remoteUsers);
+		}
+	},
+	onRemoteUserLeaveRoom: (e)=> {
+		this.remoteUsers = this.remoteUsers.filter(v=>v!=e.detail);
+		this.$emit('onRemoteUser', this.remoteUsers);
+	}
+	
 	}
 };
 </script>