diff --git a/src/components/StockChangeIndicators.js b/src/components/StockChangeIndicators.js
index 009f3284..be084b33 100644
--- a/src/components/StockChangeIndicators.js
+++ b/src/components/StockChangeIndicators.js
@@ -22,6 +22,11 @@ const StockChangeIndicators = ({
return useColorModeValue('gray.700', 'gray.400');
}
+ // 0值使用中性灰色
+ if (value === 0) {
+ return 'gray.700';
+ }
+
const absValue = Math.abs(value);
const isPositive = value > 0;
@@ -48,6 +53,11 @@ const StockChangeIndicators = ({
return useColorModeValue('gray.100', 'gray.700');
}
+ // 0值使用中性灰色背景
+ if (value === 0) {
+ return useColorModeValue('gray.100', 'gray.700');
+ }
+
const absValue = Math.abs(value);
const isPositive = value > 0;
@@ -74,6 +84,11 @@ const StockChangeIndicators = ({
return useColorModeValue('gray.300', 'gray.600');
}
+ // 0值使用中性灰色边框
+ if (value === 0) {
+ return useColorModeValue('gray.300', 'gray.600');
+ }
+
const absValue = Math.abs(value);
const isPositive = value > 0;
@@ -99,7 +114,8 @@ const StockChangeIndicators = ({
if (value == null) return null;
const sign = value > 0 ? '+' : '';
- const numStr = Math.abs(value).toFixed(1);
+ // 0值显示为 "0",其他值显示一位小数
+ const numStr = value === 0 ? '0' : Math.abs(value).toFixed(1);
const numberColor = getNumberColor(value);
const bgColor = getBgColor(value);
const borderColor = getBorderColor(value);
diff --git a/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js b/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js
index a7b28356..0a6f1ae0 100644
--- a/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js
+++ b/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js
@@ -13,14 +13,18 @@ import {
import { ViewIcon } from '@chakra-ui/icons';
import moment from 'moment';
import StockChangeIndicators from '../../../../components/StockChangeIndicators';
+import EventFollowButton from '../EventCard/EventFollowButton';
/**
* 事件头部信息区组件
* @param {Object} props
* @param {Object} props.event - 事件对象
* @param {Object} props.importance - 重要性配置对象(包含 level, color 等)
+ * @param {boolean} props.isFollowing - 是否已关注
+ * @param {number} props.followerCount - 关注数
+ * @param {Function} props.onToggleFollow - 切换关注回调
*/
-const EventHeaderInfo = ({ event, importance }) => {
+const EventHeaderInfo = ({ event, importance, isFollowing, followerCount, onToggleFollow }) => {
const sectionBg = useColorModeValue('gray.50', 'gray.750');
const headingColor = useColorModeValue('gray.700', 'gray.200');
@@ -64,12 +68,21 @@ const EventHeaderInfo = ({ event, importance }) => {
)}
- {/* 第一行:标题 */}
+ {/* 第一行:标题 + 关注按钮 */}
{/* 标题 */}
{event.title}
+
+ {/* 关注按钮 */}
+
{/* 第二行:浏览数 + 日期 */}