shaogen1995 1 hete
szülő
commit
760818eea4
3 módosított fájl, 12 hozzáadás és 2 törlés
  1. 10 0
      src/pages/A0base/index.tsx
  2. 1 1
      src/pages/A6ybwx/index.tsx
  3. 1 1
      src/pages/A7wjwj/index.tsx

+ 10 - 0
src/pages/A0base/index.tsx

@@ -21,6 +21,16 @@ function A0base() {
 
   const [currentBase, setCurrentBase] = useState(0)
 
+  // 从二三单元返回
+  useEffect(() => {
+    const urlAll = window.location.href
+
+    if (urlAll.includes('?t=')) {
+      const urlT = urlAll.split('?t=')[1]
+      if (urlT) setCurrentBase(Number(urlT))
+    }
+  }, [])
+
   const [isOpenInteract, setIsOpenInteract] = useState(false)
 
   const goto = (e: React.MouseEvent, path: string) => {

+ 1 - 1
src/pages/A6ybwx/index.tsx

@@ -106,7 +106,7 @@ function A6ybwx() {
       <div
         className='back'
         onClick={() => {
-          window.location.replace('#/base')
+          window.location.replace('#/base?t=1')
         }}
       >
         <img src={require('@/assets/img/btn_back.png')} alt='' />

+ 1 - 1
src/pages/A7wjwj/index.tsx

@@ -21,7 +21,7 @@ function A7Wjwj() {
   const gotoBack = () => {
     const flag = tab2Ref.current?.sonGetStaFu()
     if (flag) tab2Ref.current?.sonSetStaFu()
-    else window.location.replace('#/base')
+    else window.location.replace('#/base?t=2')
   }
 
   // 监听unity是否被销毁了