|
@@ -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>
|