Browse Source

feat: 增加产品日志展示功能,显示价格变更日志

Boss3
Default User 2 months ago
parent
commit
ab285cfd0e
  1. 29
      Management.html

29
Management.html

@ -1201,7 +1201,34 @@
</div>`;
}
// 产品日志展示
if (supply.product_log) {
try {
// 解析产品日志JSON
const productLogs = JSON.parse(supply.product_log);
if (Array.isArray(productLogs) && productLogs.length > 0) {
detailsHTML += `<div style="margin: 10px 0; font-size: 14px;">
<h4 style="margin: 0 0 10px 0; padding-bottom: 5px; border-bottom: 2px solid #ff4d4f; color: #333; font-size: 16px;">价格变更日志</h4>
<div style="display: flex; flex-direction: column; gap: 8px;">
${productLogs.map((log, index) => `
<div style="display: flex; align-items: flex-start; gap: 8px; padding: 10px; background-color: #fff1f0; border-radius: 4px;">
<div style="background-color: #ff4d4f; color: white; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: bold; min-width: 40px; text-align: center;">日志${index + 1}</div>
<div style="font-size: 13px; color: #666; flex: 1;">${log}</div>
</div>
`).join('')}
</div>
</div>`;
}
} catch (e) {
// 解析失败,直接展示原始日志
detailsHTML += `<div style="margin: 10px 0; font-size: 14px;">
<h4 style="margin: 0 0 10px 0; padding-bottom: 5px; border-bottom: 2px solid #ff4d4f; color: #333; font-size: 16px;">价格变更日志</h4>
<div style="padding: 10px; background-color: #fff1f0; border-radius: 4px; font-size: 13px; color: #666;">
${supply.product_log}
</div>
</div>`;
}
}
// 状态
detailsHTML += `<span class="supply-status ${statusClass}" style="display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; margin-top: 5px;">${statusText}</span>`;

Loading…
Cancel
Save