update pay promo
This commit is contained in:
@@ -29,10 +29,10 @@ const EventDescriptionSection = ({ description }) => {
|
||||
<Box bg={sectionBg} p={3} borderRadius="md">
|
||||
{/* 事件描述 */}
|
||||
<Box>
|
||||
<Heading size="sm" color={headingColor} mb={2}>
|
||||
<Heading size="md" color={headingColor} mb={2}>
|
||||
事件描述
|
||||
</Heading>
|
||||
<Text fontSize="sm" color={textColor} lineHeight="tall">
|
||||
<Text fontSize="md" color={textColor} lineHeight="tall">
|
||||
{description}
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
@@ -103,14 +103,14 @@ const EventHeaderInfo = ({ event, importance, isFollowing, followerCount, onTogg
|
||||
<Flex align="left" mb={3} gap={4}>
|
||||
{/* 浏览数 */}
|
||||
<HStack spacing={1}>
|
||||
<Icon as={Eye} boxSize={4} color="gray.400" />
|
||||
<Text fontSize="sm" color="gray.400" whiteSpace="nowrap">
|
||||
<Icon as={Eye} boxSize={5} color="gray.400" />
|
||||
<Text fontSize="md" color="gray.400" whiteSpace="nowrap">
|
||||
{(event.view_count || 0).toLocaleString()}次浏览
|
||||
</Text>
|
||||
</HStack>
|
||||
|
||||
{/* 日期 */}
|
||||
<Text fontSize="sm" color="red.500" fontWeight="medium" whiteSpace="nowrap">
|
||||
<Text fontSize="md" color="red.500" fontWeight="medium" whiteSpace="nowrap">
|
||||
{dayjs(event.created_at).format('YYYY年MM月DD日')}
|
||||
</Text>
|
||||
</Flex>
|
||||
|
||||
@@ -146,8 +146,8 @@ const StockListItem = ({
|
||||
<VStack
|
||||
align="stretch"
|
||||
spacing={1}
|
||||
minW="95px"
|
||||
maxW="110px"
|
||||
minW="110px"
|
||||
maxW="130px"
|
||||
justify="center"
|
||||
flexShrink={0}
|
||||
>
|
||||
@@ -157,11 +157,11 @@ const StockListItem = ({
|
||||
hasArrow
|
||||
bg="blue.600"
|
||||
color="white"
|
||||
fontSize="xs"
|
||||
fontSize="sm"
|
||||
>
|
||||
<VStack spacing={0} align="stretch">
|
||||
<Text
|
||||
fontSize="xs"
|
||||
fontSize="sm"
|
||||
color={codeColor}
|
||||
noOfLines={1}
|
||||
cursor="pointer"
|
||||
@@ -171,7 +171,7 @@ const StockListItem = ({
|
||||
{stock.stock_code}
|
||||
</Text>
|
||||
<Text
|
||||
fontSize="xs"
|
||||
fontSize="sm"
|
||||
fontWeight="bold"
|
||||
color={nameColor}
|
||||
noOfLines={1}
|
||||
@@ -322,13 +322,13 @@ const StockListItem = ({
|
||||
transition="background 0.2s"
|
||||
position="relative"
|
||||
>
|
||||
<Collapse in={isDescExpanded} startingHeight={56}>
|
||||
<Collapse in={isDescExpanded} startingHeight={60}>
|
||||
{/* 渲染 query_part,每句带来源悬停提示 */}
|
||||
<Text
|
||||
as="span"
|
||||
fontSize="xs"
|
||||
fontSize="sm"
|
||||
color={nameColor}
|
||||
lineHeight="1.5"
|
||||
lineHeight="1.6"
|
||||
>
|
||||
{Array.isArray(stock.relation_desc?.data) && stock.relation_desc.data.filter(item => item.query_part).map((item, index) => (
|
||||
<Tooltip
|
||||
@@ -380,10 +380,10 @@ const StockListItem = ({
|
||||
{/* 引用来源 - 浅色显示在最后 */}
|
||||
{isDescExpanded && (
|
||||
<Text
|
||||
fontSize="10px"
|
||||
fontSize="xs"
|
||||
color="gray.500"
|
||||
mt={2}
|
||||
lineHeight="1.4"
|
||||
lineHeight="1.5"
|
||||
>
|
||||
来源:{Array.isArray(stock.relation_desc?.data) &&
|
||||
[...new Set(stock.relation_desc.data
|
||||
@@ -421,11 +421,11 @@ const StockListItem = ({
|
||||
position="relative"
|
||||
>
|
||||
{/* 去掉"关联描述"标题 */}
|
||||
<Collapse in={isDescExpanded} startingHeight={56}>
|
||||
<Collapse in={isDescExpanded} startingHeight={60}>
|
||||
<Text
|
||||
fontSize="xs"
|
||||
fontSize="sm"
|
||||
color={nameColor}
|
||||
lineHeight="1.5"
|
||||
lineHeight="1.6"
|
||||
>
|
||||
{relationText}
|
||||
</Text>
|
||||
@@ -434,7 +434,7 @@ const StockListItem = ({
|
||||
{/* 提示信息 */}
|
||||
{isDescExpanded && (
|
||||
<Text
|
||||
fontSize="xs"
|
||||
fontSize="sm"
|
||||
color="gray.500"
|
||||
mt={2}
|
||||
fontStyle="italic"
|
||||
|
||||
@@ -96,24 +96,30 @@ export const useSubscription = () => {
|
||||
|
||||
// 检查是否有指定功能的权限
|
||||
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';
|
||||
};
|
||||
|
||||
// 检查是否达到指定订阅级别
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user