From 0edc6a5e0014eac26257fd40df890365c9f4796b Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 4 Dec 2025 14:38:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20H5=E7=AB=AF=E7=83=AD=E9=97=A8=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=A7=BB=E9=99=A4Tooltip=E9=81=BF=E5=85=8D=E9=BB=91?= =?UTF-8?q?=E8=89=B2=E6=82=AC=E6=B5=AE=E6=A1=86=E6=97=A0=E6=B3=95=E6=B6=88?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 useBreakpointValue 检测移动端设备 - H5端不显示标题和描述的 Tooltip 提示 - PC端保留 Tooltip 功能不变 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/views/Community/components/HotEvents.js | 24 ++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/views/Community/components/HotEvents.js b/src/views/Community/components/HotEvents.js index cd403793..ec5a3395 100644 --- a/src/views/Community/components/HotEvents.js +++ b/src/views/Community/components/HotEvents.js @@ -2,7 +2,7 @@ import React, { useState } from 'react'; import { Card, Badge, Tag, Empty, Carousel, Tooltip } from 'antd'; import { ArrowUpOutlined, ArrowDownOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons'; -import { useDisclosure } from '@chakra-ui/react'; +import { useDisclosure, useBreakpointValue } from '@chakra-ui/react'; import EventDetailModal from './EventDetailModal'; import dayjs from 'dayjs'; import './HotEvents.css'; @@ -31,6 +31,8 @@ const HotEvents = ({ events, onPageChange, onEventClick }) => { const [currentSlide, setCurrentSlide] = useState(0); const { isOpen: isModalOpen, onOpen: onModalOpen, onClose: onModalClose } = useDisclosure(); const [modalEvent, setModalEvent] = useState(null); + // H5 端不显示 Tooltip(避免触摸触发后无法消除的黑色悬浮框) + const isMobile = useBreakpointValue({ base: true, md: false }); const renderPriceChange = (value) => { if (value === null || value === undefined) { @@ -154,21 +156,33 @@ const HotEvents = ({ events, onPageChange, onEventClick }) => { > {/* Custom layout without Card.Meta */}
- + {isMobile ? ( {event.title} - + ) : ( + + + {event.title} + + + )} {renderPriceChange(event.related_avg_chg)}
- + {isMobile ? (
{event.description}
-
+ ) : ( + +
+ {event.description} +
+
+ )}
{event.creator?.username || 'Anonymous'}