mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 07:09:20 +08:00
182 lines
10 KiB
HTML
182 lines
10 KiB
HTML
<!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>
|
|
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
|
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
body {
|
|
font-family: 'Plus Jakarta Sans', sans-serif;
|
|
background: linear-gradient(135deg, #eef2ff 0%, #fae8ff 50%, #f1f5f9 100%);
|
|
min-height: 100vh;
|
|
color: #1e293b;
|
|
}
|
|
.glass {
|
|
background: rgba(255, 255, 255, 0.4);
|
|
backdrop-filter: blur(16px);
|
|
-webkit-backdrop-filter: blur(16px);
|
|
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
|
|
}
|
|
/* 时间选择器激活状态 */
|
|
.time-btn.active {
|
|
background: #6366f1;
|
|
color: white;
|
|
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
|
|
}
|
|
.time-btn { transition: all 0.3s ease; }
|
|
.no-scrollbar::-webkit-scrollbar { display: none; }
|
|
</style>
|
|
</head>
|
|
<body class="p-6">
|
|
|
|
<div class="max-w-7xl mx-auto space-y-6">
|
|
<!-- 头部:店铺信息 & 增强型时间选择器 -->
|
|
<header class="flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 pb-4">
|
|
<div>
|
|
<h1 class="text-3xl font-black text-slate-800">星辰优选旗舰店</h1>
|
|
<p class="text-slate-500 font-medium">数据维度:全方位损益实时统计</p>
|
|
</div>
|
|
|
|
<!-- 时间选择器组件 -->
|
|
<div class="glass p-1.5 rounded-2xl flex flex-wrap items-center gap-2">
|
|
<div class="flex bg-white/30 rounded-xl p-1">
|
|
<button onclick="switchTime(this)" class="time-btn active px-4 py-1.5 rounded-lg text-sm font-bold">今日</button>
|
|
<button onclick="switchTime(this)" class="time-btn px-4 py-1.5 rounded-lg text-sm font-bold">昨日</button>
|
|
<button onclick="switchTime(this)" class="time-btn px-4 py-1.5 rounded-lg text-sm font-bold">近7日</button>
|
|
<button onclick="switchTime(this)" class="time-btn px-4 py-1.5 rounded-lg text-sm font-bold">近30日</button>
|
|
</div>
|
|
<div class="h-6 w-px bg-slate-300 mx-1"></div>
|
|
<!-- 自定义时间 -->
|
|
<div class="flex items-center gap-2 px-3 py-1.5 bg-white/30 rounded-xl">
|
|
<span class="text-[10px] font-bold text-slate-400 uppercase">自定义</span>
|
|
<input type="date" class="bg-transparent text-xs font-bold outline-none border-none cursor-pointer">
|
|
<span class="text-slate-400">-</span>
|
|
<input type="date" class="bg-transparent text-xs font-bold outline-none border-none cursor-pointer">
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- 1. 核心 KPI (覆盖:销售额, ROI, 目标达成, 税后盈亏, 日单量, 客单价) -->
|
|
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4">
|
|
<div class="glass p-5 rounded-3xl">
|
|
<div class="text-[10px] font-bold text-indigo-500 uppercase">销售额</div>
|
|
<div class="text-2xl font-black">¥128,400</div>
|
|
</div>
|
|
<div class="glass p-5 rounded-3xl border-l-4 border-l-indigo-500">
|
|
<div class="text-[10px] font-bold text-indigo-500 uppercase">ROI / 费比</div>
|
|
<div class="text-2xl font-black">4.21 <span class="text-xs text-slate-400 font-normal">/ 23%</span></div>
|
|
</div>
|
|
<div class="glass p-5 rounded-3xl">
|
|
<div class="text-[10px] font-bold text-indigo-500 uppercase">达成率</div>
|
|
<div class="text-2xl font-black text-indigo-600">85.4%</div>
|
|
</div>
|
|
<div class="glass p-5 rounded-3xl">
|
|
<div class="text-[10px] font-bold text-indigo-500 uppercase">单量 / 客单价</div>
|
|
<div class="text-2xl font-black">812 <span class="text-xs text-slate-400 font-normal">/ ¥158</span></div>
|
|
</div>
|
|
<div class="glass p-5 rounded-3xl">
|
|
<div class="text-[10px] font-bold text-indigo-500 uppercase">推广费总和</div>
|
|
<div class="text-2xl font-black">¥45,000</div>
|
|
</div>
|
|
<div class="glass p-5 rounded-3xl bg-emerald-500/10 border-l-4 border-l-emerald-500">
|
|
<div class="text-[10px] font-bold text-emerald-600 uppercase">税后盈亏</div>
|
|
<div class="text-2xl font-black text-emerald-600">¥12,450</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 2. 图表与财务损益拆解 -->
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
<div class="lg:col-span-2 glass p-6 rounded-[2rem]">
|
|
<h3 class="font-bold text-lg mb-4">业绩趋势 (10/05 - 10/11)</h3>
|
|
<div id="shopTrend" style="height: 380px;"></div>
|
|
</div>
|
|
|
|
<!-- 16维度损益明细 -->
|
|
<div class="glass p-6 rounded-[2rem] flex flex-col">
|
|
<h3 class="font-bold text-lg mb-4">财务损益全维度 (P&L)</h3>
|
|
<div class="space-y-3 text-sm flex-1 overflow-y-auto pr-2 no-scrollbar">
|
|
<div class="flex justify-between p-2 rounded-xl bg-white/20"><span class="opacity-60">目标单量</span><span class="font-bold">2,000 单</span></div>
|
|
<div class="flex justify-between p-2"><span class="opacity-60">成本运费</span><span class="font-bold text-red-500">-¥32,400</span></div>
|
|
<div class="flex justify-between p-2"><span class="opacity-60">退款金额</span><span class="font-bold text-red-500">-¥8,200</span></div>
|
|
<div class="flex justify-between p-2"><span class="opacity-60">推广费用(今日)</span><span class="font-bold">¥3,200</span></div>
|
|
<div class="flex justify-between p-2"><span class="opacity-60">刷单费用</span><span class="font-bold text-orange-500">¥1,500</span></div>
|
|
<div class="flex justify-between p-2 pt-4 border-t border-white/40"><span class="text-indigo-600 font-bold">税前盈亏</span><span class="font-bold text-indigo-600">¥17,586</span></div>
|
|
<div class="flex justify-between p-2"><span class="opacity-40 italic text-xs">销售额 4% 税</span><span class="opacity-40 text-xs">¥5,136</span></div>
|
|
<!-- 最终结果 -->
|
|
<div class="flex justify-between p-4 rounded-2xl bg-gradient-to-r from-indigo-600 to-indigo-800 text-white shadow-xl shadow-indigo-100 mt-4">
|
|
<span class="font-bold uppercase tracking-widest text-xs opacity-80">税后盈亏 (Final)</span>
|
|
<span class="text-2xl font-black">¥12,450</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 3. 商品贡献列表 -->
|
|
<div class="glass rounded-[2rem] overflow-hidden">
|
|
<div class="p-6 border-b border-white/40">
|
|
<h3 class="font-bold text-lg">核心商品利润排名</h3>
|
|
</div>
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-left">
|
|
<thead>
|
|
<tr class="text-[10px] uppercase tracking-widest text-slate-400">
|
|
<th class="p-5 font-bold">商品名/SKU</th>
|
|
<th class="p-5 font-bold">销售额</th>
|
|
<th class="p-5 font-bold">推广费</th>
|
|
<th class="p-5 font-bold">ROI</th>
|
|
<th class="p-5 font-bold text-emerald-600">单品净利</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="text-sm divide-y divide-white/20">
|
|
<tr class="hover:bg-white/30 transition">
|
|
<td class="p-5 font-bold italic">2023 智能降噪耳机 Pro</td>
|
|
<td class="p-5">¥42,000</td>
|
|
<td class="p-5">¥5,200</td>
|
|
<td class="p-5"><span class="px-3 py-1 bg-indigo-100 text-indigo-600 rounded-lg font-bold">8.1</span></td>
|
|
<td class="p-5 font-black text-emerald-600">¥12,400</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// 时间切换效果
|
|
function switchTime(btn) {
|
|
document.querySelectorAll('.time-btn').forEach(b => b.classList.remove('active'));
|
|
btn.classList.add('active');
|
|
}
|
|
|
|
// Echarts 初始化 (销售趋势图)
|
|
const chart = echarts.init(document.getElementById('shopTrend'));
|
|
chart.setOption({
|
|
grid: { top: 20, left: 40, right: 20, bottom: 40 },
|
|
tooltip: { trigger: 'axis', backgroundColor: 'rgba(255,255,255,0.9)' },
|
|
xAxis: { type: 'category', data: ['10-05', '10-06', '10-07', '10-08', '10-09', '10-10', '10-11'] },
|
|
yAxis: { type: 'value', splitLine: { lineStyle: { type: 'dashed', color: 'rgba(255,255,255,0.5)' } } },
|
|
series: [{
|
|
name: '销售额',
|
|
type: 'line',
|
|
smooth: true,
|
|
symbol: 'circle',
|
|
symbolSize: 10,
|
|
lineStyle: { width: 4, color: '#6366f1' },
|
|
itemStyle: { color: '#6366f1', borderColor: '#fff', borderWidth: 2 },
|
|
areaStyle: {
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
{ offset: 0, color: 'rgba(99, 102, 241, 0.4)' },
|
|
{ offset: 1, color: 'rgba(99, 102, 241, 0)' }
|
|
])
|
|
},
|
|
data: [82, 93, 90, 120, 129, 133, 128]
|
|
}]
|
|
});
|
|
window.onresize = chart.resize;
|
|
</script>
|
|
</body>
|
|
</html> |