普通用户也支持新建群聊

This commit is contained in:
2026-07-28 19:02:23 +08:00
parent d4a512bc6e
commit 2e9da6c1ac
6 changed files with 103 additions and 174 deletions

View File

@@ -20,7 +20,7 @@
<input type="password" id="login-pass" placeholder="密码">
<button class="primary-btn" onclick="login()" style="width:100%;">登录</button>
<p id="login-error" style="color:red; margin-top:8px;"></p>
<div class="version">v2.7</div>
<div class="version" id="version-text"></div>
</div>
</div>
@@ -29,19 +29,16 @@
<!-- 群聊列表页 -->
<div id="list-page" style="display:flex; flex-direction:column; height:100%;">
<div class="header">
<div class="header-left">
<div class="header-left" onclick="Store.logout()">
<svg width="24" height="24" viewBox="0 0 24 24" stroke="#fff" fill="none" stroke-width="1.5">
<rect x="3" y="3" width="18" height="18" rx="3"/><line x1="9" y1="9" x2="15" y2="9"/><line x1="9" y1="13" x2="15" y2="13"/><line x1="9" y1="17" x2="12" y2="17"/>
</svg>
<h2>小财记账</h2>
</div>
<div style="display:flex; gap:2px;">
<button class="icon-btn" id="create-room-btn" onclick="openCreateRoom()" title="新建群聊">
<button class="icon-btn visible" id="create-room-btn" onclick="openCreateRoom()" title="新建群聊">
<svg viewBox="0 0 24 24"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</button>
<button class="icon-btn" id="logout-btn" onclick="Store.logout()" title="注销登录">
<svg viewBox="0 0 24 24"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/></svg>
</button>
</div>
</div>
<div class="chat-list" id="chat-list-container"></div>
@@ -238,6 +235,12 @@
<script src="/js/purchases.js"></script>
<script src="/js/auth.js"></script>
<script>
// 版本号
(function() {
var d = new Date();
var pad = function(n) { return n < 10 ? '0' + n : '' + n; };
document.getElementById('version-text').textContent = 'v2.8-' + (d.getFullYear() % 100) + pad(d.getMonth() + 1) + pad(d.getDate());
})();
document.addEventListener('input', function(e) {
if (e.target.id === 'msg-input' || e.target.id === 'purchase-msg-input') {
e.target.style.height = 'auto';