|
@@ -3,9 +3,10 @@ import styles from './index.module.scss'
|
|
import { useParams } from 'react-router-dom'
|
|
import { useParams } from 'react-router-dom'
|
|
import { isPc, myData, otherUrl } from '@/utils/http'
|
|
import { isPc, myData, otherUrl } from '@/utils/http'
|
|
import { VisitHotDataType } from '@/types'
|
|
import { VisitHotDataType } from '@/types'
|
|
-import Hot1 from '../A2visit/PanoVideo/Hot1'
|
|
|
|
import Hot2 from '../A2visit/PanoVideo/Hot2'
|
|
import Hot2 from '../A2visit/PanoVideo/Hot2'
|
|
import history from '@/utils/history'
|
|
import history from '@/utils/history'
|
|
|
|
+import ZHot0 from '@/components/ZHot0'
|
|
|
|
+import Zhot from '@/components/Zhot'
|
|
|
|
|
|
const obj = {
|
|
const obj = {
|
|
1: {
|
|
1: {
|
|
@@ -31,18 +32,18 @@ function C1unity() {
|
|
|
|
|
|
const temp = Reflect.get(obj, urlObj.id)
|
|
const temp = Reflect.get(obj, urlObj.id)
|
|
|
|
|
|
- console.log(123, temp)
|
|
|
|
|
|
+ // console.log(123, temp)
|
|
|
|
|
|
const res = Reflect.get(temp, isPc ? 'pc' : 'mo')
|
|
const res = Reflect.get(temp, isPc ? 'pc' : 'mo')
|
|
|
|
|
|
setUrl(`${otherUrl + res}?T=${Date.now()}`)
|
|
setUrl(`${otherUrl + res}?T=${Date.now()}`)
|
|
|
|
|
|
// 注册
|
|
// 注册
|
|
- window.unityOpenHot = (index: number) => {
|
|
|
|
|
|
+ window.unityOpenHot = name => {
|
|
const rootDom: HTMLDivElement = document.querySelector('#root')!
|
|
const rootDom: HTMLDivElement = document.querySelector('#root')!
|
|
if (rootDom) rootDom.style.zIndex = '3'
|
|
if (rootDom) rootDom.style.zIndex = '3'
|
|
// 打开热点
|
|
// 打开热点
|
|
- setInd(Number(index))
|
|
|
|
|
|
+ setAcName(name)
|
|
}
|
|
}
|
|
|
|
|
|
window.unityBack = () => {
|
|
window.unityBack = () => {
|
|
@@ -52,19 +53,8 @@ function C1unity() {
|
|
}
|
|
}
|
|
}, [urlObj.id])
|
|
}, [urlObj.id])
|
|
|
|
|
|
- // 打开热点的索引
|
|
|
|
- const [ind, setInd] = useState(-1)
|
|
|
|
-
|
|
|
|
- const data = useMemo(() => {
|
|
|
|
- let arr: VisitHotDataType = []
|
|
|
|
- if (ind !== -1) {
|
|
|
|
- const data1 = myData.visit.hot
|
|
|
|
- const data2 = myData.banquet.hot
|
|
|
|
- arr = urlId === '1' ? data1[ind].data : data2[ind].data
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return arr
|
|
|
|
- }, [ind, urlId])
|
|
|
|
|
|
+ // 热点名字-打开热点
|
|
|
|
+ const [acName, setAcName] = useState('')
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (url && isPc) {
|
|
if (url && isPc) {
|
|
@@ -90,26 +80,26 @@ function C1unity() {
|
|
<iframe className='C1unity' frameBorder='none' title='漫游' src={url}></iframe>
|
|
<iframe className='C1unity' frameBorder='none' title='漫游' src={url}></iframe>
|
|
) : null}
|
|
) : null}
|
|
|
|
|
|
- {ind === -1 ? null : ind === 0 && urlId === '1' ? (
|
|
|
|
- <Hot1
|
|
|
|
- data={data}
|
|
|
|
- closeFu={() => {
|
|
|
|
- const rootDom: HTMLDivElement = document.querySelector('#root')!
|
|
|
|
- if (rootDom) rootDom.style.zIndex = '1'
|
|
|
|
- setInd(-1)
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- ) : (
|
|
|
|
- <Hot2
|
|
|
|
- data={data}
|
|
|
|
- closeFu={() => {
|
|
|
|
- const rootDom: HTMLDivElement = document.querySelector('#root')!
|
|
|
|
- if (rootDom) rootDom.style.zIndex = '1'
|
|
|
|
- setInd(-1)
|
|
|
|
- }}
|
|
|
|
- name={myData[urlId === '1' ? 'visit' : 'banquet'].hot[ind].name}
|
|
|
|
- />
|
|
|
|
- )}
|
|
|
|
|
|
+ {acName ? (
|
|
|
|
+ acName === '周礼九拜' ? (
|
|
|
|
+ <ZHot0
|
|
|
|
+ closeFu={() => {
|
|
|
|
+ const rootDom: HTMLDivElement = document.querySelector('#root')!
|
|
|
|
+ if (rootDom) rootDom.style.zIndex = '1'
|
|
|
|
+ setAcName('')
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ ) : (
|
|
|
|
+ <Zhot
|
|
|
|
+ name={acName}
|
|
|
|
+ closeFu={() => {
|
|
|
|
+ const rootDom: HTMLDivElement = document.querySelector('#root')!
|
|
|
|
+ if (rootDom) rootDom.style.zIndex = '1'
|
|
|
|
+ setAcName('')
|
|
|
|
+ }}
|
|
|
|
+ />
|
|
|
|
+ )
|
|
|
|
+ ) : null}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|