import { defineComponent } from "vue"; import styles from './index.module.less' import event, { LIVE_EVENT_MESSAGE } from '/src/components/live-broadcast/event'; import { state } from '/src/state' import dayjs from 'dayjs'; import Empty from "/src/components/empty"; import runtime, * as RuntimeUtils from '/src/components/live-broadcast/runtime' export default defineComponent({ props: { data: { type: Array, default: () => ([]) } }, data() { return { joinList: [] as any[], // 连麦学生列表 loadingJoin: false, // 连麦列表状态 } }, mounted() { event.on(LIVE_EVENT_MESSAGE['RC:Chatroom:SeatApply'], this.onSeatApply); }, methods: { onSeatApply(evt: any) { console.log(evt) if (evt.type === 3) { this.joinList.push({ name: evt.audienceName, id: evt.audienceId, type: evt.type, }) } }, agree() { RuntimeUtils.sendMessage({ audienceId: '1094335', audienceName: '小伙伴', teacherId: state.user?.id, teacherName: state.user?.realName, type: 1, }, 'SeatResponse') }, refuse() {}, }, render() { console.log(this.joinList.length) return (
{this.joinList.length > 0 ? this.joinList.map((item : any) => (

{item.name}

{item.type === 3 ? (
申请连麦
上麦
) : (
正在连麦
下麦
)}
)) : this.loadingJoin ?
: }
) } })