手机端样式

This commit is contained in:
cxc
2022-05-31 17:46:07 +08:00
parent e683474b1d
commit 275ed2133d
2 changed files with 250 additions and 34 deletions

View File

@ -3,7 +3,8 @@
v-model="showDialog" v-model="showDialog"
:close-on-click-modal="false" :close-on-click-modal="false"
:title="mode == `1` ? `考试` : `问卷`" :title="mode == `1` ? `考试` : `问卷`"
width="80%" :width="'80%'"
:fullscreen="screenWidth < 900"
@close="closeDialog" @close="closeDialog"
> >
<div class="questions-list"> <div class="questions-list">
@ -30,16 +31,22 @@
v-model="item.choiceAnswerIdStr[0]" v-model="item.choiceAnswerIdStr[0]"
@change="stageAnswer" @change="stageAnswer"
> >
<el-radio <el-row>
v-for="el in item.questionChoiceList" <el-col
:key="el.id" v-for="el in item.questionChoiceList"
:label="el.id" :key="el.id"
> :md="12"
<textToolTip :xs="24"
:content="el.choiceContent" :sm="24"
refName="tooltipOver" >
></textToolTip> <el-radio :label="el.id">
</el-radio> <textToolTip
:content="el.choiceContent"
refName="tooltipOver"
></textToolTip>
</el-radio>
</el-col>
</el-row>
</el-radio-group> </el-radio-group>
<el-checkbox-group <el-checkbox-group
@ -90,7 +97,8 @@ const props = defineProps({
required: true, required: true,
}, },
}); });
const screenWidth = ref(0);
screenWidth.width = window.screen.width;
const { showDialog, mode } = toRefs(props); const { showDialog, mode } = toRefs(props);
const emit = defineEmits(["close", "stage"]); const emit = defineEmits(["close", "stage"]);
const joinAccount = ref(""); const joinAccount = ref("");

View File

@ -8,6 +8,7 @@
class="layout-template-4" class="layout-template-4"
ref="videoElementRef" ref="videoElementRef"
></div> ></div>
<el-button :icon="FullScreen" @click="setFullScreen"></el-button>
</div> </div>
<div id="right-chat"> <div id="right-chat">
<Chat <Chat
@ -32,7 +33,7 @@
<el-tab-pane label="专家介绍" <el-tab-pane label="专家介绍"
><div class="meeting-info expert-info" v-html="expertInfo"></div ><div class="meeting-info expert-info" v-html="expertInfo"></div
></el-tab-pane> ></el-tab-pane>
<el-tab-pane label="聊天" class="chat-pane" v-if="screenWidth < 768"> <el-tab-pane label="聊天" class="chat-pane" v-if="screenWidth < 900">
<Chat <Chat
:is-rich="route.name === 'Host'" :is-rich="route.name === 'Host'"
place="bottom" place="bottom"
@ -86,7 +87,8 @@ import dayjs from "dayjs";
import { uniqueId } from "lodash"; import { uniqueId } from "lodash";
import ZoomMtgEmbedded from "@zoomus/websdk/embedded"; import ZoomMtgEmbedded from "@zoomus/websdk/embedded";
import ReconnectingWebSocket from "reconnecting-websocket"; import ReconnectingWebSocket from "reconnecting-websocket";
import { ElMessage } from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
import { FullScreen } from "@element-plus/icons-vue";
import { signMeeting, generateSignature } from "@/api/meeting"; import { signMeeting, generateSignature } from "@/api/meeting";
import Chat from "@/components/chat"; import Chat from "@/components/chat";
import questions from "@/components/questions"; import questions from "@/components/questions";
@ -148,9 +150,10 @@ const startMeeting = async () => {
role: meetingConfig.role, role: meetingConfig.role,
}); });
let meetingSDKElement = document.getElementById("video-element"); let meetingSDKElement = document.getElementById("video-element");
try { try {
meetingConfig.client.init({ await meetingConfig.client.init({
debug: true, // debug: true,
zoomAppRoot: meetingSDKElement, zoomAppRoot: meetingSDKElement,
language: "zh-CN", language: "zh-CN",
customize: { customize: {
@ -179,6 +182,8 @@ const startMeeting = async () => {
], ],
}, },
}); });
console.log(meetingWidth.value, meetingHeight.value);
await meetingConfig.client.join({ await meetingConfig.client.join({
sdkKey: meetingConfig.sdkKey, sdkKey: meetingConfig.sdkKey,
signature: sign, signature: sign,
@ -188,6 +193,7 @@ const startMeeting = async () => {
userEmail: meetingConfig.userEmail, userEmail: meetingConfig.userEmail,
tk: meetingConfig.registrantToken, tk: meetingConfig.registrantToken,
}); });
console.log(meetingConfig.client.getAttendeeslist()); console.log(meetingConfig.client.getAttendeeslist());
document.querySelector("#suspension-view-tab-thumbnail-gallery").click(); document.querySelector("#suspension-view-tab-thumbnail-gallery").click();
@ -209,7 +215,8 @@ const startMeeting = async () => {
isMeetingLoading.value = false; isMeetingLoading.value = false;
} }
}; };
window.client = meetingConfig.client;
window.startMeeting = startMeeting;
// 根据id设置布局 // 根据id设置布局
const setLayout = (templateId) => { const setLayout = (templateId) => {
videoElementRef.value.className = `layout-template-${templateId}`; videoElementRef.value.className = `layout-template-${templateId}`;
@ -383,10 +390,28 @@ watch(attendeeslist, (val) => {
// switchToVideoOn(); // switchToVideoOn();
} }
}); });
// 点击进入全屏模式
const setFullScreen = async () => {
meetingContainerRef.value.requestFullscreen();
// meetingContainerRef.value.className =
// meetingContainerRef.value.className + " fullscreen";
// meetingWidth.value = meetingContainerRef.value.offsetWidth * 0.9;
// meetingHeight.value = (meetingWidth.value * 9) / 16;
// console.log(meetingWidth.value, meetingHeight.value);
// videoElementRef.value.style.width = `${meetingWidth.value}px`;
// videoElementRef.value.style.height = `${meetingHeight.value + 42}px`;
// await meetingConfig.client.leaveMeeting();
// startMeeting();
// setTimeout(() => {
// startMeeting();
// }, 5000);
// startMeeting();
};
// 是否显示考试和问卷弹窗 // 是否显示考试和问卷弹窗
const showExamDialog = ref(false); const showExamDialog = ref(false);
const showQuestionnaireDialog = ref(false); const showQuestionnaireDialog = ref(false);
const examStarted = ref(false); //考试是否开始
/* 签到功能 */ /* 签到功能 */
// 提交签到 // 提交签到
const showSignDialog = ref(false); //是否显示签到窗口 const showSignDialog = ref(false); //是否显示签到窗口
@ -399,7 +424,7 @@ const submitSign = async () => {
showSignDialog.value = false; showSignDialog.value = false;
ElMessage.success("签到成功"); ElMessage.success("签到成功");
}; };
// 当考试和问卷弹框未能正确弹出时,加载题目列表 // 当考试和问卷弹框未能正确弹出时,(即考试开始时,未加入会议),加载题目列表
const loadQuestionsList = async (mode) => { const loadQuestionsList = async (mode) => {
const { data } = await getQuestionsList({ const { data } = await getQuestionsList({
meetingId: store.getters.meetingId, meetingId: store.getters.meetingId,
@ -440,7 +465,7 @@ const submitQuestion = async (mode) => {
}); });
ElMessage.success("提交问卷成功"); ElMessage.success("提交问卷成功");
} }
closeDialog(); // closeDialog();
}; };
// loadQuestionsList("1"); // loadQuestionsList("1");
@ -582,8 +607,8 @@ onUnmounted(() => {
<style lang="scss" scoped> <style lang="scss" scoped>
// $videoELementWidth: 80vw * 0.9; // $videoELementWidth: 80vw * 0.9;
// $videoElementHeight: $videoELementWidth * 9 / 16 + 42px; // $videoElementHeight: $videoELementWidth * 9 / 16 + 42px;
$videoWidth: 470px; // $videoWidth: 470px;
$videoHeight: $videoWidth * 9 / 16; // $videoHeight: $videoWidth * 9 / 16;
$meetingComponentWitdh: 80vw * 0.9; $meetingComponentWitdh: 80vw * 0.9;
$meetingComponentHeight: $meetingComponentWitdh * 9 / 16; $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
@ -597,6 +622,11 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
justify-content: center; justify-content: center;
width: 80vw; width: 80vw;
position: relative; position: relative;
.el-button {
position: absolute;
right: 0;
bottom: 0;
}
// #video-element { // #video-element {
// width: $videoELementWidth; // width: $videoELementWidth;
// height: $videoElementHeight; // height: $videoElementHeight;
@ -623,17 +653,29 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
.layout-template-1 { .layout-template-1 {
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div:last-child) { > div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.5; width: $meetingComponentWitdh * 0.5;
} }
} }
.layout-template-2 { .layout-template-2 {
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div:last-child) { > div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.5; width: $meetingComponentWitdh * 0.5;
} }
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) { > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
flex-direction: row-reverse; flex-direction: row-reverse;
} }
@ -642,7 +684,12 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
.layout-template-3 { .layout-template-3 {
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div:last-child) { > div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center; align-self: center;
@ -651,12 +698,19 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
.layout-template-4 { .layout-template-4 {
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div:last-child) { > div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.2; width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16; height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center; align-self: center;
} }
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) { > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
flex-direction: row-reverse; flex-direction: row-reverse;
} }
@ -684,20 +738,20 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
:deep(#suspension-view-tabpanel-ribbon :deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root), > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-gallery :deep(#suspension-view-tabpanel-gallery
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) { > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
height: calc(80vw * 0.9 * 9 / 16); height: calc(80vw * 0.9 * 9 / 16);
} }
// :deep(#suspension-view-tabpanel-ribbon
// > .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
// > div:last-child) {
// height: calc(240px * 9 / 16);
// }
:deep(.zmwebsdk-MuiPaper-root) { :deep(.zmwebsdk-MuiPaper-root) {
background: transparent; background: transparent;
box-shadow: 0 0; box-shadow: 0 0;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 900px) {
$meetingComponentWitdh: 100vw * 0.9;
$meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
#meeting-container { #meeting-container {
width: 100vw !important; width: 100vw !important;
} }
@ -708,13 +762,167 @@ $meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
> div > div
> .zmwebsdk-MuiPaper-root > .zmwebsdk-MuiPaper-root
> .zmwebsdk-MuiPaper-root:nth-child(1)) { > .zmwebsdk-MuiPaper-root:nth-child(1)) {
width: calc(100vw * 0.9) !important; width: $meetingComponentWitdh !important;
}
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-gallery
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
height: calc(100vw * 0.9 * 9 / 16) !important;
}
.layout-template-1 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.5;
}
}
.layout-template-2 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.5;
}
}
.layout-template-3 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16;
}
}
.layout-template-4 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16;
}
}
}
#meeting-container.fullscreen {
$meetingComponentWitdh: 100vw * 0.9;
$meetingComponentHeight: $meetingComponentWitdh * 9 / 16;
padding-top: calc(100vw * 0.08) !important;
width: 100vw !important;
.layout-template-1 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.5;
}
}
.layout-template-2 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.5;
}
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
flex-direction: row-reverse;
}
}
.layout-template-3 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center;
}
}
.layout-template-4 {
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root
> div[class*="inSharing"]
+ div) {
width: $meetingComponentWitdh * 0.2;
height: $meetingComponentWitdh * 0.2 * 9 / 16;
align-self: center;
}
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
flex-direction: row-reverse;
}
}
:deep(.zmwebsdk-MuiToolbar-root.zmwebsdk-MuiToolbar-regular) {
display: none; // 隐藏顶部 toolbar
}
:deep(div[class*="zmwebsdk-makeStyles-singleView"]) {
padding: 0; // 去掉会议组件边距
} }
:deep(#video-element :deep(#video-element
> div > div
> .zmwebsdk-MuiPaper-root > .zmwebsdk-MuiPaper-root
> .zmwebsdk-MuiPaper-root:nth-child(1)) { > .zmwebsdk-MuiPaper-root:nth-child(1)) {
height: calc(100vw * 0.9 * 9 / 16) !important; width: calc(100vw * 0.9);
}
:deep(#video-element
> div
> .zmwebsdk-MuiPaper-root
> .zmwebsdk-MuiPaper-root:nth-child(2)) {
width: 270px;
background: #ccc;
}
:deep(#suspension-view-tabpanel-ribbon
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-gallery
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root),
:deep(#suspension-view-tabpanel-speaker
> .zmwebsdk-MuiBox-root.zmwebsdk-MuiBox-root) {
height: calc(100vw * 0.9 * 9 / 16);
} }
} }
</style> </style>