|
@@ -4,6 +4,8 @@ import styles from './index.module.scss'
|
|
|
import xiaImg from '@/assets/img/jiantou_w.png'
|
|
|
import classNames from 'classnames'
|
|
|
import { MyList1Type, MyObjRowType } from './data'
|
|
|
+import { urlParameter } from '@/utils/history'
|
|
|
+import { kankanImgUrl, panoSomeData } from '@/utils/urlRes'
|
|
|
|
|
|
type Props = {
|
|
|
setTopObj: (val: MyObjRowType) => void
|
|
@@ -29,10 +31,19 @@ function Bottom({ setTopObj, pageKey }: Props) {
|
|
|
const [myList1, setMyList1] = useState([] as MyList1Type[])
|
|
|
|
|
|
useEffect(() => {
|
|
|
- if (myList1[0] && myList1[0].children && myList1[0].children[0]) setAc1(myList1[0].children[0])
|
|
|
+ if (myList1[0] && myList1[0].children && myList1[0].children[0]) {
|
|
|
+ const urlObj = urlParameter(window.location.href)
|
|
|
+ if (urlObj.type) {
|
|
|
+ // 有参数
|
|
|
+ const acObj = myList1.find(v => v.id + '' === urlObj.type)
|
|
|
+ acObj && setAc1(acObj.children[0])
|
|
|
+ } else setAc1(myList1[0].children[0])
|
|
|
+ }
|
|
|
}, [myList1])
|
|
|
|
|
|
const getInfoFu = useCallback((data: any) => {
|
|
|
+ // 待完善,里面的所有数据待本地化之后 替换字符串
|
|
|
+
|
|
|
const myList1Temp = data.catalogRoot
|
|
|
|
|
|
const myObjTemp: any = {}
|
|
@@ -57,8 +68,7 @@ function Bottom({ setTopObj, pageKey }: Props) {
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (pageKey === '室外') {
|
|
|
- // 待完善路径
|
|
|
- fetch(`https://4dkk.4dage.com/720yun_fd_manage/${WKID}/someData.json`)
|
|
|
+ fetch(panoSomeData)
|
|
|
.then(res => {
|
|
|
return res.json()
|
|
|
})
|
|
@@ -125,22 +135,14 @@ function Bottom({ setTopObj, pageKey }: Props) {
|
|
|
key={item.id}
|
|
|
className={classNames(code === item.sceneCode ? 'activeTxt' : '')}
|
|
|
>
|
|
|
- {/* 图片路径待完善 */}
|
|
|
-
|
|
|
- <img
|
|
|
- src={
|
|
|
- item.type === 'kk'
|
|
|
- ? `https://4dkk.4dage.com/scene_view_data/${item.sceneCode}/user/thumb-2k.jpg`
|
|
|
- : item.icon
|
|
|
- }
|
|
|
- alt=''
|
|
|
- />
|
|
|
+ {/* 图片路径 */}
|
|
|
+ <img src={item.type === 'kk' ? kankanImgUrl(item.sceneCode) : item.icon} alt='' />
|
|
|
|
|
|
{/* 用图片懒加载,点击向下按钮之后 会有图片直接不加载的问题 */}
|
|
|
{/* <LazyImg
|
|
|
src={
|
|
|
item.type === 'kk'
|
|
|
- ? `https://4dkk.4dage.com/scene_view_data/${item.sceneCode}/user/thumb-2k.jpg`
|
|
|
+ ? kankanImgUrl(item.sceneCode)
|
|
|
: item.icon
|
|
|
}
|
|
|
/> */}
|