diff --git a/config.py b/config.py index eb80d3f..b028e10 100644 --- a/config.py +++ b/config.py @@ -320,7 +320,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '') # ========================================== # 系統版本與路徑 # ========================================== -SYSTEM_VERSION = "V10.155" +SYSTEM_VERSION = "V10.156" LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log') public_url = PUBLIC_URL # 用於模板顯示 diff --git a/templates/pchome_crawler.html b/templates/pchome_crawler.html index e57cb64..3d83161 100644 --- a/templates/pchome_crawler.html +++ b/templates/pchome_crawler.html @@ -2,20 +2,139 @@ {% block title %}PChome 爬蟲 - EwoooC{% endblock %} +{% block extra_css %} + +{% endblock %} + {% block content %} -
-
-
+
+

PChome 24h 爬蟲

爬取 PChome 24h 商品資料

-
-
+
-
+
館別爬取
@@ -39,7 +158,7 @@
-
+
關鍵字搜尋
@@ -55,7 +174,7 @@
-
@@ -67,7 +186,7 @@
-
+
自訂 URL 爬取
@@ -78,7 +197,7 @@ placeholder="https://24h.pchome.com.tw/region/DDAB">
-
@@ -125,8 +244,8 @@
- - +
+ @@ -346,10 +465,10 @@ tbody.innerHTML = ''; for (const p of products) { - const discount = p.discount ? `-${p.discount}%` : '-'; + const discount = p.discount ? `-${p.discount}%` : '-'; const stockBadge = p.stock > 0 - ? `${p.stock}` - : `缺貨`; + ? `${p.stock}` + : `缺貨`; const row = document.createElement('tr'); row.innerHTML = ` @@ -431,8 +550,7 @@ function showToast(message, type = 'info') { // 簡易 Toast const toast = document.createElement('div'); - toast.className = `alert alert-${type} position-fixed`; - toast.style.cssText = 'top: 20px; right: 20px; z-index: 9999; min-width: 300px;'; + toast.className = `pchome-toast pchome-toast--${type} position-fixed`; toast.innerHTML = ` ${message} diff --git a/templates/price_comparison.html b/templates/price_comparison.html index 2de8354..d3ea309 100644 --- a/templates/price_comparison.html +++ b/templates/price_comparison.html @@ -2,21 +2,169 @@ {% block title %}比價系統 - EwoooC{% endblock %} +{% block extra_css %} + +{% endblock %} + {% block content %} -
-
-
+
+

PChome vs MOMO 比價

比較 PChome 24h 和 MOMO 美妝商品價格

-
-
+
-
+
Step 1: 選擇品牌
@@ -36,11 +184,11 @@
-
+
Step 2: PChome 商品
-
@@ -48,7 +196,7 @@ 手動輸入
- 0 筆商品 + 0 筆商品
@@ -57,11 +205,11 @@
-
+
Step 3: MOMO 商品
-
@@ -69,7 +217,7 @@ 手動輸入
- 0 筆商品 + 0 筆商品
@@ -79,7 +227,7 @@
-
@@ -108,7 +256,7 @@
-
+

0

成功匹配 @@ -116,7 +264,7 @@
-
+

0

PChome 較便宜 @@ -124,7 +272,7 @@
-
+

0

MOMO 較便宜 @@ -132,7 +280,7 @@
-
+

$0

平均價差 @@ -154,7 +302,7 @@
圖片 商品名稱
- + @@ -188,14 +336,14 @@ -
+
Excel 需包含「商品名稱」和「售價」欄位。可選包含「商品編號」和「連結」。
@@ -212,7 +360,7 @@
PChome 商品 MOMO 商品
- + @@ -101,7 +140,7 @@ async function loadTrends() { const recordsBody = document.getElementById('recordsBody'); if (!records.success || !records.data.length) { - recordsBody.innerHTML = ''; + recordsBody.innerHTML = ''; } else { recordsBody.innerHTML = records.data.map(item => ` @@ -116,12 +155,12 @@ async function loadTrends() { const keywordsBox = document.getElementById('keywordsBox'); if (!keywords.success || !keywords.data.length) { - keywordsBox.innerHTML = '
尚無關鍵字
'; + keywordsBox.innerHTML = ''; } else { keywordsBox.innerHTML = keywords.data.map(item => `
${escapeHtml(item.keyword)} - ${escapeHtml(item.total_mentions || 0)} + ${escapeHtml(item.total_mentions || 0)}
`).join(''); }
日期 來源
尚無趨勢資料