lanxin пре 4 недеља
родитељ
комит
788bd1244a

+ 10 - 9
hot/src/views/Home.vue

@@ -44,6 +44,7 @@
                   controls
                   controlslist="nodownload"
                   :src="urlToFitFu(item.url)"
+                  :poster="item.img ? urlToFitFu(item.img) : ''"
                   v-if="index === myInd"
                 ></video>
               </div>
@@ -209,13 +210,13 @@ export default {
   methods: {
     // 本地化 url 适配
     urlToFitFu(url) {
-      return url;
-      // const resUrl = url;
-      // if (url.includes("https://super.4dage.com")) {
-      //   return url.replace("https://super.4dage.com", "");
-      // } else if (url.includes("http://super.4dage.com")) {
-      //   return url.replace("http://super.4dage.com", "");
-      // } else return resUrl;
+      // return url;
+      const resUrl = url;
+      if (url.includes("https://super.4dage.com")) {
+        return url.replace("https://super.4dage.com", "../scene");
+      } else if (url.includes("http://super.4dage.com")) {
+        return url.replace("http://super.4dage.com", "../scene");
+      } else return resUrl;
     },
 
     // 点击左右箭头
@@ -233,10 +234,10 @@ export default {
     async getData() {
       // https://www.4dmodel.com/
 
-      let url = `https://super.4dage.com/data/${
+      // let url = `https://super.4dage.com/data/${
         // 线上数据
 
-        // let url = `/data/${
+        let url = `../scene/data/${
         //本地化部署
         this.id
       }/hot/js/data.js?time=${Math.random()}`;

BIN
scene/public/images/4dagePoint.png


BIN
scene/public/images/4dagePoint2.png


+ 2 - 2
scene/public/js/Hot.js

@@ -55,8 +55,8 @@ window.initHot = function (model) {
       o = 'en' == manage.number('lang') ? '&lang=' + manage.number('lang') : ''
       ; -1 == r.indexOf('?') ? (src = link + '?time=' + randomTime().getTime() + '&id=' + window.number + o) : (src = link + '&time=' + randomTime().getTime() + '&id=' + window.number + o)
 
-    return src.replace('https://www.4dmodel.com/SuperTwo/hot_online1', 'https://houseoss.4dkankan.com/project/BDLG/hot')
-    // return src.replace('https://www.4dmodel.com/SuperTwo/hot_online1', 'http://localhost:8080')
+    // return src.replace('https://www.4dmodel.com/SuperTwo/hot_online1', 'https://houseoss.4dkankan.com/project/BDLG/hot')
+    return src.replace('https://www.4dmodel.com/SuperTwo/hot_online1', '../hot')
     // return src
   }
   var removeSrcPostMark = function (url) {

+ 53 - 49
scene/public/js/manage.js

@@ -2,10 +2,13 @@ var g_ProjectName = window.location.pathname.substring(
   window.location.pathname.indexOf('/') + 1,
   window.location.pathname.lastIndexOf('/')
 )
-var g_Prefix = 'https://super.4dage.com/'
-// var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
+// var g_Prefix = 'https://super.4dage.com/'
+var g_Prefix = window.location.href.substring(0, window.location.href.indexOf("/index.html") + 1)
+console.log(g_Prefix)
 var s = window.location.href.split('/')
 s.pop()
+window.isLocal = true
+
 //var g_Prefix = s.join('/');
 var g_index = null
 var g_modeldata = null
@@ -92,8 +95,8 @@ window.browser = {
     return 'boolean' == typeof t
       ? 'true' === r || '1' === r
       : 'number' == typeof t
-      ? parseFloat(r)
-      : window.decodeURIComponent(r)
+        ? parseFloat(r)
+        : window.decodeURIComponent(r)
   },
   urlHasValue: function (key, isGetValue) {
     let querys = window.location.search.substr(1).split('&')
@@ -145,6 +148,7 @@ var settings = {
   hotFastTran: false,
   transparentBg: false,
   bgImg: null,
+  localPrefix: '',
 
   tileClass: {
     //默认全景贴图加载的清晰度
@@ -283,7 +287,7 @@ var LineDraw = {
         opacity: o.opacity != void 0 ? o.opacity : 1
       }
       if (o.deshed) {
-        ;(prop.dashSize = o.dashSize || 0.1), (prop.gapSize = o.gapSize || 0.1)
+        ; (prop.dashSize = o.dashSize || 0.1), (prop.gapSize = o.gapSize || 0.1)
       }
       mat = new THREE[o.deshed ? 'LineDashedMaterial' : 'LineBasicMaterial'](prop)
     }
@@ -352,12 +356,12 @@ var convertTool = {
     var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
 
     /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
-			var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
-		}else{ */
+      var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
+    }else{ */
     let colliders = player.model.allFloorsVisible
       ? player.model.colliders
       : (floorIndex != void 0 ? player.model.floors.index[floorIndex] : player.model.currentFloor)
-          .collider.children
+        .collider.children
     //let colliders = (floorIndex == void 0 ) ? player.model.colliders : player.model.floors.index[floorIndex].collider.children
     var o = ray.intersectObjects(colliders)
     //}
@@ -374,7 +378,7 @@ var convertTool = {
   /*
         拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
         但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
-	 */
+   */
   getPosAtPlane: function (pos, info /* , mouse, camera */) {
     //pos:与intersectPlane的交点 见笔记
     var A = pos
@@ -437,12 +441,12 @@ var convertTool = {
         var y = t * (A.y - O.y) + O.y
         var z = t * (A.z - O.z) + O.z
         /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
-				求直线L与平面π的交点的坐标。
-				把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
-				则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
-				A(mt+a)+B(nt+b)+C(pt+c)+D=0
-				由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
-				再代入参数方程即得交点的坐标(x,y,z). */
+        求直线L与平面π的交点的坐标。
+        把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
+        则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
+        A(mt+a)+B(nt+b)+C(pt+c)+D=0
+        由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
+        再代入参数方程即得交点的坐标(x,y,z). */
       } else if (N.x == 0) {
         //z与pullPos相等
         var z = P.z
@@ -679,22 +683,22 @@ window.expandCommon = function (common) {
       return 0 === i.length
         ? null
         : (i = i
-            .map(function (e) {
-              let scores = rank.map(function (f) {
-                return f(e)
-              }) //add
-
-              return {
-                item: e,
-                scores,
-                score: scores.reduce(function (t, i) {
-                  return t + i
-                }, 0)
-              }
-            })
-            .sort(function (e, t) {
-              return t.score - e.score
-            }))
+          .map(function (e) {
+            let scores = rank.map(function (f) {
+              return f(e)
+            }) //add
+
+            return {
+              item: e,
+              scores,
+              score: scores.reduce(function (t, i) {
+                return t + i
+              }, 0)
+            }
+          })
+          .sort(function (e, t) {
+            return t.score - e.score
+          }))
     },
 
     getVisiblePano: function (positions = [], panos, options = {}) {
@@ -783,10 +787,10 @@ window.expandMath = function (math) {
 //管理js文件 获取modeldata.js 判断是否有特殊的字段,如果有就先加载SpecialScene.js 里面有对特殊场景处理的代码 否则就直接加载main
 
 var Manage = function () {
-  ;(this.weixinURL = 'https://res.wx.qq.com/open/js/jweixin-1.2.0.js'),
+  ; (this.weixinURL = 'https://res.wx.qq.com/open/js/jweixin-1.2.0.js'),
     (this.time = '?' + new Date().getTime())
   this.loadAudio()
-  this.loadWeixin()
+  // this.loadWeixin()
 }
 //动态加载js文件
 Manage.prototype.LoadJs = function (_files, succes) {
@@ -837,7 +841,7 @@ Manage.prototype.LoadJs = function (_files, succes) {
         fileObj.type = 'text/css'
         fileObj.rel = 'stylesheet/less'
       }
-      success = success || function () {}
+      success = success || function () { }
       fileObj.onload = fileObj.onreadystatechange = function () {
         if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {
           success()
@@ -885,7 +889,7 @@ Manage.prototype.number = function (variable) {
 
 Manage.prototype.loadWeixin = function () {
   var that = this
-  this.LoadJs(that.weixinURL + that.time, function () {})
+  this.LoadJs(that.weixinURL + that.time, function () { })
 }
 
 Manage.prototype.weixinShare = function () {
@@ -1139,18 +1143,18 @@ function matcher(data) {
       camera_start:
         data.model.images && data.model.images.length != 0
           ? {
-              camera: {
-                zoom: '-1',
-                quaternion: [
-                  JSON.parse(data.model.images[0].metadata).camera_quaternion.z,
-                  JSON.parse(data.model.images[0].metadata).camera_quaternion.w,
-                  JSON.parse(data.model.images[0].metadata).camera_quaternion.x,
-                  JSON.parse(data.model.images[0].metadata).camera_quaternion.y
-                ]
-              },
-              pano: { uuid: JSON.parse(data.model.images[0].metadata).scan_id },
-              mode: '0'
-            }
+            camera: {
+              zoom: '-1',
+              quaternion: [
+                JSON.parse(data.model.images[0].metadata).camera_quaternion.z,
+                JSON.parse(data.model.images[0].metadata).camera_quaternion.w,
+                JSON.parse(data.model.images[0].metadata).camera_quaternion.x,
+                JSON.parse(data.model.images[0].metadata).camera_quaternion.y
+              ]
+            },
+            pano: { uuid: JSON.parse(data.model.images[0].metadata).scan_id },
+            mode: '0'
+          }
           : ''
     },
     sid: window.number,
@@ -1642,7 +1646,7 @@ function initByTHREE(THREE) {
       if (o.position instanceof Array) o.position = new THREE.Vector3().fromArray(o.position)
       o.innerHTML = `<div class="room-label" ><a><p><span>${o.title}</span></p></a></div>`
       o.domElement = $('.widgets-doll-labels')[0]
-      ;(o.shelterByModel = true), (o.autoUpdate = true)
+        ; (o.shelterByModel = true), (o.autoUpdate = true)
 
       o.clickFun = () => {
         if (player.roomLebelClickUnabled) return
@@ -2686,7 +2690,7 @@ Manage.prototype.loadAudio = function () {
     level: 1,
     src: '',
     loop: false,
-    canplay: audio => {}
+    canplay: audio => { }
   })
 
   $('#volume')

+ 50 - 49
scene/public/showa/js/myShow.js

@@ -1,69 +1,70 @@
-var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
-var g_Prefix="https://super.4dage.com/";
-// var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
-var s = window.location.href.split('/');
-s.pop();
+var g_ProjectName = window.location.pathname.substring(window.location.pathname.indexOf("/") + 1, window.location.pathname.lastIndexOf("/"))
+// var g_Prefix="https://super.4dage.com/";
+var g_Prefix = window.location.href.substring(0, window.location.href.indexOf("/index.html") + 1)
+var s = window.location.href.split('/')
+s.pop()
+window.isLocal = true
 //var g_Prefix = s.join('/');
-var g_index=null;
-var g_modeldata=null;
+var g_index = null
+var g_modeldata = null
 
-var g_weixinTitle=null;
+var g_weixinTitle = null
 
-var g_Hots=null;
-var g_HotMeshes=[];
+var g_Hots = null
+var g_HotMeshes = []
 var g_HotMeshSize = {
   g_HotMeshWidth: 0.3,
-  g_HotMeshHeight:0.3
-};
+  g_HotMeshHeight: 0.3
+}
 
 //add表示添加,delete表示删除
-var g_HotStatus=null;
-var g_newHot = [];//存储新加热点
-var g_HotImage= {
-	"point":"https://super.4dage.com/images/4dagePoint2.png",
-	"point2":"https://super.4dage.com/images/4dagePoint.png"
-};	
-var g_saveHot=false;
+var g_HotStatus = null
+var g_newHot = []//存储新加热点
+var g_HotImage = {
+  "point": "https://super.4dage.com/images/4dagePoint2.png",
+  "point2": "https://super.4dage.com/images/4dagePoint.png"
+}
+var g_saveHot = false
 
-var g_TextColor=0x7777ff;
-var g_Text=null;
-var g_TextPlaneMesh=[];
-var g_TextIconMesh=[];
-var g_TextIcon="./images/text.png";
-var g_SelectTextIndex=null;
-var g_TextShow=null;
-var g_audioPlay=false;
-var g_background=null; 
-var g_roof=null;
+var g_TextColor = 0x7777ff
+var g_Text = null
+var g_TextPlaneMesh = []
+var g_TextIconMesh = []
+var g_TextIcon = "./images/text.png"
+var g_SelectTextIndex = null
+var g_TextShow = null
+var g_audioPlay = false
+var g_background = null
+var g_roof = null
 
-var g_data2 = null;//加载的data2.js的内容
-var g_bgAudio=null;//背景音乐
-var g_tourAudio=null;//导览音乐
-var g_play = 1;//表示播放图标状态
-var g_playAudio = null;//当前在播放或当继续播放时应该播放的,是g_bgAudio或g_tourAudio 
-var g_currentHot = null;//当前打开的热点 
+var g_data2 = null//加载的data2.js的内容
+var g_bgAudio = null//背景音乐
+var g_tourAudio = null//导览音乐
+var g_play = 1//表示播放图标状态
+var g_playAudio = null//当前在播放或当继续播放时应该播放的,是g_bgAudio或g_tourAudio 
+var g_currentHot = null//当前打开的热点 
 //var g_Texture=null;
 //var g_ChunknameTexture={};   //chunkname和贴图名称对应
-var g_NormalTexture=false;
-var g_SpecularTexture=false;
-var g_DirectionalLight=null;  
-  
-var g_snapShotWidth = 200; //截图下载图片的大小
-var g_snapShotHeight = 140;
+var g_NormalTexture = false
+var g_SpecularTexture = false
+var g_DirectionalLight = null
+
+var g_snapShotWidth = 200 //截图下载图片的大小
+var g_snapShotHeight = 140
 
 //微信分享
 var g_weixinObj = {
   "title": document.querySelector("head title").innerHTML,
-  "lineLink" : window.location.href,
-  "imgUrl" : "https://www.4dmodel.com/SuperPanoramic/images/weixintitle.jpg",
-  "desc" : "四维时代提供技术支持",
+  "lineLink": window.location.href,
+  "imgUrl": "https://www.4dmodel.com/SuperPanoramic/images/weixintitle.jpg",
+  "desc": "四维时代提供技术支持",
 }
 
 var settings = {
-    overlay:{
-		width:1, height:0.5, depth:0.02
-	}  
+  overlay: {
+    width: 1, height: 0.5, depth: 0.02
+  }
 }
-if(window.number == '725'||window.number == '724'){
-    settings.mobileNavHigh = true
+if (window.number == '725' || window.number == '724') {
+  settings.mobileNavHigh = true
 }

+ 15 - 13
scene/src/pages/A2main/index.tsx

@@ -25,14 +25,14 @@ function A2main() {
   const [viewNum, setViewNum] = useState(1)
   const [isShowSection, setIsShowSection] = useState(false)
 
-  useEffect(() => {
-    http.get(`https://count.4dage.com/api/count/detail/${SCENE_CODE}`).then(res => {
-      setLikeNum(res.data.starSum!)
-    })
-    http.get(`https://count.4dage.com/api/count/saveVisit/${SCENE_CODE}`).then(res => {
-      setViewNum(res.data.visitSum!)
-    })
-  }, [])
+  // useEffect(() => {
+  //   http.get(`https://count.4dage.com/api/count/detail/${SCENE_CODE}`).then(res => {
+  //     setLikeNum(res.data.starSum!)
+  //   })
+  //   http.get(`https://count.4dage.com/api/count/saveVisit/${SCENE_CODE}`).then(res => {
+  //     setViewNum(res.data.visitSum!)
+  //   })
+  // }, [])
 
   // 点击点赞
   const likeFu = useCallback(() => {
@@ -215,21 +215,23 @@ function A2main() {
             </div>
 
             {/* 点赞 */}
-            <div className='likeBox' onClick={likeFu}>
+            {/*
+             <div className='likeBox' onClick={likeFu}>
               <img src={like ? imgArr[1] : imgArr[0]} alt='' />
               <div className='hoveImg'>点赞{likeNum}</div>
               <div className={classNames('likeMove', like ? 'likeMoveAc' : '')}>+1</div>
             </div>
+            */}
 
-            <div className='A2_share_box' onClick={handleShareClick}>
+            {/* <div className='A2_share_box' onClick={handleShareClick}>
               <img src={require('@/assets/img/share.png')} alt='' />
               <div className='hoveImg'>分享</div>
-            </div>
+            </div> */}
 
-            <div className='A2_view_box'>
+            {/* <div className='A2_view_box'>
               <img src={require('@/assets/img/view.png')} alt='' />
               <div className='hoveImg'>浏览量{viewNum}</div>
-            </div>
+            </div> */}
 
             <div id='vr' className='ui-icon wide hidden' style={{ display: 'none' }}>
               {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}