@@ -62,8 +62,8 @@ yh:
|
||||
app-auth:
|
||||
enabled: true
|
||||
# 本应用自身身份(客户端签名用)
|
||||
app-key: 100001
|
||||
app-secret: ec4e860206374c80938719fff8e14a86
|
||||
app-key: 100006
|
||||
app-secret: e053f7d98518407ab0e69f0500820d17
|
||||
open:
|
||||
enabled: true
|
||||
base-host: http://base.yunhaixingtong.com
|
||||
|
||||
@@ -47,6 +47,8 @@
|
||||
.seg { display: inline-flex; background: #e2e8f0; border-radius: 8px; padding: 3px; }
|
||||
.seg button { border: none; background: none; padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text2); }
|
||||
.seg button.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }
|
||||
/* tab 条数(v17 ReadTabCount):空内容时不占位 */
|
||||
.seg .seg-cnt { margin-left: 5px; font-size: 12px; color: var(--text2); font-weight: 400; }
|
||||
.input { border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-size: 13px; background: #fff; color: var(--text); outline: none; }
|
||||
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
|
||||
select.input { cursor: pointer; }
|
||||
@@ -270,9 +272,9 @@
|
||||
</div>
|
||||
<div class="toolbar">
|
||||
<div class="seg" id="readSeg">
|
||||
<button class="on" data-v="0" onclick="inboxFilter('readType',0,this)">全部</button>
|
||||
<button data-v="1" onclick="inboxFilter('readType',1,this)">未读</button>
|
||||
<button data-v="2" onclick="inboxFilter('readType',2,this)">已读</button>
|
||||
<button class="on" data-v="0" onclick="inboxFilter('readType',0,this)">全部<span class="seg-cnt" id="cntAll"></span></button>
|
||||
<button data-v="1" onclick="inboxFilter('readType',1,this)">未读<span class="seg-cnt" id="cntUnread"></span></button>
|
||||
<button data-v="2" onclick="inboxFilter('readType',2,this)">已读<span class="seg-cnt" id="cntRead"></span></button>
|
||||
</div>
|
||||
<select class="input" id="inboxType" onchange="reloadInbox()">
|
||||
<option value="">全部类型</option>
|
||||
@@ -727,6 +729,17 @@ function renderUnreadBadge() {
|
||||
const n = inboxState.unreadCount;
|
||||
$('unreadBadge').textContent = n > 0 ? (n > 99 ? '99+' : n) : '';
|
||||
}
|
||||
/* 三 tab 条数(v17 ReadTabCount):与列表同一 keyword/type 过滤,readType 不参与 */
|
||||
async function loadInboxCounts() {
|
||||
const put = (id, n) => { const el = $(id); if (el) el.textContent = n > 0 ? '(' + n + ')' : ''; };
|
||||
try {
|
||||
const c = await api('/notice/ReadTabCount', {
|
||||
params: { type: $('inboxType').value, keyword: $('inboxKw').value.trim() }
|
||||
});
|
||||
if (!c) return;
|
||||
put('cntAll', c.all); put('cntUnread', c.unread); put('cntRead', c.read);
|
||||
} catch (e) { /* 统计失败不影响列表 */ }
|
||||
}
|
||||
async function loadInbox() {
|
||||
const box = $('inboxList');
|
||||
box.innerHTML = '<div class="empty">加载中…</div>';
|
||||
@@ -743,6 +756,7 @@ async function loadInbox() {
|
||||
const list = (r && r.content) || [];
|
||||
inboxState.unreadCount = (r && r.unreadCount) || inboxState.unreadCount;
|
||||
renderUnreadBadge();
|
||||
loadInboxCounts();
|
||||
$('inboxSub').textContent = r ? ('共 ' + r.total + ' 条 · 未读 ' + r.unreadCount + ' 条') : '';
|
||||
|
||||
if (!list.length) {
|
||||
@@ -819,9 +833,14 @@ async function openDetail(serid, from) {
|
||||
$('dFiles').style.display = 'none';
|
||||
}
|
||||
|
||||
// 上一篇/下一篇
|
||||
// 上一篇/下一篇(v17:已收序列沿用收件箱当前筛选;重要程度走 noticeType,`type` 已被序列类型占用)
|
||||
let np = {};
|
||||
try { np = await api('/notice/GetNextPrev', { params: { serid, type: 1 } }) || {}; } catch (e) { /* 忽略 */ }
|
||||
const navParams = { serid, type: 1 };
|
||||
if (from === 'inbox') {
|
||||
navParams.keyword = $('inboxKw').value.trim();
|
||||
if ($('inboxType').value) navParams.noticeType = $('inboxType').value;
|
||||
}
|
||||
try { np = await api('/notice/GetNextPrev', { params: navParams }) || {}; } catch (e) { /* 忽略 */ }
|
||||
setupNavBtn('dPrev', np.prev || np.preId || np.prevId, '上一篇');
|
||||
setupNavBtn('dNext', np.next || np.nextId, '下一篇');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user