Skip to content

Commit

Permalink
perf: 优化会议
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Dec 20, 2024
1 parent 34af77e commit f9540b0
Showing 1 changed file with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export default {
this.addShow = data.show;
this.invitationShow = data.show;
this.invitationLoad = false;
this.openModal('加入会议失败');
$A.modalError('加入会议失败');
break;
}
},
Expand Down Expand Up @@ -320,7 +320,10 @@ export default {
isMeeting = this.meetingShow;
}
if (isMeeting) {
this.openModal("正在会议中,无法进入其他会议室", 'warning');
$A.modalWarning({
content: "正在会议中,无法进入其他会议室",
onOk: this.onBeforeClose
});
return;
}
Expand Down Expand Up @@ -419,7 +422,10 @@ export default {
// 关闭弹窗
this.addShow = false;
}).catch(({ msg }) => {
this.openModal(msg);
$A.modalError({
content: msg,
onOk: this.onBeforeClose
});
}).finally(_ => {
loader(false);
});
Expand All @@ -430,12 +436,18 @@ export default {
$A.loadScript('js/AgoraRTC_N-4.17.0.js').then(_ => {
this.join(data)
}).catch(_ => {
this.openModal("会议组件加载失败!");
$A.modalError({
content: "会议组件加载失败!",
onOk: this.onBeforeClose
});
}).finally(_ => {
loader(false);
})
}).catch(({msg}) => {
this.openModal(msg);
$A.modalError({
content: msg,
onOk: this.onBeforeClose
});
}).finally(_ => {
loader(false);
});
Expand Down Expand Up @@ -470,7 +482,7 @@ export default {
this.invitationShow = true;
} else if (type === 'submit') {
if (this.invitationData.userids.length === 0) {
this.openModal("请选择邀请成员", 'warning');
$A.modalWarning("请选择邀请成员");
return;
}
this.invitationLoad = true;
Expand All @@ -483,7 +495,7 @@ export default {
this.$store.dispatch("updateDialogLastMsg", data.msgs);
$A.messageSuccess(msg);
}).catch(({msg}) => {
this.openModal(msg);
$A.modalError(msg);
}).finally(_ => {
this.invitationLoad = false;
});
Expand All @@ -496,20 +508,14 @@ export default {
content: '确定要离开会议吗?',
cancelText: '继续',
okText: '退出',
onOk: this.onBeforeClose
onOk: async () => {
await this.onBeforeClose()
resolve()
}
});
})
},
openModal(msg, type) {
const modal = type === 'warning' ? $A.modalWarning : $A.modalError;
modal({
content: msg,
onOk: this.onBeforeClose
});
},
async onBeforeClose() {
try {
await this.leave()
Expand Down Expand Up @@ -539,7 +545,7 @@ export default {
});
this.invitationShow = false;
}).catch(({ msg }) => {
this.openModal(msg);
$A.modalError(msg);
}).finally(_ => {
this.linkCopyLoad = false;
});
Expand Down

0 comments on commit f9540b0

Please sign in to comment.