dm-design/商家端web/内容管理/轮播图管理.html

799 lines
24 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>轮播图管理 - 大妈集市商户端</title>
<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;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
.page-header {
background: white;
padding: 16px 24px;
margin-bottom: 16px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.page-title {
font-size: 24px;
font-weight: 600;
color: #262626;
}
/* 主要内容区域 */
.content {
display: flex;
flex-direction: column;
gap: 20px;
}
/* 搜索过滤区域 */
.filter-section {
background: white;
padding: 24px;
margin-bottom: 16px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.search-form {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 16px;
margin-bottom: 16px;
}
.form-item {
display: flex;
flex-direction: column;
gap: 8px;
}
.form-label {
font-size: 14px;
color: #666;
font-weight: 500;
}
.form-input {
height: 40px;
padding: 0 12px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
}
.form-input:focus {
outline: none;
border-color: #1890ff;
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}
.button-group {
display: flex;
gap: 12px;
}
/* 按钮样式 */
.btn {
height: 40px;
padding: 0 16px;
border: none;
border-radius: 6px;
font-size: 14px;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
transition: all 0.3s;
}
.btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.btn-primary {
background: #1890ff;
color: white;
}
.btn-primary:hover:not(:disabled) {
background: #40a9ff;
}
.btn-secondary {
background: white;
color: #666;
border: 1px solid #ddd;
}
.btn-secondary:hover:not(:disabled) {
border-color: #1890ff;
color: #1890ff;
}
.btn-link {
background: none;
border: none;
color: #1890ff;
padding: 4px 8px;
text-decoration: none;
}
.btn-link:hover {
color: #40a9ff;
text-decoration: underline;
}
/* 操作按钮区域 */
.action-section {
display: flex;
gap: 8px;
}
/* 表格区域 */
.table-section {
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
margin-bottom: 16px;
}
.table-wrapper {
overflow-x: auto;
}
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}
.data-table th {
background: #fafafa;
padding: 12px 8px;
text-align: left;
font-weight: 600;
color: #666;
border-bottom: 1px solid #f0f0f0;
white-space: nowrap;
}
.data-table td {
padding: 12px 8px;
border-bottom: 1px solid #f9f9f9;
vertical-align: middle;
}
.data-table tbody tr:hover {
background: #f8f9fa;
}
.banner-preview {
width: 60px;
height: 40px;
object-fit: cover;
border-radius: 4px;
cursor: pointer;
}
.status {
padding: 2px 8px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
}
.status-enabled {
background: #f6ffed;
color: #52c41a;
border: 1px solid #b7eb8f;
}
.status-disabled {
background: #fff2f0;
color: #ff4d4f;
border: 1px solid #ffb3b3;
}
.actions {
display: flex;
gap: 8px;
}
/* 分页区域 */
.pagination {
padding: 20px 24px;
display: flex;
justify-content: space-between;
align-items: center;
background: white;
border-top: 1px solid #f0f0f0;
}
.pagination-info {
color: #666;
font-size: 14px;
}
.pagination-controls {
display: flex;
align-items: center;
gap: 16px;
}
.page-size-selector {
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
color: #666;
}
.page-size-select {
height: 32px;
padding: 0 8px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
background: white;
}
.page-list {
display: flex;
align-items: center;
gap: 4px;
list-style: none;
}
.page-item {
min-width: 32px;
height: 32px;
padding: 0 8px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: all 0.3s;
background: white;
color: #666;
}
.page-item:hover:not(.disabled):not(.active) {
border-color: #1890ff;
color: #1890ff;
}
.page-item.active {
background: #1890ff;
border-color: #1890ff;
color: white;
}
.page-item.disabled {
opacity: 0.5;
cursor: not-allowed;
color: #ccc;
}
.page-item.ellipsis {
border: none;
cursor: default;
color: #999;
}
.page-item.ellipsis:hover {
border: none;
color: #999;
}
.page-jump {
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
color: #666;
}
.page-jump input {
width: 50px;
height: 32px;
padding: 0 8px;
border: 1px solid #ddd;
border-radius: 4px;
text-align: center;
font-size: 14px;
}
.total-info {
color: #666;
}
/* 弹窗样式 */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
}
.modal.show {
display: flex;
align-items: center;
justify-content: center;
}
.modal-content {
background: #fff;
border-radius: 8px;
width: 500px;
max-width: 90vw;
max-height: 90vh;
overflow: auto;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.modal-header {
padding: 16px 24px;
border-bottom: 1px solid #e8e8e8;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-header h3 {
margin: 0;
font-size: 16px;
font-weight: 600;
}
.modal-close {
background: none;
border: none;
font-size: 20px;
cursor: pointer;
color: #999;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
}
.modal-close:hover {
color: #333;
}
.modal-body {
padding: 24px;
}
.modal-footer {
padding: 16px 24px;
border-top: 1px solid #e8e8e8;
display: flex;
gap: 8px;
justify-content: flex-end;
}
/* 表单样式 */
.form-group.form-item {
margin-bottom: 20px;
display: block;
}
.form-group.form-item label {
display: block;
margin-bottom: 8px;
font-weight: 500;
color: #333;
}
.form-group.form-item label.required::before {
content: '*';
color: #ff4d4f;
margin-right: 4px;
}
.form-group.form-item input[type="text"],
.form-group.form-item select {
width: 100%;
padding: 8px 12px;
border: 1px solid #d9d9d9;
border-radius: 4px;
font-size: 14px;
}
.form-group.form-item input[type="text"]:focus,
.form-group.form-item select:focus {
outline: none;
border-color: #40a9ff;
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}
.error-message {
color: #ff4d4f;
font-size: 12px;
margin-top: 4px;
}
/* 开关样式 */
.switch-wrapper {
display: flex;
align-items: center;
}
.switch {
position: relative;
display: inline-block;
width: 180px;
height: 32px;
cursor: pointer;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.switch-slider {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #f0f0f0;
border-radius: 16px;
transition: all 0.3s;
display: flex;
align-items: center;
justify-content: space-between;
padding: 4px;
border: 1px solid #d9d9d9;
}
.switch input:checked + .switch-slider {
background: #1890ff;
border-color: #1890ff;
}
.switch-slider::before {
content: '';
position: absolute;
height: 24px;
width: 80px;
left: 4px;
background: #fff;
border-radius: 12px;
transition: all 0.3s;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch input:checked + .switch-slider::before {
transform: translateX(92px);
}
.switch-option {
font-size: 12px;
font-weight: 500;
z-index: 1;
padding: 0 12px;
transition: color 0.3s;
}
.switch-option.disabled {
color: #999;
}
.switch-option.enabled {
color: #fff;
}
.switch input:checked ~ .switch-slider .disabled {
color: #fff;
}
.switch input:checked ~ .switch-slider .enabled {
color: #1890ff;
}
/* 上传区域样式 */
.upload-area {
border: 2px dashed #d9d9d9;
border-radius: 6px;
padding: 40px 20px;
text-align: center;
cursor: pointer;
transition: border-color 0.3s;
background: #fafafa;
}
.upload-icon {
font-size: 32px;
margin-bottom: 12px;
opacity: 0.6;
}
.upload-text {
color: #666;
font-size: 14px;
}
.upload-link {
color: #1890ff;
cursor: pointer;
}
.upload-tips {
color: #999;
font-size: 12px;
margin-top: 8px;
}
/* 响应式设计 */
@media (max-width: 768px) {
.container {
padding: 10px;
}
.form-row {
flex-direction: column;
align-items: stretch;
gap: 12px;
}
.form-actions {
margin-left: 0;
}
.pagination-section {
flex-direction: column;
gap: 12px;
}
.pagination-info {
justify-content: center;
}
.modal-content {
width: 95vw;
}
}
</style>
</head>
<body>
<div class="container">
<!-- 页面标题 -->
<div class="page-header">
<h1 class="page-title">轮播图管理</h1>
</div>
<!-- 搜索过滤区域 -->
<div class="filter-section">
<div class="search-form">
<div class="form-item">
<label class="form-label">应用</label>
<select id="applicationSelect" class="form-input">
<option value="用户端">用户端</option>
<option value="商户端">商户端</option>
</select>
</div>
</div>
<div class="button-group">
<button class="btn btn-primary" id="searchBtn">查询</button>
<button class="btn btn-secondary" id="resetBtn">重置</button>
</div>
</div>
<!-- 操作按钮区域 -->
<div class="action-section">
<button class="btn btn-primary" id="addBannerBtn">新增轮播图</button>
<button class="btn btn-secondary" id="sortBtn">排序</button>
</div>
<!-- 表格区域 -->
<div class="table-section">
<div class="table-wrapper">
<table class="data-table">
<thead>
<tr>
<th>序号</th>
<th>名称</th>
<th>轮播图</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>春申菜市场主页1</td>
<td>
<img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA2MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjYwIiBoZWlnaHQ9IjQwIiBmaWxsPSIjRjVGNUY1IiBzdHJva2U9IiNEREREREQiLz4KPHN2ZyB4PSIyMCIgeT0iMTAiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJtMTQgMTAgOS0xMC02LjMgOS0xLjciIHN0cm9rZT0iIzk5OTk5OSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHN2ZyB4PSIyIiB5PSIyIiB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjkiIGN5PSI5IiByPSIyIiBzdHJva2U9IiM5OTk5OTkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPgo8L3N2Zz4K" alt="轮播图" class="banner-preview">
</td>
<td><span class="status status-enabled">已启用</span></td>
<td class="actions">
<button class="btn btn-link">编辑</button>
<button class="btn btn-link">删除</button>
</td>
</tr>
<tr>
<td>2</td>
<td>春申菜市场主页2</td>
<td>
<img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA2MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjYwIiBoZWlnaHQ9IjQwIiBmaWxsPSIjRjVGNUY1IiBzdHJva2U9IiNEREREREQiLz4KPHN2ZyB4PSIyMCIgeT0iMTAiIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJtMTQgMTAgOS0xMC02LjMgOS0xLjciIHN0cm9rZT0iIzk5OTk5OSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHN2ZyB4PSIyIiB5PSIyIiB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxjaXJjbGUgY3g9IjkiIGN5PSI5IiByPSIyIiBzdHJva2U9IiM5OTk5OTkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+Cjwvc3ZnPgo8L3N2Zz4K" alt="轮播图" class="banner-preview">
</td>
<td><span class="status status-enabled">已启用</span></td>
<td class="actions">
<button class="btn btn-link">编辑</button>
<button class="btn btn-link">删除</button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- 分页区域 -->
<div class="pagination">
<div class="pagination-info">共 177 条</div>
<div class="pagination-controls">
<div class="page-size-selector">
<select class="page-size-select">
<option value="10" selected>10条/页</option>
<option value="20">20条/页</option>
<option value="50">50条/页</option>
</select>
</div>
<div class="page-item disabled">«</div>
<div class="page-list">
<div class="page-item active">1</div>
<div class="page-item">2</div>
<div class="page-item">3</div>
<div class="page-item">4</div>
<div class="page-item">5</div>
<div class="page-item">6</div>
<div class="page-item ellipsis"></div>
<div class="page-item">18</div>
</div>
<div class="page-item">»</div>
<div class="page-jump">
前往 <input type="number" value="1" min="1">
</div>
</div>
</div>
</div>
</div>
<!-- 新增轮播图弹窗 -->
<div id="addBannerModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3>添加轮播图</h3>
<button class="modal-close" id="closeModal">&times;</button>
</div>
<div class="modal-body">
<form id="bannerForm">
<div class="form-group form-item">
<label class="required">轮播图名称</label>
<input type="text" id="bannerName" placeholder="请输入轮播图名称">
<div class="error-message">不能为空。</div>
</div>
<div class="form-group form-item">
<label>状态</label>
<div class="switch-wrapper">
<label class="switch">
<input type="checkbox" id="bannerStatus" checked>
<span class="switch-slider">
<span class="switch-option disabled">禁用</span>
<span class="switch-option enabled">启用</span>
</span>
</label>
</div>
</div>
<div class="form-group form-item">
<label class="required">应用</label>
<div class="select-wrapper">
<select id="bannerApplication">
<option value="">请选择应用</option>
<option value="用户端">用户端</option>
<option value="商户端">商户端</option>
</select>
</div>
</div>
<div class="form-group form-item">
<label class="required">轮播图</label>
<div class="upload-area" id="uploadArea">
<div class="upload-icon">📁</div>
<div class="upload-text">
将文件拖到此处,或<span class="upload-link">点击上传</span>
</div>
</div>
<div class="upload-tips">只能上传jpg/png文件且不超过500kb</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" id="cancelBtn">取消</button>
<button class="btn btn-primary" id="confirmBtn">确认</button>
</div>
</div>
</div>
<script>
// 简化的JavaScript仅用于UI交互演示
document.addEventListener('DOMContentLoaded', function() {
// 新增轮播图按钮
document.getElementById('addBannerBtn').addEventListener('click', function() {
document.getElementById('addBannerModal').classList.add('show');
});
// 关闭弹窗
function closeModal() {
document.getElementById('addBannerModal').classList.remove('show');
}
document.getElementById('closeModal').addEventListener('click', closeModal);
document.getElementById('cancelBtn').addEventListener('click', closeModal);
// 点击弹窗背景关闭
document.getElementById('addBannerModal').addEventListener('click', function(e) {
if (e.target.id === 'addBannerModal') {
closeModal();
}
});
// 确认按钮
document.getElementById('confirmBtn').addEventListener('click', function() {
// 这里只是演示,不做实际处理
alert('这是演示页面,确认按钮已点击');
closeModal();
});
// 搜索和重置按钮(仅演示)
document.getElementById('searchBtn').addEventListener('click', function() {
alert('这是演示页面,查询功能已触发');
});
document.getElementById('resetBtn').addEventListener('click', function() {
alert('这是演示页面,重置功能已触发');
});
// 排序按钮(仅演示)
document.getElementById('sortBtn').addEventListener('click', function() {
alert('这是演示页面,排序功能已触发');
});
});
</script>
</body>
</html>