在前后端开发联调前 的提交20260223

This commit is contained in:
Neo
2026-02-23 23:02:20 +08:00
parent 254ccb1e77
commit fafc95e64c
1142 changed files with 10366960 additions and 36957 deletions

View File

@@ -0,0 +1,51 @@
/**
* coach-detail.html 交互逻辑
*/
/* 任务展开/收起 */
function toggleAllTasks() {
var hidden = document.getElementById('hiddenTasks');
var btn = document.getElementById('toggleTasksBtn');
if (hidden.classList.contains('hidden')) {
hidden.classList.remove('hidden');
btn.textContent = '收起 ↑';
} else {
hidden.classList.add('hidden');
btn.textContent = '展开全部 ↓';
}
}
/* 收入明细月份切换 */
function switchIncomeTab(tab) {
var tabs = document.querySelectorAll('.income-tab');
tabs.forEach(function(t) { t.classList.remove('active'); });
document.getElementById('incomeTab_' + tab).classList.add('active');
document.getElementById('incomeThisMonth').classList.toggle('hidden', tab !== 'this');
document.getElementById('incomeLastMonth').classList.toggle('hidden', tab !== 'last');
}
/* 备注弹窗 */
function showNoteModal() {
document.getElementById('noteModal').classList.remove('hidden');
document.getElementById('noteModal').classList.add('flex');
document.getElementById('noteText').value = '';
}
function hideNoteModal() {
document.getElementById('noteModal').classList.add('hidden');
document.getElementById('noteModal').classList.remove('flex');
}
function saveNote() {
var text = document.getElementById('noteText').value.trim();
if (!text) { showToast('请输入备注内容'); return; }
hideNoteModal();
showToast('备注已保存');
}
/* Toast */
function showToast(msg) {
var toast = document.getElementById('toast');
toast.textContent = msg;
toast.classList.remove('hidden');
setTimeout(function() { toast.classList.add('hidden'); }, 1500);
}