mobile app models chat login notifications themes
This commit is contained in:
@@ -175,7 +175,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 创建群聊弹窗 -->
|
||||
<div id="createGroupModal" class="fixed inset-0 bg-black/50 z-[9990] hidden flex items-center justify-center">
|
||||
<div id="createGroupModal" class="fixed inset-0 bg-black/50 z-[9990] hidden items-center justify-center">
|
||||
<div class="bg-white rounded-xl shadow-xl w-96 max-h-[80vh] flex flex-col">
|
||||
<div class="px-4 py-3 border-b border-slate-200 flex justify-between items-center">
|
||||
<h3 class="font-semibold">创建群聊</h3>
|
||||
@@ -193,7 +193,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 成员列表弹窗 -->
|
||||
<div id="membersModal" class="fixed inset-0 bg-black/50 z-[9990] hidden flex items-center justify-center">
|
||||
<div id="membersModal" class="fixed inset-0 bg-black/50 z-[9990] hidden items-center justify-center">
|
||||
<div class="bg-white rounded-xl shadow-xl w-[420px] max-h-[80vh] flex flex-col">
|
||||
<div class="px-4 py-3 border-b border-slate-200 flex justify-between items-center">
|
||||
<h3 class="font-semibold">群成员</h3>
|
||||
@@ -210,7 +210,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 群公告弹窗 -->
|
||||
<div id="announcementModal" class="fixed inset-0 bg-black/50 z-[9990] hidden flex items-center justify-center">
|
||||
<div id="announcementModal" class="fixed inset-0 bg-black/50 z-[9990] hidden items-center justify-center">
|
||||
<div class="bg-white rounded-xl shadow-xl w-96 flex flex-col">
|
||||
<div class="px-4 py-3 border-b border-slate-200 flex justify-between items-center">
|
||||
<h3 class="font-semibold">群公告</h3>
|
||||
@@ -232,7 +232,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 搜索聊天记录弹窗 -->
|
||||
<div id="searchModal" class="fixed inset-0 bg-black/50 z-[9990] hidden flex items-center justify-center">
|
||||
<div id="searchModal" class="fixed inset-0 bg-black/50 z-[9990] hidden items-center justify-center">
|
||||
<div class="bg-white rounded-xl shadow-xl w-[480px] max-h-[80vh] flex flex-col">
|
||||
<div class="px-4 py-3 border-b border-slate-200 flex justify-between items-center">
|
||||
<h3 class="font-semibold">搜索聊天记录</h3>
|
||||
@@ -246,7 +246,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 群文件弹窗 -->
|
||||
<div id="fileListModal" class="fixed inset-0 bg-black/50 z-[9990] hidden flex items-center justify-center">
|
||||
<div id="fileListModal" class="fixed inset-0 bg-black/50 z-[9990] hidden items-center justify-center">
|
||||
<div class="bg-white rounded-xl shadow-xl w-[480px] max-h-[80vh] flex flex-col">
|
||||
<div class="px-4 py-3 border-b border-slate-200 flex justify-between items-center">
|
||||
<h3 class="font-semibold">群文件</h3>
|
||||
@@ -257,7 +257,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 群昵称弹窗 -->
|
||||
<div id="nicknameModal" class="fixed inset-0 bg-black/50 z-[9991] hidden flex items-center justify-center">
|
||||
<div id="nicknameModal" class="fixed inset-0 bg-black/50 z-[9991] hidden items-center justify-center">
|
||||
<div class="bg-white rounded-xl shadow-xl w-80 flex flex-col">
|
||||
<div class="px-4 py-3 border-b border-slate-200 flex justify-between items-center">
|
||||
<h3 class="font-semibold">设置群昵称</h3>
|
||||
@@ -934,7 +934,9 @@ function markRead(roomId) {
|
||||
|
||||
// ========== 创建群聊 ==========
|
||||
async function showCreateGroup() {
|
||||
document.getElementById('createGroupModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('createGroupModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
// 重置弹窗标题和按钮(防止被邀请好友功能覆盖)
|
||||
document.querySelector('#createGroupModal h3').textContent = '创建群聊';
|
||||
const createBtn = document.querySelector('#createGroupModal .bg-primary');
|
||||
@@ -959,7 +961,11 @@ async function showCreateGroup() {
|
||||
}
|
||||
}
|
||||
|
||||
function hideCreateGroup() { document.getElementById('createGroupModal').classList.add('hidden'); }
|
||||
function hideCreateGroup() {
|
||||
const modal = document.getElementById('createGroupModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.classList.remove('flex');
|
||||
}
|
||||
|
||||
async function createGroup() {
|
||||
const name = document.getElementById('groupName').value.trim();
|
||||
@@ -983,7 +989,9 @@ async function createGroup() {
|
||||
// ========== 成员列表 ==========
|
||||
async function showMembers() {
|
||||
if (!currentRoomId) return;
|
||||
document.getElementById('membersModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('membersModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
const res = await fetch(`/api/chat/rooms/${currentRoomId}/members`);
|
||||
const data = await res.json();
|
||||
if (!data.success) return;
|
||||
@@ -1026,7 +1034,11 @@ async function showMembers() {
|
||||
document.getElementById('inviteSection').classList.toggle('hidden', !isGroup);
|
||||
}
|
||||
|
||||
function hideMembers() { document.getElementById('membersModal').classList.add('hidden'); }
|
||||
function hideMembers() {
|
||||
const modal = document.getElementById('membersModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.classList.remove('flex');
|
||||
}
|
||||
|
||||
async function showInvite() {
|
||||
hideMembers();
|
||||
@@ -1082,7 +1094,9 @@ async function transferOwner(uid, name) {
|
||||
// ========== 群公告 ==========
|
||||
async function showAnnouncement() {
|
||||
if (!currentRoomId) return;
|
||||
document.getElementById('announcementModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('announcementModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
const res = await fetch(`/api/chat/rooms/${currentRoomId}/announcement`);
|
||||
const data = await res.json();
|
||||
if (data.success) {
|
||||
@@ -1103,7 +1117,11 @@ async function showAnnouncement() {
|
||||
}
|
||||
document.getElementById('btnEditAnnouncement').classList.toggle('hidden', myRoomRole !== 'admin');
|
||||
}
|
||||
function hideAnnouncement() { document.getElementById('announcementModal').classList.add('hidden'); }
|
||||
function hideAnnouncement() {
|
||||
const modal = document.getElementById('announcementModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.classList.remove('flex');
|
||||
}
|
||||
function editAnnouncement() {
|
||||
document.getElementById('announcementEditSection').classList.remove('hidden');
|
||||
document.getElementById('btnEditAnnouncement').classList.add('hidden');
|
||||
@@ -1125,8 +1143,20 @@ async function saveAnnouncement() {
|
||||
}
|
||||
|
||||
// ========== 搜索聊天记录 ==========
|
||||
function showSearchPanel() { if (!currentRoomId) return; document.getElementById('searchModal').classList.remove('hidden'); document.getElementById('msgSearchInput').value = ''; document.getElementById('searchResults').innerHTML = ''; document.getElementById('msgSearchInput').focus(); }
|
||||
function hideSearchPanel() { document.getElementById('searchModal').classList.add('hidden'); }
|
||||
function showSearchPanel() {
|
||||
if (!currentRoomId) return;
|
||||
const modal = document.getElementById('searchModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
document.getElementById('msgSearchInput').value = '';
|
||||
document.getElementById('searchResults').innerHTML = '';
|
||||
document.getElementById('msgSearchInput').focus();
|
||||
}
|
||||
function hideSearchPanel() {
|
||||
const modal = document.getElementById('searchModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.classList.remove('flex');
|
||||
}
|
||||
function debounceSearch() { clearTimeout(searchTimer); searchTimer = setTimeout(doSearch, 300); }
|
||||
async function doSearch() {
|
||||
const q = document.getElementById('msgSearchInput').value.trim();
|
||||
@@ -1154,7 +1184,9 @@ function scrollToMsg(msgId) {
|
||||
// ========== 群文件 ==========
|
||||
async function showFileList() {
|
||||
if (!currentRoomId) return;
|
||||
document.getElementById('fileListModal').classList.remove('hidden');
|
||||
const modal = document.getElementById('fileListModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
const res = await fetch(`/api/chat/rooms/${currentRoomId}/files`);
|
||||
const data = await res.json();
|
||||
const container = document.getElementById('fileListContent');
|
||||
@@ -1173,11 +1205,25 @@ async function showFileList() {
|
||||
</div>`;
|
||||
}).join('');
|
||||
}
|
||||
function hideFileList() { document.getElementById('fileListModal').classList.add('hidden'); }
|
||||
function hideFileList() {
|
||||
const modal = document.getElementById('fileListModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.classList.remove('flex');
|
||||
}
|
||||
|
||||
// ========== 群昵称 ==========
|
||||
function showNicknameModal() { document.getElementById('nicknameModal').classList.remove('hidden'); const me = currentRoomMembers.find(m => m.id === currentUser.id); document.getElementById('nicknameInput').value = me?.nickname || ''; }
|
||||
function hideNicknameModal() { document.getElementById('nicknameModal').classList.add('hidden'); }
|
||||
function showNicknameModal() {
|
||||
const modal = document.getElementById('nicknameModal');
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
const me = currentRoomMembers.find(m => m.id === currentUser.id);
|
||||
document.getElementById('nicknameInput').value = me?.nickname || '';
|
||||
}
|
||||
function hideNicknameModal() {
|
||||
const modal = document.getElementById('nicknameModal');
|
||||
modal.classList.add('hidden');
|
||||
modal.classList.remove('flex');
|
||||
}
|
||||
async function saveNickname() {
|
||||
const nickname = document.getElementById('nicknameInput').value.trim();
|
||||
const res = await fetch(`/api/chat/rooms/${currentRoomId}/nickname`, {
|
||||
|
||||
Reference in New Issue
Block a user