|
@@ -9,6 +9,7 @@ import history from '@/utils/history'
|
|
import FloorHotspotIcon from '@/assets/img/icon-flo-1.png'
|
|
import FloorHotspotIcon from '@/assets/img/icon-flo-1.png'
|
|
import { ArrowLeftOutlined } from '@ant-design/icons'
|
|
import { ArrowLeftOutlined } from '@ant-design/icons'
|
|
import FloorBtn from '@/components/FloorBtn'
|
|
import FloorBtn from '@/components/FloorBtn'
|
|
|
|
+import { KrpanoMiddleware } from '@/components/KrpanoMiddleware'
|
|
// import { myData } from '@/utils/http'
|
|
// import { myData } from '@/utils/http'
|
|
|
|
|
|
window.draggbleHotspotEvent = (ath: number, atv: number) => {
|
|
window.draggbleHotspotEvent = (ath: number, atv: number) => {
|
|
@@ -38,161 +39,153 @@ function A3banPano() {
|
|
|
|
|
|
return (
|
|
return (
|
|
<div className={styles.A3banPano}>
|
|
<div className={styles.A3banPano}>
|
|
- <Krpano className={styles.pano} currentScene={curScene}>
|
|
|
|
- <Scene
|
|
|
|
- name='pano3'
|
|
|
|
- previewUrl={otherUrl + 'pano/pano3.tiles/thumb.jpg'}
|
|
|
|
- imageTagAttributes={{
|
|
|
|
- type: 'cube',
|
|
|
|
- tileSize: 512,
|
|
|
|
- multires: true
|
|
|
|
- }}
|
|
|
|
- images={[
|
|
|
|
- {
|
|
|
|
- tiledImageWidth: 2816,
|
|
|
|
- tiledImageHeight: 2816,
|
|
|
|
- url: otherUrl + 'pano/pano3.tiles/%s/l3/%v/l3_%s_%v_%h.jpg'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tiledImageWidth: 1536,
|
|
|
|
- tiledImageHeight: 1536,
|
|
|
|
- url: otherUrl + 'pano/pano3.tiles/%s/l2/%v/l2_%s_%v_%h.jpg'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tiledImageWidth: 768,
|
|
|
|
- tiledImageHeight: 768,
|
|
|
|
- url: otherUrl + 'pano/pano3.tiles/%s/l1/%v/l1_%s_%v_%h.jpg'
|
|
|
|
- }
|
|
|
|
- ]}
|
|
|
|
- >
|
|
|
|
- <View hlookat={180} vlookat={0} fovType='MFOV' fov={120} fovMin={70} fovMax={130} />
|
|
|
|
- {/* 自己在的数据里面添加 字段louType 区分热点位置 1=一楼 2=2楼 3=庭院(字符串) */}
|
|
|
|
- {myData.banquet.hot
|
|
|
|
- .filter(c => c.louType === '2')
|
|
|
|
- .map((item, index) => (
|
|
|
|
- // 热点图标
|
|
|
|
- <HotSpot
|
|
|
|
- key={index}
|
|
|
|
- type='text'
|
|
|
|
- name={item.name}
|
|
|
|
- atv={item.atv}
|
|
|
|
- ath={item.ath}
|
|
|
|
- edge='top'
|
|
|
|
- distorted={true}
|
|
|
|
- scale={1}
|
|
|
|
- bg={false}
|
|
|
|
- onOver={() => setActiveIdx(index)}
|
|
|
|
- onOut={() => setActiveIdx(-1)}
|
|
|
|
- onClick={() => setInd(index)}
|
|
|
|
- // @ts-ignore
|
|
|
|
- // onDown='draggable_hotspot()'
|
|
|
|
- >
|
|
|
|
- <HotIcon
|
|
|
|
- isPano
|
|
|
|
- isModel={item.isModel ? true : false}
|
|
|
|
- key={index}
|
|
|
|
- index={index}
|
|
|
|
- isHoverAc={activeIdx === index}
|
|
|
|
- hoverSrc={item.hoverSrc}
|
|
|
|
- />
|
|
|
|
- </HotSpot>
|
|
|
|
- ))}
|
|
|
|
-
|
|
|
|
- <HotSpot
|
|
|
|
- name='firstFloor'
|
|
|
|
- type='text'
|
|
|
|
- atv={-11.32}
|
|
|
|
- ath={-18.68}
|
|
|
|
- edge='top'
|
|
|
|
- distorted={true}
|
|
|
|
- scale={0.6}
|
|
|
|
- bg={false}
|
|
|
|
- onClick={() => {
|
|
|
|
- history.push('/banquet?r=ren')
|
|
|
|
|
|
+ <KrpanoMiddleware>
|
|
|
|
+ <Krpano className={styles.pano} currentScene={curScene}>
|
|
|
|
+ <Scene
|
|
|
|
+ name='pano3'
|
|
|
|
+ previewUrl={otherUrl + 'pano/pano3.tiles/thumb.jpg'}
|
|
|
|
+ imageTagAttributes={{
|
|
|
|
+ type: 'cube',
|
|
|
|
+ tileSize: 512,
|
|
|
|
+ multires: true
|
|
}}
|
|
}}
|
|
- // @ts-ignore
|
|
|
|
- // onDown='draggable_hotspot()'
|
|
|
|
|
|
+ images={[
|
|
|
|
+ {
|
|
|
|
+ tiledImageWidth: 1152,
|
|
|
|
+ tiledImageHeight: 1152,
|
|
|
|
+ url: otherUrl + 'pano/pano3.tiles/%s/l1/%v/l1_%s_%v_%h.jpg'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ tiledImageWidth: 1152,
|
|
|
|
+ tiledImageHeight: 1152,
|
|
|
|
+ url: otherUrl + 'pano/pano3.tiles/%s/l1/%v/l1_%s_%v_%h.jpg'
|
|
|
|
+ }
|
|
|
|
+ ]}
|
|
>
|
|
>
|
|
- <div className={styles.floorHotspot}>
|
|
|
|
- <img src={FloorHotspotIcon} className={styles.floorHotspotIcon} alt='' />
|
|
|
|
- <span>返回一楼</span>
|
|
|
|
- </div>
|
|
|
|
- </HotSpot>
|
|
|
|
|
|
+ <View hlookat={180} vlookat={0} fovType='MFOV' fov={120} fovMin={70} fovMax={130} />
|
|
|
|
+ {/* 自己在的数据里面添加 字段louType 区分热点位置 1=一楼 2=2楼 3=庭院(字符串) */}
|
|
|
|
+ {myData.banquet.hot
|
|
|
|
+ .filter(c => c.louType === '2')
|
|
|
|
+ .map((item, index) => (
|
|
|
|
+ // 热点图标
|
|
|
|
+ <HotSpot
|
|
|
|
+ key={index}
|
|
|
|
+ type='text'
|
|
|
|
+ name={item.name}
|
|
|
|
+ atv={item.atv}
|
|
|
|
+ ath={item.ath}
|
|
|
|
+ edge='top'
|
|
|
|
+ distorted={true}
|
|
|
|
+ scale={1}
|
|
|
|
+ bg={false}
|
|
|
|
+ onOver={() => setActiveIdx(index)}
|
|
|
|
+ onOut={() => setActiveIdx(-1)}
|
|
|
|
+ onClick={() => setInd(index)}
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ // onDown='draggable_hotspot()'
|
|
|
|
+ >
|
|
|
|
+ <HotIcon
|
|
|
|
+ isPano
|
|
|
|
+ isModel={item.isModel ? true : false}
|
|
|
|
+ key={index}
|
|
|
|
+ index={index}
|
|
|
|
+ isHoverAc={activeIdx === index}
|
|
|
|
+ hoverSrc={item.hoverSrc}
|
|
|
|
+ />
|
|
|
|
+ </HotSpot>
|
|
|
|
+ ))}
|
|
|
|
|
|
- <HotSpot
|
|
|
|
- name='courtyard'
|
|
|
|
- type='text'
|
|
|
|
- atv={-12.8}
|
|
|
|
- ath={135.43}
|
|
|
|
- edge='top'
|
|
|
|
- distorted={true}
|
|
|
|
- scale={0.6}
|
|
|
|
- bg={false}
|
|
|
|
- onClick={() => {
|
|
|
|
- history.replace('/banPano/3')
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- <div className={styles.courtyardHotspot}>
|
|
|
|
- <ArrowLeftOutlined rev={undefined} />
|
|
|
|
- <p>观赏庭院</p>
|
|
|
|
- </div>
|
|
|
|
- </HotSpot>
|
|
|
|
- </Scene>
|
|
|
|
|
|
+ <HotSpot
|
|
|
|
+ name='firstFloor'
|
|
|
|
+ type='text'
|
|
|
|
+ atv={-11.32}
|
|
|
|
+ ath={-18.68}
|
|
|
|
+ edge='top'
|
|
|
|
+ distorted={true}
|
|
|
|
+ scale={0.6}
|
|
|
|
+ bg={false}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ history.push('/banquet?r=ren')
|
|
|
|
+ }}
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ // onDown='draggable_hotspot()'
|
|
|
|
+ >
|
|
|
|
+ <div className={styles.floorHotspot}>
|
|
|
|
+ <img src={FloorHotspotIcon} className={styles.floorHotspotIcon} alt='' />
|
|
|
|
+ <span>返回一楼</span>
|
|
|
|
+ </div>
|
|
|
|
+ </HotSpot>
|
|
|
|
|
|
- <Scene
|
|
|
|
- name='pano4'
|
|
|
|
- previewUrl={otherUrl + 'pano/pano4.tiles/thumb.jpg'}
|
|
|
|
- imageTagAttributes={{
|
|
|
|
- type: 'cube',
|
|
|
|
- tileSize: 512,
|
|
|
|
- multires: true
|
|
|
|
- }}
|
|
|
|
- images={[
|
|
|
|
- {
|
|
|
|
- tiledImageWidth: 2816,
|
|
|
|
- tiledImageHeight: 2816,
|
|
|
|
- url: otherUrl + 'pano/pano4.tiles/%s/l3/%v/l3_%s_%v_%h.jpg'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tiledImageWidth: 1536,
|
|
|
|
- tiledImageHeight: 1536,
|
|
|
|
- url: otherUrl + 'pano/pano4.tiles/%s/l2/%v/l2_%s_%v_%h.jpg'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- tiledImageWidth: 768,
|
|
|
|
- tiledImageHeight: 768,
|
|
|
|
- url: otherUrl + 'pano/pano4.tiles/%s/l1/%v/l1_%s_%v_%h.jpg'
|
|
|
|
- }
|
|
|
|
- ]}
|
|
|
|
- >
|
|
|
|
- <View hlookat={75} vlookat={10} fovType='MFOV' fov={120} fovMin={70} fovMax={130} />
|
|
|
|
|
|
+ <HotSpot
|
|
|
|
+ name='courtyard'
|
|
|
|
+ type='text'
|
|
|
|
+ atv={-12.8}
|
|
|
|
+ ath={135.43}
|
|
|
|
+ edge='top'
|
|
|
|
+ distorted={true}
|
|
|
|
+ scale={0.6}
|
|
|
|
+ bg={false}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ history.replace('/banPano/3')
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ <div className={styles.courtyardHotspot}>
|
|
|
|
+ <ArrowLeftOutlined rev={undefined} />
|
|
|
|
+ <p>观赏庭院</p>
|
|
|
|
+ </div>
|
|
|
|
+ </HotSpot>
|
|
|
|
+ </Scene>
|
|
|
|
|
|
- <HotSpot
|
|
|
|
- name='indoor'
|
|
|
|
- type='text'
|
|
|
|
- atv={1.58}
|
|
|
|
- ath={58.54}
|
|
|
|
- edge='top'
|
|
|
|
- distorted={true}
|
|
|
|
- scale={0.6}
|
|
|
|
- bg={false}
|
|
|
|
- onClick={() => {
|
|
|
|
- history.replace('/banPano/2')
|
|
|
|
|
|
+ <Scene
|
|
|
|
+ name='pano4'
|
|
|
|
+ previewUrl={otherUrl + 'pano/pano4.tiles/thumb.jpg'}
|
|
|
|
+ imageTagAttributes={{
|
|
|
|
+ type: 'cube',
|
|
|
|
+ tileSize: 512,
|
|
|
|
+ multires: true
|
|
}}
|
|
}}
|
|
|
|
+ images={[
|
|
|
|
+ {
|
|
|
|
+ tiledImageWidth: 1152,
|
|
|
|
+ tiledImageHeight: 1152,
|
|
|
|
+ url: otherUrl + 'pano/pano4.tiles/%s/l1/%v/l1_%s_%v_%h.jpg'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ tiledImageWidth: 1152,
|
|
|
|
+ tiledImageHeight: 1152,
|
|
|
|
+ url: otherUrl + 'pano/pano4.tiles/%s/l1/%v/l1_%s_%v_%h.jpg'
|
|
|
|
+ }
|
|
|
|
+ ]}
|
|
>
|
|
>
|
|
- <div className={styles.indoorHotspot}>
|
|
|
|
- <p>返回室内</p>
|
|
|
|
- </div>
|
|
|
|
- </HotSpot>
|
|
|
|
- </Scene>
|
|
|
|
- </Krpano>
|
|
|
|
|
|
+ <View hlookat={75} vlookat={10} fovType='MFOV' fov={120} fovMin={70} fovMax={130} />
|
|
|
|
+
|
|
|
|
+ <HotSpot
|
|
|
|
+ name='indoor'
|
|
|
|
+ type='text'
|
|
|
|
+ atv={1.58}
|
|
|
|
+ ath={58.54}
|
|
|
|
+ edge='top'
|
|
|
|
+ distorted={true}
|
|
|
|
+ scale={0.6}
|
|
|
|
+ bg={false}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ history.replace('/banPano/2')
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ <div className={styles.indoorHotspot}>
|
|
|
|
+ <p>返回室内</p>
|
|
|
|
+ </div>
|
|
|
|
+ </HotSpot>
|
|
|
|
+ </Scene>
|
|
|
|
+ </Krpano>
|
|
|
|
|
|
- {/* 右下角按钮 */}
|
|
|
|
- <FloorBtn />
|
|
|
|
|
|
+ {/* 右下角按钮 */}
|
|
|
|
+ <FloorBtn />
|
|
|
|
|
|
- {ind === -1 ? null : (
|
|
|
|
- <Hot2 data={data} closeFu={() => setInd(-1)} name={myData.banquet.hot[ind].name} />
|
|
|
|
- )}
|
|
|
|
|
|
+ {ind === -1 ? null : (
|
|
|
|
+ <Hot2 data={data} closeFu={() => setInd(-1)} name={myData.banquet.hot[ind].name} />
|
|
|
|
+ )}
|
|
|
|
+ </KrpanoMiddleware>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|