tremble 4 years ago
parent
commit
8e49a0a4b3

+ 6 - 13
edit-backstage/edit.html

@@ -6,7 +6,7 @@
     <meta name="viewport"
         content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <title>四维时代</title>
+    <title>信息工程大学</title>
     <meta name="description" content="3D camera">
     <meta property="og:title" content="3D camera">
     <meta property="og:description" content="3D Showcase">
@@ -1227,7 +1227,7 @@
                                 <a class="del hasHover"></a>
                             </div> -->
                         </li>
-                        <li data-name="hotStyle">
+                        <li data-name="hotStyle" style="display: none">
                             <div class="itemTitle">
                                 <span>选择热点样式</span>
                             </div>
@@ -1252,7 +1252,7 @@
                                 </li>  -->
                             </ul>
                         </li>
-                        <li data-name="floorMarkerColor">
+                        <li data-name="floorMarkerColor" style="display: none">
                             <div class="itemTitle">
                                 <span>当前位置/导览路线</span>
                             </div>
@@ -1273,13 +1273,13 @@
                                 <span>其他设置</span>
                             </div>
                             <ul class="other-item">
-                                <li>
+                                <li style="display: none">
                                     <input name="loadlogo" class="editCheckbox" type="checkbox" value="loadlogo"
                                         id="loadlogo">
                                     <label for="loadlogo"></label>
                                     <label for="loadlogo">隐藏公司logo </label>
                                 </li>
-                                <li>
+                                <li style="display: none">
                                     <input name="hotImgScale" class="editCheckbox" type="checkbox" value="hotImgScale"
                                         id="hotImgScale">
                                     <label for="hotImgScale"></label>
@@ -1297,7 +1297,7 @@
                                     <label for="hideMouseMarker"></label>
                                     <label for="hideMouseMarker">隐藏鼠标标记 </label>
                                 </li>
-                                <li>
+                                <li style="display: none">
 <!--                                     <input name="g_specialScene" class="editCheckbox" type="checkbox"
                                         value="g_specialScene" id="g_specialScene">
                                     <label for="g_specialScene"></label>
@@ -1310,13 +1310,6 @@
                                     <label for="twoData">启动二代数据 <i class="colorRed">-请慎重选择</i> </label>
                                 </li>
                             </ul>
-                            <ul>
-                                <li>
-                                    <label class="remark">注:
-                                        <br>特殊大场景:一般不勾选,是对某些需要特殊处理的场景设置的。如果勾选了还需要将处理的内容写进SpecialScene.js,否则没有作用。
-                                        <br><br>启动二代数据:和tile贴图有关。</label>
-                                </li>
-                            </ul>
                         </li>
                     </ul>
                 </div>

+ 1 - 1
edit-backstage/js/edit.js

@@ -3415,7 +3415,7 @@ var EditOverlay = {
 }
 
 //----------------漫游可见性---------------------------------
-
+//如果加载了sweep_locations.csv,设置将无效
 var VisiSet = {
 
     setPanoVisible: false,

+ 236 - 230
edit-backstage/js/overlay.js

@@ -3,24 +3,24 @@ MathLight.RADIANS_PER_DEGREE = Math.PI / 180;
 MathLight.DEGREES_PER_RADIAN = 180 / Math.PI;
 
 var filterAll = function filterAll(e, t) {
-    return e.filter(function (e) {
-  return t.every(function (t) {
-    return t(e);
-  });
-});
-} 
-var sortByScore = function (list, request, rank) {
-  var i = filterAll(list, request);
-  return 0 === i.length ? null : i = i.map(function (e) {
-    return {
-      item: e,
-      score: rank.reduce(function (t, i) {
-        return t + i(e);
-      }, 0)
-    };
-  }).sort(function (e, t) {
-    return t.score - e.score;
-  });
+    return e.filter(function(e) {
+        return t.every(function(t) {
+            return t(e);
+        });
+    });
+}
+var sortByScore = function(list, request, rank) {
+    var i = filterAll(list, request);
+    return 0 === i.length ? null : i = i.map(function(e) {
+        return {
+            item: e,
+            score: rank.reduce(function(t, i) {
+                return t + i(e);
+            }, 0)
+        };
+    }).sort(function(e, t) {
+        return t.score - e.score;
+    });
 };
 /* var cameraLight = {
     clampVFOV: function(fov, t, i, n) {
@@ -44,130 +44,138 @@ var sortByScore = function (list, request, rank) {
     }
 };
   */
- 
- 
- 
-var initOverlay = function(THREE){
-    var _planeGeometry = new THREE.PlaneGeometry(settings.overlay.width, settings.overlay.height,1,1)
-    var _boxGeometry = new THREE.BoxBufferGeometry(settings.overlay.width, settings.overlay.height, settings.overlay.depth )
-        //ie的mesh 加了polygonOffset也是会重叠。所以去掉前面的face:  (但是突然ie又播放不了videoTexture)
-        var newIndex = [..._boxGeometry.index.array]
-        newIndex.splice(4*6,6)
-        _boxGeometry.setIndex(new THREE.BufferAttribute(new Uint16Array(newIndex), 1))
-     
-
-    var _boxMat = new THREE.MeshBasicMaterial({//MeshStandardMaterial
-            color:"#eeeeee", 
-            transparent: !0 ,
-            opacity:0.8
-        })
-    
-    var overlayGroup = new THREE.Object3D;    player.model.add(overlayGroup);  overlayGroup.name = "overlayGroup"
-    player.overlayGroup = overlayGroup;
 
+var initOverlay = function(THREE) {
+    var _planeGeometry = new THREE.PlaneGeometry(settings.overlay.width,settings.overlay.height,1,1)
+    var _boxGeometry = new THREE.BoxBufferGeometry(settings.overlay.width,settings.overlay.height,settings.overlay.depth)
+    //ie的mesh 加了polygonOffset也是会重叠。所以去掉前面的face:  (但是突然ie又播放不了videoTexture)
+    var newIndex = [..._boxGeometry.index.array]
+    newIndex.splice(4 * 6, 6)
+    _boxGeometry.setIndex(new THREE.BufferAttribute(new Uint16Array(newIndex),1))
 
-    var Overlay = function(info){ 
-        THREE.Object3D.call(this); 
+    var _boxMat = new THREE.MeshBasicMaterial({
+        //MeshStandardMaterial
+        color: "#eeeeee",
+        transparent: !0,
+        opacity: 0.8
+    })
+
+    var overlayGroup = new THREE.Object3D;
+    player.model.add(overlayGroup);
+    overlayGroup.name = "overlayGroup"
+    player.overlayGroup = overlayGroup;
+
+    var Overlay = function(info) {
+        THREE.Object3D.call(this);
         this.sid = info.sid;
-        if(info.media)this.preDeal(info) 
+        if (info.media)
+            this.preDeal(info)
         this.build(info);
-        this.name = "overlay_"+this.sid;
+        this.name = "overlay_" + this.sid;
     }
     Overlay.prototype = Object.create(THREE.Object3D.prototype);
-    
-    Overlay.prototype.build = function(info){
-        
-        var plane = new THREE.Mesh(_planeGeometry, new THREE.MeshBasicMaterial({//MeshStandardMaterial
-            color:"#00c8af",
-            opacity:0.4,
+
+    Overlay.prototype.build = function(info) {
+
+        var plane = new THREE.Mesh(_planeGeometry,new THREE.MeshBasicMaterial({
+            //MeshStandardMaterial
+            color: "#00c8af",
+            opacity: 0.4,
             transparent: !0,
-            polygonOffset : true,//是否开启多边形偏移		//ie不开启时blank也不会闪烁
-            polygonOffsetFactor : -0.9,//多边形偏移因子
-            polygonOffsetUnits : -4.0,//多边形偏移单位  
-        }) )								
+            polygonOffset: true,
+            //是否开启多边形偏移		//ie不开启时blank也不会闪烁
+            polygonOffsetFactor: -0.9,
+            //多边形偏移因子
+            polygonOffsetUnits: -4.0,
+            //多边形偏移单位  
+        }))
         plane.renderOrder = 3
         this.add(plane);
         this.plane = plane;
-        if(info.hasBox){
-            this.addBox(true)  
-        }   
+        if (info.hasBox) {
+            this.addBox(true)
+        }
         overlayGroup.add(this);
-        
-        if(info.media){ 
-            if(info.media.includes('video')){
+
+        if (info.media) {
+            if (info.media.includes('video')) {
                 var video = $('<video controls="controls" loop autoplay x5-playsinline="" webkit-playsinline="true" playsinline="true" controlslist="nodownload"></video>')[0]
-                video.setAttribute("crossOrigin", 'Anonymous')//要在src设置好前解决跨域
-                $(video).on('contextmenu', function () { return false; });//禁止右键点击出
-                 
-                video.src = manage.dealURL(info.file)  ;
+                video.setAttribute("crossOrigin", 'Anonymous')
+                //要在src设置好前解决跨域
+                $(video).on('contextmenu', function() {
+                    return false;
+                });
+                //禁止右键点击出
+
+                video.src = manage.dealURL(info.file);
                 info.media = video;
                 info.type = "video"
-                
+
                 video.addEventListener('loadeddata', ()=>{
                     console.log(this.sid + " loaded!!!")
-                })
+                }
+                )
                 video.volume = 0
                 video.muted = true
-            }else if(info.media.includes('photo')){
+                plane.material.opacity = 1;
+            } else if (info.media.includes('photo')) {
                 /* var img = new Image();
                  
                 img.src = manage.dealURL(info.file) //"https://4dkk.4dage.com/images/images"+Config.projectNum+"/overlay"+this.sid+".jpg?m="+new Date().getTime()
                 info.media = img
                  */
-                
-                info.type = "photo"  
-                
+
+                info.type = "photo"
+                plane.material.opacity = 0.1;
             }
-            plane.material.opacity = 0.1;
-            plane.material.color = new THREE.Color(1,1,1) 
+
+            plane.material.color = new THREE.Color(1,1,1)
         }
-        if(info.width == void 0) info.width = settings.overlay.width;
-        if(info.height == void 0) info.height = settings.overlay.height;
-        this.setFromInfo(info) 
+        if (info.width == void 0)
+            info.width = settings.overlay.width;
+        if (info.height == void 0)
+            info.height = settings.overlay.height;
+        this.setFromInfo(info)
         this.fileSrc = info.file
-        
+
     }
-    
-     
-     
-    Overlay.prototype.setFromInfo = function(info){//1 恢复到编辑之前 2 初始加载 
-        var plane = this.plane; 
-        this.transformAtPanos = info.transformAtPanos || {} //在每个漫游点独立设置的position。  
-        var curPanoTransform = player.currentPano && this.transformAtPanos[player.currentPano.id] || {} 
-        
-        info.depth && this.scale.setZ(info.depth/settings.overlay.depth)
-        
-         
-        this.posCustom = info.pos ? info.pos.clone() : this.position.clone(); //没有单独设置position的漫游点使用的position
-        this.position.copy(curPanoTransform.pos || this.posCustom )
-        
+
+    Overlay.prototype.setFromInfo = function(info) {
+        //1 恢复到编辑之前 2 初始加载 
+        var plane = this.plane;
+        this.transformAtPanos = info.transformAtPanos || {}
+        //在每个漫游点独立设置的position。  
+        var curPanoTransform = player.currentPano && this.transformAtPanos[player.currentPano.id] || {}
+
+        info.depth && this.scale.setZ(info.depth / settings.overlay.depth)
+
+        this.posCustom = info.pos ? info.pos.clone() : this.position.clone();
+        //没有单独设置position的漫游点使用的position
+        this.position.copy(curPanoTransform.pos || this.posCustom)
+
         this.quaCustom = info.qua ? info.qua.clone() : this.quaternion.clone()
         this.quaternion.copy(curPanoTransform.qua || this.quaCustom);
-        
-        
-        this.widthCustom = info.width  
-        this.heightCustom = info.height  
+
+        this.widthCustom = info.width
+        this.heightCustom = info.height
         this.width = curPanoTransform.width || this.widthCustom
         this.height = curPanoTransform.height || this.heightCustom
         var a = this.getScaleBySize(this.width, this.height)
-        this.scale.setX( a.x )
-        this.scale.setY( a.y )
-        
-        
-        
-        
-        if(info.type){
-            if(!plane.material.map){
-                if(info.type == "video"){ 
-                    plane.material.map = new THREE.VideoTexture( info.media ); 
+        this.scale.setX(a.x)
+        this.scale.setY(a.y)
+
+        if (info.type) {
+            if (!plane.material.map) {
+                if (info.type == "video") {
+                    plane.material.map = new THREE.VideoTexture(info.media);
                     this.hasRequestLoad = true
-                    
+
                     plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
                     plane.material.map.minFilter = THREE.LinearFilter;
                     plane.material.map.magFilter = THREE.LinearFilter;
-                    plane.material.map.generateMipmaps = true; 
-                    
-                }else{  
+                    plane.material.map.generateMipmaps = true;
+
+                } else {
                     this._loadDones = []
                     /* plane.material.map = Texture.load(info.file,()=>{
                         if(this._loadDones){
@@ -175,61 +183,62 @@ var initOverlay = function(THREE){
                             this._loadDones = null
                         }
                     })  */
-                } 
+                }
                 /* plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
                 plane.material.map.minFilter = THREE.LinearFilter;
                 plane.material.map.magFilter = THREE.LinearFilter;
                 plane.material.map.generateMipmaps = true;  */
-            }else plane.material.map.image = info.media; 
+            } else
+                plane.material.map.image = info.media;
             this.file = info.file;
         }
         this.overlayType = info.type;
-         
-        if(!!this.hasBox != !!info.hasBox){
-            this.addBox(!this.hasBox); 
+
+        if (!!this.hasBox != !!info.hasBox) {
+            this.addBox(!this.hasBox);
         }
-        
+
         this.updateMatrixWorld()
         this.getVisiblePanos()
-        
-    } 
 
-    Overlay.prototype.addBox = function(state){
-        if(state == !!this.hasBox){ 
+    }
+
+    Overlay.prototype.addBox = function(state) {
+        if (state == !!this.hasBox) {
             return;
-        } 
-        if(state){
-            var box = new THREE.Mesh(_boxGeometry , _boxMat) 
-            box.position.set(0,0,settings.overlay.depth/2);
-            box.renderOrder = 3 
-            this.plane.position.set(0,0,settings.overlay.depth ); 
+        }
+        if (state) {
+            var box = new THREE.Mesh(_boxGeometry,_boxMat)
+            box.position.set(0, 0, settings.overlay.depth / 2);
+            box.renderOrder = 3
+            this.plane.position.set(0, 0, settings.overlay.depth);
             this.add(box);
-            this.box = box;   
-            
-        }else{
-            this.plane.position.set(0,0,0);
+            this.box = box;
+
+        } else {
+            this.plane.position.set(0, 0, 0);
             this.remove(this.box);
             this.box = null;
-        }  
+        }
         this.hasBox = state
     }
-    
-    Overlay.prototype.getSizeByScale = function(){ 
+
+    Overlay.prototype.getSizeByScale = function() {
         return {
-            width : settings.overlay.width * this.scale.x,
-            height : settings.overlay.height * this.scale.y
+            width: settings.overlay.width * this.scale.x,
+            height: settings.overlay.height * this.scale.y
         }
     }
-    Overlay.prototype.getScaleBySize = function(width, height){ 
+    Overlay.prototype.getScaleBySize = function(width, height) {
         return {
-            x : width / settings.overlay.width,
-            y : height / settings.overlay.height,
-        }  
-    } 
-    
-    Overlay.prototype.preDeal = function(info){
+            x: width / settings.overlay.width,
+            y: height / settings.overlay.height,
+        }
+    }
+
+    Overlay.prototype.preDeal = function(info) {
         info.pos = new THREE.Vector3().fromArray(info.pos)
-        info.qua = new THREE.Quaternion().fromArray(info.qua) 
+        info.qua = new THREE.Quaternion().fromArray(info.qua)
         info.width = parseFloat(info.width)
         info.height = parseFloat(info.height)
         info.depth = parseFloat(info.depth)
@@ -241,95 +250,95 @@ var initOverlay = function(THREE){
         info.qua.y = parseFloat(info.qua.y)
         info.qua.z = parseFloat(info.qua.z)
         info.qua.w = parseFloat(info.qua.w)
-        
-        if(!info.transformAtPanos)info.transformAtPanos = {}
-               
-        for(let i in info.transformAtPanos){
+
+        if (!info.transformAtPanos)
+            info.transformAtPanos = {}
+
+        for (let i in info.transformAtPanos) {
             info.transformAtPanos[i].pos = new THREE.Vector3().fromArray(info.transformAtPanos[i].pos)
             info.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(info.transformAtPanos[i].qua)
-                
+
         }
-        
+
     }
-    
-    Overlay.prototype.getVisiblePanos = function(){ 
-        this.visiblePanos = getVisiblePano(this.plane.getWorldPosition(),{model: null});  
-        
+
+    Overlay.prototype.getVisiblePanos = function() {
+        this.visiblePanos = getVisiblePano(this.plane.getWorldPosition(), {
+            model: null
+        });
+
     }
-    Overlay.prototype.updateVisibles = function(panos){ 
+    
+    
+    Overlay.prototype.updateVisibles = function(panos) {
         this.visible = !!panos.find(pano=>this.visiblePanos.includes(pano))
-        if(!this.visible && this.overlayType == 'video') this.plane.material.map.image.pause()
-    }    
-    Overlay.updateVisibles = function(panos){
-        if(panos === true){
+        if (!this.visible && this.overlayType == 'video')
+            this.plane.material.map.image.pause()
+    }
+    
+    
+    Overlay.updateVisibles = function(panos) {
+        if (panos === true) {
             player.overlayGroup.children.forEach(e=>e.visible = true)
-        }else{
+        } else {
             player.overlayGroup.children.forEach(e=>e.updateVisibles(panos))
         }
     }
-    
-    
-    Overlay.prototype.addToLoadQueue = function(){
-        if(this.overlayType == 'photo'){ 
+
+    Overlay.prototype.addToLoadQueue = function() {
+        if (this.overlayType == 'photo') {
             Overlay.loadQueue.includes(this) || Overlay.loadQueue.push(this)
-              
+
         }
-    } 
-    Overlay.prototype.requestDownload = function(){
-        if(this.hasRequestLoad ||  this.overlayType != 'photo')return
-        
-        console.log('overlay requestDownload : '+this.sid)
-        var plane = this.plane; 
-        
-        plane.material.map = Texture.load(this.file,()=>{
+    }
+    
+    
+    Overlay.prototype.requestDownload = function() {
+        if (this.hasRequestLoad || this.overlayType != 'photo')
+            return
+
+        console.log('overlay beginDownload : ' + this.sid)
+        var plane = this.plane;
+
+        plane.material.map = Texture.load(this.file, ()=>{
             plane.material.needsUpdate = true
-            if(this._loadDones){
+            if (this._loadDones) {
                 this._loadDones.forEach(e=>e())
-                this._loadDones = null  
+                this._loadDones = null
             }
-            setTimeout(Overlay.loadNext,50)
+            setTimeout(Overlay.loadNext, 50)
             plane.material.opacity = 1;
-            console.log('overlay loaded: '+this.sid)
+            console.log('overlay loaded: ' + this.sid)
         })
         plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
         plane.material.map.minFilter = THREE.LinearFilter;
         plane.material.map.magFilter = THREE.LinearFilter;
-        plane.material.map.generateMipmaps = true; 
-        
-         
+        plane.material.map.generateMipmaps = true;
+
         this.hasRequestLoad = true
     }
-    
-    
-    
-    
-    
- 
+
     Overlay.loadQueue = [];
-  
-    
-    Overlay.getNeedLoad = function(){ 
-        if(!player || !player.domElement || !player.mode)return;
-        
-        if(player.mode != 'panorama'){
-            if( !Overlay.loadWhenOutside) return;
-            /* var loadings = player.overlayGroup.children.filter(e=>e.hasRequestLoad && e._loadDones)//开始下载了但是没加载好的
-            
-            if(loadings.length==4){
-                Overlay.loadQueue = player.overlayGroup.children.filter(e=>!e.hasRequestLoad) .slice(0,5);
-            } */
-            
-            if(Overlay.loadQueue.length == 0){
-                Overlay.loadQueue = player.overlayGroup.children.filter(e=>!e.hasRequestLoad).slice(0,5);
+
+    Overlay.getNeedLoad = function() {
+        if (!player || !player.domElement || !player.mode)
+            return;
+
+        if (player.mode != 'panorama') {
+            if (!Overlay.loadWhenOutside)
+                return; 
+
+            if (Overlay.loadQueue.length == 0) {
+                Overlay.loadQueue = player.overlayGroup.children.filter(e=>!e.hasRequestLoad).slice(0, 5);
             }
-            
+
             return;
         }
         Overlay.loadWhenOutside = true
         var overlays = player.overlayGroup.children.filter(e=>!e.hasRequestLoad && e.visiblePanos.includes(player.currentPano))
         //var maxAngle = THREE.Math.degToRad( cameraLight.getHFOVFromVFOV(70, player.domElement.clientWidth, app.player.domElement.clientHeight) / 2);
         var cameraDir = player.getDirection()
-        
+
         /* var maxCount = 5; 
         if(overlays.length>maxCount){
             for(var i=0;i<overlays.length;i++){ 
@@ -345,52 +354,49 @@ var initOverlay = function(THREE){
                 Overlay.loadQueue.push()
             }
         }else{ */
-            Overlay.loadQueue = overlays
+        Overlay.loadQueue = overlays
         //} 
-        
-        
-      
-        var request = [(overlay)=>{ 
+
+        var request = [(overlay)=>{
             return true
-        }];
+        }
+        ];
         var rank = [(overlay)=>{
             var dis = overlay.plane.getWorldPosition().distanceTo(player.position);
             return -dis
-        },(overlay)=>{
-            var tagDir = overlay.plane.getWorldPosition().sub(player.position) 
+        }
+        , (overlay)=>{
+            var tagDir = overlay.plane.getWorldPosition().sub(player.position)
             var angle = tagDir.angleTo(cameraDir)
-            return -angle*20
-        }]
-        var result = sortByScore(Overlay.loadQueue, request,rank); 
-        Overlay.loadQueue = result ? result.slice(0,5).map(e=>e.item) : player.overlayGroup.children.filter(e=>!e.hasRequestLoad).slice(0,2);
-         
-      
+            return -angle * 20
+        }
+        ]
+        var result = sortByScore(Overlay.loadQueue, request, rank);
+        Overlay.loadQueue = result ? result.slice(0, 5).map(e=>e.item) : player.overlayGroup.children.filter(e=>!e.hasRequestLoad).slice(0, 2);
+
     }
-    
+
     Overlay.maxLoadingCount = 3;
     Overlay.loadNext = ()=>{
-        
+
         var loadings = player.overlayGroup.children.filter(e=>e.hasRequestLoad && e._loadDones)//开始下载了但是没加载好的
-        Overlay.loadQueue.slice(0,Overlay.maxLoadingCount-loadings.length).forEach(e=>e.requestDownload())
-        Overlay.loadQueue.splice(0,Overlay.maxLoadingCount-loadings.length)
-    } 
-    
-    
+        
+        Overlay.loadQueue.slice(0, Overlay.maxLoadingCount - loadings.length).forEach(e=>e.requestDownload())
+        Overlay.loadQueue.splice(0, Overlay.maxLoadingCount - loadings.length)
+    }
+
     Overlay.load = ()=>{
-        Overlay.getNeedLoad()
-        //Overlay.loadQueue.slice(0,2).forEach(e=>e.requestDownload())
-        Overlay.loadNext() 
-        var unloads = player.overlayGroup.children.filter(e=>!e.hasRequestLoad) 
-        if(unloads.length){ 
+        Overlay.getNeedLoad() 
+        Overlay.loadNext()
+        var unloads = player.overlayGroup.children.filter(e=>!e.hasRequestLoad)
+        if (unloads.length) {
             setTimeout(Overlay.load, 200)
-        }else{
+        } else {
             Overlay.allRequestLoad = true
             console.log('allRequestLoad')
         }
     }
-  
-    
-    
+
     window.Overlay = Overlay;
-    
-} 
+
+}

+ 1 - 2
hotspot/src/views/Home.vue

@@ -302,14 +302,13 @@ export default {
     .desc{
       color: #fff;
       width: 76%;
-      margin: -36px auto 0;
+      margin: -40px auto 0;
       max-height: 120px;
       overflow-y: auto;
       overflow-x: hidden;
       text-align: center;
       position: relative;
       z-index: 999;
-      line-height: 1.2;
     }
     .desc-duo{
       text-indent: 32px;

+ 2 - 1
web/package.json

@@ -13,7 +13,8 @@
     "swiper": "^5.3.8",
     "vue": "^2.6.11",
     "vue-awesome-swiper": "^4.1.1",
-    "vue-router": "^3.2.0"
+    "vue-router": "^3.2.0",
+    "vue-worker": "^1.2.1"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "~4.5.0",

+ 1 - 1
web/public/index.html

@@ -6,7 +6,7 @@
     <meta name="viewport"
         content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <title></title>
+    <title>信息工程大学</title>
     <meta name="description" content="四维时代">
     <meta property="og:title" content="四维时代">
     <meta property="og:description" content="四维时代">

+ 39 - 21
web/public/static/js/main_2020_show.js

@@ -4900,21 +4900,29 @@ window.Modernizr = function(n, e, t) {
             n.prototype.goToDestination = function(e, t, i, n) {
                         
                 //音频 
-                if(this.destinationItem[1] == 0 && e!='noMusic'){//如果是每个folder的起始
-                    var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
-                    if(musicInfo && musicInfo.music){
+                if(!this.destinationItem){
+                    this.goNext()
+                }
+                else{
+                    if(this.destinationItem[1] == 0){//如果是每个folder的起始
                         g_tourAudio.pause();
                         g_tourAudio.src = ""
-                        
-                        if(e!='noMusic'){
-                            var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music :  g_Prefix + musicInfo.music;
-                            g_tourAudio.src = manage.dealURL(o);
-                            g_tourAudio.load()  
+                        var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
+                        if(musicInfo && musicInfo.music){
+                            
+                            
+                            if(e!='noMusic'){
+                                var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music :  g_Prefix + musicInfo.music;
+                                g_tourAudio.src = manage.dealURL(o);
+                                g_tourAudio.load()  
+                            }
                         }
+                        
                     }
-                    
                 }
                 
+
+                
                 if (this.onTheBus = !0,
                 this.emit("update.controls"),
                 this.player.updateLastView(),
@@ -4930,10 +4938,18 @@ window.Modernizr = function(n, e, t) {
                     
                         //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
                         //var walk = window.MP_PREFETCHED_MODELDATA.black ? 'black' : 'walk';
-                     
                         var s = this.getMomentTour(this.destinationItem)   //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
-                        a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow,  s, true, i, this.actionComplete.bind(this)),
+
+                     
+                        if(e == 'noMusic'){
+                            var aim = new THREE.Vector3(0,0,-1).applyQuaternion(r.quaternion).add(r.position)   
+                            a = this.player.flyToPano.bind(this.player, {pano: this.model.panos.index[r.panoId], lookAtPoint: aim }, this.actionComplete.bind(this))
+                        }else{
+                            a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow,  s, true, i, this.actionComplete.bind(this))
+                        }
+                        
                         o = this.arrivedAtDestination.bind(this, !0)
+                        
                     } else{
                         a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
                         o = this.arrivedAtDestination.bind(this, !1);
@@ -4978,8 +4994,7 @@ window.Modernizr = function(n, e, t) {
                     this.emit(p.TourStart),
                     this.player.enablePreRendering(),
                     this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
-                    this.goToDestination()) : (this.clearWalkingSectionPaused(),
-                    this.goToDestination())))
+                    this.goToDestination()) : this.goToDestination()))
             } 
 			,
 			n.prototype.bgmReplay = function() {//xzw add  结束tour后可能要继续播放背景音乐
@@ -6858,7 +6873,7 @@ window.Modernizr = function(n, e, t) {
                 var i = Q.pageTitle;
                 // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
                 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
-                document.title = i ,
+                // document.title = i ,
                 K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
                     delay: {
                         show: 50,
@@ -15755,7 +15770,7 @@ window.Modernizr = function(n, e, t) {
             }else{
                 u.texture1.value = defaultTex1;
                 u.texture2.value = defaultTex2;
-                console.log(this.sid)
+                // console.log(this.sid)
             }  
         }
         
@@ -15971,9 +15986,9 @@ window.Modernizr = function(n, e, t) {
                 //     manage.switchBgmState(false); 
                 //     g_bgAudio.pauseByHot = true
                 // } 
-                // if(g_tourAudio)g_tourAudio.pause()
+                if(g_tourAudio)g_tourAudio.pause()
                 
-                var src = getLink(this.link   )
+                var src = getLink(this.link)
                 myElement.src = src; 
                 myElement.id = "id1";
 				myElement.allowTransparency = "true";
@@ -19874,8 +19889,8 @@ window.Modernizr = function(n, e, t) {
                     }
                 }
             };
-            console.log("--------------------------"),
-            console.log(JSON.stringify(i));
+            // console.log("--------------------------"),
+            // console.log(JSON.stringify(i));
             var n = this.player.model.addtag(e, i).build();
             n && (n.disc && this.player.tagDiscs.push(n.disc),
             n.visible || n.show(o.tags.startup.fadeInDuration))
@@ -22230,10 +22245,13 @@ window.Modernizr = function(n, e, t) {
                 return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
             }
             ,
+            // n.prototype.tloadOverlays= function(){
+            //     this.model.loadOverlays() 
+            // },
             n.prototype.start = function(e) {
                  //-------------------
-                window.initOverlay(r)
-                this.model.loadOverlays() 
+                 window.initOverlay(r)
+                 this.model.loadOverlays()
                 //loadVideo();//add   
                 //-------------------
                 

+ 2 - 2
web/public/static/js/myShow.js

@@ -1,7 +1,7 @@
 var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
-var g_Prefix="http://192.168.1.101:8080/";
+// var g_Prefix="http://192.168.1.101:8080/";
 // https://super.4dage.com/
-// var g_Prefix=window.location.origin+'/';
+var g_Prefix=window.location.origin+'/';
 
 var s = window.location.href.split('/');
 s.pop();

+ 4 - 4
web/public/static/js/overlay.js

@@ -104,7 +104,7 @@ var initOverlay = function(THREE){
                 info.type = "video"
                 
                 video.addEventListener('loadeddata', ()=>{
-                    console.log(this.sid + " loaded!!!")
+                    // console.log(this.sid + " loaded!!!")
                 })
                 video.volume = 0
                 video.muted = true
@@ -279,7 +279,7 @@ var initOverlay = function(THREE){
     Overlay.prototype.requestDownload = function(){
         if(this.hasRequestLoad ||  this.overlayType != 'photo')return
         
-        console.log('overlay requestDownload : '+this.sid)
+        // console.log('overlay requestDownload : '+this.sid)
         var plane = this.plane; 
         
         plane.material.map = Texture.load(this.file,()=>{
@@ -290,7 +290,7 @@ var initOverlay = function(THREE){
             }
             setTimeout(Overlay.loadNext,50)
             plane.material.opacity = 1;
-            console.log('overlay loaded: '+this.sid)
+            // console.log('overlay loaded: '+this.sid)
         })
         plane.material.map.wrapS = plane.material.map.wrapT = THREE.ClampToEdgeWrapping;
         plane.material.map.minFilter = THREE.LinearFilter;
@@ -386,7 +386,7 @@ var initOverlay = function(THREE){
             setTimeout(Overlay.load, 200)
         }else{
             Overlay.allRequestLoad = true
-            console.log('allRequestLoad')
+            // console.log('allRequestLoad')
         }
     }
   

BIN
web/src/assets/audio/redianchangjuan.mp3


BIN
web/src/assets/video/welcome.mp4


+ 2 - 0
web/src/components/longvideo/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="longvideo">
+    <audio preload autoplay ref="changjuan" :src="require('@/assets/audio/redianchangjuan.mp3')"></audio>
     <img class="close" @click="$bus.$emit('toggleLongVideo',false)" :src="require('@/assets/images/icon/close.png')" alt="">
     <div class="longbody">
       <video @click="autoplay" :style="{left:translate.x + 'px'}" ref="layout" autoplay loop :src="require('@/assets/video/video.mp4')"></video>
@@ -133,6 +134,7 @@ export default {
     this.$refs.scro.addEventListener('touchstart', this.scrollreadyMove)
 
     this.autoplay()
+    this.$refs.changjuan.play();
     this.$refs.layout.addEventListener('loadedmetadata',()=>{
       this.loading = false
     })

+ 2 - 0
web/src/components/svg.vue

@@ -180,6 +180,8 @@ export default {
                 this.modeActive = t
             })
 
+            this.$bus.$emit("onFinish",true)
+
             // 监听点位变化
             // window.player.on("flying.ended", (pano1, position, pano)=> {
             //   console.log(pano.id);

+ 32 - 2
web/src/components/welcome/index.vue

@@ -5,8 +5,11 @@
       <div  v-if="!isVideo" class="we_title">欢迎访问<br/>战略支援部队信息工程大学数字史馆</div>
       <span v-if="!isVideo" class="btn" @click="showVideo">开始预览</span>
     </template>
-    <video @click="autoplay" ref="welcome" :style="{opacity:isVideo?1:0}" preload="auto" :poster="require('@/assets/images/videopost.jpg')" :src="require('@/assets/video/welcome.mp4')"></video>
+    <video ref="welcome" :style="{opacity:isVideo?1:0}" preload :poster="require('@/assets/images/videopost.jpg')" :src="require('@/assets/video/welcome.mp4')"></video>
     <span v-if="isVideo" class="btn jump" @click="$bus.$emit('toggleWelcome', false)">跳过</span>
+     <div class="loading" v-if="loading">
+      <span>加载中...</span>
+    </div>
   </div>
 </template>
 
@@ -14,7 +17,8 @@
 export default {
   data(){
     return {
-      isVideo: false
+      isVideo: false,
+      loading:true
     }
   },
   methods:{
@@ -36,6 +40,13 @@ export default {
         this.$refs.welcome && this.$refs.welcome.addEventListener('ended',()=>{
           this.$bus.$emit('toggleWelcome', false)
         })
+
+        this.$refs.welcome.addEventListener('loadedmetadata',()=>{
+          setTimeout(() => {
+            this.loading = false
+          }, 3000);
+        })
+
       })
     
     // this.autoplay()
@@ -103,4 +114,23 @@ export default {
     left: auto;
   }
 }
+
+.loading{
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 10000;
+    background: #000;
+    >span{
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translateX(-50%,-50%);
+      color: #fff;
+      font-size: 16px;
+      display: inline-block;
+    }
+  }
 </style>

+ 30 - 2
web/src/pages/Home.vue

@@ -96,7 +96,13 @@
             <v-guide v-show="showPull"/>
         </transition>
     </div>
-    <welcome v-if="showWelcome"/>
+    <keep-alive>
+        <welcome v-if="showWelcome"/>
+    </keep-alive>
+
+    <div class="loading" v-if="loading">
+      <span>加载中...</span>
+    </div>
   </div>
 </template>
 
@@ -179,6 +185,7 @@ export default {
         }
         if (!data) {
             manage.switchBgmState(true); 
+            // window.player.tloadOverlays()
         }
     })
     
@@ -206,6 +213,7 @@ export default {
         window.player.on("loadLongVideo", ()=> {
             this.showLoingVideo = true
         })
+        this.loading = false
     })
 
     
@@ -238,7 +246,8 @@ export default {
         isFade:true,
         showWelcome:true,
         showLoingVideo: false,
-        fileCode:''
+        fileCode:'',
+        loading:true
       }
   }
 }
@@ -337,4 +346,23 @@ export default {
     height: 100%;
     background: rgba(0, 0, 0, 0.6);
 }
+
+.loading{
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 10000;
+    background: #000;
+    >span{
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      transform: translateX(-50%,-50%);
+      color: #fff;
+      font-size: 16px;
+      display: inline-block;
+    }
+  }
 </style>