diff --git a/src/components/EventDetailPanel/EventDescriptionSection.js b/src/components/EventDetailPanel/EventDescriptionSection.js index 7ede74dd..70f5ec18 100644 --- a/src/components/EventDetailPanel/EventDescriptionSection.js +++ b/src/components/EventDetailPanel/EventDescriptionSection.js @@ -29,10 +29,10 @@ const EventDescriptionSection = ({ description }) => { {/* 事件描述 */} - + 事件描述 - + {description} diff --git a/src/components/EventDetailPanel/EventHeaderInfo.js b/src/components/EventDetailPanel/EventHeaderInfo.js index c9676e22..a7dd6045 100644 --- a/src/components/EventDetailPanel/EventHeaderInfo.js +++ b/src/components/EventDetailPanel/EventHeaderInfo.js @@ -103,14 +103,14 @@ const EventHeaderInfo = ({ event, importance, isFollowing, followerCount, onTogg {/* 浏览数 */} - - + + {(event.view_count || 0).toLocaleString()}次浏览 {/* 日期 */} - + {dayjs(event.created_at).format('YYYY年MM月DD日')} diff --git a/src/components/EventDetailPanel/StockListItem.js b/src/components/EventDetailPanel/StockListItem.js index 3105a5d3..8c53f37c 100644 --- a/src/components/EventDetailPanel/StockListItem.js +++ b/src/components/EventDetailPanel/StockListItem.js @@ -146,8 +146,8 @@ const StockListItem = ({ @@ -157,11 +157,11 @@ const StockListItem = ({ hasArrow bg="blue.600" color="white" - fontSize="xs" + fontSize="sm" > - + {/* 渲染 query_part,每句带来源悬停提示 */} {Array.isArray(stock.relation_desc?.data) && stock.relation_desc.data.filter(item => item.query_part).map((item, index) => ( 来源:{Array.isArray(stock.relation_desc?.data) && [...new Set(stock.relation_desc.data @@ -421,11 +421,11 @@ const StockListItem = ({ position="relative" > {/* 去掉"关联描述"标题 */} - + {relationText} @@ -434,7 +434,7 @@ const StockListItem = ({ {/* 提示信息 */} {isDescExpanded && ( { // 检查是否有指定功能的权限 const hasFeatureAccess = (featureName) => { - // Max 用户解锁所有功能 - if (user?.subscription_type === 'max' || subscriptionInfo.type === 'max') { + // 获取功能所需的权限级别 + const requiredLevel = FEATURE_REQUIREMENTS[featureName]; + + // 如果功能不需要特定权限(不在列表中),默认允许 + if (!requiredLevel) { return true; } - if (!subscriptionInfo.is_active) { - return false; + // 获取当前用户的订阅类型 + const currentType = (subscriptionInfo.type || 'free').toLowerCase(); + + // Max 用户解锁所有功能 + if (currentType === 'max' || user?.subscription_type === 'max') { + return true; } - const requiredLevel = FEATURE_REQUIREMENTS[featureName]; - if (!requiredLevel) { - return true; // 如果功能不需要特定权限,默认允许 + // Pro 用户可以访问 free 和 pro 级别的功能 + if (currentType === 'pro') { + return requiredLevel === 'free' || requiredLevel === 'pro'; } - const currentLevel = getSubscriptionLevel(); - const requiredLevelNum = getSubscriptionLevel(requiredLevel); - - return currentLevel >= requiredLevelNum; + // Free 用户只能访问 free 级别的功能 + // 由于 deep_analysis 和 concept_sector 需要 pro,Free 用户无法访问 + return requiredLevel === 'free'; }; // 检查是否达到指定订阅级别 diff --git a/src/store/slices/subscriptionSlice.js b/src/store/slices/subscriptionSlice.js index d6811373..18cdb9aa 100644 --- a/src/store/slices/subscriptionSlice.js +++ b/src/store/slices/subscriptionSlice.js @@ -28,11 +28,15 @@ export const fetchSubscriptionInfo = createAsyncThunk( if (data.success && data.data) { // 数据标准化处理 + const subType = (data.data.type || data.data.subscription_type || 'free').toLowerCase(); + // Free 用户的 is_active 应为 false,Pro/Max 用户根据实际状态判断 + const isActive = subType === 'free' ? false : (data.data.is_active === true); + const normalizedData = { - type: (data.data.type || data.data.subscription_type || 'free').toLowerCase(), + type: subType, status: data.data.status || 'active', days_left: data.data.days_left || 0, - is_active: data.data.is_active !== false, + is_active: isActive, end_date: data.data.end_date || null };