init: 项目初始提交 - NeoZQYY Monorepo 完整代码
This commit is contained in:
887
docs/h5_ui/pages/board-customer.html
Normal file
887
docs/h5_ui/pages/board-customer.html
Normal file
@@ -0,0 +1,887 @@
|
||||
<!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;
|
||||
}
|
||||
#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; }
|
||||
}
|
||||
.customer-card {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.customer-card:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
.dim-container { display: none; }
|
||||
.dim-container.active { display: block; }
|
||||
.assistant-tag { display: inline-flex; align-items: center; gap: 2px; }
|
||||
.assistant-assignee { color: #e34d59; font-weight: 700; }
|
||||
.assistant-abandoned { color: #c5c5c5; }
|
||||
.assistant-normal { color: #2c2c2c; }
|
||||
.assistant-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 16px;
|
||||
height: 14px;
|
||||
padding: 0 5px;
|
||||
border-radius: 6px;
|
||||
font-size: 10px;
|
||||
line-height: 1;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.3px;
|
||||
transform: translateY(-0.5px);
|
||||
}
|
||||
.assistant-badge-follow {
|
||||
color: #ffffff;
|
||||
background: linear-gradient(135deg, #e34d59 0%, #f26a76 100%);
|
||||
border: 1px solid rgba(227, 77, 89, 0.28);
|
||||
box-shadow: 0 1px 3px rgba(227, 77, 89, 0.28), inset 0 0.5px 0 rgba(255, 255, 255, 0.42);
|
||||
}
|
||||
.assistant-badge-drop {
|
||||
color: #ffffff;
|
||||
background: linear-gradient(135deg, #d4d4d4 0%, #b6b6b6 100%);
|
||||
border: 1px solid rgba(120, 120, 120, 0.18);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14), inset 0 0.5px 0 rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
.assistant-sep { color: #dcdcdc; margin: 0 6px; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-1 min-h-screen">
|
||||
<!-- 顶部导航 - 仅Tab -->
|
||||
<div class="safe-area-top bg-white sticky top-0 z-20 shadow-sm">
|
||||
<div class="flex border-b border-gray-2">
|
||||
<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 tab-active">客户</a>
|
||||
<a href="board-coach.html" class="flex-1 py-3 text-center text-sm font-medium text-gray-7">助教</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 筛选区域(二级) -->
|
||||
<div id="filterBar" class="bg-gray-1 sticky top-[44px] 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('type')" 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="typeLabel">最应召回</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('project')" 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="projectLabel">全部</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="typeDropdown" 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="selectType('最应召回')">最应召回(默认)</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectType('最大消费潜力')">最大消费潜力</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectType('最高余额')">最高余额</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectType('最近充值')">最近充值</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectType('最高消费 近60天')">最高消费 近60天</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectType('最频繁 近60天')">最频繁 近60天</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectType('最近到店')">最近到店</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectType('最专一')">最专一</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 项目筛选弹窗 -->
|
||||
<div id="projectDropdown" 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="selectProject('全部')">全部</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectProject('中🎱')">中🎱</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectProject('斯诺克')">斯诺克</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectProject('麻将')">麻将</div>
|
||||
<div class="px-4 py-3 text-sm text-gray-10 hover:bg-primary/5 rounded-lg cursor-pointer" onclick="selectProject('团建')">团建</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 客户列表区域 -->
|
||||
<div class="px-5 pt-4 pb-2 flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-base font-semibold text-gray-12">客户列表</span>
|
||||
<span class="text-sm text-gray-6">· 前100名</span>
|
||||
</div>
|
||||
<span class="text-sm text-gray-5">共100名客户</span>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最应召回(默认) ==================== -->
|
||||
<div id="dim-recall" class="dim-container active p-4 pt-1 space-y-3">
|
||||
<!-- Card 1: 演示 assignee (红色加粗+跟) + normal + abandoned (灰色+弃) -->
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">王</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">王先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.92</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">召回指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">30天到店 <span class="text-gray-11 font-medium">5次</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">15天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">7天</span></div>
|
||||
<div class="text-gray-6">超过 <span class="text-error font-medium">8天</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥8,000</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">小燕</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-abandoned">Amy</span><span class="assistant-badge assistant-badge-drop">弃</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- Card 2: 全部 normal 助教 -->
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-pink-400 to-rose-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">李</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">李女士</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.88</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">召回指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">30天到店 <span class="text-gray-11 font-medium">3次</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">20天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">10天</span></div>
|
||||
<div class="text-gray-6">超过 <span class="text-error font-medium">10天</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥12,500</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">Amy</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">小燕</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- Card 3: 另一位 assignee 助教 -->
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-blue-400 to-indigo-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">张</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">张先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.85</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">召回指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">30天到店 <span class="text-gray-11 font-medium">2次</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">18天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">7天</span></div>
|
||||
<div class="text-gray-6">超过 <span class="text-error font-medium">11天</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥3,200</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">泡芙</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">小燕</span></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最大消费潜力 ==================== -->
|
||||
<div id="dim-potential" class="dim-container p-4 pt-1 space-y-3">
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-rose-400 to-pink-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">赵</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">赵女士</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.95</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">近30天消费 <span class="text-gray-11 font-medium">¥4,800</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">5天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">10天</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥15,000</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">小燕</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-green-400 to-emerald-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">刘</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">刘先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.87</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">近30天消费 <span class="text-gray-11 font-medium">¥3,500</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">8天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">14天</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥6,800</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">Amy</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-abandoned">泡芙</span><span class="assistant-badge assistant-badge-drop">弃</span></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最高余额 ==================== -->
|
||||
<div id="dim-balance" class="dim-container p-4 pt-1 space-y-3">
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-rose-400 to-pink-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">赵</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">赵女士</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.78</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">余额合计 <span class="text-warning font-bold">¥25,000</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥6,200</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">12天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">10天</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">小燕</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-abandoned">Amy</span><span class="assistant-badge assistant-badge-drop">弃</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-purple-400 to-violet-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">陈</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">陈先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.72</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">余额合计 <span class="text-warning font-bold">¥18,500</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥3,800</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">8天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">14天</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">小燕</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最近充值 ==================== -->
|
||||
<div id="dim-recharge" class="dim-container p-4 pt-1 space-y-3">
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-400 to-blue-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">吴</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">吴先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">¥5,000</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">充值金额</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">最近充值 <span class="text-gray-11 font-medium">2天前</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥8,200</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">2天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">7天</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">Amy</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">小燕</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-orange-400 to-amber-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">郑</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">郑女士</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">¥3,000</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">充值金额</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">最近充值 <span class="text-gray-11 font-medium">5天前</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥6,500</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">5天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">10天</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">泡芙</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">Amy</span></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最高消费 近60天 ==================== -->
|
||||
<div id="dim-spend60" class="dim-container p-4 pt-1 space-y-3">
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-pink-400 to-rose-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">李</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">李女士</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.91</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">近60天消费 <span class="text-warning font-bold">¥12,800</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">3天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">7天</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥8,200</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">小燕</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">Amy</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-abandoned">泡芙</span><span class="assistant-badge assistant-badge-drop">弃</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">王</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">王先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.84</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">近60天消费 <span class="text-warning font-bold">¥9,500</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">15天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">7天</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥5,000</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">小燕</span></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最频繁 近60天 ==================== -->
|
||||
<div id="dim-freq60" class="dim-container p-4 pt-1 space-y-3">
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-blue-400 to-indigo-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">张</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">张先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.82</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">60天到店 <span class="text-warning font-bold">18天</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥8,600</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥4,200</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">2天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">3天</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">小燕</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-abandoned">Amy</span><span class="assistant-badge assistant-badge-drop">弃</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-purple-400 to-violet-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">陈</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">陈先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.79</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">60天到店 <span class="text-warning font-bold">15天</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥6,200</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥7,800</span></div>
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">3天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">4天</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">Amy</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">小燕</span></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最近到店 ==================== -->
|
||||
<div id="dim-recent" class="dim-container p-4 pt-1 space-y-3">
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-green-400 to-emerald-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">刘</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">刘先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.88</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">最近到店 <span class="text-success font-bold">1天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">7天</span></div>
|
||||
<div class="text-gray-6">60天到店 <span class="text-gray-11 font-medium">12天</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥5,400</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥9,200</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">Amy</span></span>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-cyan-400 to-teal-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">周</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">周先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.75</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs mb-2.5 ml-11">
|
||||
<div class="text-gray-6">最近到店 <span class="text-success font-bold">2天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">10天</span></div>
|
||||
<div class="text-gray-6">60天到店 <span class="text-gray-11 font-medium">8天</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥3,800</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥5,500</span></div>
|
||||
</div>
|
||||
<div class="text-xs border-t border-gray-1 pt-2 ml-11">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">小燕</span><span class="assistant-badge assistant-badge-follow">跟</span></span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-abandoned">泡芙</span><span class="assistant-badge assistant-badge-drop">弃</span></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- ==================== 最专一 ==================== -->
|
||||
<div id="dim-loyal" class="dim-container p-4 pt-1 space-y-3">
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-teal-400 to-cyan-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">孙</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">孙先生</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.81</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 最专一:助教信息优先,带关系指数 -->
|
||||
<div class="text-xs mb-2 ml-11 pb-2 border-b border-gray-1">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-assignee">小燕</span><span class="assistant-badge assistant-badge-follow">跟</span></span><span class="text-gray-5 text-[10px] ml-0.5">(0.95)</span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span><span class="text-gray-5 text-[10px] ml-0.5">(0.68)</span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-abandoned">Amy</span><span class="assistant-badge assistant-badge-drop">弃</span></span><span class="text-gray-5 text-[10px] ml-0.5">(0.32)</span>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs ml-11">
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">6天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">7天</span></div>
|
||||
<div class="text-gray-6">60天到店 <span class="text-gray-11 font-medium">10天</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥4,500</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥7,200</span></div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="customer-detail.html" class="block bg-white rounded-2xl p-4 shadow-sm customer-card">
|
||||
<div class="flex items-center justify-between mb-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="w-9 h-9 rounded-xl bg-gradient-to-br from-rose-400 to-pink-500 flex items-center justify-center shrink-0">
|
||||
<span class="text-white font-semibold text-sm">赵</span>
|
||||
</div>
|
||||
<span class="font-semibold text-gray-13">赵女士</span>
|
||||
</div>
|
||||
<div class="text-right shrink-0">
|
||||
<div class="text-primary font-bold">0.90</div>
|
||||
<div class="text-[10px] text-gray-6 -mt-0.5">消费潜力指数</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-xs mb-2 ml-11 pb-2 border-b border-gray-1">
|
||||
<span class="text-gray-6">助教:</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">Amy</span></span><span class="text-gray-5 text-[10px] ml-0.5">(0.88)</span>
|
||||
<span class="assistant-sep">|</span>
|
||||
<span class="assistant-tag">❤️ <span class="assistant-normal">泡芙</span></span><span class="text-gray-5 text-[10px] ml-0.5">(0.72)</span>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-x-4 gap-y-1.5 text-xs ml-11">
|
||||
<div class="text-gray-6">最近到店 <span class="text-gray-11 font-medium">4天前</span></div>
|
||||
<div class="text-gray-6">理想间隔 <span class="text-gray-11 font-medium">5天</span></div>
|
||||
<div class="text-gray-6">60天到店 <span class="text-gray-11 font-medium">14天</span></div>
|
||||
<div class="text-gray-6">近60天消费 <span class="text-gray-11 font-medium">¥7,800</span></div>
|
||||
<div class="text-gray-6">余额合计 <span class="text-gray-11 font-medium">¥12,000</span></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- 悬浮助手按钮 -->
|
||||
<script src="../js/ai-float-btn.js"></script>
|
||||
|
||||
<!-- 通用底部导航 -->
|
||||
<script src="../js/bottom-nav.js"></script>
|
||||
|
||||
<script>
|
||||
let currentFilter = null;
|
||||
|
||||
/* ---- 维度容器 ID 映射 ---- */
|
||||
const dimMap = {
|
||||
'最应召回': 'dim-recall',
|
||||
'最大消费潜力': 'dim-potential',
|
||||
'最高余额': 'dim-balance',
|
||||
'最近充值': 'dim-recharge',
|
||||
'最高消费 近60天': 'dim-spend60',
|
||||
'最频繁 近60天': 'dim-freq60',
|
||||
'最近到店': 'dim-recent',
|
||||
'最专一': 'dim-loyal'
|
||||
};
|
||||
|
||||
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 typeDropdown = document.getElementById('typeDropdown');
|
||||
const projectDropdown = document.getElementById('projectDropdown');
|
||||
|
||||
if (currentFilter === type) {
|
||||
closeAllFilters();
|
||||
return;
|
||||
}
|
||||
|
||||
closeAllFilters();
|
||||
currentFilter = type;
|
||||
overlay.classList.add('show');
|
||||
|
||||
if (type === 'type') {
|
||||
positionDropdown(typeDropdown);
|
||||
typeDropdown.classList.add('show');
|
||||
} else if (type === 'project') {
|
||||
positionDropdown(projectDropdown);
|
||||
projectDropdown.classList.add('show');
|
||||
}
|
||||
}
|
||||
|
||||
function closeAllFilters() {
|
||||
currentFilter = null;
|
||||
document.getElementById('filterOverlay').classList.remove('show');
|
||||
document.getElementById('typeDropdown').classList.remove('show');
|
||||
document.getElementById('projectDropdown').classList.remove('show');
|
||||
}
|
||||
|
||||
function selectType(value) {
|
||||
document.getElementById('typeLabel').textContent = value;
|
||||
// 切换维度容器
|
||||
document.querySelectorAll('.dim-container').forEach(el => el.classList.remove('active'));
|
||||
const id = dimMap[value];
|
||||
if (id) document.getElementById(id).classList.add('active');
|
||||
closeAllFilters();
|
||||
}
|
||||
|
||||
function selectProject(value) {
|
||||
document.getElementById('projectLabel').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;
|
||||
const HEADER_HEIGHT = 44;
|
||||
|
||||
let lastY = window.scrollY || 0;
|
||||
let lastDir = null;
|
||||
let ticking = false;
|
||||
let acc = 0;
|
||||
let lockedDir = null;
|
||||
|
||||
function getFilterBarThreshold() {
|
||||
return HEADER_HEIGHT;
|
||||
}
|
||||
|
||||
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;
|
||||
const filterBarThreshold = getFilterBarThreshold();
|
||||
|
||||
if (y <= filterBarThreshold) {
|
||||
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>
|
||||
Reference in New Issue
Block a user