From 62ccdcbc39fc91c7899bb2ad2b3abbcf935df2b7 Mon Sep 17 00:00:00 2001 From: "zhangf@suq.cn" Date: Mon, 7 Sep 2026 10:44:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(stock):=20=E6=B7=BB=E5=8A=A0=E8=82=A1?= =?UTF-8?q?=E7=A5=A8=E4=BF=A1=E6=81=AF=E5=AE=9E=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=92=8C=E5=9B=BE=E8=A1=A8=E5=8A=A8=E6=80=81=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在页脚组件中为股票价格、单位和涨跌幅添加动态颜色样式 - 将股票信息获取逻辑从投资页面移至头部组件以统一管理 - 为投资页面股票信息区域的价格、单位和涨跌幅添加颜色标识 - 将静态股票走势图替换为实时更新的新浪股票图表 - 实现股票图表定时刷新机制,每分钟自动更新一次 - 添加页面可见性检测,仅在页面可见时执行图表刷新 - 移除投资页面中重复的股票信息获取PHP代码 --- .../website/1/zh/demo/components/footer.html | 7 ++- .../website/1/zh/demo/components/header.html | 14 +++++ public/themes/website/1/zh/demo/investment.html | 63 ++++++++++++++++------ 3 files changed, 63 insertions(+), 21 deletions(-) diff --git a/public/themes/website/1/zh/demo/components/footer.html b/public/themes/website/1/zh/demo/components/footer.html index 0b15f12..f75aed5 100644 --- a/public/themes/website/1/zh/demo/components/footer.html +++ b/public/themes/website/1/zh/demo/components/footer.html @@ -7,11 +7,10 @@ RAYNEN 睿能科技 - +{php} +// 获取股票信息 +$stockInfo = getStockInfo('603933'); +// 判断涨跌颜色 +$priceColor = ''; +if ($stockInfo['change'] !== '--') { +$changeVal = floatval(str_replace(['+', '-'], '', $stockInfo['change'])); +if ($stockInfo['change'][0] === '+') { +$priceColor = 'color: #ef4335'; // 上涨红色 +} elseif ($stockInfo['change'][0] === '-') { +$priceColor = 'color: #00b894'; // 下跌绿色 +} +} +{/php} diff --git a/public/themes/website/1/zh/demo/investment.html b/public/themes/website/1/zh/demo/investment.html index 011f665..98cc91c 100644 --- a/public/themes/website/1/zh/demo/investment.html +++ b/public/themes/website/1/zh/demo/investment.html @@ -140,21 +140,6 @@ {/hcTaglib:category} - - {php} - // 获取股票信息 - $stockInfo = getStockInfo('603933'); - // 判断涨跌颜色 - $priceColor = ''; - if ($stockInfo['change'] !== '--') { - $changeVal = floatval(str_replace(['+', '-'], '', $stockInfo['change'])); - if ($stockInfo['change'][0] === '+') { - $priceColor = 'color: #ef4335'; // 上涨红色 - } elseif ($stockInfo['change'][0] === '-') { - $priceColor = 'color: #00b894'; // 下跌绿色 - } - } - {/php}

股票信息

@@ -162,7 +147,7 @@

股票代码:{$stockInfo.code}

{$stockInfo.price} - + {$stockInfo.change}  {$stockInfo.changePercent}
    @@ -186,7 +171,7 @@

    截止 {$stockInfo.updateTime}*报价有十五分钟或以上延迟。

- 股票走势图 + 睿能科技分时走势图
@@ -289,6 +274,50 @@ + + \ No newline at end of file