Compare commits

...

4 Commits

Author SHA1 Message Date
cxc
fcc2842b33 修复全屏时视频框尺寸问题、会议结束时主持人结束会议 2022-06-09 15:47:07 +08:00
cxc
74a8f058c1 stop audio stream 2022-06-09 11:07:22 +08:00
cxc
aed3fee7a6 缓存聊天记录 2022-06-09 10:44:12 +08:00
cxc
d98beeca62 默认背景图 2022-06-09 10:22:55 +08:00
4 changed files with 61 additions and 28 deletions

View File

@ -90,7 +90,9 @@ onMounted(() => {
isVideoAvailable.value = false; isVideoAvailable.value = false;
} }
try { try {
audioStream.value = navigator.mediaDevices.getUserMedia({ audio: true }); audioStream.value = await navigator.mediaDevices.getUserMedia({
audio: true,
});
isAudioAvailable.value = true; isAudioAvailable.value = true;
} catch (error) { } catch (error) {
console.log(error); console.log(error);

View File

@ -79,6 +79,7 @@ router.beforeEach(async (to) => {
// 如果要去的页面会议号于 vuex中的不一样则清除数据 // 如果要去的页面会议号于 vuex中的不一样则清除数据
if (to.params.meetingId !== store.state.joinUser.meetingId) { if (to.params.meetingId !== store.state.joinUser.meetingId) {
store.commit("setJoinUser", {}); store.commit("setJoinUser", {});
store.commit("setMessagesList", []);
} }
// 如果参会方式发生更改,则清除数据 // 如果参会方式发生更改,则清除数据
if ( if (
@ -147,6 +148,7 @@ router.beforeEach(async (to) => {
// 如果要去的页面会议号于 vuex中的不一样则清除数据 // 如果要去的页面会议号于 vuex中的不一样则清除数据
if (to.params.meetingId !== store.state.joinUser.meetingId) { if (to.params.meetingId !== store.state.joinUser.meetingId) {
store.commit("setJoinUser", {}); store.commit("setJoinUser", {});
store.commit("setMessagesList", []);
} }
if (store.state.joinUser.icCard) { if (store.state.joinUser.icCard) {
try { try {

View File

@ -8,6 +8,9 @@ const store = createStore({
: {}, : {},
meeting: {}, meeting: {},
meetingSetting: {}, meetingSetting: {},
messagesList: localStorage.getItem("MESSAGES")
? JSON.parse(localStorage.getItem("MESSAGES"))
: [],
password: "", //参会密码 password: "", //参会密码
joinType: localStorage.getItem("JOINTYPE") joinType: localStorage.getItem("JOINTYPE")
? JSON.parse(localStorage.getItem("JOINTYPE")) ? JSON.parse(localStorage.getItem("JOINTYPE"))
@ -36,6 +39,10 @@ const store = createStore({
setMeetingSetting(state, data) { setMeetingSetting(state, data) {
state.meetingSetting = data; state.meetingSetting = data;
}, },
setMessagesList(state, data) {
state.messagesList = data;
localStorage.setItem("MESSAGES", JSON.stringify(data));
},
}, },
actions: { actions: {
// 请求会议信息 // 请求会议信息

View File

@ -9,6 +9,7 @@
:class="{ :class="{
fullscreen: isFullScreen && !isVerticalFullScreen, fullscreen: isFullScreen && !isVerticalFullScreen,
verticalFullScreen: isVerticalFullScreen, verticalFullScreen: isVerticalFullScreen,
notInSharing: !inSharing,
}" }"
> >
<div <div
@ -69,6 +70,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
title="签到" title="签到"
width="30%" width="30%"
:fullscreen="screenWidth < 900"
> >
<span>是否确认签到</span> <span>是否确认签到</span>
<template #footer> <template #footer>
@ -559,6 +561,7 @@ const initWebSocket = () => {
id: uniqueId(), id: uniqueId(),
time: dayjs().format("YYYY-MM-DD HH:mm:ss"), time: dayjs().format("YYYY-MM-DD HH:mm:ss"),
}); });
store.commit("setMessagesList", messages.value);
} }
// 开始签到时 // 开始签到时
else if (data.type === "isStartSign" && route.name === "Meeting") { else if (data.type === "isStartSign" && route.name === "Meeting") {
@ -582,20 +585,24 @@ const initWebSocket = () => {
showQuestionnaireDialog.value = false; showQuestionnaireDialog.value = false;
ElMessageBox.alert("会议已结束"); ElMessageBox.alert("会议已结束");
socket.close(); socket.close();
if (store.getters.bankId && !store.state.joinUser.examSubmited) { if (route.name === "Meeting") {
if (examQuestionsList.value.length === 0) { if (store.getters.bankId && !store.state.joinUser.examSubmited) {
examQuestionsList.value = await loadQuestionsList("1"); if (examQuestionsList.value.length === 0) {
examQuestionsList.value = await loadQuestionsList("1");
}
submitQuestion("1");
} }
submitQuestion("1"); if (
} store.getters.questionnaireId &&
if ( !store.state.joinUser.questionnaireSubmited
store.getters.questionnaireId && ) {
!store.state.joinUser.questionnaireSubmited if (questionnaireQuestionsList.value.length === 0) {
) { questionnaireQuestionsList.value = await loadQuestionsList("2");
if (questionnaireQuestionsList.value.length === 0) { }
questionnaireQuestionsList.value = await loadQuestionsList("2"); submitQuestion("2");
} }
submitQuestion("2"); } else if (route.name === "Host") {
meetingConfig.client.endMeeting();
} }
} }
}); });
@ -610,6 +617,7 @@ initWebSocket();
// 消息列表 // 消息列表
const messages = ref([]); const messages = ref([]);
messages.value = store.state.messagesList.map((msg) => msg);
const sendMessage = (msgObj) => { const sendMessage = (msgObj) => {
console.log(JSON.stringify(JSON.stringify(msgObj))); console.log(JSON.stringify(JSON.stringify(msgObj)));
socket.send( socket.send(
@ -621,6 +629,7 @@ const sendMessage = (msgObj) => {
) )
); );
messages.value.push(msgObj); messages.value.push(msgObj);
store.commit("setMessagesList", messages.value);
}; };
const examQuestionsList = ref([]); const examQuestionsList = ref([]);
@ -634,7 +643,9 @@ const getStageQuestionnaireAnswer = (val) => {
const isFullScreen = ref(false); const isFullScreen = ref(false);
onMounted(() => { onMounted(() => {
meetingContainerRef.value.style.background = ` url(${store.getters.templateBackgroundPic}) 0% 0% / cover no-repeat`; meetingContainerRef.value.style.background = ` url(${
store.getters.templateBackgroundPic || store.getters.defaultBackground
}) 0% 0% / cover no-repeat`;
meetingWidth.value = meetingContainerRef.value.offsetWidth * 0.96; meetingWidth.value = meetingContainerRef.value.offsetWidth * 0.96;
meetingHeight.value = (meetingWidth.value * 9) / 16; meetingHeight.value = (meetingWidth.value * 9) / 16;
@ -806,8 +817,8 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.15;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.15 * 9 / 16;
position: relative; position: relative;
} }
} }
@ -816,8 +827,8 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.15;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.15 * 9 / 16;
position: relative; position: relative;
} }
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
@ -879,8 +890,8 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.15;
height: $meetingComponentWitdh * 0.2 * 9 / 14.5; height: $meetingComponentWitdh * 0.15 * 9 / 14.5;
position: relative; position: relative;
align-self: initial; align-self: initial;
} }
@ -915,7 +926,12 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
#meeting-chat-row { #meeting-chat-row {
.fullscreen-wrap { .fullscreen-wrap {
width: 80vw; width: 80vw;
:deep(.notInSharing.fullscreen
div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div) {
width: 96vw;
}
#meeting-container.fullscreen { #meeting-container.fullscreen {
$meetingComponentWitdh: 96vw; $meetingComponentWitdh: 96vw;
padding-top: calc(100vw * 0.08); padding-top: calc(100vw * 0.08);
@ -951,8 +967,8 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.15;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.15 * 9 / 16;
} }
} }
.layout-template-4 { .layout-template-4 {
@ -960,8 +976,8 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.15;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.15 * 9 / 16;
} }
} }
@ -982,7 +998,12 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
// height: calc(100vw * 0.9 * 9 / 16); // height: calc(100vw * 0.9 * 9 / 16);
// } // }
} }
:deep(.notInSharing.verticalFullScreen
div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div) {
width: 96vh;
}
#meeting-container.verticalFullScreen { #meeting-container.verticalFullScreen {
$meetingComponentWitdh: 96vh; $meetingComponentWitdh: 96vh;
$meetingComponentHeight: $meetingComponentWitdh * 9 / 16; $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
@ -994,14 +1015,15 @@ $meetingBackgroundHeight: 80vw * 9 / 16;
left: 100vw; left: 100vw;
width: 100vh !important; width: 100vh !important;
height: 100vw; height: 100vw;
#video-element { #video-element {
width: $meetingComponentWitdh; width: $meetingComponentWitdh;
:deep(div[id*="suspension-view-tabpanel"] :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"] > div[class*="inSharing"]
+ div) { + div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.15;
height: $meetingComponentWitdh * 0.2 * 9 / 14.5; height: $meetingComponentWitdh * 0.15 * 9 / 14.5;
} }
:deep(div[id*="suspension-view-tabpanel"] :deep(div[id*="suspension-view-tabpanel"]
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root