From a9a9dca0901ae1e860f396042ed8c4283b3252f2 Mon Sep 17 00:00:00 2001 From: cxc Date: Wed, 18 May 2022 17:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E6=8C=81=E4=BA=BA=E5=8F=82=E4=BC=9A?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 +- package.json | 5 +- src/components/messageList.vue | 5 + src/components/questions.vue | 4 +- src/router/index.js | 51 ++- src/store/index.js | 9 + src/style/appoint-desktop.scss | 6 + src/style/appoint-mobile.scss | 6 + src/views/appointment.vue | 3 +- src/views/host.vue | 550 +++++++++++++++++++++++++++++++++ src/views/meeting.vue | 511 ++++++++++++++++++------------ src/views/verify.vue | 15 +- yarn.lock | 18 +- 13 files changed, 961 insertions(+), 224 deletions(-) create mode 100644 src/views/host.vue diff --git a/.env.production b/.env.production index 4855fd4..91c22e4 100644 --- a/.env.production +++ b/.env.production @@ -2,4 +2,4 @@ VUE_APP_ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = 'http://120.26.107.74:1618' \ No newline at end of file +VUE_APP_BASE_API = '/api' \ No newline at end of file diff --git a/package.json b/package.json index 09fbf7d..b421511 100644 --- a/package.json +++ b/package.json @@ -8,15 +8,18 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@element-plus/icons-vue": "^1.1.4", "@wangeditor/editor": "^5.0.1", "@wangeditor/editor-for-vue": "^5.1.10", - "@zoomus/websdk": "^2.3.5", + "@zoomus/websdk": "^2.4.0", "axios": "^0.26.1", "coi-serviceworker": "^0.1.6", "core-js": "^3.8.3", + "crypto-js": "^4.1.1", "dayjs": "^1.11.1", "element-plus": "^2.1.9", "lodash": "^4.17.21", + "reconnecting-websocket": "^4.4.0", "vue": "^3.2.13", "vue-router": "^4.0.3", "vuex": "^4.0.0" diff --git a/src/components/messageList.vue b/src/components/messageList.vue index 3310e3a..a2bff12 100644 --- a/src/components/messageList.vue +++ b/src/components/messageList.vue @@ -71,6 +71,11 @@ const { messageList } = toRefs(props); background-color: #fff; border-radius: 10px; font-size: 16px; + :deep(p) { + margin: 0; + word-wrap: break-word; + word-break:break-all; + } } .time { font-size: 12px; diff --git a/src/components/questions.vue b/src/components/questions.vue index 297b8b6..1f7e113 100644 --- a/src/components/questions.vue +++ b/src/components/questions.vue @@ -91,7 +91,7 @@ const { showDialog, mode } = toRefs(props); const emit = defineEmits(["close"]); const joinAccount = ref(""); joinAccount.value = - store.getters.nickname || store.getters.phone || store.getters.icCard; + store.getters.icCard || store.getters.phone || store.getters.nickname; // 加载问题列表 const form = ref({ @@ -122,7 +122,7 @@ const submit = async (questionsRef) => { commitExamList: form.value.questionsList.map((item) => { return { questionId: item.id, - choiceAnswerIdStr: item.choiceAnswerIdStr.join(","), + choiceAnswerIdStr: item.choiceAnswerIdStr.join(",") + ",", }; }), }); diff --git a/src/router/index.js b/src/router/index.js index d9172cc..3990b90 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,13 @@ import { createWebHistory, createRouter } from "vue-router"; import store from "@/store"; -import { whitelistJoinMeeting } from "@/api/meeting"; +import _ from "lodash"; +import cryptoJs from "crypto-js"; +import { + whitelistJoinMeeting, + registerJoinUser, + visitorJoinUser, +} from "@/api/meeting"; const router = createRouter({ history: createWebHistory(), routes: [ @@ -20,6 +26,16 @@ const router = createRouter({ name: "Meeting", component: () => import("@/views/meeting.vue"), }, + // { + // path: "/host/:meetingId/:hostinfo", + // name: "Host", + // component: () => import("@/views/host.vue"), + // }, + { + path: "/host/:meetingId/:pwd/:username/:nickname", + name: "Host", + component: () => import("@/views/host.vue"), + }, { path: "/:pathMatch(.*)*", name: "NotFound", @@ -33,10 +49,32 @@ router.beforeEach(async (to) => { if (!store.state.meeting.id && to.params.meetingId) { await store.dispatch("getMeetingInfo", to.params.meetingId); } + // 前往主持人页面 + if (to.name === "Host") { + console.log("host"); + // const bytes = cryptoJs.AES.decrypt(to.params.hostinfo, "secret"); + // const decryptedData = JSON.parse(bytes.toString(cryptoJs.enc.Utf8)); + store.commit("setJoinUser", { + nickname: to.params.nickname, + username: to.params.username, + }); + store.commit("setPassword", to.params.pwd); + return true; + } // 如果要前往参会页面 if (to.name === "Meeting") { - // 如果是白名单模式 + // 如果要去的页面会议号于 vuex中的不一样,则清除数据 + if (to.params.meetingId !== store.state.joinUser.meetingId) { + store.commit("setJoinUser", {}); + } + // 如果参会方式发生更改,则清除数据 + if (store.state.meeting.joinType !== store.state.joinType) { + store.commit("setJoinUser", {}); + store.commit("setJoinType", store.state.meeting.joinType); + return `/verify/${to.params.meetingId}`; + } if (store.state.meeting.joinType === "1") { + // 如果是白名单模式 if (store.state.joinUser.icCard) { // 检测输入的IC卡号是否在白名单范围内,是则放行,否则返回原地址 try { @@ -55,9 +93,16 @@ router.beforeEach(async (to) => { return `/verify/${to.params.meetingId}`; } } else { - if (!store.state.password) { + if (_.isEmpty(store.state.joinUser)) { return `/verify/${to.params.meetingId}`; } else { + if (store.state.meeting.joinType === "2") { + const { data } = await registerJoinUser(store.state.joinUser); + store.commit("setPassword", data); + } else { + const { data } = await visitorJoinUser(store.state.joinUser); + store.commit("setPassword", data); + } return true; } } diff --git a/src/store/index.js b/src/store/index.js index dd67f42..aa4c959 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -8,6 +8,9 @@ const store = createStore({ : {}, meeting: {}, password: "", //参会密码 + joinType: localStorage.getItem("JOINTYPE") + ? JSON.parse(localStorage.getItem("JOINTYPE")) + : "1", }, mutations: { // 设置参会人员信息 @@ -23,6 +26,11 @@ const store = createStore({ // 设置参会密码 setPassword(state, data) { state.password = data; + // localStorage.setItem("PASSWORD", JSON.stringify(data)); + }, + setJoinType(state, data) { + state.joinType = data; + localStorage.setItem("JOINTYPE", JSON.stringify(data)); }, }, actions: { @@ -30,6 +38,7 @@ const store = createStore({ async getMeetingInfo(context, meetingId) { const { data } = await getMeetingDetailById(meetingId); context.commit("setMeetingInfo", data); + // context.commit("setJoinType", data.joinType); }, }, getters: { diff --git a/src/style/appoint-desktop.scss b/src/style/appoint-desktop.scss index 69ce8de..ceb241a 100644 --- a/src/style/appoint-desktop.scss +++ b/src/style/appoint-desktop.scss @@ -2,6 +2,12 @@ .meeting-title { font-size: 24px; } + .meeting-cover { + // width: 100%; + height: 70vh; + display: block; + margin: 0 auto; + } .meeting-time { font-size: 16px; } diff --git a/src/style/appoint-mobile.scss b/src/style/appoint-mobile.scss index 6c6db1c..d779e62 100644 --- a/src/style/appoint-mobile.scss +++ b/src/style/appoint-mobile.scss @@ -2,6 +2,12 @@ // body { // background-color: indianred; // } + .meeting-cover { + width: 100%; + // height: 70vh; + display: block; + margin: 0 auto; + } .meeting-title { font-size: 7vw; } diff --git a/src/views/appointment.vue b/src/views/appointment.vue index 136edfa..b0f6673 100644 --- a/src/views/appointment.vue +++ b/src/views/appointment.vue @@ -449,7 +449,8 @@ loadMeetingDetail(meetingId.value); @import "@/style/appoint-desktop.scss"; .meeting-cover { - width: 100%; + // width: 100%; + height: 50vh; } .meeting-title { text-align: center; diff --git a/src/views/host.vue b/src/views/host.vue new file mode 100644 index 0000000..661a452 --- /dev/null +++ b/src/views/host.vue @@ -0,0 +1,550 @@ + + + diff --git a/src/views/meeting.vue b/src/views/meeting.vue index cbee2b2..3afbf25 100644 --- a/src/views/meeting.vue +++ b/src/views/meeting.vue @@ -1,7 +1,28 @@ diff --git a/src/views/verify.vue b/src/views/verify.vue index ed6b191..581a365 100644 --- a/src/views/verify.vue +++ b/src/views/verify.vue @@ -335,11 +335,7 @@