|
@@ -19,7 +19,7 @@ function A3banPano() {
|
|
// 路由:/banPano/id
|
|
// 路由:/banPano/id
|
|
const urlObj: any = useParams()
|
|
const urlObj: any = useParams()
|
|
// 0为 第一种模式的热点 其他为第二种
|
|
// 0为 第一种模式的热点 其他为第二种
|
|
- const [ind, setInd] = useState(-1)
|
|
|
|
|
|
+ const [acName, setAcName] = useState('')
|
|
const [activeIdx, setActiveIdx] = useState(-1)
|
|
const [activeIdx, setActiveIdx] = useState(-1)
|
|
const [curScene, setCurScene] = useState('')
|
|
const [curScene, setCurScene] = useState('')
|
|
|
|
|
|
@@ -31,10 +31,11 @@ function A3banPano() {
|
|
// myData.banquet.hot.filter(v=>v.louType===id)
|
|
// myData.banquet.hot.filter(v=>v.louType===id)
|
|
}, [urlObj.id])
|
|
}, [urlObj.id])
|
|
|
|
|
|
- const data = useMemo(() => {
|
|
|
|
- if (ind !== -1) return myData.banquet.hot[ind].data
|
|
|
|
- else return []
|
|
|
|
- }, [ind])
|
|
|
|
|
|
+ const info = useMemo(() => {
|
|
|
|
+ let infoRes: any = {}
|
|
|
|
+ if (acName) infoRes = myData.banquet.hot.find(v => v.name === acName)
|
|
|
|
+ return infoRes
|
|
|
|
+ }, [acName])
|
|
|
|
|
|
return (
|
|
return (
|
|
<div className={styles.A3banPano}>
|
|
<div className={styles.A3banPano}>
|
|
@@ -83,7 +84,7 @@ function A3banPano() {
|
|
bg={false}
|
|
bg={false}
|
|
onOver={() => setActiveIdx(index)}
|
|
onOver={() => setActiveIdx(index)}
|
|
onOut={() => setActiveIdx(-1)}
|
|
onOut={() => setActiveIdx(-1)}
|
|
- onClick={() => setInd(index)}
|
|
|
|
|
|
+ onClick={() => setAcName(item.name)}
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
// onDown='draggable_hotspot()'
|
|
// onDown='draggable_hotspot()'
|
|
>
|
|
>
|
|
@@ -190,9 +191,9 @@ function A3banPano() {
|
|
{/* 右下角按钮 */}
|
|
{/* 右下角按钮 */}
|
|
<FloorBtn />
|
|
<FloorBtn />
|
|
|
|
|
|
- {ind === -1 ? null : (
|
|
|
|
- <Hot2 data={data} closeFu={() => setInd(-1)} name={myData.banquet.hot[ind].name} />
|
|
|
|
- )}
|
|
|
|
|
|
+ {acName && info && info.data ? (
|
|
|
|
+ <Hot2 data={info.data} closeFu={() => setAcName('')} name={info.name} />
|
|
|
|
+ ) : null}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|