769 lines
26 KiB
HTML
769 lines
26 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>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||
background-color: #f5f7fa;
|
||
padding: 20px;
|
||
}
|
||
|
||
.container {
|
||
max-width: 1600px;
|
||
margin: 0 auto;
|
||
background: white;
|
||
padding: 20px;
|
||
border-radius: 8px;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||
}
|
||
|
||
/* 页面标题 */
|
||
.page-header {
|
||
margin-bottom: 20px;
|
||
padding-bottom: 15px;
|
||
border-bottom: 1px solid #ebeef5;
|
||
}
|
||
|
||
.page-header h2 {
|
||
font-size: 20px;
|
||
color: #303133;
|
||
font-weight: 500;
|
||
}
|
||
|
||
/* 返回按钮 */
|
||
.back-section {
|
||
margin-bottom: 20px;
|
||
}
|
||
|
||
.btn {
|
||
padding: 8px 20px;
|
||
border: none;
|
||
border-radius: 4px;
|
||
font-size: 14px;
|
||
cursor: pointer;
|
||
transition: all 0.3s;
|
||
}
|
||
|
||
.btn-default {
|
||
background-color: white;
|
||
color: #606266;
|
||
border: 1px solid #dcdfe6;
|
||
}
|
||
|
||
.btn-default:hover {
|
||
background-color: #f5f7fa;
|
||
border-color: #c0c4cc;
|
||
}
|
||
|
||
.btn-primary {
|
||
background-color: #409eff;
|
||
color: white;
|
||
}
|
||
|
||
.btn-primary:hover {
|
||
background-color: #66b1ff;
|
||
}
|
||
|
||
.btn-success {
|
||
background-color: #67c23a;
|
||
color: white;
|
||
}
|
||
|
||
.btn-success:hover {
|
||
background-color: #85ce61;
|
||
}
|
||
|
||
.btn-small {
|
||
padding: 5px 12px;
|
||
font-size: 12px;
|
||
}
|
||
|
||
.btn-danger {
|
||
background-color: #f56c6c;
|
||
color: white;
|
||
}
|
||
|
||
.btn-danger:hover {
|
||
background-color: #f78989;
|
||
}
|
||
|
||
/* 表格样式 */
|
||
.table-wrapper {
|
||
overflow-x: auto;
|
||
}
|
||
|
||
table {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
font-size: 14px;
|
||
}
|
||
|
||
thead {
|
||
background-color: #f5f7fa;
|
||
}
|
||
|
||
th {
|
||
padding: 12px 8px;
|
||
text-align: center;
|
||
font-weight: 500;
|
||
color: #606266;
|
||
border-bottom: 1px solid #ebeef5;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
td {
|
||
padding: 12px 8px;
|
||
text-align: center;
|
||
border-bottom: 1px solid #ebeef5;
|
||
color: #606266;
|
||
}
|
||
|
||
tbody tr:hover {
|
||
background-color: #f5f7fa;
|
||
}
|
||
|
||
/* 操作按钮组 */
|
||
.action-buttons {
|
||
display: flex;
|
||
gap: 5px;
|
||
justify-content: center;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
/* 模态框样式 */
|
||
.modal {
|
||
display: none;
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
background-color: rgba(0, 0, 0, 0.5);
|
||
z-index: 1000;
|
||
}
|
||
|
||
.modal.active {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.modal-content {
|
||
background: white;
|
||
width: 90%;
|
||
max-width: 650px;
|
||
max-height: 90vh;
|
||
border-radius: 8px;
|
||
overflow: hidden;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.modal-header {
|
||
padding: 20px;
|
||
border-bottom: 1px solid #ebeef5;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.modal-header h3 {
|
||
font-size: 18px;
|
||
color: #303133;
|
||
margin: 0;
|
||
}
|
||
|
||
.modal-close {
|
||
font-size: 24px;
|
||
color: #909399;
|
||
cursor: pointer;
|
||
border: none;
|
||
background: none;
|
||
padding: 0;
|
||
width: 24px;
|
||
height: 24px;
|
||
line-height: 1;
|
||
}
|
||
|
||
.modal-close:hover {
|
||
color: #606266;
|
||
}
|
||
|
||
.modal-body {
|
||
padding: 20px;
|
||
overflow-y: auto;
|
||
flex: 1;
|
||
}
|
||
|
||
.modal-footer {
|
||
padding: 15px 20px;
|
||
border-top: 1px solid #ebeef5;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 10px;
|
||
}
|
||
|
||
/* 表单样式 */
|
||
.form-section {
|
||
margin-bottom: 25px;
|
||
}
|
||
|
||
.form-section-title {
|
||
font-size: 16px;
|
||
color: #303133;
|
||
font-weight: 500;
|
||
margin-bottom: 15px;
|
||
padding-bottom: 10px;
|
||
border-bottom: 1px solid #ebeef5;
|
||
}
|
||
|
||
.form-group {
|
||
margin-bottom: 18px;
|
||
display: flex;
|
||
align-items: flex-start;
|
||
}
|
||
|
||
.form-label {
|
||
width: 120px;
|
||
padding-top: 8px;
|
||
color: #606266;
|
||
font-size: 14px;
|
||
text-align: right;
|
||
padding-right: 12px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.form-input-wrapper {
|
||
flex: 1;
|
||
}
|
||
|
||
.form-input {
|
||
width: 100%;
|
||
padding: 8px 12px;
|
||
border: 1px solid #dcdfe6;
|
||
border-radius: 4px;
|
||
font-size: 14px;
|
||
outline: none;
|
||
transition: border-color 0.3s;
|
||
}
|
||
|
||
.form-input:focus {
|
||
border-color: #409eff;
|
||
}
|
||
|
||
/* 图片上传样式 */
|
||
.upload-box {
|
||
width: 140px;
|
||
height: 140px;
|
||
border: 1px dashed #dcdfe6;
|
||
border-radius: 4px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background-color: #fafafa;
|
||
}
|
||
|
||
.upload-box-text {
|
||
color: #909399;
|
||
font-size: 14px;
|
||
}
|
||
|
||
/* 开关样式 */
|
||
.switch-group {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 15px;
|
||
}
|
||
|
||
.switch {
|
||
position: relative;
|
||
display: inline-block;
|
||
width: 44px;
|
||
height: 22px;
|
||
}
|
||
|
||
.switch input {
|
||
opacity: 0;
|
||
width: 0;
|
||
height: 0;
|
||
}
|
||
|
||
.switch-slider {
|
||
position: absolute;
|
||
cursor: pointer;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background-color: #dcdfe6;
|
||
transition: 0.3s;
|
||
border-radius: 22px;
|
||
}
|
||
|
||
.switch-slider:before {
|
||
position: absolute;
|
||
content: "";
|
||
height: 18px;
|
||
width: 18px;
|
||
left: 2px;
|
||
bottom: 2px;
|
||
background-color: white;
|
||
transition: 0.3s;
|
||
border-radius: 50%;
|
||
}
|
||
|
||
.switch input:checked + .switch-slider {
|
||
background-color: #409eff;
|
||
}
|
||
|
||
.switch input:checked + .switch-slider:before {
|
||
transform: translateX(22px);
|
||
}
|
||
|
||
.switch-label {
|
||
color: #606266;
|
||
font-size: 14px;
|
||
}
|
||
|
||
.switch-label.active {
|
||
color: #409eff;
|
||
}
|
||
|
||
/* 复选框组样式 */
|
||
.checkbox-group {
|
||
display: flex;
|
||
gap: 15px;
|
||
align-items: center;
|
||
}
|
||
|
||
.checkbox-option {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 5px;
|
||
}
|
||
|
||
.checkbox-option input[type="checkbox"] {
|
||
margin: 0;
|
||
}
|
||
|
||
.checkbox-option label {
|
||
color: #606266;
|
||
font-size: 14px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
/* 时间输入样式 */
|
||
.time-group {
|
||
display: flex;
|
||
gap: 10px;
|
||
align-items: center;
|
||
}
|
||
|
||
.time-input {
|
||
width: 180px;
|
||
}
|
||
|
||
/* 说明文字样式 */
|
||
.form-hint {
|
||
color: #909399;
|
||
font-size: 12px;
|
||
margin-top: 5px;
|
||
line-height: 1.5;
|
||
}
|
||
|
||
.btn-cancel {
|
||
background-color: white;
|
||
color: #606266;
|
||
border: 1px solid #dcdfe6;
|
||
}
|
||
|
||
.btn-cancel:hover {
|
||
background-color: #f5f7fa;
|
||
border-color: #c0c4cc;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<!-- 页面标题 -->
|
||
<div class="page-header">
|
||
<h2>待审核菜市场</h2>
|
||
</div>
|
||
|
||
<!-- 返回按钮 -->
|
||
<div class="back-section">
|
||
<button class="btn btn-default" onclick="goBack()">返回菜市场列表</button>
|
||
</div>
|
||
|
||
<!-- 表格 -->
|
||
<div class="table-wrapper">
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>市场名</th>
|
||
<th>地址</th>
|
||
<th>经营者姓名</th>
|
||
<th>经营者账号</th>
|
||
<th>操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody id="pendingMarketsTableBody">
|
||
<!-- 动态填充待审核数据 -->
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 详情模态框 -->
|
||
<div class="modal" id="detailMarketModal">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h3>菜市场详情</h3>
|
||
<button class="modal-close" onclick="closeDetailModal()">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form id="detailMarketForm">
|
||
<!-- 经营者信息 -->
|
||
<div class="form-section">
|
||
<div class="form-section-title">经营者信息</div>
|
||
<div class="form-group">
|
||
<div class="form-label">经营者账号</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailOperatorAccount" readonly>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<div class="form-label">经营者姓名</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailOperatorName" readonly>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 基础配置 -->
|
||
<div class="form-section">
|
||
<div class="form-section-title">基础配置</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场名称</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailMarketName" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">商品类目类型</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailCategoryType" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场背景图</div>
|
||
<div class="form-input-wrapper">
|
||
<div class="upload-box" style="pointer-events: none;">
|
||
<span class="upload-box-text">暂无图片</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场营业执照</div>
|
||
<div class="form-input-wrapper">
|
||
<div class="upload-box" style="pointer-events: none;">
|
||
<span class="upload-box-text">暂无图片</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场实拍图</div>
|
||
<div class="form-input-wrapper">
|
||
<div class="upload-box" style="pointer-events: none;">
|
||
<span class="upload-box-text">暂无图片</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场地址</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailAddress" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">详细地址</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailDetailAddress" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场定位</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailLocation" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场营业时间</div>
|
||
<div class="form-input-wrapper">
|
||
<div class="switch-group">
|
||
<span class="switch-label">手动营业</span>
|
||
<label class="switch">
|
||
<input type="checkbox" id="detailAutoBusinessTime" disabled>
|
||
<span class="switch-slider"></span>
|
||
</label>
|
||
<span class="switch-label active">自动营业</span>
|
||
</div>
|
||
<div class="checkbox-group" style="margin-top: 10px;">
|
||
<div class="checkbox-option">
|
||
<input type="checkbox" id="detailEveryday" disabled>
|
||
<label for="detailEveryday">每天</label>
|
||
</div>
|
||
<div class="checkbox-option">
|
||
<input type="checkbox" id="detailWorkday" disabled>
|
||
<label for="detailWorkday">工作日</label>
|
||
</div>
|
||
<div class="checkbox-option">
|
||
<input type="checkbox" id="detailCustom" disabled>
|
||
<label for="detailCustom">自定义</label>
|
||
</div>
|
||
</div>
|
||
<div class="time-group" style="margin-top: 10px;">
|
||
<input type="time" class="form-input time-input" id="detailStartTime" readonly>
|
||
<input type="time" class="form-input time-input" id="detailEndTime" readonly>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">菜市场状态</div>
|
||
<div class="form-input-wrapper">
|
||
<div class="switch-group">
|
||
<span class="switch-label">禁用</span>
|
||
<label class="switch">
|
||
<input type="checkbox" id="detailMarketStatus" disabled>
|
||
<span class="switch-slider"></span>
|
||
</label>
|
||
<span class="switch-label active">启用</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">摊位数</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailBoothCount" readonly>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="form-label">营业状态</div>
|
||
<div class="form-input-wrapper">
|
||
<input type="text" class="form-input" id="detailBusinessStatus" readonly>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 配送设置 -->
|
||
<div class="form-section">
|
||
<div class="form-section-title">配送设置</div>
|
||
<div class="form-group">
|
||
<div class="form-label"></div>
|
||
<div class="form-input-wrapper">
|
||
<div class="form-hint">ℹ️ 开启后,将允许该菜市场经营者/摊主(无经营者)自由配置是否呼叫第三方骑手进行配送;</div>
|
||
<div class="form-hint">第三方配送费用因距离、天气、时段等因素会产生不同程度的浮动;将根据实际配送费用进行扣除。</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<div class="form-label">是否允许第三方骑手配送</div>
|
||
<div class="form-input-wrapper">
|
||
<div class="switch-group">
|
||
<span class="switch-label">禁用</span>
|
||
<label class="switch">
|
||
<input type="checkbox" id="detailThirdPartyDelivery" disabled>
|
||
<span class="switch-slider"></span>
|
||
</label>
|
||
<span class="switch-label active">启用</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn btn-cancel" onclick="closeDetailModal()">关闭</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
// 页面加载时填充数据
|
||
window.onload = function() {
|
||
loadPendingMarkets();
|
||
};
|
||
|
||
// 加载待审核菜市场数据
|
||
function loadPendingMarkets() {
|
||
// 模拟待审核数据,实际应该从后端API获取
|
||
const mockPendingData = [
|
||
{
|
||
marketName: '新申请菜市场',
|
||
categoryType: 'offline',
|
||
address: '上海市浦东新区张江高科技园区',
|
||
operatorName: '王五',
|
||
operatorAccount: '13900001234',
|
||
detailAddress: '张江高科技园区祖冲之路1000号',
|
||
location: '121.605827, 31.206107',
|
||
boothCount: '0',
|
||
businessStatus: '休息',
|
||
autoBusinessTime: true,
|
||
marketStatus: false,
|
||
thirdPartyDelivery: true
|
||
},
|
||
{
|
||
marketName: '东方农贸市场',
|
||
categoryType: 'cloud',
|
||
address: '北京市朝阳区建国路88号',
|
||
operatorName: '赵六',
|
||
operatorAccount: '13900005678',
|
||
detailAddress: '建国路88号SOHO现代城',
|
||
location: '116.462813, 39.912285',
|
||
boothCount: '0',
|
||
businessStatus: '休息',
|
||
autoBusinessTime: true,
|
||
marketStatus: false,
|
||
thirdPartyDelivery: false
|
||
},
|
||
{
|
||
marketName: '绿色生态市场',
|
||
categoryType: 'offline',
|
||
address: '福建省厦门市思明区',
|
||
operatorName: '孙七',
|
||
operatorAccount: '13900009999',
|
||
detailAddress: '思明区湖滨南路999号',
|
||
location: '118.089425, 24.479663',
|
||
boothCount: '0',
|
||
businessStatus: '休息',
|
||
autoBusinessTime: true,
|
||
marketStatus: false,
|
||
thirdPartyDelivery: true
|
||
}
|
||
];
|
||
|
||
// 填充表格数据
|
||
const tbody = document.getElementById('pendingMarketsTableBody');
|
||
tbody.innerHTML = '';
|
||
|
||
if (mockPendingData.length === 0) {
|
||
tbody.innerHTML = '<tr><td colspan="5" style="text-align: center; color: #909399;">暂无待审核菜市场</td></tr>';
|
||
} else {
|
||
mockPendingData.forEach((market, index) => {
|
||
const row = document.createElement('tr');
|
||
row.innerHTML = `
|
||
<td>${market.marketName}</td>
|
||
<td>${market.address}</td>
|
||
<td>${market.operatorName || ''}</td>
|
||
<td>${market.operatorAccount || ''}</td>
|
||
<td>
|
||
<div class="action-buttons">
|
||
<button class="btn btn-primary btn-small" onclick='viewPendingMarketDetail(${JSON.stringify(market)})'>详情</button>
|
||
<button class="btn btn-success btn-small" onclick="approveMarket('${market.marketName}')">通过</button>
|
||
<button class="btn btn-danger btn-small" onclick="rejectMarket('${market.marketName}')">拒绝</button>
|
||
</div>
|
||
</td>
|
||
`;
|
||
tbody.appendChild(row);
|
||
});
|
||
}
|
||
}
|
||
|
||
// 返回菜市场列表
|
||
function goBack() {
|
||
window.location.href = '菜市场列表.html';
|
||
}
|
||
|
||
// 查看待审核菜市场详情
|
||
function viewPendingMarketDetail(marketData) {
|
||
openDetailModal(marketData);
|
||
}
|
||
|
||
// 打开详情模态框
|
||
function openDetailModal(rowData) {
|
||
// 填充详情数据
|
||
document.getElementById('detailOperatorAccount').value = rowData.operatorAccount || '';
|
||
document.getElementById('detailOperatorName').value = rowData.operatorName || '';
|
||
document.getElementById('detailMarketName').value = rowData.marketName || '';
|
||
|
||
// 填充商品类目类型,转换为中文显示
|
||
let categoryTypeText = '';
|
||
if (rowData.categoryType === 'offline') {
|
||
categoryTypeText = '线下菜市场';
|
||
} else if (rowData.categoryType === 'cloud') {
|
||
categoryTypeText = '云店';
|
||
} else {
|
||
categoryTypeText = rowData.categoryType || '';
|
||
}
|
||
document.getElementById('detailCategoryType').value = categoryTypeText;
|
||
|
||
document.getElementById('detailAddress').value = rowData.address || '';
|
||
document.getElementById('detailDetailAddress').value = rowData.detailAddress || '';
|
||
document.getElementById('detailLocation').value = rowData.location || '';
|
||
document.getElementById('detailBoothCount').value = rowData.boothCount || '';
|
||
document.getElementById('detailBusinessStatus').value = rowData.businessStatus || '';
|
||
|
||
// 设置开关状态
|
||
document.getElementById('detailAutoBusinessTime').checked = rowData.autoBusinessTime || false;
|
||
document.getElementById('detailMarketStatus').checked = rowData.marketStatus || false;
|
||
document.getElementById('detailThirdPartyDelivery').checked = rowData.thirdPartyDelivery || false;
|
||
|
||
// 显示模态框
|
||
document.getElementById('detailMarketModal').classList.add('active');
|
||
}
|
||
|
||
// 关闭详情模态框
|
||
function closeDetailModal() {
|
||
document.getElementById('detailMarketModal').classList.remove('active');
|
||
}
|
||
|
||
// 点击详情模态框背景关闭
|
||
document.getElementById('detailMarketModal').addEventListener('click', function(e) {
|
||
if (e.target === this) {
|
||
closeDetailModal();
|
||
}
|
||
});
|
||
|
||
// 审核通过
|
||
function approveMarket(marketName) {
|
||
if (confirm('确定通过 "' + marketName + '" 的申请吗?')) {
|
||
alert('审核通过功能待实现');
|
||
// 这里应该调用后端API进行审核通过操作
|
||
// 成功后刷新列表
|
||
// loadPendingMarkets();
|
||
}
|
||
}
|
||
|
||
// 审核拒绝
|
||
function rejectMarket(marketName) {
|
||
if (confirm('确定拒绝 "' + marketName + '" 的申请吗?')) {
|
||
alert('审核拒绝功能待实现');
|
||
// 这里应该调用后端API进行审核拒绝操作
|
||
// 成功后刷新列表
|
||
// loadPendingMarkets();
|
||
}
|
||
}
|
||
</script>
|
||
</body>
|
||
</html>
|