综述: 优化数据分析模块页面结构
- 修改商家端主页菜单,将"数据中心"重命名为"数据分析" - 调整菜单图标样式,使用fa-analytics替换fa-chart-bar - 删除原有的数据分析.html文件,拆分为三个独立页面:商品分析、客户分析、订单分析 - 为菜单项添加页面加载功能,点击时加载对应的分析页面内容
This commit is contained in:
		
							parent
							
								
									26fafa296a
								
							
						
					
					
						commit
						b6302401bd
					
				|  | @ -325,28 +325,28 @@ | ||||||
|                 </a> |                 </a> | ||||||
|             </li> |             </li> | ||||||
|              |              | ||||||
|             <li class="menu-item expanded"> |             <li class="menu-item"> | ||||||
|                 <div class="menu-link" onclick="toggleSubmenu(this)"> |                 <div class="menu-link" onclick="toggleSubmenu(this)"> | ||||||
|                     <span class="menu-icon"> |                     <span class="menu-icon"> | ||||||
|                         <i class="fas fa-chart-bar"></i> |                         <i class="fas fa-analytics"></i> | ||||||
|                     </span> |                     </span> | ||||||
|                     <span class="menu-text">数据中心</span> |                     <span class="menu-text">数据分析</span> | ||||||
|                     <span class="menu-arrow"> |                     <span class="menu-arrow"> | ||||||
|                         <i class="fas fa-chevron-right"></i> |                         <i class="fas fa-chevron-right"></i> | ||||||
|                     </span> |                     </span> | ||||||
|                 </div> |                 </div> | ||||||
|                 <div class="submenu"> |                 <div class="submenu"> | ||||||
|                     <a href="#" class="submenu-link"> |                     <a href="#" class="submenu-link" onclick="loadContent('./数据分析/订单分析.html', this)"> | ||||||
|                         <span class="submenu-icon"></span> |                         <span class="submenu-icon"></span> | ||||||
|                         客户分析 |                         订单分析 | ||||||
|                     </a> |                     </a> | ||||||
|                     <a href="#" class="submenu-link"> |                     <a href="#" class="submenu-link" onclick="loadContent('./数据分析/商品分析.html', this)"> | ||||||
|                         <span class="submenu-icon"></span> |                         <span class="submenu-icon"></span> | ||||||
|                         商品分析 |                         商品分析 | ||||||
|                     </a> |                     </a> | ||||||
|                     <a href="#" class="submenu-link"> |                     <a href="#" class="submenu-link" onclick="loadContent('./数据分析/客户分析.html', this)"> | ||||||
|                         <span class="submenu-icon"></span> |                         <span class="submenu-icon"></span> | ||||||
|                         订单统计分析 |                         客户分析 | ||||||
|                     </a> |                     </a> | ||||||
|                 </div> |                 </div> | ||||||
|             </li> |             </li> | ||||||
|  |  | ||||||
|  | @ -0,0 +1,523 @@ | ||||||
|  | <!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); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         /* 商品整体概况 */ | ||||||
|  |         .product-overview { | ||||||
|  |             background: #fff; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             padding: 20px; | ||||||
|  |             margin-bottom: 30px; | ||||||
|  |             box-shadow: 0 2px 8px rgba(0,0,0,0.1); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .overview-title { | ||||||
|  |             font-size: 18px; | ||||||
|  |             font-weight: 600; | ||||||
|  |             margin-bottom: 20px; | ||||||
|  |             color: #333; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stats-grid { | ||||||
|  |             display: grid; | ||||||
|  |             grid-template-columns: repeat(3, 1fr); | ||||||
|  |             gap: 20px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-card { | ||||||
|  |             text-align: left; | ||||||
|  |             padding: 0; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-label { | ||||||
|  |             font-size: 14px; | ||||||
|  |             color: #666; | ||||||
|  |             margin-bottom: 8px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .stat-value { | ||||||
|  |             font-size: 24px; | ||||||
|  |             font-weight: 600; | ||||||
|  |             color: #333; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         /* 排行榜区域 */ | ||||||
|  |         .ranking-section { | ||||||
|  |             background: #fff; | ||||||
|  |             border-radius: 8px; | ||||||
|  |             padding: 20px; | ||||||
|  |             margin-bottom: 30px; | ||||||
|  |             box-shadow: 0 2px 8px rgba(0,0,0,0.1); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .ranking-title { | ||||||
|  |             font-size: 16px; | ||||||
|  |             font-weight: 600; | ||||||
|  |             margin-bottom: 20px; | ||||||
|  |             color: #333; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .ranking-grid { | ||||||
|  |             display: grid; | ||||||
|  |             grid-template-columns: 1fr 1fr; | ||||||
|  |             gap: 40px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .ranking-table { | ||||||
|  |             width: 100%; | ||||||
|  |             border-collapse: collapse; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .ranking-table th { | ||||||
|  |             background-color: #fafafa; | ||||||
|  |             padding: 12px; | ||||||
|  |             text-align: left; | ||||||
|  |             border-bottom: 1px solid #e8e8e8; | ||||||
|  |             font-weight: 500; | ||||||
|  |             color: #333; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .ranking-table td { | ||||||
|  |             padding: 12px; | ||||||
|  |             border-bottom: 1px solid #e8e8e8; | ||||||
|  |             color: #666; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .ranking-table tbody tr:hover { | ||||||
|  |             background-color: #f5f5f5; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         .no-data { | ||||||
|  |             text-align: center; | ||||||
|  |             color: #999; | ||||||
|  |             padding: 40px 0; | ||||||
|  |             font-size: 14px; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         /* 响应式设计 */ | ||||||
|  |         @media (max-width: 768px) { | ||||||
|  |             .container { | ||||||
|  |                 padding: 20px; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             .stats-grid { | ||||||
|  |                 grid-template-columns: 1fr; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             .ranking-grid { | ||||||
|  |                 grid-template-columns: 1fr; | ||||||
|  |                 gap: 20px; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             .filter-row { | ||||||
|  |                 flex-direction: column; | ||||||
|  |                 align-items: flex-start; | ||||||
|  |                 gap: 15px; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     </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">今天</option> | ||||||
|  |                         <option value="yesterday">昨天</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> | ||||||
|  | 
 | ||||||
|  |         <!-- 商品整体概况 --> | ||||||
|  |         <div class="product-overview"> | ||||||
|  |             <h2 class="overview-title">商品整体概况</h2> | ||||||
|  |             <div class="stats-grid"> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">在售商品数</div> | ||||||
|  |                     <div class="stat-value" id="onSaleProducts">29</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">被访问商品数</div> | ||||||
|  |                     <div class="stat-value" id="visitedProducts">0</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">折扣商品数</div> | ||||||
|  |                     <div class="stat-value" id="discountProducts">0</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">预售商品数</div> | ||||||
|  |                     <div class="stat-value" id="presaleProducts">17</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">商品浏览量</div> | ||||||
|  |                     <div class="stat-value" id="productViews">0</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">商品加购人数</div> | ||||||
|  |                     <div class="stat-value" id="addToCartUsers">0</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">商品加购件数</div> | ||||||
|  |                     <div class="stat-value" id="addToCartItems">0</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">商品点赞件数</div> | ||||||
|  |                     <div class="stat-value" id="productLikes">0</div> | ||||||
|  |                 </div> | ||||||
|  |                 <div class="stat-card"> | ||||||
|  |                     <div class="stat-label">商品支付件数</div> | ||||||
|  |                     <div class="stat-value" id="productOrders">0</div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  |         </div> | ||||||
|  | 
 | ||||||
|  |         <!-- 商品排行 --> | ||||||
|  |         <div class="ranking-section"> | ||||||
|  |             <h2 class="ranking-title">商品排行</h2> | ||||||
|  | 
 | ||||||
|  |             <!-- 商品访客数TOP --> | ||||||
|  |             <div style="margin-bottom: 40px;"> | ||||||
|  |                 <h3 style="font-size: 16px; font-weight: 500; margin-bottom: 15px; color: #333;">商品访客数TOP</h3> | ||||||
|  |                 <div class="ranking-grid"> | ||||||
|  |                     <div> | ||||||
|  |                         <table class="ranking-table"> | ||||||
|  |                             <thead> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <th>排名</th> | ||||||
|  |                                     <th>商品名称</th> | ||||||
|  |                                     <th>访客数</th> | ||||||
|  |                                 </tr> | ||||||
|  |                             </thead> | ||||||
|  |                             <tbody id="visitorRankingTable"> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <td colspan="3" class="no-data">暂无数据</td> | ||||||
|  |                                 </tr> | ||||||
|  |                             </tbody> | ||||||
|  |                         </table> | ||||||
|  |                     </div> | ||||||
|  | 
 | ||||||
|  |                     <!-- 商品支付转化率TOP --> | ||||||
|  |                     <div> | ||||||
|  |                         <h3 style="font-size: 16px; font-weight: 500; margin-bottom: 15px; color: #333;">商品支付转化率TOP</h3> | ||||||
|  |                         <table class="ranking-table"> | ||||||
|  |                             <thead> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <th>排名</th> | ||||||
|  |                                     <th>商品名称</th> | ||||||
|  |                                     <th>支付转化率 (%)</th> | ||||||
|  |                                 </tr> | ||||||
|  |                             </thead> | ||||||
|  |                             <tbody id="conversionRankingTable"> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <td colspan="3" class="no-data">暂无数据</td> | ||||||
|  |                                 </tr> | ||||||
|  |                             </tbody> | ||||||
|  |                         </table> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  | 
 | ||||||
|  |             <!-- 销售量TOP --> | ||||||
|  |             <div style="margin-bottom: 40px;"> | ||||||
|  |                 <h3 style="font-size: 16px; font-weight: 500; margin-bottom: 15px; color: #333;">销售量TOP</h3> | ||||||
|  |                 <div class="ranking-grid"> | ||||||
|  |                     <div> | ||||||
|  |                         <table class="ranking-table"> | ||||||
|  |                             <thead> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <th>排名</th> | ||||||
|  |                                     <th>商品名称</th> | ||||||
|  |                                     <th>销售量</th> | ||||||
|  |                                 </tr> | ||||||
|  |                             </thead> | ||||||
|  |                             <tbody id="salesVolumeRankingTable"> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <td colspan="3" class="no-data">暂无数据</td> | ||||||
|  |                                 </tr> | ||||||
|  |                             </tbody> | ||||||
|  |                         </table> | ||||||
|  |                     </div> | ||||||
|  | 
 | ||||||
|  |                     <!-- 销售额TOP --> | ||||||
|  |                     <div> | ||||||
|  |                         <h3 style="font-size: 16px; font-weight: 500; margin-bottom: 15px; color: #333;">销售额TOP</h3> | ||||||
|  |                         <table class="ranking-table"> | ||||||
|  |                             <thead> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <th>排名</th> | ||||||
|  |                                     <th>商品名称</th> | ||||||
|  |                                     <th>销售额</th> | ||||||
|  |                                 </tr> | ||||||
|  |                             </thead> | ||||||
|  |                             <tbody id="salesAmountRankingTable"> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <td colspan="3" class="no-data">暂无数据</td> | ||||||
|  |                                 </tr> | ||||||
|  |                             </tbody> | ||||||
|  |                         </table> | ||||||
|  |                     </div> | ||||||
|  |                 </div> | ||||||
|  |             </div> | ||||||
|  | 
 | ||||||
|  |             <!-- 回复率TOP --> | ||||||
|  |             <div> | ||||||
|  |                 <h3 style="font-size: 16px; font-weight: 500; margin-bottom: 15px; color: #333;">回复率TOP</h3> | ||||||
|  |                 <div class="ranking-grid"> | ||||||
|  |                     <div> | ||||||
|  |                         <table class="ranking-table"> | ||||||
|  |                             <thead> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <th>排名</th> | ||||||
|  |                                     <th>商品名称</th> | ||||||
|  |                                     <th>回复率 (%)</th> | ||||||
|  |                                 </tr> | ||||||
|  |                             </thead> | ||||||
|  |                             <tbody id="replyRateRankingTable"> | ||||||
|  |                                 <tr> | ||||||
|  |                                     <td colspan="3" class="no-data">暂无数据</td> | ||||||
|  |                                 </tr> | ||||||
|  |                             </tbody> | ||||||
|  |                         </table> | ||||||
|  |                     </div> | ||||||
|  |                     <div></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 overviewData = { | ||||||
|  |                 onSaleProducts: 29, | ||||||
|  |                 visitedProducts: 15, | ||||||
|  |                 discountProducts: 5, | ||||||
|  |                 presaleProducts: 17, | ||||||
|  |                 productViews: 1250, | ||||||
|  |                 addToCartUsers: 89, | ||||||
|  |                 addToCartItems: 156, | ||||||
|  |                 productLikes: 234, | ||||||
|  |                 productOrders: 67 | ||||||
|  |             }; | ||||||
|  | 
 | ||||||
|  |             Object.keys(overviewData).forEach(key => { | ||||||
|  |                 const element = document.getElementById(key); | ||||||
|  |                 if (element) { | ||||||
|  |                     element.textContent = overviewData[key]; | ||||||
|  |                 } | ||||||
|  |             }); | ||||||
|  | 
 | ||||||
|  |             // 更新排行榜数据 | ||||||
|  |             updateRankingTable('visitorRankingTable', [ | ||||||
|  |                 { rank: 1, name: '热销商品A', value: '156' }, | ||||||
|  |                 { rank: 2, name: '优质商品B', value: '134' }, | ||||||
|  |                 { rank: 3, name: '精选商品C', value: '98' }, | ||||||
|  |                 { rank: 4, name: '推荐商品D', value: '76' }, | ||||||
|  |                 { rank: 5, name: '特色商品E', value: '54' } | ||||||
|  |             ]); | ||||||
|  | 
 | ||||||
|  |             updateRankingTable('conversionRankingTable', [ | ||||||
|  |                 { rank: 1, name: '爆款商品A', value: '15.6' }, | ||||||
|  |                 { rank: 2, name: '热门商品B', value: '12.3' }, | ||||||
|  |                 { rank: 3, name: '优选商品C', value: '9.8' }, | ||||||
|  |                 { rank: 4, name: '精品商品D', value: '7.6' }, | ||||||
|  |                 { rank: 5, name: '特惠商品E', value: '5.4' } | ||||||
|  |             ]); | ||||||
|  | 
 | ||||||
|  |             updateRankingTable('salesVolumeRankingTable', [ | ||||||
|  |                 { rank: 1, name: '畅销商品A', value: '89' }, | ||||||
|  |                 { rank: 2, name: '热销商品B', value: '67' }, | ||||||
|  |                 { rank: 3, name: '优质商品C', value: '45' }, | ||||||
|  |                 { rank: 4, name: '精选商品D', value: '34' }, | ||||||
|  |                 { rank: 5, name: '推荐商品E', value: '23' } | ||||||
|  |             ]); | ||||||
|  | 
 | ||||||
|  |             updateRankingTable('salesAmountRankingTable', [ | ||||||
|  |                 { rank: 1, name: '高端商品A', value: '¥12,560' }, | ||||||
|  |                 { rank: 2, name: '精品商品B', value: '¥9,870' }, | ||||||
|  |                 { rank: 3, name: '优选商品C', value: '¥7,650' }, | ||||||
|  |                 { rank: 4, name: '热门商品D', value: '¥5,430' }, | ||||||
|  |                 { rank: 5, name: '特色商品E', value: '¥3,210' } | ||||||
|  |             ]); | ||||||
|  | 
 | ||||||
|  |             updateRankingTable('replyRateRankingTable', [ | ||||||
|  |                 { rank: 1, name: '服务型商品A', value: '95.6' }, | ||||||
|  |                 { rank: 2, name: '互动型商品B', value: '87.3' }, | ||||||
|  |                 { rank: 3, name: '咨询型商品C', value: '76.8' }, | ||||||
|  |                 { rank: 4, name: '体验型商品D', value: '65.4' }, | ||||||
|  |                 { rank: 5, name: '问答型商品E', value: '54.2' } | ||||||
|  |             ]); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         // 更新排行榜表格 | ||||||
|  |         function updateRankingTable(tableId, data) { | ||||||
|  |             const tbody = document.getElementById(tableId); | ||||||
|  |             if (!tbody) return; | ||||||
|  | 
 | ||||||
|  |             if (data.length === 0) { | ||||||
|  |                 tbody.innerHTML = '<tr><td colspan="3" class="no-data">暂无数据</td></tr>'; | ||||||
|  |                 return; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             tbody.innerHTML = data.map(item => ` | ||||||
|  |                 <tr> | ||||||
|  |                     <td>${item.rank}</td> | ||||||
|  |                     <td>${item.name}</td> | ||||||
|  |                     <td>${item.value}</td> | ||||||
|  |                 </tr> | ||||||
|  |             `).join(''); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         // 页面加载时初始化数据 | ||||||
|  |         document.addEventListener('DOMContentLoaded', function() { | ||||||
|  |             loadMockData(); | ||||||
|  |         }); | ||||||
|  |     </script> | ||||||
|  | </body> | ||||||
|  | </html> | ||||||
|  | @ -0,0 +1,360 @@ | ||||||
|  | <!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">今天</option> | ||||||
|  |                         <option value="yesterday">昨天</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> | ||||||
		Loading…
	
		Reference in New Issue