From b644f5708496d06651a14a465ddcf7fda1f0443b Mon Sep 17 00:00:00 2001 From: OoO Date: Wed, 13 May 2026 21:14:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=84=AA=E5=8C=96=E7=95=B6=E6=97=A5=E6=A5=AD?= =?UTF-8?q?=E7=B8=BE=E6=89=8B=E6=A9=9F=E7=89=88=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 2 +- templates/daily_sales.html | 18 +++--- web/static/css/page-daily-sales.css | 89 +++++++++++++++++++++++++---- 3 files changed, 89 insertions(+), 20 deletions(-) diff --git a/config.py b/config.py index 17c621a..d60b207 100644 --- a/config.py +++ b/config.py @@ -320,7 +320,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.125" +SYSTEM_VERSION = "V10.126" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/templates/daily_sales.html b/templates/daily_sales.html index 69a110c..c52cc1b 100644 --- a/templates/daily_sales.html +++ b/templates/daily_sales.html @@ -357,15 +357,15 @@ {% for cat in categories %} - {{ cat.category }} - {{ cat.vendor or '-' }} - ${{ "{:,.0f}".format(cat.revenue) }} - ${{ "{:,.0f}".format(cat.cost or 0) }} - ${{ "{:,.0f}".format(cat.profit or 0) }} - {{ "{:.1f}%".format(cat.margin_rate) }} - {{ "{:,.0f}".format(cat.qty or 0) }} - {{ cat.sku_count or 0 }} - ${{ "{:,.0f}".format(cat.avg_price) }} + {{ cat.category }} + {{ cat.vendor or '-' }} + ${{ "{:,.0f}".format(cat.revenue) }} + ${{ "{:,.0f}".format(cat.cost or 0) }} + ${{ "{:,.0f}".format(cat.profit or 0) }} + {{ "{:.1f}%".format(cat.margin_rate) }} + {{ "{:,.0f}".format(cat.qty or 0) }} + {{ cat.sku_count or 0 }} + ${{ "{:,.0f}".format(cat.avg_price) }} {% endfor %} diff --git a/web/static/css/page-daily-sales.css b/web/static/css/page-daily-sales.css index b387dbf..8407e91 100644 --- a/web/static/css/page-daily-sales.css +++ b/web/static/css/page-daily-sales.css @@ -714,11 +714,11 @@ .kpi-card__icon-bg { position: absolute; - right: -12px; - bottom: -12px; - font-size: 4.6rem; + right: 10px; + bottom: 10px; + font-size: 3.8rem; color: currentColor; - opacity: 0.08; + opacity: 0.06; transform: rotate(-12deg); pointer-events: none; } @@ -845,11 +845,14 @@ .chart-container--md { height: 350px; } .chart-responsive { - overflow-x: auto; - -webkit-overflow-scrolling: touch; + min-width: 0; + overflow: hidden; } -#top10ChartContainer { min-width: 400px; } +#top10ChartContainer { + min-width: 0; + width: 100%; +} .chart-mobile-hint { background: var(--momo-page-accent-soft); @@ -929,8 +932,69 @@ } @media (max-width: 767px) { - #categoryTable { min-width: 800px; white-space: nowrap; } - #categoryTable th, #categoryTable td { font-size: 0.82rem; padding: 0.5rem; } + .daily-sales-page .table-responsive { + overflow: visible; + } + + #categoryTable, + #categoryTable thead, + #categoryTable tbody, + #categoryTable tr, + #categoryTable td { + display: block; + width: 100%; + } + + #categoryTable thead { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip: rect(0 0 0 0); + white-space: nowrap; + } + + #categoryTable tbody { + display: grid; + gap: 10px; + padding: 10px 0; + background: var(--momo-bg-paper); + } + + #categoryTable tbody tr { + background: var(--momo-bg-surface); + border: 1px solid var(--momo-border-light); + border-radius: 8px; + overflow: hidden; + } + + #categoryTable tbody td { + display: grid; + grid-template-columns: minmax(82px, 0.36fr) minmax(0, 1fr); + gap: 10px; + align-items: start; + min-height: 38px; + padding: 9px 12px; + border-bottom: 1px solid var(--momo-border-light); + font-size: 0.78rem; + white-space: normal; + } + + #categoryTable tbody td:last-child { + border-bottom: 0; + } + + #categoryTable tbody td::before { + content: attr(data-label); + color: var(--momo-text-tertiary); + font-family: var(--momo-font-mono, ui-monospace, monospace); + font-size: 0.66rem; + font-weight: 800; + } + + #categoryTable td.num { + text-align: left; + } } /* ---------- Mobile KPI compaction ---------- */ @@ -942,6 +1006,11 @@ .daily-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-card__value { font-size: 1.2rem; } .kpi-card__label { font-size: 0.7rem; } + .kpi-card__icon-bg { + right: 8px; + bottom: 8px; + font-size: 2.8rem; + } .chart-container { height: 250px; } } @@ -951,5 +1020,5 @@ @media (max-width: 575px) { .chart-container { height: 220px; } - #top10ChartContainer { min-width: 450px; } + #top10ChartContainer { min-width: 0; } }