|
@@ -50,8 +50,9 @@
|
|
|
import { propTypes } from '/@/utils/propTypes';
|
|
|
import { UserInfoType, useRtcStore } from '/@/store/modules/rtc';
|
|
|
import defaultAvatar from '/@/assets/images/rtcLive/avatar_small@2x.png';
|
|
|
- import { computed, watchEffect } from 'vue';
|
|
|
+ import { computed, unref, watch, watchEffect } from 'vue';
|
|
|
import { useSocket } from '/@/hooks/userSocket';
|
|
|
+ import Dialog from '../basic/dialog';
|
|
|
const rtcStore = useRtcStore();
|
|
|
|
|
|
const role = computed(() => rtcStore.role);
|
|
@@ -74,6 +75,17 @@
|
|
|
watchEffect(() => {
|
|
|
console.log('memberList', props.data);
|
|
|
});
|
|
|
+ watch(
|
|
|
+ () => props.data,
|
|
|
+ (val) => {
|
|
|
+ if (val.length > 3 && unref(role) == 'customer') {
|
|
|
+ Dialog.toast({ content: `房间已满员` });
|
|
|
+ const { closeSocket } = useSocket();
|
|
|
+ closeSocket();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { deep: true },
|
|
|
+ );
|
|
|
const emit = defineEmits(['openMember', 'closeMember']);
|
|
|
|
|
|
function closeMember(): void {
|