diff --git a/src/components/Hot.vue b/src/components/Hot.vue deleted file mode 100644 index 67b0914..0000000 --- a/src/components/Hot.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - 热度榜 - - - - - - {{ i + 1 }} - - - {{ item["roomName"] }} - - - 在线人数:{{ - item["peopleNum"] - }} - - 创建者:{{ item.creator }} - - - - {{ item.needPassword ? "有密码" : "无密码" }} - - - 加入房间 - - - - - - - - - - - - - 加入房间 - - - - - diff --git a/src/components/RoomList.vue b/src/components/RoomList.vue index 139173d..6960f29 100644 --- a/src/components/RoomList.vue +++ b/src/components/RoomList.vue @@ -13,6 +13,7 @@ import { getObjValue } from "@/utils"; const router = useRouter(); const props = defineProps<{ isMyRoom: boolean; + isHot: boolean; userId?: string; }>(); @@ -41,6 +42,9 @@ const { getMyRoomList, myRoomList, + getHotRoomList, + hotRoomList, + joinRoom } = useRoomApi(formData.value.roomId); @@ -48,6 +52,9 @@ const getRoomList = async (showMsg = false) => { if (props.isMyRoom) { await getMyRoomList(showMsg); if (myRoomList.value) thisRoomList.value = myRoomList.value.list!; + } else if (props.isHot) { + await getHotRoomList(showMsg); + if (hotRoomList.value) thisRoomList.value = hotRoomList.value.list!; } else { await getRoomList_(); if (roomList.value) thisRoomList.value = roomList.value.list!; @@ -88,9 +95,9 @@ onMounted(() => {