shaogen1995 před 9 měsíci
rodič
revize
ffd43304ea

+ 1 - 1
Code/public/myData/myData.js

@@ -3,7 +3,7 @@ window.isHH = document.documentElement.clientWidth >= document.documentElement.c
 const isPcTemp = document.documentElement.clientWidth >= 1200
 
 // 本地开发静态资源目录
-const baseUrlLoc = 'http://192.168.0.18:8081/staticData/'
+const baseUrlLoc = ' http://192.168.20.55:8080/staticData/'
 
 const myBaseUrl = 'https://houseoss.4dkankan.com/project/henan/'
 

+ 76 - 72
Code/src/pages/A2visit2/index.tsx

@@ -35,7 +35,7 @@ function A2visit2() {
   const videoRef = useRef<HTMLVideoElement>(null)
 
   //  进入院落 全景图显示
-  const [panoShow, setPanoShow] = useState(false)
+  const [panoShow, setPanoShow] = useState(window.location.href.includes('?v=v2') ? true : false)
 
   // 点击进入室内
   const [toShi, setToShi] = useState(false)
@@ -47,80 +47,82 @@ function A2visit2() {
 
   return (
     <div className={styles.A2visit2}>
-      <div
-        className='A22imgBox'
-        style={{ opacity: panoShow ? '0' : '1', pointerEvents: panoShow ? 'none' : 'auto' }}
-      >
-        {/* 底部按钮 */}
+      {window.location.href.includes('?v=v2') ? null : (
         <div
-          className='A22btn'
-          style={{
-            opacity: loding < 100 ? '0' : '1',
-            pointerEvents: loding < 100 ? 'none' : 'auto'
-          }}
+          className='A22imgBox'
+          style={{ opacity: panoShow ? '0' : '1', pointerEvents: panoShow ? 'none' : 'auto' }}
         >
-          {myData.visit2.btnArr.map((item, index) => (
-            <div
-              onClick={() => {
-                setBtnAc(item)
-                setVideoPlay(true)
+          {/* 底部按钮 */}
+          <div
+            className='A22btn'
+            style={{
+              opacity: loding < 100 ? '0' : '1',
+              pointerEvents: loding < 100 ? 'none' : 'auto'
+            }}
+          >
+            {myData.visit2.btnArr.map((item, index) => (
+              <div
+                onClick={() => {
+                  setBtnAc(item)
+                  setVideoPlay(true)
+                  setTimeout(() => {
+                    if (videoRef.current) videoRef.current.play()
+                  }, 100)
+                }}
+                key={index}
+                className='A22btnRow'
+                style={{
+                  backgroundImage: `url(${baseURL}plow/left${btnAc === item ? 'Ac' : ''}.png)`,
+                  color: btnAc === item ? '#BD7656' : '#DACB8B'
+                }}
+              >
+                {item}
+              </div>
+            ))}
+          </div>
+
+          {loding >= 100 ? (
+            // 进入院落
+            <NextPage
+              clickSon={() => {
+                setPanoShow(true)
                 setTimeout(() => {
-                  if (videoRef.current) videoRef.current.play()
-                }, 100)
-              }}
-              key={index}
-              className='A22btnRow'
-              style={{
-                backgroundImage: `url(${baseURL}plow/left${btnAc === item ? 'Ac' : ''}.png)`,
-                color: btnAc === item ? '#BD7656' : '#DACB8B'
+                  domDelOwnFu('.A22imgBox')
+                }, 500)
               }}
-            >
-              {item}
-            </div>
-          ))}
-        </div>
+              txt='进入院落'
+            />
+          ) : null}
 
-        {loding >= 100 ? (
-          // 进入院落
-          <NextPage
-            clickSon={() => {
-              setPanoShow(true)
-              setTimeout(() => {
-                domDelOwnFu('.A22imgBox')
-              }, 500)
-            }}
-            txt='进入院落'
-          />
-        ) : null}
+          {/* 3个视频 */}
+          <div className='A22videoBox' style={{ zIndex: videoPlay ? '2' : '0' }}>
+            {myData.visit2.btnArr.map((item, index) => (
+              <div key={index} className='A22video' style={{ opacity: btnAc === item ? 1 : 0 }}>
+                <video
+                  ref={btnAc === item ? videoRef : null}
+                  playsInline
+                  muted
+                  webkit-playsinline='true'
+                  x5-video-player-type='h5'
+                  onEnded={() => setVideoPlay(false)}
+                >
+                  <source type='video/mp4' src={`${baseURL}visit2/${item}.mp4`} />
+                  Your browser does not support the video tag.
+                </video>
+              </div>
+            ))}
+          </div>
 
-        {/* 3个视频 */}
-        <div className='A22videoBox' style={{ zIndex: videoPlay ? '2' : '0' }}>
-          {myData.visit2.btnArr.map((item, index) => (
-            <div key={index} className='A22video' style={{ opacity: btnAc === item ? 1 : 0 }}>
-              <video
-                ref={btnAc === item ? videoRef : null}
-                playsInline
-                muted
-                webkit-playsinline='true'
-                x5-video-player-type='h5'
-                onEnded={() => setVideoPlay(false)}
-              >
-                <source type='video/mp4' src={`${baseURL}visit2/${item}.mp4`} />
-                Your browser does not support the video tag.
-              </video>
+          {/* 加载进度条 */}
+          {loding >= 100 ? null : (
+            <div className='A22xian'>
+              <div>
+                <div style={{ width: loding + '%' }}></div>
+              </div>
             </div>
-          ))}
+          )}
         </div>
-
-        {/* 加载进度条 */}
-        {loding >= 100 ? null : (
-          <div className='A22xian'>
-            <div>
-              <div style={{ width: loding + '%' }}></div>
-            </div>
-          </div>
-        )}
-      </div>
+      )}
 
       {/* 右下角按钮 */}
       <FloorBtn
@@ -133,11 +135,13 @@ function A2visit2() {
         }
       />
 
-      <CatVideo
-        isShow={panoShow}
-        src={baseURL + myData.visit2.进入院落}
-        parentFu={() => domDelOwnFu('#CatVideo')}
-      />
+      {window.location.href.includes('?v=v2') ? null : (
+        <CatVideo
+          isShow={panoShow}
+          src={baseURL + myData.visit2.进入院落}
+          parentFu={() => domDelOwnFu('#CatVideo')}
+        />
+      )}
 
       {/* 全景图页面 */}
       {window.location.href.includes('r=ren') ? null : (

+ 5 - 1
Code/src/pages/A3banPano/index.tsx

@@ -8,6 +8,7 @@ import Hot2 from '../A2visit/PanoVideo/Hot2'
 import history from '@/utils/history'
 import FloorHotspotIcon from '@/assets/img/icon-flo-1.png'
 import { ArrowLeftOutlined } from '@ant-design/icons'
+import FloorBtn from '@/components/FloorBtn'
 // import { myData } from '@/utils/http'
 
 window.draggbleHotspotEvent = (ath: number, atv: number) => {
@@ -102,7 +103,7 @@ function A3banPano() {
             scale={0.6}
             bg={false}
             onClick={() => {
-              history.push('/banquet')
+              history.push('/banquet?r=ren')
             }}
             // @ts-ignore
             // onDown='draggable_hotspot()'
@@ -176,6 +177,9 @@ function A3banPano() {
         </Scene>
       </Krpano>
 
+      {/* 右下角按钮 */}
+      <FloorBtn />
+
       {ind === -1 ? null : (
         <Hot2 data={data} closeFu={() => setInd(-1)} name={myData.banquet.hot[ind].name} />
       )}

+ 14 - 12
Code/src/pages/A3banquet/index.tsx

@@ -38,17 +38,19 @@ function A3banquet() {
   return (
     <div className={styles.A3banquet}>
       {/* 初始静态图 */}
-      <BaseImg
-        isShow={cutVideoShow}
-        iconSrc={`${baseURL}banquet/mulu.png`}
-        parentFu={() => btnStart()}
-        bgImg={`${baseURL}${myData.banquet.bgImg}`}
-        imgNow={imgNow}
-        imgNumFu={imgNumFu}
-      />
+      {window.location.href.includes('?r=ren') ? null : (
+        <BaseImg
+          isShow={cutVideoShow}
+          iconSrc={`${baseURL}banquet/mulu.png`}
+          parentFu={() => btnStart()}
+          bgImg={`${baseURL}${myData.banquet.bgImg}`}
+          imgNow={imgNow}
+          imgNumFu={imgNumFu}
+        />
+      )}
 
       {/* 过度动画页面 */}
-      {imgNow ? (
+      {imgNow && !window.location.href.includes('?r=ren') ? (
         <CatVideo
           isShow={cutVideoShow}
           src={baseURL + myData.banquet.videos[0]}
@@ -57,7 +59,7 @@ function A3banquet() {
       ) : null}
 
       {/* 全景图 */}
-      {imgNow ? (
+      {imgNow || window.location.href.includes('?r=ren') ? (
         <div className={classNames('pvBox', cutVideoShow ? '' : 'pvBoxShow')}>
           <PanoImg />
           {/* 跳到下一章 */}
@@ -69,7 +71,7 @@ function A3banquet() {
       ) : null}
 
       {/* 游戏弹窗 */}
-      {imgNow ? (
+      {imgNow || window.location.href.includes('?r=ren') ? (
         <div className={classNames('A3gameBox', gameShow ? 'A3gameBoxShow' : '')}>
           <div className='A3gtit'>请选择游戏</div>
           <div className='A3grow1' onClick={() => history.push('/unend/game1')}>
@@ -85,7 +87,7 @@ function A3banquet() {
       ) : null}
 
       {/* 结尾动画 */}
-      {imgNow ? (
+      {imgNow || window.location.href.includes('?r=ren') ? (
         <EndVideo
           lastVideo={lastVideo}
           delDom='.pvBox'

+ 11 - 5
Code/src/pages/A6plow/index.tsx

@@ -1,4 +1,4 @@
-import React, { useCallback, useMemo, useState } from 'react'
+import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import styles from './index.module.scss'
 import BaseImg from '@/components/BaseImg'
 import { baseURL, isPc, myData } from '@/utils/http'
@@ -35,9 +35,7 @@ function A6plow() {
   // 点击继续
   const btnStart = useCallback(() => {
     setCutVideoShow(true)
-    // 播放第一个整地的视频
-    videoPlayFu(0)
-  }, [videoPlayFu])
+  }, [])
 
   // 点击 跳下一个章节
   const [lastVideo, setLastVideo] = useState(false)
@@ -67,6 +65,10 @@ function A6plow() {
   // 蔬菜-庄家切换
   const [staCut, setStaCut] = useState('蔬菜')
 
+  useEffect(() => {
+    setLeftAc(4)
+  }, [staCut])
+
   // 切换底部的时候播放视频
   const [btnVideo, setBtnVideo] = useState('')
 
@@ -101,7 +103,7 @@ function A6plow() {
       <div
         className='A6SS'
         hidden={staCut !== '蔬菜'}
-        style={{ backgroundImage: `url(${baseURL}plow/sBg.jpg)` }}
+        style={{ backgroundImage: `url(${baseURL}plow/bg.jpg)` }}
       >
         {/* 热点 */}
         {myData.plow.isSSSArr.map((v: PlowHotType, i) => (
@@ -153,6 +155,10 @@ function A6plow() {
               onClick={() => {
                 setStaCut(v)
                 setBtnVideo(v)
+
+                // 每次切换都是播放第4个视频
+                leftAcFu(4)
+
                 setTimeout(() => {
                   const domAll: any = document.querySelectorAll('.A6videoBoxsss video')
                   if (domAll && domAll.length) {

+ 3 - 0
Code/src/pages/C2unityEnd/index.tsx

@@ -60,8 +60,11 @@ function C2unityEnd() {
 
   useEffect(() => {
     window.unityBack = () => {
+      console.log('从unity点击返回')
+
       // 退出
       if (window.location.href.includes('r=ren')) history.replace('/more?r=ren')
+      else if (window.location.href.includes('v=v2')) history.replace('/visit2?v=v2')
       else history.go(-1)
     }
   }, [])

binární
资源/staticData/more/ren/xunYe.jpg


binární
资源/staticData/plow/bg.jpg


binární
资源/staticData/plow/sBg.jpg