shaogen1995 4 hafta önce
ebeveyn
işleme
f2312946fc

+ 14 - 0
src/components/MenuSider/data.ts

@@ -0,0 +1,14 @@
+// 获取当前路径路由,并且跳到知识图谱页面
+export const toEchPageFu = () => {
+  const nowPageLast = window.location.hash
+  window.location.replace(`#/knowlege?back=${nowPageLast}`)
+}
+
+// 从知识图谱页面返回
+export const echPageBackFu = () => {
+  const search = new URLSearchParams(window.location.hash.split('?')[1] || '')
+  const tab = search.get('back')
+  if (tab) {
+    window.location.replace(tab)
+  }
+}

+ 2 - 9
src/components/MenuSider/index.tsx

@@ -1,9 +1,9 @@
 import React, { useState } from 'react'
 import styles from './index.module.scss'
 import classNames from 'classnames'
-import { Toast } from 'antd-mobile'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
+import { toEchPageFu } from './data'
 
 /**
  * @param activeTab 0:一碑两面 1:一碑万象 2:无尽未竟
@@ -95,14 +95,7 @@ function MenuSider({ activeTab }: { activeTab: number }) {
               </div>
               <div className='knowledge'>
                 <img src={require('@/assets/img/icon_knowledge.png')} alt='' />
-                <div
-                  className='txt songFontc'
-                  onClick={() => {
-                    Toast.show({
-                      content: '正在开发中'
-                    })
-                  }}
-                >
+                <div className='txt songFontc' onClick={() => toEchPageFu()}>
                   {myLangue === 'EN' ? 'mapping knowledge domain' : '知识图谱'}
                 </div>
               </div>

+ 2 - 9
src/pages/A0base/index.tsx

@@ -6,6 +6,7 @@ import { RootState } from '@/store'
 import { Toast } from 'antd-mobile'
 import { cutUnityFu, unityShow } from './data'
 import Zloding from '@/components/Zloding'
+import { toEchPageFu } from '@/components/MenuSider/data'
 
 function A0base() {
   const [loding, setLoding] = useState(false)
@@ -13,7 +14,6 @@ function A0base() {
   useEffect(() => {
     // 切换场景
     cutUnityFu('TombstoneView', () => setLoding(true))
-
   }, [])
 
   const { myData, myLangue } = useSelector((state: RootState) => state.A0Layout)
@@ -76,14 +76,7 @@ function A0base() {
           >
             {myLangue === 'EN' ? 'Stele Shadow Intelligence Mapping' : '碑影智绘'}
           </div>
-          <div
-            className='inter songFontc'
-            onClick={() => {
-              Toast.show({
-                content: '正在开发中'
-              })
-            }}
-          >
+          <div className='inter songFontc' onClick={() => toEchPageFu()}>
             {myLangue === 'EN' ? 'mapping knowledge domain' : '知识图谱'}
           </div>
           {/* <div

+ 20 - 24
src/pages/A6ybwx/A6_2_zxzgh/index.tsx

@@ -2,13 +2,8 @@ import React, { useState, useRef, useEffect } from 'react'
 import styles from './index.module.scss'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
-import { Toast } from 'antd-mobile'
 import iosTouch from '@/utils/iosTouch'
 
-
-
-
-
 type InfoCardProps = {
   time: string
   location: string
@@ -151,11 +146,10 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
     <>
       <div
         id='A7Sinicize'
-
         className={styles.Sinicize}
         onWheel={handleWheel}
-      // onTouchMove={handleOriTouchMove}
-      // onTouchStart={handleTouchStart}
+        // onTouchMove={handleOriTouchMove}
+        // onTouchStart={handleTouchStart}
       >
         <div className='SinicizeScroll' ref={originRef}>
           <div ref={sinicize1Ref} className={styles.Sinicize1}>
@@ -236,14 +230,16 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
                     style={{ backgroundImage: `url(${sItem.bgPath})` }}
                     onClick={() => handleYearItemClick(index)}
                   >
-                    <div className="yearContainner">
+                    <div className='yearContainner'>
                       <div className='txt songFont'>{sItem.time}</div>
                       {/* <div className='front'>{sItem.desc}</div> */}
                     </div>
-
                   </div>
 
-                  <div id='sinicizeDetail' className={`${selectedTime === index ? 'detailShow' : 'detailHide'}`}>
+                  <div
+                    id='sinicizeDetail'
+                    className={`${selectedTime === index ? 'detailShow' : 'detailHide'}`}
+                  >
                     {/* {selectedTime === index && ( */}
                     <>
                       <div className='left'>
@@ -256,10 +252,11 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
                           /> */}
                             <div
                               style={{
-                                backgroundImage: `url(${isShowLine[0]?.isShow
-                                  ? sItem.imgItems[0].srcLine
-                                  : sItem.imgItems[0].src
-                                  })`
+                                backgroundImage: `url(${
+                                  isShowLine[0]?.isShow
+                                    ? sItem.imgItems[0].srcLine
+                                    : sItem.imgItems[0].src
+                                })`
                               }}
                               className={`pic ${isShowLine[0]?.isShow ? 'picLine' : ''}`}
                             />
@@ -309,11 +306,13 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
                             </div> */}
                                 <div
                                   style={{
-                                    backgroundImage: `url(${isShowLine[index2 + 1]?.isShow ? i.srcLine : i.src
-                                      })`
+                                    backgroundImage: `url(${
+                                      isShowLine[index2 + 1]?.isShow ? i.srcLine : i.src
+                                    })`
                                   }}
-                                  className={`pic ${isShowLine[index2 + 1]?.isShow ? 'picLine' : ''
-                                    }`}
+                                  className={`pic ${
+                                    isShowLine[index2 + 1]?.isShow ? 'picLine' : ''
+                                  }`}
                                 />
                                 {!isShowLine[index2 + 1]?.isShow ? (
                                   <InfoCard
@@ -349,14 +348,11 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
                 </div>
               ))}
               <div className='yearItem'>
-                <div
-                  className='year year-zongjie'
-                >
-                  <div className="yearContainner">
+                <div className='year year-zongjie'>
+                  <div className='yearContainner'>
                     <div className='txt songFont'>{myData.sinicizeDataStatic.zongjie.title}</div>
                     <div className='front'>{myData.sinicizeDataStatic.zongjie.txt}</div>
                   </div>
-
                 </div>
               </div>
             </div>

+ 6 - 17
src/pages/A9knowlege/index.module.scss

@@ -1,32 +1,21 @@
 .A9knowlege {
+  position: relative;
+  z-index: 2;
   display: flex;
   width: 100%;
   height: 100%;
   overflow: hidden;
   background: url('./images/bg_jiaohu-min.jpg') no-repeat center / cover;
 
-  :global {
-    .back {
-      width: 60px;
-      height: 30px;
-      position: absolute;
-      z-index: 3;
-      top: 3%;
-      left: 4%;
-      cursor: pointer;
+  // :global {
 
-      & > img {
-        height: 100%;
-        object-fit: contain;
-      }
-    }
-  }
+  // }
 }
 
 .main {
   flex: 1;
 
-  > * {
+  >* {
     width: 100%;
     height: 100%;
     border: none;
@@ -38,4 +27,4 @@
   width: 298px;
   height: 100%;
   background: url('./images/img_pop_02-min.png') no-repeat center / cover;
-}
+}

+ 3 - 3
src/pages/A9knowlege/index.tsx

@@ -4,6 +4,8 @@ import Chart from './components/Chart'
 import Panel from './components/Panel'
 import Panel2 from './components/Panel2'
 import ModelPanel from './components/ModelPanel'
+import { echPageBackFu } from '@/components/MenuSider/data'
+import Zback from '@/components/Zback'
 
 function A9knowlege() {
   const echartRef = useRef<HTMLDivElement | null>(null)
@@ -113,9 +115,7 @@ function A9knowlege() {
 
   return (
     <div className={styles.A9knowlege}>
-      <div className='back' onClick={() => window.location.replace('#/base')}>
-        <img src={require('@/assets/img/btn_back.png')} alt='' />
-      </div>
+      <Zback clickFu={() => echPageBackFu()} />
 
       <div className={styles.main}>
         <div id='echart-container' ref={echartRef} />