Skip to content

Commit

Permalink
fix: room myinfo and joinroom
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Oct 30, 2024
1 parent da2ae42 commit d1a033f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
12 changes: 7 additions & 5 deletions src/components/RoomList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, watch } from "vue";
import { nextTick, onMounted, ref, watch } from "vue";
import { ElNotification, ElMessageBox } from "element-plus";
import {
roomStatus,
Expand Down Expand Up @@ -75,9 +75,7 @@ const getRoomList = async (showMsg = false) => {
};
const JoinRoomDialog = ref(false);
const JoinRoomC = ref<InstanceType<typeof JoinRoom>>();
const openJoinRoomDialog = () => {
JoinRoomC.value?.init();
JoinRoomDialog.value = true;
};
const joinThisRoom = async (item: RoomList) => {
Expand Down Expand Up @@ -387,12 +385,16 @@ const exitRoom = async (roomId: string) => {
</div>
</div>

<el-dialog v-model="JoinRoomDialog" class="rounded-lg dark:bg-zinc-800 w-[443px] max-sm:w-[90%]">
<el-dialog
v-model="JoinRoomDialog"
:destroy-on-close="true"
class="rounded-lg dark:bg-zinc-800 w-[443px] max-sm:w-[90%]"
>
<template #header>
<div class="overflow-hidden text-ellipsis">
<span class="truncate">加入房间</span>
</div>
</template>
<JoinRoom :item="formData" ref="joinRoomC" :disableInitReq="true" />
<JoinRoom :item="formData" :disableInitReq="true" />
</el-dialog>
</template>
17 changes: 6 additions & 11 deletions src/components/cinema/RoomManage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const { updateSet, isUpdating } = useUpdateRoomSettings(Props.token, Props.roomI
// 更新房间密码
const password = ref("");
const { state: newToken, execute: reqUpdateRoomPasswordApi } = updateRoomPasswordApi();
const { execute: reqUpdateRoomPasswordApi } = updateRoomPasswordApi();
const changePassword = async () => {
try {
strLengthLimit(password.value, 32);
Expand All @@ -101,16 +101,11 @@ const changePassword = async () => {
}
});
if (newToken.value) {
ElNotification({
title: "更新成功",
type: "success"
});
roomPwd.value = password.value;
setTimeout(() => {
window.location.reload();
}, 500);
}
ElNotification({
title: "更新成功",
type: "success"
});
roomPwd.value = password.value;
} catch (err: any) {
console.error(err);
ElNotification({
Expand Down
2 changes: 1 addition & 1 deletion src/views/Cinema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ onMounted(async () => {
// 获取用户信息
try {
if (!myInfo.value) await getMyInfo(roomID.value);
await getMyInfo(roomID.value);
} catch (err: any) {
console.error(err);
ElNotification({
Expand Down

0 comments on commit d1a033f

Please sign in to comment.