tremble 3 лет назад
Родитель
Сommit
702f93d730

+ 1 - 1
public/static/template/skin/vtourskin.xml

@@ -17,7 +17,7 @@
                    design_text_shadow="1"/> 
     <include url="%SWFPATH%/plugins/swipe_gallery.xml"/>
 	<include url="%SWFPATH%/plugins/showtext.xml" />
-    <autorotate enabled="false" waittime="1.0" speed="-2.0" horizon="0.0" tofov="120.0"/>
+    <autorotate enabled="false" waittime="1.0" speed="2.0" horizon="0.0" tofov="120.0"/>
     <vtourskinxmlpath url="./"/>
     <include url="%SWFPATH%/plugins/tooltip.xml"/>
     <settings name="auto_thumbs" thumb_size="84" thumb_background_size="90" thumb_spacing="14" left="0" right="0"

+ 0 - 2
src/components/tablist/index.vue

@@ -92,14 +92,12 @@ export default {
         if (document.querySelector('#'+this.subId)) {
             this.oneWidth = document.querySelector('#'+this.subId).offsetWidth
             this.menuWidth = document.querySelector('#'+this.id).offsetWidth
-            console.log(this.menuWidth,this.oneLeft, this.oneWidth);
             this.isShowScroll = this.oneWidth  + 40 > this.menuWidth
         }
       })
     },
     moveSlide(type) {
       if (type == 'back') {
-        console.log(this.menuWidth,this.oneLeft, this.oneWidth);
         if ((this.menuWidth - this.oneLeft) > this.oneWidth) {
           return
         }

+ 1 - 1
src/core/utils.js

@@ -15,7 +15,7 @@ export default class Utils {
       var sceneName = krpano.get('xml.scene');
       var hlookat = krpano.get("view.hlookat");
       var vlookat = krpano.get("view.vlookat");
-      console.log(hlookat,vlookat);
+
       return {
         sceneName,
         hlookat,

+ 78 - 75
src/framework/core/index.vue

@@ -3,7 +3,7 @@
     <div class="none-center" v-show="!activeItem">请先上传或添加场景素材</div>
 
     <div v-show="activeItem" id="pano"></div>
-    <template v-if="showSnapshot&&activeItem">
+    <template v-if="showSnapshot && activeItem">
       <snapshot :showFlash="showFlash"></snapshot>
       <button class="ui-button submit" @click="onClick">将当前视角设为初始画面</button>
     </template>
@@ -13,7 +13,7 @@
 <script>
 import * as krfn from "@/core/index.js";
 import { uploadCover } from "@/api";
-import { $waiting } from '@/components/shared/loading'
+import { $waiting } from "@/components/shared/loading";
 import { mapGetters } from "vuex";
 
 import Snapshot from "@/components/Snapshot";
@@ -23,15 +23,15 @@ export default {
   components: { Snapshot },
   data() {
     return {
-      activeItem:'',
-      showFlash:false,
-      someData:''
+      activeItem: "",
+      showFlash: false,
+      someData: "",
     };
   },
   computed: {
     ...mapGetters({
       info: "info",
-      backupInfo: "backupInfo"
+      backupInfo: "backupInfo",
     }),
     showSnapshot() {
       return this.$route.name == "screen";
@@ -41,85 +41,88 @@ export default {
     },
   },
   methods: {
-    updateInfo(){
-      let iidx = this.info.scenes.findIndex(item=>this.activeItem.sceneCode == item.sceneCode)
-      if (iidx>-1) {
+    updateInfo() {
+      let iidx = this.info.scenes.findIndex((item) => this.activeItem.sceneCode == item.sceneCode);
+
+      if (iidx > -1) {
         this.info.scenes[iidx] = {
-          ...this.activeItem
-        }
+          ...this.activeItem,
+        };
+      }
+
+      if (this.activeItem.sceneCode == this.info.firstScene.sceneCode) {
+        this.info.firstScene = {
+          ...this.activeItem,
+        };
       }
+
       this.$store.commit("SetInfo", this.info);
     },
     onClick() {
-      this.$bus.emit('toggleFlash',true)
+      this.$bus.emit("toggleFlash", true);
       let canvas = $("#krpanoSWFObject canvas")[0];
-      let krpano = document.getElementById('krpanoSWFObject');
+      let krpano = document.getElementById("krpanoSWFObject");
       let data = __krfn.utils.setInitView(krpano, canvas);
 
-      console.log(data.url);
-
-      uploadCover(
-        { file: data.url, filename: "initCover.jpg", sceneCode:this.activeItem.sceneCode  },
-        res => {
-          if (res.code==0) {
-            let icon =  res.data.filePath
-            this.activeItem.icon = icon
-            this.activeItem.initVisual= {
-              hlookat: data.hlookat,
-              vlookat: data.vlookat
-            }
-            this.$bus.emit('toggleFlash',false)
-            this.$bus.emit("initView", icon);
-            this.updateInfo()
-            this.$msg.success("设置成功")
-            this.$store.commit("SetInfo", this.info);
-          }
-        });
+      uploadCover({ file: data.url, filename: "initCover.jpg", sceneCode: this.activeItem.sceneCode }, (res) => {
+        if (res.code == 0) {
+          let icon = res.data.filePath;
+          this.activeItem.icon = icon;
+          this.activeItem.initVisual = {
+            hlookat: data.hlookat,
+            vlookat: data.vlookat,
+          };
+          this.$bus.emit("toggleFlash", false);
+          this.updateInfo();
+          this.$msg.success("设置成功");
+          this.$store.commit("SetInfo", this.info);
+          this.$bus.emit("initView", icon);
+        }
+      });
     },
     addhotspot(param) {
-      let krpano = document.getElementById('krpanoSWFObject');
+      let krpano = document.getElementById("krpanoSWFObject");
       __krfn.utils.addhotspot(krpano, param, true);
-    }
-    
+    },
   },
-  watch:{
-    '$route.name':function(newVal){
-        let krpano = document.getElementById('krpanoSWFObject');
-        __krfn.utils.toggleHotspot(krpano,newVal!='screen'&&newVal!='commentary');
+  watch: {
+    "$route.name": function(newVal) {
+      let krpano = document.getElementById("krpanoSWFObject");
+      __krfn.utils.toggleHotspot(krpano, newVal != "screen" && newVal != "commentary");
     },
-    activeItem:{
+    activeItem: {
       handler(newVal) {
         if (newVal) {
-          this.$nextTick(()=>{
+          this.$nextTick(() => {
             this.$bus.emit("initView", newVal.icon);
-          })
-        }
-        $('#pano').empty();
-        window.vrInitFn = ()=>{
-            $waiting.hide()
-              var krpano = document.getElementById('krpanoSWFObject');
-            __krfn.utils.initHotspot(krpano,newVal&&newVal.someData,true);
-            __krfn.utils.toggleHotspot(krpano,this.$route.name!='screen'&&this.$route.name!='commentary');
+          });
         }
-        window.vrViewFn = ()=>{
+        $("#pano").empty();
+        window.vrInitFn = () => {
+          $waiting.hide();
+          var krpano = document.getElementById("krpanoSWFObject");
+          __krfn.utils.initHotspot(krpano, newVal && newVal.someData, true);
+          __krfn.utils.toggleHotspot(krpano, this.$route.name != "screen" && this.$route.name != "commentary");
+        };
+        window.vrViewFn = () => {
           try {
-            let tmp = newVal.initVisual
-            var krpano = document.getElementById('krpanoSWFObject');
-            krpano.set('view.vlookat',tmp.vlookat);
-            krpano.set('view.hlookat',tmp.hlookat);
+            let tmp = newVal.initVisual;
+            var krpano = document.getElementById("krpanoSWFObject");
+            krpano.set("view.vlookat", tmp.vlookat);
+            krpano.set("view.hlookat", tmp.hlookat);
           } catch (error) {
-            error
+            error;
           }
-        }
-               
+        };
+
         var settings = {
-          'events[skin_events].onxmlcomplete':'js(window.vrViewFn());',
-          'events[skin_events].onloadcomplete': 'js(window.vrInitFn());'
+          "events[skin_events].onxmlcomplete": "js(window.vrViewFn());",
+          "events[skin_events].onloadcomplete": "js(window.vrInitFn());",
         };
-        if(newVal){
-            removepano('#pano')
-            $waiting.show()
-            embedpano({
+        if (newVal) {
+          removepano("#pano");
+          $waiting.show();
+          embedpano({
             // http://oss-xiaoan.oss-cn-shenzhen.aliyuncs.com/720yun_fd_manage/fd720_Va0LrkXW3/vtour/tour.xml
             // xml: "%HTMLPATH%/static/template/tour.xml",
             xml: `${this.$cdn}/pano/${newVal.sceneCode}/vtour/tour.xml`,
@@ -127,24 +130,24 @@ export default {
             target: "pano",
             html5: "auto",
             mobilescale: 1,
-            vars:settings,
+            vars: settings,
             webglsettings: { preserveDrawingBuffer: true },
             passQueryParameters: true,
           });
           // $waiting.hide()
         }
       },
-      immediate: true
-    }
+      immediate: true,
+    },
   },
   mounted() {
     window.__krfn = __krfn;
-   
-    this.$bus.on('currentPcode',data=>{
-      this.activeItem = data
-    })
-    
-    this.$bus.on("addhotspot", data => {
+
+    this.$bus.on("currentPcode", (data) => {
+      this.activeItem = data;
+    });
+
+    this.$bus.on("addhotspot", (data) => {
       this.addhotspot(data);
     });
   },
@@ -156,11 +159,11 @@ export default {
   width: 100%;
   position: relative;
   height: 100%;
-  .none-center{
+  .none-center {
     position: absolute;
     top: 50%;
     left: 50%;
-    transform: translate(-50%,-50%);
+    transform: translate(-50%, -50%);
   }
   #pano {
     width: 100%;
@@ -182,4 +185,4 @@ export default {
     z-index: 99;
   }
 }
-</style>
+</style>

+ 6 - 6
src/framework/show/index.vue

@@ -282,12 +282,12 @@ export default {
     },
     canLoad(newVal) {
       if (newVal) {
-        setTimeout(() => {
-          this.showTips = this.localRemind
-          setTimeout(() => {
-            this.showTips = false;
-          }, this.showInfo.remindTime * 1000);
-        }, 2000);
+        // setTimeout(() => {
+        //   this.showTips = this.localRemind
+        //   setTimeout(() => {
+        //     this.showTips = false;
+        //   }, this.showInfo.remindTime * 1000);
+        // }, 2000);
       }
     },
     showInfo: {

+ 19 - 14
src/views/hotspot/EditPanel.vue

@@ -56,7 +56,7 @@
                   <input type="text" class="ui-input" placeholder="请填写标题限15字" :maxlength="15" v-model="hotspot.hotspotTitle" />
                 </div>
 
-                <div class="ui-between title">简介</div>
+                <!-- <div class="ui-between title">简介</div>
                 <div>
                   <textarea
                     style="height:150px;"
@@ -66,7 +66,7 @@
                     class="ui-input ui-textarea"
                     v-model="hotspot.introduce"
                   />
-                </div>
+                </div> -->
 
                 <div class="ui-between title">字号</div>
                 <div class="medias-list">
@@ -212,7 +212,7 @@ export default {
     }
 
     return {
-      uploadList:[],
+      uploadList: [],
       canSave: false,
       hotSpotTypeList: [
         {
@@ -381,7 +381,7 @@ export default {
           cb(res);
         });
 
-        this.uploadList = []
+      this.uploadList = [];
     },
     onFileChange(e) {
       e.files.forEach((eachFile, i) => {
@@ -389,7 +389,6 @@ export default {
           return eachFile.type.indexOf(iii) > -1;
         });
 
-
         if (!flag) {
           setTimeout(() => {
             this.$msg({
@@ -432,18 +431,25 @@ export default {
 
         this.uploadList.push(p);
       });
-      this.uploadAll(data=>{
-        if (this.param == 'image') {
-          this.hotspot[this.param] = this.hotspot[this.param].concat(data)
-        }
-        else{
-          this.hotspot[this.param] = data
+
+      if (this.param == "image") {
+        if (this.hotspot[this.param].length + this.uploadList.length > 20) {
+          $waiting.hide();
+          return this.$alert({ content: "最多添加20张图片" });
         }
+      }
+
+      this.uploadAll((data) => {
         $waiting.hide();
-      })
+        if (this.param == "image") {
+          this.hotspot[this.param] = this.hotspot[this.param].concat(data);
+        } else {
+          this.hotspot[this.param] = data;
+        }
+      });
     },
     handleUpload(data) {
-      this.param = data.type
+      this.param = data.type;
       this.$nextTick(() => {
         this.$refs.uploadFileMl.click();
       });
@@ -526,7 +532,6 @@ export default {
           });
         }
 
-        
         this.$store.commit("SetHotspot", this.hotspot);
         this.$emit("close");
         this.$emit("save", this.hotspot);

+ 1 - 5
src/views/hotspot/hotspotType/image.vue

@@ -30,7 +30,7 @@ export default {
   
   methods:{
     del(item){
-      let index = this.images.findIndex(i => i.id === item.id)
+      let index = this.images.findIndex(i => i.fileName === item.fileName)
       ~index && this.images.splice(index, 1)
       this.$emit('imageChange',this.images)
     },
@@ -44,11 +44,7 @@ export default {
     image:{
       deep:true,
       handler:function (newVal) {
-        console.log(newVal);
         this.images = [...newVal]
-        if (this.images.length>20) {
-          return this.$alert({ content: "最多添加20张图片" });
-        }
       }
     },
   }

+ 1 - 1
src/views/information/Setting.vue

@@ -2,7 +2,7 @@
   <div class="view-setting" app-border dir-left>
     <div class="ui-title">初始场景</div>
     <div class="preview">
-      <img v-if="info.firstScene" :src="info.firstScene.icon" alt="" />
+      <img v-if="info.firstScene" :src="$cdn + info.firstScene.icon" alt="" />
       <div class="tips" v-else>
         <i class="iconfont iconphotoview" style="font-size: 40px"></i>
       </div>

+ 9 - 0
src/views/information/Toolbar.vue

@@ -150,6 +150,7 @@ export default {
   watch: {
     "info.scenes": {
       deep: true,
+      immediate:true,
       handler: function (newVal) {
         let arr = newVal.filter((item) => {
           return this.tabtowActive.id == item.category;
@@ -334,6 +335,14 @@ export default {
         this.tabtowActive = data.willActive
       }
     })
+
+    this.$bus.on('initView',()=>{
+      let arr = this.info.scenes.filter((item) => {
+          return this.tabtowActive.id == item.category;
+        });
+      this.scenes = arr.sort((a,b)=>a.weight-b.weight)
+    })
+    
   },
   components: {
     draggable,