在前后端开发联调前 的提交20260223
This commit is contained in:
51
docs/h5_ui/js/coach-detail.js
Normal file
51
docs/h5_ui/js/coach-detail.js
Normal 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);
|
||||
}
|
||||
15
docs/h5_ui/js/customer-service-records.js
Normal file
15
docs/h5_ui/js/customer-service-records.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/* 客户服务记录页 — 月份切换 */
|
||||
(function () {
|
||||
var currentMonth = 2;
|
||||
|
||||
window.switchMonth = function (direction) {
|
||||
if (direction === 'prev' && currentMonth > 1) currentMonth--;
|
||||
else if (direction === 'next' && currentMonth < 2) currentMonth++;
|
||||
|
||||
document.getElementById('monthLabel').textContent = '2026年' + currentMonth + '月';
|
||||
document.getElementById('nextMonthBtn').disabled = currentMonth >= 2;
|
||||
document.getElementById('nextMonthBtn').style.opacity = currentMonth >= 2 ? '0.3' : '1';
|
||||
document.getElementById('prevMonthBtn').disabled = currentMonth <= 1;
|
||||
document.getElementById('prevMonthBtn').style.opacity = currentMonth <= 1 ? '0.3' : '1';
|
||||
};
|
||||
})();
|
||||
21
docs/h5_ui/js/notes.js
Normal file
21
docs/h5_ui/js/notes.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 备注页面 Tab 切换逻辑
|
||||
*/
|
||||
function switchTab(tab) {
|
||||
var customerNotes = document.getElementById('customerNotes');
|
||||
var coachNotes = document.getElementById('coachNotes');
|
||||
var tabCustomer = document.getElementById('tabCustomer');
|
||||
var tabCoach = document.getElementById('tabCoach');
|
||||
|
||||
if (tab === 'customer') {
|
||||
customerNotes.classList.remove('hidden');
|
||||
coachNotes.classList.add('hidden');
|
||||
tabCustomer.classList.add('active');
|
||||
tabCoach.classList.remove('active');
|
||||
} else {
|
||||
customerNotes.classList.add('hidden');
|
||||
coachNotes.classList.remove('hidden');
|
||||
tabCustomer.classList.remove('active');
|
||||
tabCoach.classList.add('active');
|
||||
}
|
||||
}
|
||||
23
docs/h5_ui/js/task-detail-abandon.js
Normal file
23
docs/h5_ui/js/task-detail-abandon.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/* task-detail.html 专用 — 放弃客户弹窗 */
|
||||
function showAbandonModal() {
|
||||
document.getElementById('abandonModal').classList.remove('hidden');
|
||||
document.getElementById('abandonModal').classList.add('flex');
|
||||
document.getElementById('abandonReason').value = '';
|
||||
document.getElementById('abandonError').classList.add('hidden');
|
||||
}
|
||||
|
||||
function hideAbandonModal() {
|
||||
document.getElementById('abandonModal').classList.add('hidden');
|
||||
document.getElementById('abandonModal').classList.remove('flex');
|
||||
}
|
||||
|
||||
function submitAbandon() {
|
||||
var reason = document.getElementById('abandonReason').value.trim();
|
||||
if (!reason) {
|
||||
document.getElementById('abandonError').classList.remove('hidden');
|
||||
document.getElementById('abandonReason').focus();
|
||||
return;
|
||||
}
|
||||
hideAbandonModal();
|
||||
showToast('已放弃该客户的维护');
|
||||
}
|
||||
40
docs/h5_ui/js/task-detail-notes.js
Normal file
40
docs/h5_ui/js/task-detail-notes.js
Normal file
@@ -0,0 +1,40 @@
|
||||
/* task-detail 系列页面共享 — 备注弹窗 + Toast */
|
||||
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('备注已保存');
|
||||
}
|
||||
|
||||
function confirmDeleteNote() {
|
||||
document.getElementById('deleteNoteModal').classList.remove('hidden');
|
||||
document.getElementById('deleteNoteModal').classList.add('flex');
|
||||
}
|
||||
|
||||
function hideDeleteNoteModal() {
|
||||
document.getElementById('deleteNoteModal').classList.add('hidden');
|
||||
document.getElementById('deleteNoteModal').classList.remove('flex');
|
||||
}
|
||||
|
||||
function deleteNote() {
|
||||
hideDeleteNoteModal();
|
||||
showToast('备注已删除');
|
||||
}
|
||||
|
||||
function showToast(msg) {
|
||||
var toast = document.getElementById('toast');
|
||||
toast.textContent = msg;
|
||||
toast.classList.remove('hidden');
|
||||
setTimeout(function () { toast.classList.add('hidden'); }, 1500);
|
||||
}
|
||||
Reference in New Issue
Block a user