fix: route formal homepage to growth command center
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s

This commit is contained in:
ogt
2026-06-24 21:18:09 +08:00
parent 65aa23800c
commit 5adeacd65c
5 changed files with 113 additions and 15 deletions

View File

@@ -1119,6 +1119,40 @@
justify-content: flex-end;
}
.growth-action-evidence {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 5px;
margin-top: 7px;
}
.growth-action-evidence-chip {
border: 1px solid rgba(42, 37, 32, 0.08);
border-radius: 8px;
background: rgba(255, 255, 255, 0.64);
min-width: 0;
padding: 5px 6px;
}
.growth-action-evidence-label {
color: var(--momo-text-muted);
display: block;
font-size: 0.6rem;
font-weight: 950;
line-height: 1.2;
}
.growth-action-evidence-value {
color: var(--momo-text-strong);
display: block;
font-family: var(--momo-font-mono);
font-size: 0.7rem;
font-weight: 950;
line-height: 1.25;
margin-top: 2px;
overflow-wrap: anywhere;
}
.growth-decision-panel {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
@@ -2018,6 +2052,10 @@
flex: 1 1 100%;
}
.growth-action-evidence {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.growth-detail-price-grid {
grid-template-columns: 1fr;
}
@@ -2092,6 +2130,16 @@
</article>
</section>
<section class="growth-action-board" id="growthActionBoard" aria-label="今日策略動作">
<div class="growth-action-board-head">
<h3 class="growth-action-board-title">今日策略動作</h3>
<span class="growth-action-board-note">照順序處理最可能影響業績的商品</span>
</div>
<div class="growth-action-list">
<div class="text-center py-3 text-muted">整理動作中...</div>
</div>
</section>
<!-- ── 今日重點總覽 ── -->
<section class="ops-flow" aria-label="今日重點總覽">
<div class="ops-flow-head">
@@ -2231,15 +2279,6 @@
<div class="text-center py-3 text-muted">整理策略中...</div>
</div>
</div>
<div class="growth-action-board" id="growthActionBoard" aria-label="今日策略動作">
<div class="growth-action-board-head">
<h3 class="growth-action-board-title">今日策略動作</h3>
<span class="growth-action-board-note">照順序處理最可能影響業績的商品</span>
</div>
<div class="growth-action-list">
<div class="text-center py-3 text-muted">整理動作中...</div>
</div>
</div>
<div class="growth-decision-panel" id="growthDecisionSummary">
<div>
<h3 class="growth-decision-title">正在整理處理建議</h3>
@@ -3606,6 +3645,40 @@ function growthActionPlanForRow(row) {
};
}
function growthActionEvidence(row) {
const price = row?.external_price || null;
const candidate = row?.review_candidate || null;
const gap = price && price.gap_pct !== null && price.gap_pct !== undefined ? Number(price.gap_pct) : null;
const quality = Math.round(rowQualityScore(row));
return [
{
label: 'PChome',
value: price ? formatGrowthDetailPrice(price, 'pchome') : candidate ? formatPriceAmount(candidate.pchome_price) : '待補',
},
{
label: 'MOMO',
value: price ? formatGrowthDetailPrice(price, 'momo') : candidate ? formatPriceAmount(candidate.momo_price) : '待補',
},
{
label: '差距',
value: candidate ? '候選待確認' : gap === null ? '待判斷' : formatGapDisplay(gap),
},
{
label: '可信度',
value: quality ? `${quality}%` : '待補',
},
];
}
function renderGrowthActionEvidence(row) {
return `<div class="growth-action-evidence">
${growthActionEvidence(row).map((item) => `<span class="growth-action-evidence-chip">
<span class="growth-action-evidence-label">${escapeHtml(item.label)}</span>
<span class="growth-action-evidence-value">${escapeHtml(item.value)}</span>
</span>`).join('')}
</div>`;
}
function renderGrowthActionBoard() {
const board = document.getElementById('growthActionBoard');
if (!board) return;
@@ -3639,6 +3712,7 @@ function renderGrowthActionBoard() {
<div>
<span class="growth-action-pill">${escapeHtml(plan.label)}</span>
<p class="growth-action-meta">近 7 天 ${escapeHtml(formatMoney(row.sales_7d))}</p>
${renderGrowthActionEvidence(row)}
</div>
<div class="growth-action-buttons">
<button type="button" class="btn btn-sm btn-outline-secondary table-row-action" data-growth-action="show-product-detail" data-product-key="${key}">詳情</button>