import React, { useMemo, useState } from 'react' import styles from './index.module.scss' import Hot1 from './Hot1' import Hot2 from './Hot2' import { myData } from '@/utils/http' import HotIcon from '@/components/HotIcon' function PanoVideo() { // 0为 第一种模式的热点 其他为第二种 const [ind, setInd] = useState(-1) const data = useMemo(() => { if (ind !== -1) return myData.visit.hot[ind].data else return [] }, [ind]) return (
{/* 待完善 */} 全景视频页面----- {myData.visit.hot.map((item, index) => ( // 热点图标 setInd(val)} hoverSrc={item.hoverSrc} /> ))} {ind === -1 ? null : ind === 0 ? ( setInd(-1)} /> ) : ( setInd(-1)} name={myData.visit.hot[ind].name} /> )}
) } const MemoPanoVideo = React.memo(PanoVideo) export default MemoPanoVideo