Browse Source

统一已下架货源显示样式,只显示倒计时标签

Boss2
Default User 2 months ago
parent
commit
0eb81cb25e
  1. 59
      supply.html

59
supply.html

@ -338,19 +338,18 @@
color: white;
}
/* 模态框 */
/* 模态框 - 改为全屏样式 */
.modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
background-color: white;
display: none;
justify-content: center;
align-items: flex-start;
padding-top: 50px;
flex-direction: column;
z-index: 1000;
overflow: hidden;
}
.modal.active {
@ -359,12 +358,15 @@
.modal-content {
background-color: white;
width: 90%;
max-width: 600px;
max-height: 85vh;
border-radius: 12px;
width: 100%;
height: 100%;
max-width: none;
max-height: none;
border-radius: 0;
overflow: hidden;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
box-shadow: none;
display: flex;
flex-direction: column;
}
.modal-header {
@ -398,8 +400,9 @@
.modal-body {
padding: 20px;
max-height: 65vh;
overflow-y: auto;
max-height: none;
flex: 1;
}
/* 修复select下拉框向上显示问题 */
@ -1588,14 +1591,14 @@
<!-- 商品图片 -->
<div class="form-group">
<label class="form-label">商品图片</label>
<div id="editUploadImages" class="upload-images" style="display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px;">
<!-- 图片将通过JavaScript动态加载 -->
<div class="upload-area">
<div id="editUploadImages" class="upload-images" style="display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px;">
<!-- 图片将通过JavaScript动态加载 -->
</div>
<div class="add-image" onclick="triggerEditImageUpload()">+</div>
<input type="file" id="editImageUpload" multiple accept="image/*" style="display: none;" onchange="handleEditImageUpload(event)">
<div style="font-size: 12px; color: #999; margin-top: 10px; text-align: left;">最多上传2张图片</div>
</div>
<div style="font-size: 12px; color: #999; margin-top: 10px;">最多上传2张图片</div>
<input type="file" id="editImageUpload" multiple accept="image/*" style="display: none;" onchange="handleEditImageUpload(event)">
<button type="button" onclick="triggerEditImageUpload()" style="margin-top: 10px; padding: 8px 16px; background-color: #f0f0f0; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; cursor: pointer;">
添加图片
</button>
</div>
<!-- 货源类型 -->
@ -3974,7 +3977,7 @@
'published': { text: '已上架', class: 'status-published' },
'pending_review': { text: '审核中', class: 'status-pending' },
'rejected': { text: '审核失败', class: 'status-rejected' },
'hidden': { text: '已隐藏', class: 'status-draft' },
'hidden': { text: '已下架', class: 'status-draft' },
'sold_out': { text: '已下架', class: 'status-draft' }
};
@ -4064,7 +4067,7 @@
<div style="flex: 1;">
<div class="supply-name">
${supply.productName}
<span class="supply-status ${status.class}">${status.text}</span>
${(supply.status === 'hidden' || supply.status === 'sold_out') ? '' : `<span class="supply-status ${status.class}">${status.text}</span>`}
${supply.autoOfflineHours && supply.autoOfflineHours !== '' && supply.autoOfflineHours !== null ? `<span class="countdown-badge" data-id="${supply.id}" style="margin-left: 8px; padding: 4px 12px; background: linear-gradient(135deg, #ff6b6b, #ee5a6f); color: white; border-radius: 16px; font-size: 12px; font-weight: 500; box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3); display: inline-flex; align-items: center; gap: 4px;">⏰ 计算中...</span>` : ''}
<button class="copy-supply-btn" onclick="copySupply('${supply.id}')">复制</button>
</div>
@ -4463,7 +4466,9 @@
// 显示创建货源模态框
function showAddSupplyModal() {
document.getElementById('createSupplyModal').style.display = 'flex';
document.getElementById('createSupplyModal').classList.add('active');
// 隐藏body滚动条,避免双滚动条
document.body.style.overflow = 'hidden';
// 重新加载联系人数据,确保最新
loadContacts();
@ -4602,7 +4607,9 @@
function hideAddSupplyModal() {
// 保存当前表单状态
saveFormData();
document.getElementById('createSupplyModal').style.display = 'none';
document.getElementById('createSupplyModal').classList.remove('active');
// 恢复body滚动条
document.body.style.overflow = 'auto';
}
// 触发图片上传
@ -5764,7 +5771,9 @@
}
// 显示编辑模态框
document.getElementById('editSupplyModal').style.display = 'flex';
document.getElementById('editSupplyModal').classList.add('active');
// 隐藏body滚动条,避免双滚动条
document.body.style.overflow = 'hidden';
} catch (error) {
console.error('显示编辑货源失败:', error);
alert('显示编辑货源失败');
@ -5773,10 +5782,12 @@
// 隐藏编辑货源模态框
function hideEditSupplyModal() {
document.getElementById('editSupplyModal').style.display = 'none';
document.getElementById('editSupplyModal').classList.remove('active');
currentEditSupplyId = null;
// 重置发布模式状态
window.currentEditPublishMode = false;
// 恢复body滚动条
document.body.style.overflow = 'auto';
}
// 编辑后上架货源

Loading…
Cancel
Save