import React, { useEffect, useRef } from 'react' import styles from './index.module.scss' import BtnRight from '@/components/BtnRight' import { GoodsType } from '@/types' import { baseURL } from '@/utils/http' type Props = { closeFu: () => void info: GoodsType } function HotInfo({ closeFu, info }: Props) { const videoRef = useRef(null) useEffect(() => { if (info.type === 'video') { setTimeout(() => { if (videoRef.current) videoRef.current.play() }, 100) } }, [info.type]) return (
{/* 左边主体 */}
{info.type === 'img' ? ( ) : info.type === 'video' ? ( ) : ( )}
{/* 右边文字 */}

{info.name}

{/* 右下角的返回按钮 */} closeFu()} title='返回' />
) } const MemoHotInfo = React.memo(HotInfo) export default MemoHotInfo