Просмотр исходного кода

Merge branch 'master' of http://192.168.0.115:3000/lanxin/gmlx into master

shaogen1995 5 дней назад
Родитель
Сommit
8af57dd8f9

+ 43 - 40
pano/src/components/Pano/index.tsx

@@ -16,7 +16,7 @@ interface ISceneProps extends Partial<SceneProps> {
 }
 
 const Panoramic = ({ openHot }: { openHot: (id: string) => void }) => {
-  const [currentScene, setCurrentScene] = useState('p1')
+  const [currentScene, setCurrentScene] = useState('p6')
   window.setCurrentScene = (name: string) => {
     setCurrentScene(name)
   }
@@ -25,7 +25,7 @@ const Panoramic = ({ openHot }: { openHot: (id: string) => void }) => {
   const [hotspotHover, setHotspotHover] = useState(false)
   useEffect(() => {
     window.draggbleHotspotEvent = (ath: number, atv: number) => {
-      console.log(`ath: ${ath}, atv: ${atv}`)
+      console.log(`atv: ${atv}, ath: ${ath}`)
     }
   }, [])
 
@@ -86,15 +86,14 @@ const Panoramic = ({ openHot }: { openHot: (id: string) => void }) => {
               // onOut={() => setHotspotHover(false)}
               // onDown='draggable_hotspot()'
               onClick={() => {
-                setCurrentScene('p2')
-                if (window.parent) {
-                  console.log('setIsHotPano')
-                  window.parent.window.setIsHotPano(true)
+                    if (window.parent) {
+                      console.log('setIsHotPano')
+                  window.parent.window.gotoScene()
                 }
               }}
             >
               <div className='A0hotspot'>
-                <div className='text'>建筑名称</div>
+                <div className='text'>革命领袖视察黑龙江纪念馆</div>
               </div>
             </HotSpot>
           </>
@@ -394,40 +393,44 @@ const Panoramic = ({ openHot }: { openHot: (id: string) => void }) => {
         ],
         children: (
           <>
-            <View
-              hlookat={0}
-              vlookat={40}
-              fovType='MFOV'
-              fov={120}
-              maxPixelZoom={2}
-              fovMin={70}
-              fovMax={180}
-              limitView='range'
-              vlookatMax={90}
-              vlookatMin={-55}
-            />
+          <View
+            hlookat={0}
+            vlookat={40}
+            fovType='MFOV'
+            fov={120}
+            maxPixelZoom={2}
+            fovMin={70}
+            fovMax={180}
+            limitView='range'
+            vlookatMax={90}
+            vlookatMin={-55}
+          />
 
-            <HotSpot
-              name='dccgftTitle'
-              type='text'
-              atv={25.83}
-              ath={-1.08}
-              scale={0.5}
-              edge='top'
-              bg={false}
-              distorted={true}
-              onOver={() => {}}
-              // onHover={() => setHotspotHover(true)}
-              // onOut={() => setHotspotHover(false)}
-              // onDown='draggable_hotspot()'
-              onClick={() => {
-                console.log('click')
-                openHot('hot1')
-              }}
-            >
-              <div className='A1hotspot' />
-            </HotSpot>
-          </>
+          <HotSpot
+            name='dccgftTitle'
+            type='text'
+            atv={18.25}
+            ath={2.62}
+            scale={0.5}
+            edge='top'
+            bg={false}
+            distorted={true}
+            onOver={() => {}}
+            // onHover={() => setHotspotHover(true)}
+            // onOut={() => setHotspotHover(false)}
+            // onDown='draggable_hotspot()'
+            onClick={() => {
+                  if (window.parent) {
+                    console.log('setIsHotPano')
+                window.parent.window.gotoScene()
+              }
+            }}
+          >
+            <div className='A0hotspot'>
+              <div className='text'>革命领袖视察黑龙江纪念馆</div>
+            </div>
+          </HotSpot>
+        </>
         )
       },
       {

+ 1 - 1
pano/src/types/function.d.ts

@@ -1,7 +1,7 @@
 // 全局方法
 declare global {
   interface Window {
-    setIsHotPano: (isHotPano: boolean) => void
+    gotoScene: () => void
     setActiveHotId: (id: string) => void
     setCurrentScene: (name: string) => void
   }

+ 15 - 18
project/src/pages/A1home/index.tsx

@@ -1,15 +1,13 @@
 import React, { useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import MenuSider from '@/components/MenuSider'
-import { callIframeFu } from '@/utils/history'
+import history, { callIframeFu } from '@/utils/history'
 import PanoHot from './PanoHot'
 import { baseOssUrl } from '@/utils/http'
 function A1home() {
   const [isOpenPano, setIsOpenPano] = useState(false)
   const [isShowDetail, setIsShowDetail] = useState(false)
   const [currentSceneIndex, setCurrentSceneIndex] = useState(0)
-  // 是否进入二级页面
-  const [isHotPano, setIsHotPano] = useState(false)
   const [activeIndex, setActiveIndex] = useState(-1)
 
   const scrollRef = useRef<HTMLDivElement>(null)
@@ -18,8 +16,8 @@ function A1home() {
   const totalScenes = sceneList.length
 
   useEffect(() => {
-    window.setIsHotPano = (isHotPano: boolean) => {
-      setIsHotPano(isHotPano)
+    window.gotoScene = () => {
+      history.push('/scene')
     }
     window.setActiveHotId = (id: string) => {
       console.log('setActiveHotId222', id)
@@ -117,23 +115,22 @@ function A1home() {
         <>
           <iframe
             id='panoIframe'
-           src='https://houseoss.4dkankan.com/project/gmlx/Pano/index.html'
+            src='https://houseoss.4dkankan.com/project/gmlx/Pano/index.html'
             title='pono'
           ></iframe>
           {activeIndex !== -1 && (
             <PanoHot activeIndex={activeIndex} setActiveIndex={setActiveIndex} />
           )}
-          {/* 详情按钮-只在二级页面显示 */}
-          {isHotPano && (
-            <div className={styles.skipBtn} onClick={() => setIsShowDetail(!isShowDetail)}>
-              <img
-                src={require(`@/assets/img/${isShowDetail ? 'detail_ac' : 'detail'}.png`)}
-                alt=''
-              />
-            </div>
-          )}
+
+          {/* <div className={styles.skipBtn} onClick={() => setIsShowDetail(!isShowDetail)}>
+            <img
+              src={require(`@/assets/img/${isShowDetail ? 'detail_ac' : 'detail'}.png`)}
+              alt=''
+            />
+          </div> */}
+
           {/* 场景列表=由详情按钮控制 */}
-          <div className={`${styles.detailContent} ${isShowDetail ? 'show' : ''}`}>
+          {/* <div className={`${styles.detailContent} ${isShowDetail ? 'show' : ''}`}>
             <img
               className={styles.arrowLeft}
               src={require(`@/assets/img/arrow_left.png`)}
@@ -160,7 +157,7 @@ function A1home() {
               alt=''
               onClick={handleNext}
             />
-          </div>
+          </div> */}
         </>
       ) : (
         <>
@@ -172,7 +169,7 @@ function A1home() {
             muted
             className={styles.bgVideo}
           /> */}
-          <div className="baseVideo"></div>
+          <div className='baseVideo'></div>
 
           {/* 跳过按钮 */}
           <div className={styles.skipBtn} onClick={() => setIsOpenPano(true)}>

+ 13 - 12
project/src/pages/A1homeM/index.tsx

@@ -1,22 +1,20 @@
 import React, { useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
-import { callIframeFu } from '@/utils/history'
+import history, { callIframeFu } from '@/utils/history'
 import PanoHot from './PanoHot'
 import { baseOssUrl } from '@/utils/http'
 import TopBarM from '@/components/TopBarM'
 function A1home() {
   const [isShowDetail, setIsShowDetail] = useState(false)
   const [currentSceneIndex, setCurrentSceneIndex] = useState(0)
-  // 是否进入二级页面
-  const [isHotPano, setIsHotPano] = useState(false)
   const [activeIndex, setActiveIndex] = useState(-1)
 
   const scrollRef = useRef<HTMLDivElement>(null)
   const sceneList = myDataTemp.sceneList
 
   useEffect(() => {
-    window.setIsHotPano = (isHotPano: boolean) => {
-      setIsHotPano(isHotPano)
+    window.gotoScene = () => {
+      history.push('/scene')
     }
     window.setActiveHotId = (id: string) => {
       console.log('setActiveHotId222', id)
@@ -49,13 +47,16 @@ function A1home() {
       ></iframe>
       {activeIndex !== -1 && <PanoHot activeIndex={activeIndex} setActiveIndex={setActiveIndex} />}
       {/* 详情按钮-只在二级页面显示 */}
-      {isHotPano && (
-        <div className={`${styles.skipBtn} ${isShowDetail ? styles.skipBtnAc : ''}`} onClick={() => setIsShowDetail(!isShowDetail)}>
-          <img src={require(`@/assets/img/${isShowDetail ? 'detail_ac' : 'detail'}.png`)} alt='' />
-        </div>
-      )}
+
+      {/* <div
+        className={`${styles.skipBtn} ${isShowDetail ? styles.skipBtnAc : ''}`}
+        onClick={() => setIsShowDetail(!isShowDetail)}
+      >
+        <img src={require(`@/assets/img/${isShowDetail ? 'detail_ac' : 'detail'}.png`)} alt='' />
+      </div> */}
+
       {/* 场景列表=由详情按钮控制 */}
-      <div className={`${styles.detailContent} ${isShowDetail ? 'show' : ''}`}>
+      {/* <div className={`${styles.detailContent} ${isShowDetail ? 'show' : ''}`}>
         <div ref={scrollRef} className={styles.scroll} onWheel={handleWheel}>
           <div className={styles.detailItemC}>
             {sceneList.map((item, index) => (
@@ -70,7 +71,7 @@ function A1home() {
             ))}
           </div>
         </div>
-      </div>
+      </div> */}
       <TopBarM />
     </div>
   )

+ 8 - 2
project/src/pages/A6life/Record/index.tsx

@@ -4,15 +4,21 @@ import Zvideo from '@/components/Zvideo'
 import Zback from '@/components/Zback'
 function Record({
   activeIndex,
-  setActiveIndex
+  setActiveIndex,
+  setIsShowIntro
 }: {
   activeIndex: number
   setActiveIndex: (index: number) => void
+  setIsShowIntro: (isShow: boolean) => void
 }) {
   return (
     <div className={styles.Record}>
       <Zvideo src={myDataTemp.lifeList[activeIndex].videoSrc || ''} />
-      <Zback onBack={() => setActiveIndex(activeIndex - 1)} />
+      <Zback
+        onBack={() => {
+          setIsShowIntro(false)
+        }}
+      />
     </div>
   )
 }

+ 16 - 3
project/src/pages/A6life/index.tsx

@@ -11,9 +11,16 @@ function A6life() {
   return (
     <div className={styles.A6life}>
       <div className={styles.lifeContent}>
-       
         <div className={styles.top}>
-          {isShowIntro ? <Intro activeIndex={activeIndex} setIsShowIntro={setIsShowIntro}/> : <SwiperComponent activeIndex={activeIndex} setActiveIndex={setActiveIndex} setIsShowIntro={setIsShowIntro}/>}
+          {isShowIntro && activeIndex !== lifeList.length - 1 ? (
+            <Intro activeIndex={activeIndex} setIsShowIntro={setIsShowIntro} />
+          ) : (
+            <SwiperComponent
+              activeIndex={activeIndex}
+              setActiveIndex={setActiveIndex}
+              setIsShowIntro={setIsShowIntro}
+            />
+          )}
         </div>
         <div className={styles.bottom}>
           <div className={styles.timeline}>
@@ -54,7 +61,13 @@ function A6life() {
 
         <MenuSider isSidebarOpen={false} />
       </div>
-      {activeIndex===lifeList.length-1 ? <Record activeIndex={activeIndex} setActiveIndex={setActiveIndex}/> : null}
+      {activeIndex === lifeList.length - 1 && isShowIntro ? (
+        <Record
+          activeIndex={activeIndex}
+          setActiveIndex={setActiveIndex}
+          setIsShowIntro={setIsShowIntro}
+        />
+      ) : null}
     </div>
   )
 }

+ 1 - 1
project/src/types/function.d.ts

@@ -1,7 +1,7 @@
 // 全局方法
 declare global {
   interface Window {
-    setIsHotPano: (isHotPano: boolean) => void
+    gotoScene: () => void
     setActiveHotId: (id: string) => void
     sceneBack: () => void
   }