|
@@ -1,17 +1,17 @@
|
|
|
import React, { useState } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
|
-import { myData, otherUrl } from '@/utils/http'
|
|
|
-import Hot2 from '@/pages/A2visit/PanoVideo/Hot2'
|
|
|
+import { hotInfo, otherUrl } from '@/utils/http'
|
|
|
import { HotSpot, Krpano, Scene, View } from '@dage/krpano'
|
|
|
import HotIcon from '@/components/HotIcon'
|
|
|
import { KrpanoMiddleware } from '@/components/KrpanoMiddleware'
|
|
|
+import Zhot from '@/components/Zhot'
|
|
|
|
|
|
// window.draggbleHotspotEvent = (ath: number, atv: number) => {
|
|
|
// console.log(`ath: ${ath}, atv: ${atv}`)
|
|
|
// }
|
|
|
|
|
|
function A22Pano() {
|
|
|
- const [acInd, setAcInd] = useState(-1)
|
|
|
+ const [acName, setAcName] = useState('')
|
|
|
const [activeIdx, setActiveIdx] = useState(-1)
|
|
|
|
|
|
return (
|
|
@@ -40,26 +40,26 @@ function A22Pano() {
|
|
|
]}
|
|
|
>
|
|
|
<View hlookat={0} vlookat={0} fovType='MFOV' fov={120} fovMin={70} fovMax={130} />
|
|
|
- {myData.visit2.hot.map((item, index) => (
|
|
|
+ {hotInfo.cheQi2.map((item, index) => (
|
|
|
// 热点图标
|
|
|
<HotSpot
|
|
|
key={index}
|
|
|
type='text'
|
|
|
name={item.name}
|
|
|
- atv={item.atv}
|
|
|
- ath={item.ath}
|
|
|
+ atv={item.panoLoc.atv}
|
|
|
+ ath={item.panoLoc.ath}
|
|
|
edge='top'
|
|
|
distorted={true}
|
|
|
- scale={item.size}
|
|
|
+ scale={item.panoLoc.size}
|
|
|
bg={false}
|
|
|
onOver={() => setActiveIdx(index)}
|
|
|
onOut={() => setActiveIdx(-1)}
|
|
|
- onClick={() => setAcInd(index)}
|
|
|
+ onClick={() => setAcName(item.name)}
|
|
|
// @ts-ignore
|
|
|
// onDown='draggable_hotspot()'
|
|
|
>
|
|
|
<HotIcon
|
|
|
- isModel={item.isModel ? true : false}
|
|
|
+ isModel={item.tubiao === '文物' ? true : false}
|
|
|
key={index}
|
|
|
index={index}
|
|
|
isHoverAc={activeIdx === index}
|
|
@@ -72,13 +72,7 @@ function A22Pano() {
|
|
|
</Krpano>
|
|
|
</KrpanoMiddleware>
|
|
|
|
|
|
- {acInd !== -1 ? (
|
|
|
- <Hot2
|
|
|
- data={myData.visit2.hot[acInd].data}
|
|
|
- closeFu={() => setAcInd(-1)}
|
|
|
- name={myData.visit2.hot[acInd].name}
|
|
|
- />
|
|
|
- ) : null}
|
|
|
+ {acName ? <Zhot name={acName} closeFu={() => setAcName('')} /> : null}
|
|
|
</div>
|
|
|
)
|
|
|
}
|