359 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			359 lines
		
	
	
		
			11 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.jsdelivr.net/npm/chart.js"></script>
 | ||
|     <style>
 | ||
|         * {
 | ||
|             margin: 0;
 | ||
|             padding: 0;
 | ||
|             box-sizing: border-box;
 | ||
|         }
 | ||
| 
 | ||
|         body {
 | ||
|             font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", 微软雅黑, Arial, sans-serif;
 | ||
|             background-color: #f5f5f5;
 | ||
|             color: #333;
 | ||
|             overflow-x: hidden;
 | ||
|         }
 | ||
| 
 | ||
|         .container {
 | ||
|             max-width: 1400px;
 | ||
|             margin: 0 auto;
 | ||
|             padding: 30px;
 | ||
|         }
 | ||
| 
 | ||
|         /* 顶部筛选区域 */
 | ||
|         .filter-section {
 | ||
|             background: #fff;
 | ||
|             padding: 20px;
 | ||
|             border-radius: 8px;
 | ||
|             margin-bottom: 30px;
 | ||
|             box-shadow: 0 2px 8px rgba(0,0,0,0.1);
 | ||
|         }
 | ||
| 
 | ||
|         .filter-row {
 | ||
|             display: flex;
 | ||
|             align-items: center;
 | ||
|             gap: 20px;
 | ||
|             flex-wrap: wrap;
 | ||
|         }
 | ||
| 
 | ||
|         .filter-item {
 | ||
|             display: flex;
 | ||
|             align-items: center;
 | ||
|             gap: 10px;
 | ||
|         }
 | ||
| 
 | ||
|         .filter-item label {
 | ||
|             font-weight: 500;
 | ||
|             color: #333;
 | ||
|             min-width: 70px;
 | ||
|         }
 | ||
| 
 | ||
|         .filter-item select,
 | ||
|         .filter-item input {
 | ||
|             padding: 8px 12px;
 | ||
|             border: 1px solid #d9d9d9;
 | ||
|             border-radius: 4px;
 | ||
|             min-width: 120px;
 | ||
|             font-size: 14px;
 | ||
|             transition: all 0.3s ease;
 | ||
|         }
 | ||
| 
 | ||
|         .filter-item select:focus,
 | ||
|         .filter-item input:focus {
 | ||
|             border-color: #1890ff;
 | ||
|             box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
 | ||
|             outline: none;
 | ||
|         }
 | ||
| 
 | ||
|         .btn {
 | ||
|             padding: 10px 20px;
 | ||
|             border-radius: 5px;
 | ||
|             font-size: 14px;
 | ||
|             font-weight: 500;
 | ||
|             transition: all 0.3s ease;
 | ||
|             display: inline-flex;
 | ||
|             align-items: center;
 | ||
|             gap: 5px;
 | ||
|             border: none;
 | ||
|             cursor: pointer;
 | ||
|         }
 | ||
| 
 | ||
|         .btn-primary {
 | ||
|             background-color: #1890ff;
 | ||
|             color: #fff;
 | ||
|         }
 | ||
| 
 | ||
|         .btn-primary:hover {
 | ||
|             background-color: #40a9ff;
 | ||
|             transform: translateY(-2px);
 | ||
|         }
 | ||
| 
 | ||
|         .btn-success {
 | ||
|             background-color: #52c41a;
 | ||
|             color: #fff;
 | ||
|         }
 | ||
| 
 | ||
|         .btn-success:hover {
 | ||
|             background-color: #73d13d;
 | ||
|             transform: translateY(-2px);
 | ||
|         }
 | ||
| 
 | ||
|         /* 订单分析标题 */
 | ||
|         .page-title {
 | ||
|             font-size: 24px;
 | ||
|             font-weight: 600;
 | ||
|             margin-bottom: 30px;
 | ||
|             color: #333;
 | ||
|         }
 | ||
| 
 | ||
|         /* 订单统计概览 */
 | ||
|         .order-overview {
 | ||
|             background: #fff;
 | ||
|             border-radius: 8px;
 | ||
|             padding: 20px;
 | ||
|             margin-bottom: 30px;
 | ||
|             box-shadow: 0 2px 8px rgba(0,0,0,0.1);
 | ||
|         }
 | ||
| 
 | ||
|         .stats-grid {
 | ||
|             display: grid;
 | ||
|             grid-template-columns: repeat(4, 1fr);
 | ||
|             gap: 30px;
 | ||
|             margin-bottom: 30px;
 | ||
|         }
 | ||
| 
 | ||
|         .stats-grid-bottom {
 | ||
|             display: grid;
 | ||
|             grid-template-columns: repeat(4, 1fr);
 | ||
|             gap: 30px;
 | ||
|             margin-bottom: 30px;
 | ||
|         }
 | ||
| 
 | ||
|         .stats-grid-third {
 | ||
|             display: grid;
 | ||
|             grid-template-columns: repeat(4, 1fr);
 | ||
|             gap: 30px;
 | ||
|         }
 | ||
| 
 | ||
|         .stat-card {
 | ||
|             text-align: left;
 | ||
|             padding: 0;
 | ||
|         }
 | ||
| 
 | ||
|         .stat-label {
 | ||
|             font-size: 14px;
 | ||
|             color: #666;
 | ||
|             margin-bottom: 8px;
 | ||
|             font-weight: 400;
 | ||
|         }
 | ||
| 
 | ||
|         .stat-value {
 | ||
|             font-size: 24px;
 | ||
|             font-weight: 600;
 | ||
|             color: #333;
 | ||
|             line-height: 1.2;
 | ||
|         }
 | ||
| 
 | ||
|         .stat-percentage {
 | ||
|             color: #666;
 | ||
|             font-size: 16px;
 | ||
|         }
 | ||
| 
 | ||
|         /* 响应式设计 */
 | ||
|         @media (max-width: 1200px) {
 | ||
|             .stats-grid,
 | ||
|             .stats-grid-bottom,
 | ||
|             .stats-grid-third {
 | ||
|                 grid-template-columns: repeat(2, 1fr);
 | ||
|                 gap: 20px;
 | ||
|             }
 | ||
|         }
 | ||
| 
 | ||
|         @media (max-width: 768px) {
 | ||
|             .container {
 | ||
|                 padding: 20px;
 | ||
|             }
 | ||
| 
 | ||
|             .stats-grid,
 | ||
|             .stats-grid-bottom,
 | ||
|             .stats-grid-third {
 | ||
|                 grid-template-columns: 1fr;
 | ||
|                 gap: 15px;
 | ||
|             }
 | ||
| 
 | ||
|             .filter-row {
 | ||
|                 flex-direction: column;
 | ||
|                 align-items: flex-start;
 | ||
|                 gap: 15px;
 | ||
|             }
 | ||
| 
 | ||
|             .page-title {
 | ||
|                 font-size: 20px;
 | ||
|             }
 | ||
| 
 | ||
|             .stat-value {
 | ||
|                 font-size: 20px;
 | ||
|             }
 | ||
|         }
 | ||
|     </style>
 | ||
| </head>
 | ||
| <body>
 | ||
|     <div class="container">
 | ||
|         <!-- 顶部筛选区域 -->
 | ||
|         <div class="filter-section">
 | ||
|             <div class="filter-row">
 | ||
|                 <div class="filter-item">
 | ||
|                     <label for="dateRange">日期范围:</label>
 | ||
|                     <select id="dateRange">
 | ||
|                         <option value="today">近1天</option>
 | ||
|                         <option value="week" selected>近7天</option>
 | ||
|                         <option value="month">近30天</option>
 | ||
|                         <option value="custom">自定义</option>
 | ||
|                     </select>
 | ||
|                 </div>
 | ||
|                 <div class="filter-item" id="customDateRange" style="display: none;">
 | ||
|                     <label for="startDate">开始日期:</label>
 | ||
|                     <input type="date" id="startDate">
 | ||
|                     <label for="endDate">结束日期:</label>
 | ||
|                     <input type="date" id="endDate">
 | ||
|                 </div>
 | ||
|                 <button class="btn btn-primary" onclick="queryData()">
 | ||
|                     <span>查询</span>
 | ||
|                 </button>
 | ||
|                 <button class="btn btn-success" onclick="exportData()">
 | ||
|                     <span>导出</span>
 | ||
|                 </button>
 | ||
|             </div>
 | ||
|         </div>
 | ||
| 
 | ||
|         <!-- 页面标题 -->
 | ||
|         <h1 class="page-title">订单分析</h1>
 | ||
| 
 | ||
|         <!-- 订单统计概览 -->
 | ||
|         <div class="order-overview">
 | ||
|             <!-- 第一行统计数据 -->
 | ||
|             <div class="stats-grid">
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">下单订单数量</div>
 | ||
|                     <div class="stat-value" id="totalOrders">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">支付订单数量</div>
 | ||
|                     <div class="stat-value" id="paidOrders">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">有效订单数量</div>
 | ||
|                     <div class="stat-value" id="validOrders">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">有效订单率</div>
 | ||
|                     <div class="stat-value stat-percentage" id="validOrderRate">0.00%</div>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
| 
 | ||
|             <!-- 第二行统计数据 -->
 | ||
|             <div class="stats-grid-bottom">
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">订单实付金额(元)</div>
 | ||
|                     <div class="stat-value" id="actualAmount">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">订单退款金额(元)</div>
 | ||
|                     <div class="stat-value" id="refundAmount">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">售后订单数量</div>
 | ||
|                     <div class="stat-value" id="afterSalesOrders">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">售后订单率(%)</div>
 | ||
|                     <div class="stat-value stat-percentage" id="afterSalesRate">0.00%</div>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
| 
 | ||
|             <!-- 第三行统计数据 -->
 | ||
|             <div class="stats-grid-third">
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">退款金额(元)</div>
 | ||
|                     <div class="stat-value" id="totalRefundAmount">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">订单支出(元)</div>
 | ||
|                     <div class="stat-value" id="orderExpenditure">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">待入账金额(元)</div>
 | ||
|                     <div class="stat-value" id="pendingAmount">0</div>
 | ||
|                 </div>
 | ||
|                 <div class="stat-card">
 | ||
|                     <div class="stat-label">已入账金额(元)</div>
 | ||
|                     <div class="stat-value" id="accountedAmount">0</div>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
|         </div>
 | ||
|     </div>
 | ||
| 
 | ||
|     <script>
 | ||
|         // 日期范围选择
 | ||
|         document.getElementById('dateRange').addEventListener('change', function() {
 | ||
|             const customDateRange = document.getElementById('customDateRange');
 | ||
|             if (this.value === 'custom') {
 | ||
|                 customDateRange.style.display = 'flex';
 | ||
|             } else {
 | ||
|                 customDateRange.style.display = 'none';
 | ||
|             }
 | ||
|         });
 | ||
| 
 | ||
|         // 查询数据
 | ||
|         function queryData() {
 | ||
|             console.log('查询订单数据');
 | ||
|             // 这里可以添加实际的数据查询逻辑
 | ||
|             // 模拟数据更新
 | ||
|             loadMockData();
 | ||
|         }
 | ||
| 
 | ||
|         // 导出数据
 | ||
|         function exportData() {
 | ||
|             console.log('导出订单数据');
 | ||
|             // 这里可以添加实际的数据导出逻辑
 | ||
|             alert('导出功能开发中...');
 | ||
|         }
 | ||
| 
 | ||
|         // 加载模拟数据
 | ||
|         function loadMockData() {
 | ||
|             // 更新订单概况数据
 | ||
|             const orderData = {
 | ||
|                 totalOrders: 156,
 | ||
|                 paidOrders: 89,
 | ||
|                 validOrders: 85,
 | ||
|                 validOrderRate: '54.49%',
 | ||
|                 actualAmount: '12,580',
 | ||
|                 refundAmount: '1,280',
 | ||
|                 afterSalesOrders: 8,
 | ||
|                 afterSalesRate: '5.13%',
 | ||
|                 totalRefundAmount: '2,450',
 | ||
|                 orderExpenditure: '8,760',
 | ||
|                 pendingAmount: '3,820',
 | ||
|                 accountedAmount: '10,760'
 | ||
|             };
 | ||
| 
 | ||
|             Object.keys(orderData).forEach(key => {
 | ||
|                 const element = document.getElementById(key);
 | ||
|                 if (element) {
 | ||
|                     element.textContent = orderData[key];
 | ||
|                 }
 | ||
|             });
 | ||
|         }
 | ||
| 
 | ||
|         // 页面加载时初始化数据
 | ||
|         document.addEventListener('DOMContentLoaded', function() {
 | ||
|             loadMockData();
 | ||
|         });
 | ||
|     </script>
 | ||
| </body>
 | ||
| </html> |