feat:引入 TDesign 以及前端初稿

This commit is contained in:
Neo
2026-01-24 22:56:57 +08:00
parent 6147924889
commit c972c52e04
80 changed files with 35245 additions and 0 deletions

View File

@@ -0,0 +1,526 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>看板-助教 - 球房运营助手</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#0052d9',
'primary-light': '#ecf2fe',
success: '#00a870',
warning: '#ed7b2f',
error: '#e34d59',
'gray-1': '#f3f3f3',
'gray-2': '#eeeeee',
'gray-3': '#e7e7e7',
'gray-4': '#dcdcdc',
'gray-5': '#c5c5c5',
'gray-6': '#a6a6a6',
'gray-7': '#8b8b8b',
'gray-8': '#777777',
'gray-9': '#5e5e5e',
'gray-10': '#4b4b4b',
'gray-11': '#393939',
'gray-12': '#2c2c2c',
'gray-13': '#242424',
},
fontFamily: {
sans: ['Noto Sans SC', 'sans-serif'],
}
}
}
}
</script>
<style>
body {
font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
padding-bottom: 80px;
}
.safe-area-top {
padding-top: env(safe-area-inset-top, 44px);
}
.tab-active {
color: #0052d9;
position: relative;
}
.tab-active::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 24px;
height: 3px;
background: linear-gradient(90deg, #0052d9, #5b9cf8);
border-radius: 2px;
}
.filter-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.filter-overlay.show {
display: block;
}
.filter-dropdown {
display: none;
position: fixed;
left: 0;
right: 0;
background: white;
border-radius: 0 0 16px 16px;
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
z-index: 1001;
max-height: 60vh;
overflow-y: auto;
}
.filter-dropdown.show {
display: block;
}
/* 二级筛选栏层级与动效 */
#filterBar {
overflow: hidden;
max-height: 120px;
transition: transform 220ms ease, opacity 220ms ease, max-height 220ms ease;
will-change: transform, opacity;
}
/* 浠呯敤浜庘€滈娆¤繘鍏ラ〉闈⑩€濈殑涓嬫粦鍑虹幇锛堢敤 transition 瑙﹀彂涓€娆★級 */
#filterBar.filter-bar-enter {
transform: translateY(-16px);
opacity: 0;
}
#filterBar.filter-bar-hidden {
opacity: 0;
transform: translateY(-110%);
pointer-events: none;
}
@keyframes filterBarDrop {
from { transform: translateY(-16px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
#filterBar { animation: none; transition: none; }
}
.coach-card {
transition: all 0.2s ease;
}
.coach-card:active {
transform: scale(0.98);
}
</style>
</head>
<body class="bg-gray-1 min-h-screen">
<!-- 顶部导航 -->
<div class="safe-area-top bg-white sticky top-0 z-20 shadow-sm">
<div class="h-11 flex items-center justify-center relative border-b border-gray-2">
<h1 class="text-base font-medium text-gray-13">看板</h1>
</div>
<!-- 一级 Tab -->
<div class="flex">
<a href="board-finance.html" class="flex-1 py-3 text-center text-sm font-medium text-gray-7">财务</a>
<a href="board-customer.html" class="flex-1 py-3 text-center text-sm font-medium text-gray-7">客户</a>
<a href="board-coach.html" class="flex-1 py-3 text-center text-sm font-medium tab-active">助教</a>
</div>
</div>
<!-- 筛选区域(二级) -->
<div id="filterBar" class="bg-gray-1 sticky top-[88px] z-10 px-4 py-2 border-b border-gray-2">
<div class="bg-white rounded-2xl p-1.5 flex gap-2 shadow-sm border border-gray-2">
<button onclick="toggleFilter('sort')" class="flex-1 px-3 py-2 bg-gray-50 rounded-lg text-sm text-gray-10 flex items-center justify-center gap-1 border border-gray-100">
<span id="sortLabel">创收最多</span>
<svg class="w-4 h-4 text-gray-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"/>
</svg>
</button>
<button onclick="toggleFilter('skill')" class="flex-1 px-3 py-2 bg-gray-50 rounded-lg text-sm text-gray-10 flex items-center justify-center gap-1 border border-gray-100">
<span id="skillLabel">不限</span>
<svg class="w-4 h-4 text-gray-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"/>
</svg>
</button>
<button onclick="toggleFilter('time')" class="flex-1 px-3 py-2 bg-gray-50 rounded-lg text-sm text-gray-10 flex items-center justify-center gap-1 border border-gray-100">
<span id="timeLabel">本月</span>
<svg class="w-4 h-4 text-gray-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="6 9 12 15 18 9"/>
</svg>
</button>
</div>
</div>
<!-- 遮罩层 -->
<div id="filterOverlay" class="filter-overlay" onclick="closeAllFilters()"></div>
<!-- 排序筛选弹窗 -->
<div id="sortDropdown" class="filter-dropdown">
<div class="p-4 space-y-2">
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSort('创收最多')">创收最多</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSort('创收最低')">创收最低</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSort('业绩最高')">业绩最高</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSort('业绩最低')">业绩最低</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSort('工资最高')">工资最高</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSort('工资最低')">工资最低</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSort('潜在客源储值')">潜在客源储值</div>
</div>
</div>
<!-- 擅长项目筛选弹窗 -->
<div id="skillDropdown" class="filter-dropdown">
<div class="p-4 space-y-2">
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSkill('不限')">不限</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSkill('中🎱')">中🎱</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSkill('斯诺克')">斯诺克</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSkill('麻将')">麻将</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectSkill('团建')">团建</div>
</div>
</div>
<!-- 时间筛选弹窗 -->
<div id="timeDropdown" class="filter-dropdown">
<div class="p-4 space-y-2">
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectTime('本月')">本月</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectTime('上个月')">上个月</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectTime('最近3个月')">最近3个月</div>
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectTime('本季度')">本季度</div>
</div>
</div>
<!-- 助教列表 -->
<div class="p-4 space-y-3">
<!-- 助教卡片 1 -->
<a href="coach-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm coach-card">
<div class="flex items-center justify-between mb-3">
<div class="flex items-center gap-2">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-blue-400 to-indigo-500 flex items-center justify-center">
<span class="text-white font-semibold"></span>
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-gray-13">小燕</span>
<span class="px-1.5 py-0.5 bg-gradient-to-r from-amber-400 to-orange-400 text-white text-xs rounded">星级</span>
<span class="px-1.5 py-0.5 bg-primary/10 text-primary text-xs rounded">中🎱</span>
</div>
</div>
</div>
<div class="text-right">
<p class="text-sm text-success font-semibold">8.6万</p>
<p class="text-xs text-gray-6">本期流水</p>
</div>
</div>
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-2 text-gray-6">
<span>💖 王先生</span>
<span>💖 李女士</span>
</div>
<span class="text-gray-6">上课86小时</span>
</div>
</a>
<!-- 助教卡片 2 -->
<a href="coach-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm coach-card">
<div class="flex items-center justify-between mb-3">
<div class="flex items-center gap-2">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-green-400 to-emerald-500 flex items-center justify-center">
<span class="text-white font-semibold"></span>
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-gray-13">泡芙</span>
<span class="px-1.5 py-0.5 bg-gradient-to-r from-purple-400 to-violet-400 text-white text-xs rounded">高级</span>
<span class="px-1.5 py-0.5 bg-success/10 text-success text-xs rounded">斯诺克</span>
</div>
</div>
</div>
<div class="text-right">
<p class="text-sm text-success font-semibold">7.2万</p>
<p class="text-xs text-gray-6">本期流水</p>
</div>
</div>
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-2 text-gray-6">
<span>💖 陈先生</span>
<span>💛 刘女士</span>
</div>
<span class="text-gray-6">上课72小时</span>
</div>
</a>
<!-- 助教卡片 3 -->
<a href="coach-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm coach-card">
<div class="flex items-center justify-between mb-3">
<div class="flex items-center gap-2">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-pink-400 to-rose-500 flex items-center justify-center">
<span class="text-white font-semibold">A</span>
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-gray-13">Amy</span>
<span class="px-1.5 py-0.5 bg-gradient-to-r from-amber-400 to-orange-400 text-white text-xs rounded">星级</span>
<span class="px-1.5 py-0.5 bg-primary/10 text-primary text-xs rounded">中🎱</span>
<span class="px-1.5 py-0.5 bg-success/10 text-success text-xs rounded">斯诺克</span>
</div>
</div>
</div>
<div class="text-right">
<p class="text-sm text-success font-semibold">6.8万</p>
<p class="text-xs text-gray-6">本期流水</p>
</div>
</div>
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-2 text-gray-6">
<span>💖 张先生</span>
<span>💛 周女士</span>
</div>
<span class="text-gray-6">上课68小时</span>
</div>
</a>
<!-- 助教卡片 4 -->
<a href="coach-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm coach-card">
<div class="flex items-center justify-between mb-3">
<div class="flex items-center gap-2">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center">
<span class="text-white font-semibold">M</span>
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-gray-13">Mia</span>
<span class="px-1.5 py-0.5 bg-gradient-to-r from-blue-400 to-indigo-400 text-white text-xs rounded">中级</span>
<span class="px-1.5 py-0.5 bg-warning/10 text-warning text-xs rounded">麻将</span>
</div>
</div>
</div>
<div class="text-right">
<p class="text-sm text-success font-semibold">5.5万</p>
<p class="text-xs text-gray-6">本期流水</p>
</div>
</div>
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-2 text-gray-6">
<span>💛 赵先生</span>
<span>💛 吴女士</span>
</div>
<span class="text-gray-6">上课55小时</span>
</div>
</a>
<!-- 助教卡片 5 -->
<a href="coach-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm coach-card">
<div class="flex items-center justify-between mb-3">
<div class="flex items-center gap-2">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-purple-400 to-violet-500 flex items-center justify-center">
<span class="text-white font-semibold"></span>
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-gray-13">糖糖</span>
<span class="px-1.5 py-0.5 bg-gradient-to-r from-gray-400 to-gray-500 text-white text-xs rounded">初级</span>
<span class="px-1.5 py-0.5 bg-primary/10 text-primary text-xs rounded">中🎱</span>
</div>
</div>
</div>
<div class="text-right">
<p class="text-sm text-success font-semibold">4.2万</p>
<p class="text-xs text-gray-6">本期流水</p>
</div>
</div>
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-2 text-gray-6">
<span>💛 钱先生</span>
<span>💛 孙女士</span>
</div>
<span class="text-gray-6">上课42小时</span>
</div>
</a>
<!-- 助教卡片 6 -->
<a href="coach-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm coach-card">
<div class="flex items-center justify-between mb-3">
<div class="flex items-center gap-2">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-cyan-400 to-teal-500 flex items-center justify-center">
<span class="text-white font-semibold"></span>
</div>
<div>
<div class="flex items-center gap-2">
<span class="text-base font-semibold text-gray-13">露露</span>
<span class="px-1.5 py-0.5 bg-gradient-to-r from-blue-400 to-indigo-400 text-white text-xs rounded">中级</span>
<span class="px-1.5 py-0.5 bg-error/10 text-error text-xs rounded">团建</span>
</div>
</div>
</div>
<div class="text-right">
<p class="text-sm text-success font-semibold">3.8万</p>
<p class="text-xs text-gray-6">本期流水</p>
</div>
</div>
<div class="flex items-center justify-between text-sm">
<div class="flex items-center gap-2 text-gray-6">
<span>💛 郑先生</span>
<span>💛 冯女士</span>
</div>
<span class="text-gray-6">上课38小时</span>
</div>
</a>
</div>
<!-- 悬浮助手按钮 -->
<script src="../js/ai-float-btn.js"></script>
<!-- 通用底部导航 -->
<script src="../js/bottom-nav.js"></script>
<script>
let currentFilter = null;
function positionDropdown(dropdownEl) {
const bar = document.getElementById('filterBar');
if (!bar || !dropdownEl) return;
const rect = bar.getBoundingClientRect();
dropdownEl.style.top = `${rect.bottom}px`;
}
function toggleFilter(type) {
const overlay = document.getElementById('filterOverlay');
const sortDropdown = document.getElementById('sortDropdown');
const skillDropdown = document.getElementById('skillDropdown');
const timeDropdown = document.getElementById('timeDropdown');
if (currentFilter === type) {
closeAllFilters();
return;
}
closeAllFilters();
currentFilter = type;
overlay.classList.add('show');
if (type === 'sort') {
positionDropdown(sortDropdown);
sortDropdown.classList.add('show');
} else if (type === 'skill') {
positionDropdown(skillDropdown);
skillDropdown.classList.add('show');
} else if (type === 'time') {
positionDropdown(timeDropdown);
timeDropdown.classList.add('show');
}
}
function closeAllFilters() {
currentFilter = null;
document.getElementById('filterOverlay').classList.remove('show');
document.getElementById('sortDropdown').classList.remove('show');
document.getElementById('skillDropdown').classList.remove('show');
document.getElementById('timeDropdown').classList.remove('show');
}
function selectSort(value) {
document.getElementById('sortLabel').textContent = value;
closeAllFilters();
}
function selectSkill(value) {
document.getElementById('skillLabel').textContent = value;
closeAllFilters();
}
function selectTime(value) {
document.getElementById('timeLabel').textContent = value;
closeAllFilters();
}
// 滚动时:下滑隐藏筛选栏,上滑显示(单次滚动手势结束后判断一次,避免抖动)
(function initFilterBarScrollBehavior() {
const bar = document.getElementById('filterBar');
if (!bar) return;
const TRIGGER_DISTANCE_DOWN = 24;
const TRIGGER_DISTANCE_UP = 12;
const JITTER_THRESHOLD = 2;
let lastY = window.scrollY || 0;
let lastDir = null; // 'down' | 'up'
let ticking = false;
let acc = 0;
let lockedDir = null; // 'down' | 'up'
// 首次进入:用 transition 做一次从上到下出现
bar.classList.add('filter-bar-enter');
window.requestAnimationFrame(() => {
bar.classList.remove('filter-bar-enter');
});
function setVisible(visible) {
if (visible) {
bar.classList.remove('filter-bar-hidden');
} else {
if (!bar.classList.contains('filter-bar-hidden')) closeAllFilters();
bar.classList.add('filter-bar-hidden');
}
}
function resetGesture(y) {
lastY = y;
lastDir = null;
acc = 0;
lockedDir = null;
}
function onScrollFrame() {
const y = window.scrollY || 0;
if (y <= 8) {
setVisible(true);
resetGesture(y);
return;
}
const delta = y - lastY;
if (Math.abs(delta) <= JITTER_THRESHOLD) {
lastY = y;
return;
}
const dir = delta > 0 ? 'down' : 'up';
if (lastDir === null) {
lastDir = dir;
} else if (dir !== lastDir) {
lastDir = dir;
lockedDir = null;
acc = 0;
}
lastY = y;
if (lockedDir === dir) return;
acc += Math.abs(delta);
const threshold = dir === 'up' ? TRIGGER_DISTANCE_UP : TRIGGER_DISTANCE_DOWN;
if (acc < threshold) return;
setVisible(dir === 'up');
lockedDir = dir;
acc = 0;
}
window.addEventListener('scroll', () => {
if (ticking) return;
ticking = true;
window.requestAnimationFrame(() => {
onScrollFrame();
ticking = false;
});
}, { passive: true });
})();
</script>
</body>
</html>