shaogen1995 vor 7 Monaten
Ursprung
Commit
8a76021e8b

Datei-Diff unterdrückt, da er zu groß ist
+ 122 - 264
Code/public/myData/hot.js


+ 5 - 4
Code/src/pages/A2visit/PanoVideo/index.tsx

@@ -7,9 +7,10 @@ import { KrpanoMiddleware, KrpanoMiddlewareMethods } from '@/components/KrpanoMi
 import ZHot0 from '@/components/ZHot0'
 import Zhot from '@/components/Zhot'
 
-// window.draggbleHotspotEvent = (ath: number, atv: number) => {
-//   console.log(`ath: ${ath}, atv: ${atv}`)
-// }
+// 待完善
+window.draggbleHotspotEvent = (ath: number, atv: number) => {
+  console.log(`ath: ${ath}, atv: ${atv}`)
+}
 
 type Propr = {
   lodingOk: () => void
@@ -85,7 +86,7 @@ function PanoVideo({ lodingOk }: Propr) {
                 onOut={() => setActiveIdx(-1)}
                 onClick={() => setAcName(item.name)}
                 // @ts-ignore
-                // onDown='draggable_hotspot()'
+                onDown='draggable_hotspot()'
               >
                 <HotIcon
                   isModel={item.tubiao === '文物' ? true : false}

+ 4 - 4
Code/src/pages/A2visit2/A22Pano/index.tsx

@@ -5,9 +5,9 @@ import { HotSpot, Krpano, Scene, View } from '@dage/krpano'
 import HotIcon from '@/components/HotIcon'
 import { KrpanoMiddleware } from '@/components/KrpanoMiddleware'
 
-// window.draggbleHotspotEvent = (ath: number, atv: number) => {
-//   console.log(`ath: ${ath}, atv: ${atv}`)
-// }
+window.draggbleHotspotEvent = (ath: number, atv: number) => {
+  console.log(`ath: ${ath}, atv: ${atv}`)
+}
 
 type Props = {
   setAcName: (val: string) => void
@@ -58,7 +58,7 @@ function A22Pano({ setAcName }: Props) {
                 onOut={() => setActiveIdx(-1)}
                 onClick={() => setAcName(item.name)}
                 // @ts-ignore
-                // onDown='draggable_hotspot()'
+                onDown='draggable_hotspot()'
               >
                 <HotIcon
                   isModel={item.tubiao === '文物' ? true : false}

+ 6 - 6
Code/src/pages/A3banPano/index.tsx

@@ -14,9 +14,9 @@ import Zhot from '@/components/Zhot'
 import NextPage from '@/components/NextPage'
 // import { myData } from '@/utils/http'
 
-// window.draggbleHotspotEvent = (ath: number, atv: number) => {
-//   console.log(`ath: ${ath}, atv: ${atv}`)
-// }
+window.draggbleHotspotEvent = (ath: number, atv: number) => {
+  console.log(`ath: ${ath}, atv: ${atv}`)
+}
 
 function A3banPano() {
   // 路由:/banPano/id
@@ -92,7 +92,7 @@ function A3banPano() {
                 onOut={() => setActiveIdx(-1)}
                 onClick={() => setAcName(item.name)}
                 // @ts-ignore
-                // onDown='draggable_hotspot()'
+                onDown='draggable_hotspot()'
               >
                 <HotIcon
                   isPano
@@ -118,7 +118,7 @@ function A3banPano() {
                 history.push('/banquet?r=ren')
               }}
               // @ts-ignore
-              // onDown='draggable_hotspot()'
+              onDown='draggable_hotspot()'
             >
               <div className={styles.floorHotspot}>
                 <img src={FloorHotspotIcon} className={styles.floorHotspotIcon} alt='' />
@@ -187,7 +187,7 @@ function A3banPano() {
                 onOut={() => setActiveIdx(-1)}
                 onClick={() => setAcName(item.name)}
                 // @ts-ignore
-                // onDown='draggable_hotspot()'
+                onDown='draggable_hotspot()'
               >
                 <HotIcon
                   isPano

+ 4 - 4
Code/src/pages/A3banquet/PanoImg/index.tsx

@@ -8,9 +8,9 @@ import { HotSpot, Krpano, Scene, View } from '@dage/krpano'
 import FloorHotspotIcon from '@/assets/img/icon-flo-min.png'
 import Zhot from '@/components/Zhot'
 
-// window.draggbleHotspotEvent = (ath: number, atv: number) => {
-//   console.log(`ath: ${ath}, atv: ${atv}`)
-// }
+window.draggbleHotspotEvent = (ath: number, atv: number) => {
+  console.log(`ath: ${ath}, atv: ${atv}`)
+}
 
 function PanoImg() {
   //热点
@@ -78,7 +78,7 @@ function PanoImg() {
                 onOut={() => setActiveIdx(-1)}
                 onClick={() => setAcName(item.name)}
                 // @ts-ignore
-                // onDown='draggable_hotspot()'
+                onDown='draggable_hotspot()'
               >
                 <HotIcon
                   isPano

+ 1 - 1
Code/src/pages/A6plow/index.tsx

@@ -74,7 +74,7 @@ function A6plow() {
 
   // 根据 庄稼 tab不同来变化
   const tabHotAcName = useMemo(() => {
-    if (staCut === '蔬菜') return '汉代农作物'
+    if (staCut === '蔬菜') return '汉代蔬菜'
     else {
       let obj = {
         0: '汉代耕地工具',

+ 4 - 4
Code/src/pages/A6xian/A6PanoVideo/index.tsx

@@ -6,9 +6,9 @@ import { HotSpot, Krpano, VideoScene, videoSceneModel, View } from '@dage/krpano
 import HotIcon from '@/components/HotIcon'
 import Zhot from '@/components/Zhot'
 
-// window.draggbleHotspotEvent = (ath: number, atv: number) => {
-//   console.log(`ath: ${ath}, atv: ${atv}`)
-// }
+window.draggbleHotspotEvent = (ath: number, atv: number) => {
+  console.log(`ath: ${ath}, atv: ${atv}`)
+}
 
 function A6PanoVideo() {
   const [acName, setAcName] = useState('')
@@ -61,7 +61,7 @@ function A6PanoVideo() {
                 onOut={() => setActiveIdx(-1)}
                 onClick={() => setAcName(item.name)}
                 // @ts-ignore
-                // onDown='draggable_hotspot()'
+                onDown='draggable_hotspot()'
               >
                 <HotIcon
                   isModel={item.tubiao === '文物' ? true : false}

+ 5 - 2
Code/src/pages/B1more/S2mien/index.module.scss

@@ -19,10 +19,13 @@
         }
 
         .S2leftBox1Tit {
-          font-weight: 700;
           font-size: 18px;
-          color: red;
+          color: #ead98f;
           margin-bottom: 8px;
+          img {
+            width: 15px;
+            margin-right: 4px;
+          }
         }
 
         .S2leftRow {

+ 6 - 1
Code/src/pages/B1more/S2mien/index.tsx

@@ -7,6 +7,8 @@ import ZHot0 from '@/components/ZHot0'
 import Zhot from '@/components/Zhot'
 import { HotRowType } from '@/components/Zhot/type'
 
+import titImg from '@/assets/img/leftAc.png'
+
 const levObj = {
   周礼九拜: '车骑拜谒',
   cheQi: '车骑拜谒',
@@ -74,7 +76,10 @@ function S2mien({ hidden }: Props) {
         <div ref={sroolDomRef} className='S2leftMain'>
           {hotArr.left.map((item1, index1) => (
             <div className='S2leftBox' key={index1}>
-              <div className='S2leftBox1Tit'>{item1.name1}</div>
+              <div className='S2leftBox1Tit'>
+                <img src={titImg} alt='' />
+                {item1.name1}
+              </div>
               {item1.son.map((item, index) => (
                 <div
                   onClick={() => setAcName(item.name)}

+ 43 - 5
Code/src/pages/B1more/S3goods/HotInfo/index.tsx

@@ -6,6 +6,8 @@ import { baseURL, isPc } from '@/utils/http'
 import classNames from 'classnames'
 import { ImageViewer } from 'antd-mobile'
 import { Image } from 'antd'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
 
 type Props = {
   closeFu: () => void
@@ -25,6 +27,26 @@ function HotInfo({ closeFu, info }: Props) {
 
   const [imgLook, setImgLook] = useState('')
 
+  // 模型的缩放问题
+  const [modelSize, setModelSize] = useState({ ww: 0, hh: 0, wwB: 0, hhB: 0 })
+
+  const rootStyle = useSelector((state: RootState) => state.A0Layout.style)
+
+  useEffect(() => {
+    if (info.type === 'model') {
+      // 模型重定义尺寸
+      const dom = document.querySelector('.S3modelBox')
+      if (dom) {
+        setModelSize({
+          ww: Number((dom.clientWidth * rootStyle.sizeW).toFixed(2)),
+          hh: Number((dom.clientHeight * rootStyle.sizeH).toFixed(2)),
+          wwB: dom.clientWidth,
+          hhB: dom.clientHeight
+        })
+      }
+    }
+  }, [info.type, rootStyle.sizeH, rootStyle.sizeW])
+
   return (
     <div id='HotOpCss' className={styles.HotInfo}>
       {/* 移动端查看图片 */}
@@ -65,11 +87,27 @@ function HotInfo({ closeFu, info }: Props) {
             x5-video-player-type='h5'
           ></video>
         ) : (
-          <iframe
-            title={info.name}
-            src={`${baseURL}modelLoding/model.html?u=${info.inSrc}`}
-            frameBorder='0'
-          ></iframe>
+          <div
+            className='S3modelBox'
+            style={
+              isPc && Object.keys(rootStyle).length && modelSize.ww
+                ? {
+                    position: 'relative',
+                    width: modelSize.ww + 'px',
+                    height: modelSize.hh + 'px',
+                    transform: `translate(${-(modelSize.ww - modelSize.wwB) / 2}px, ${
+                      -(modelSize.hh - modelSize.hhB) / 2
+                    }px) scale(${1 / rootStyle.sizeW}, ${1 / rootStyle.sizeH})`
+                  }
+                : { width: '100%', height: '100%' }
+            }
+          >
+            <iframe
+              title={info.name}
+              src={`${baseURL}modelLoding/model.html?u=${info.inSrc}`}
+              frameBorder='0'
+            ></iframe>
+          </div>
         )}
       </div>
 

+ 1 - 0
Code/src/pages/B1more/S3goods/index.tsx

@@ -147,6 +147,7 @@ function S3goods({ hidden }: Props) {
                     style={{ backgroundImage: `url(${row2Bac(index2)})` }}
                   >
                     {item2.name}
+                    {item2.type === 'model' ? '---' : ''}
 
                     {/* 上下的线 */}
                     {index2 < item1.info.length - 1 ? (

BIN
资源/staticData/Zhot/bac.png