Просмотр исходного кода

Merge branch 'master' of http://192.168.0.115:3000/chenzhiguang/FD_Pano

任一存 3 лет назад
Родитель
Сommit
4ca7ccd4e4

+ 4 - 3
src/components/rollName/index.vue

@@ -82,11 +82,12 @@ export default {
     vertical-align:unset;
   }
   .shenglv{
-    text-overflow: ellipsis;
+    // text-overflow: ellipsis;
     overflow: hidden;
-    white-space: nowrap;
-    line-height: 100%;
+    // white-space: nowrap;
+    // line-height: 100%;
     vertical-align: baseline;
+    padding-left: 0px;
   }
 }
 </style>

+ 10 - 0
src/components/shared/loading/index.js

@@ -2,12 +2,14 @@ import Vue from 'vue'
 import UIViewLoading from './ViewLoading'
 import UIWaiting from './Waiting'
 import UISmallWaiting from './smallWaiting'
+import UISmallWaiting1 from './smallWaiting1'
 
 
 
 export const ViewLoading = Vue.extend(UIViewLoading)
 export const Waiting = Vue.extend(UIWaiting)
 export const SmallWaiting = Vue.extend(UISmallWaiting)
+export const SmallWaiting1 = Vue.extend(UISmallWaiting1)
 
 
 const waiting = function(){
@@ -22,6 +24,11 @@ const smallWaiting = function(){
     return instance
 }
 
+const smallWaiting1 = function(){
+    let instance = new SmallWaiting1().$mount()
+    document.body.appendChild(instance.$el)
+    return instance
+}
 
 export function $viewLoading(data={}){
     let instance = new ViewLoading({data}).$mount()
@@ -46,4 +53,7 @@ export function $viewLoading(data={}){
 export const $waiting = waiting()
 export const $smallWaiting = smallWaiting()
 
+export const $smallWaiting1 = smallWaiting1()
+
+
 

+ 71 - 0
src/components/shared/loading/smallWaiting1.vue

@@ -0,0 +1,71 @@
+<template>
+    <popup ref="Message" v-if="display">
+        <div class="ui-waiting">
+            <div class="txt">加载中</div>
+            <div class="spinner">
+                <div class="bounce1"></div>
+                <div class="bounce2"></div>
+                <div class="bounce3"></div>
+            </div>
+            <!-- <div>请稍等...</div> -->
+        </div>
+    </popup>
+</template>
+<script>
+import Popup from "../popup";
+export default {
+    name: "ui-waiting",
+    components: {
+        Popup
+    },
+    data() {
+        return {
+            display: false,
+            duration: 0
+        };
+    },
+    methods: {
+        show() {
+            this.$nextTick(() => (this.display = true));
+        },
+        hide() {
+            this.$nextTick(() => (this.display = false));
+        }
+    }
+};
+</script>
+<style lang="less" scoped>
+.ui-waiting {
+    color: #fff;
+    text-align: center;
+    letter-spacing: 2px;
+    .txt{
+        font-size: 14px;
+    }
+    .spinner {
+        width: 100%;
+        text-align: center;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        margin-top: 5px;
+        > div {
+            width: 5px;
+            height: 5px;
+            background-color: #fff;
+            margin: 5px;
+            border-radius: 100%;
+            display: inline-block;
+            animation: bouncedelay 1.4s infinite ease-in-out;
+            animation-fill-mode: both;
+        }
+
+        .bounce1 {
+            animation-delay: -0.32s;
+        }
+        .bounce2 {
+            animation-delay: -0.16s;
+        }
+    }
+}
+</style>

+ 1 - 1
src/components/shared/message/Confirm.vue

@@ -27,7 +27,7 @@
                 >{{okText}}</a>
             </div>
             <div v-else class="ui-message-footer"  :class="{'footer-material':isMaterial}">
-                <button class="ui-button cancel" @click="onNo">{{noText}}</button>
+                <button class="ui-button cancel" :class="{deepcancel:!isMaterial}" @click="onNo">{{noText}}</button>
                 <button class="ui-button submit" @click="onOk">{{okText}}</button>
             </div>
         </div>

+ 1 - 1
src/components/tableSelect.vue

@@ -364,7 +364,7 @@ props:{
 
 .checkbox > input:checked + span {
   background:#fff;
-  border:1px solid rgba(0,200,175,1);
+  border:1px solid #0076F6;
   background:@color url(/static/img/g.png) no-repeat center center;
 }
 

+ 2 - 1
src/core/utils.js

@@ -27,6 +27,7 @@ export default class Utils {
   scaleCanvas (canvas, width, height) {
     let w = canvas.width
     let h = canvas.height;
+    
     if (width == undefined) {
         width = w;
     }
@@ -42,7 +43,7 @@ export default class Utils {
   }
   getDataURL (canvas, type, width, height) {
     let cas = this.scaleCanvas(canvas, width, height);
-    return cas.toDataURL(type,1.0);
+    return cas.toDataURL(type, 1);
   }
 
   setInitAngleImg(mycanvas){

+ 2 - 0
src/framework/core/index.vue

@@ -57,6 +57,8 @@ export default {
       let krpano = document.getElementById('krpanoSWFObject');
       let data = __krfn.utils.setInitView(krpano, canvas);
 
+      console.log(data.url);
+
       uploadCover(
         { file: data.url, filename: "initCover.jpg" },
         res => {

+ 18 - 1
src/framework/show/index.vue

@@ -187,23 +187,39 @@ export default {
       this.showInfo.scenes.forEach((item) => {
         this.showInfo.catalogs.forEach((sub) => {
           if (item.category == sub.id) {
-            tmp.push(sub);
+            if (tmp.indexOf(sub) < 0) {
+              tmp.push(sub);
+            }
           }
         });
       });
       tmp = this.$unique(tmp)
+
       this.showInfo.catalogs = tmp;
       let rootmp = [];
       tmp.forEach((item) => {
         this.showInfo.catalogRoot.forEach((sub) => {
+
           sub.children = this.$unique(sub.children)
+
           if (sub.children.indexOf(item.id) > -1) {
             rootmp.push(sub);
           }
         });
       });
+
+
       rootmp = this.$unique(rootmp)
 
+      let sortArr = this.showInfo.catalogRoot.map(item=>item.name)
+      rootmp.sort((a,b)=>{
+        return sortArr.indexOf(a.name) - sortArr.indexOf(b.name)
+      })
+
+
+      console.log(rootmp,666666);
+
+
       this.showInfo.catalogRoot = rootmp.map((item) => {
         let temp = [];
         item.children = this.$unique(item.children)
@@ -219,6 +235,7 @@ export default {
           children: temp,
         };
       });
+
       this.showInfo.catalogs = tmp
 
       let cid = 'c_'+this.$randomWord(true,8,8)

+ 59 - 19
src/framework/show/list.vue

@@ -1,10 +1,10 @@
 <template>
-  <div class="list">
+  <div class="list" :style="{'max-width':isW ? '1396px':'100%'}">
     <div class="l-con" :class="showList ? 'active' : ''" v-if="!(showInfo.catalogRoot.length == 1 && scenes.length == 1 && showInfo.catalogs.length == 1)">
       <div class="pic-con">
         <div class="clip-scroller" ref="sw" v-swiper:mySwiper="swiperOptions" v-if="scenes.length > 0">
           <ul class="pic-list swiper-wrapper">
-            <li class="swiper-slide" :title="item.sceneTitle" @click="handleVR(item,$event)" v-for="(item, i) in scenes" :key="i">
+            <li class="swiper-slide" :title="item.sceneTitle" @click="handleVR(item,i)" v-for="(item, i) in scenes" :key="i">
               <div :class="{ active: selected.sceneCode == item.sceneCode }">
                 <img :src="item.icon + `?${Math.random()}`" alt="" />
                 <i class="iconfont iconedit_type_3d" :class="{ iconedit_type_panorama: item.type !== '4dkk' }"></i>
@@ -16,7 +16,7 @@
 
         <div class="clip-scroller"  ref="sw1"  v-swiper:mySwipera="swiperOptions" v-if="childTab.length > 1">
           <ul class="pp-tap swiper-wrapper">
-            <li class="swiper-slide" @click="tabtowActive = item" v-for="(item, i) in childTab" :key="i">
+            <li class="swiper-slide" @click="handleTabtow(item,i)" v-for="(item, i) in childTab" :key="i">
               <rollName
                 :offset="30"
                 :mgin="20"
@@ -31,9 +31,9 @@
         </div>
       </div>
 
-      <div class="clip-scroller" ref="sw2"  v-swiper:mySwiperb="swiperOptions" v-if="showInfo.catalogRoot.length > 0 && showInfo.catalogs.length > 1">
-        <ul class="tap  swiper-wrapper">
-          <li  class="swiper-slide" @click="taboneActive = item" :class="{ active: item.id == taboneActive.id }" v-for="(item, i) in showInfo.catalogRoot" :key="i">
+      <div class="clip-scroller" ref="sw2" v-swiper:mySwiperb="swiperOptions" v-if="showInfo.catalogRoot.length > 0 && showInfo.catalogs.length > 1">
+        <ul class="tap  swiper-wrapper" v-if="showInfo.catalogRoot.length > 1">
+          <li  class="swiper-slide" @click="handleTabone(item,i)" :class="{ active: item.id == taboneActive.id }" v-for="(item, i) in showInfo.catalogRoot" :key="i">
             <rollName
               :offset="30"
               :mgin="20"
@@ -47,7 +47,7 @@
         </ul>
       </div>
     </div>
-    <div class="btn dl"  v-if="!(showInfo.catalogRoot.length == 1 && scenes.length == 1 && showInfo.catalogs.length == 1)" @click="showList = !showList"><i class="iconfont " :class="showList ? 'iconnav_scene_down' : 'iconnav_scene_up'"></i>场景导航</div>
+    <div class="btn dl" :class="{deepbg:showList}" v-if="!(showInfo.catalogRoot.length == 1 && scenes.length == 1 && showInfo.catalogs.length == 1)" @click="showList = !showList"><i class="iconfont " :class="showList ? 'iconnav_scene_down' : 'iconnav_scene_up'"></i>场景导航</div>
   </div>
 </template>
 
@@ -61,8 +61,9 @@ import { directive } from "vue-awesome-swiper";
 import "swiper/css/swiper.css";
 
 
-let $scroll = null;
+let isW = window.innerWidth > 1400;
 
+console.log(window.innerWidth);
 export default {
   props: ["select"],
   components: { rollName },
@@ -78,6 +79,7 @@ export default {
       childTab: [],
       scenes: [],
       showList: true,
+      isW,
       loadFirst: true,
       menuWidth: 0,
       sceneNum: config.sceneNum,
@@ -94,16 +96,13 @@ export default {
     swiperOptions() {
       return {
         slidesPerView: "auto",
+        // initialSlide:0,
         // observer:true,
         // observeParents: true,
         centeredSlides : true,
         centerInsufficientSlides: true,
         centeredSlidesBounds: true,
-        on:{
-          click: function(e){
-            console.log(e);
-          },
-        },
+        freeMode:true
       };
     },
   },
@@ -114,11 +113,46 @@ export default {
         return this.$refs[ref][0].clientWidth;
       }
     },
-    handleVR(item,e=null) {
+
+    fixPosit(ref,i,prenum,nexnum){
+         if (i!==null) {
+        let acidx = this.$refs[ref].swiper.activeIndex
+
+
+        if (i - acidx > nexnum ) {
+          this.$refs[ref].swiper.slideNext()
+        }
+
+        if (acidx - i > prenum ) {
+          this.$refs[ref].swiper.slidePrev()
+        }
+      }
+    },
+
+    handleTabtow(item,i=null){
+      this.tabtowActive = item
+      this.fixPosit('sw1',i,3,3)
+    },
+
+    handleTabone(item,i=null){
+      this.taboneActive = item
+      let pp = this.isW ? 5 : 4
+      let nn = this.isW ? 5 : 4
+
+
+      this.fixPosit('sw2',i,pp,nn)
+    },
+
+    handleVR(item,i=null) {
       history.replaceState(null, null, "".concat(window.location.pathname, "?").concat(`id=${this.showInfo.id}&vr=${item.sceneCode}`));
       this.sceneNum = item.sceneCode;
 
-      console.dir(e&& $(e.target));
+      let pp = this.isW ? 7 : 5
+      let nn = this.isW ? 7 : 5
+
+
+      this.fixPosit('sw',i,pp,nn)
+     
     },
    
   },
@@ -278,6 +312,10 @@ export default {
       font-size: 18px;
     }
   }
+
+  .deepbg{
+    background: rgba(0, 0, 0, 0.5);
+  }
   .l-con {
     width: 100%;
     transition: all ease 0.3s;
@@ -309,15 +347,17 @@ export default {
     .pp-tap {
       padding: 0 0 16px;
       > li {
-        width: 150px;
+        max-width: 84px;
+        margin: 0 10px;
+
       }
     }
     .tap {
-      padding: 16px 0;
+      padding: 20px 0 16px;
 
       > li {
         position: relative;
-        width: 116px;
+        width: 104px;
         .btn{
           width: 100%;
           padding: 0;
@@ -334,7 +374,7 @@ export default {
             border-right:  @size * 1.5 solid transparent;
             border-top:  @size*2 solid rgba(0, 0, 0, 0.5);
             position: absolute;
-            top: -18px;
+            top: -20px;
             left: 50%;
             transform: translateX(-50%);
           }

+ 3 - 2
src/framework/show/popup/index.vue

@@ -1,6 +1,6 @@
 <template>
     <popup v-if="show">
-      <div class="ui-message ui-message-confirm" style="width: 400px">
+      <div class="ui-message ui-message-confirm" style="width: 430px">
         <div class="ui-message-header">
           <span>{{title}}</span>
           <span @click="$emit('close')">
@@ -40,6 +40,7 @@ export default {
 }
 .ui-message-confirm{
   border-radius: 0;
+  padding: 0;
   .icon_close{
     color: #909090;
   }
@@ -47,7 +48,7 @@ export default {
 
   .ui-message-header{
     border-bottom: 1px solid #EBEBEB;
-    padding: 0 10px 0 30px;
+    padding: 12px 20px 12px 30px;
     >span{
       margin: 0;
     }

+ 2 - 2
src/framework/show/popup/password.vue

@@ -23,7 +23,6 @@
             <i v-if="key" ref="isearch" class="iconfont icon_close" @click="key=''"></i>
           </div>
         </div>
-        <div class="ma-line"></div>
         <div class="ui-message-footer">
           <div class="btn">
             <button @click="emitname" class="ui-button submit" :class="{disable:!key}" >
@@ -53,7 +52,7 @@ export default {
     emitname(){
       this.$refs.uinput.blur()
       if (!this.key.trim()) {
-        return this.$alert({ content: "请输入访问密码" });
+        return
       }
       
       this.$emit('submit',this.key)
@@ -73,6 +72,7 @@ export default {
   box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
   border-radius: 4px;
   border: 1px solid #E4E7ED;
+  height: 230px;
   .icon_close{
     color: #909090;
   }

+ 22 - 1
src/framework/show/popup/preview.vue

@@ -1,7 +1,7 @@
 <template>
     <popup v-if="show">
       <div class="ui-message ui-message-confirm" 
-      :style="{width: typeW[item.hotspotType]}">
+      :style="{width: typeW[item.hotspotType]}"  :class="{'txtui-confirm':item.hotspotType=='textarea'}" >
         <div class="ui-message-header">
           <span>{{item.hotspotTitle}}</span>
           <span @click="$emit('close')">
@@ -54,6 +54,7 @@ export default {
       pano:'960px',
       audio:'430px',
       video:'960px',
+      
     }
     return {
       typeStr,
@@ -138,6 +139,26 @@ export default {
 
   }
 }
+
+.txtui-confirm{
+  width: 430px;
+   .ui-message-header{
+    border-bottom: 1px solid #EBEBEB;
+    padding: 12px 20px 12px 30px;
+    >span{
+      margin: 0;
+    }
+  }
+  .ui-message-main{
+    width: 330px;
+    margin: 20px auto;
+    padding: 0;
+    background: #fff;
+    .v-textarea{
+      padding: 0;
+    }
+  }
+}
 </style>
 
 <style lang="less" scoped>

+ 6 - 0
src/framework/showMobile/index.vue

@@ -244,6 +244,12 @@ export default {
       });
       rootmp = this.$unique(rootmp);
 
+      let sortArr = this.showInfo.catalogRoot.map(item=>item.name)
+      rootmp.sort((a,b)=>{
+        return sortArr.indexOf(a.name) - sortArr.indexOf(b.name)
+      })
+
+
       this.showInfo.catalogRoot = rootmp.map((item) => {
         let temp = [];
         item.children = this.$unique(item.children);

+ 39 - 6
src/framework/showMobile/list.vue

@@ -5,7 +5,7 @@
 
         <div ref="sw" v-swiper:mySwiper="swiperOptions"  v-if="scenes.length>0">
           <ul class="pic-list swiper-wrapper">
-            <li class="swiper-slide" @click="handleVR(item)" v-for="(item,i) in scenes" :key="i">
+            <li class="swiper-slide" @click="handleVR(item,i)" v-for="(item,i) in scenes" :key="i">
               <div :class="{active:selected.sceneCode==item.sceneCode}">
                 <img :src="item.icon+`?${Math.random()}`" alt="" />
                 <i class="iconfont" :class="item.type!='4dkk'?'iconedit_type_panorama':'iconedit_type_3d'"></i>
@@ -18,7 +18,7 @@
         <div ref="sw1"  v-swiper:mySwipera="swiperOptions" v-if="childTab.length > 1">
           
         <ul class="tap swiper-wrapper"  >
-          <li class="swiper-slide" @click="tabtowActive = item" v-for="(item,i) in childTab" :key="i">
+          <li class="swiper-slide" @click="handleTabtow(item,i)" v-for="(item,i) in childTab" :key="i">
               <rollName :offset="30" :mgin="20" :active="item.id == tabtowActive.id" class="btn pic-rect" :class="{active:item.id == tabtowActive.id}" :myref="'ww'+item.id" :name="item.name"/>
           </li>
         </ul>
@@ -27,7 +27,7 @@
       
       <div class="clip-scroller" ref="sw2"  v-swiper:mySwiperb="swiperOptions" v-if="showInfo.catalogRoot.length > 0 && showInfo.catalogs.length > 1">
          <ul class="tap swiper-wrapper" v-if="showInfo.catalogRoot.length > 1">
-          <li class="swiper-slide" @click="taboneActive = item" :class="{ active: item.id == taboneActive.id }" v-for="(item,i) in showInfo.catalogRoot" :key="i">
+          <li class="swiper-slide" @click="handleTabone(item,i)" :class="{ active: item.id == taboneActive.id }" v-for="(item,i) in showInfo.catalogRoot" :key="i">
               <rollName :offset="30" :mgin="20" :active="item.id == taboneActive.id" class="btn rect" :class="{active:item.id == taboneActive.id}" :myref="'zw'+item.id" :name="item.name"/>
           </li>
         </ul>
@@ -40,6 +40,7 @@
             <i class="iconfont" :class="isDaolan?'iconshow_suspension':'iconshow_playback'"></i>
             <span title="导览" >导览</span>
           </li>
+          {{mapvisit}}
           <template v-if="currentActive!='2d'&& currentActive!='3d' && mapvisit == 0">
             <li v-for="(item,i) in menu" @click="handleMenu(item)" :key="i">
               <i class="iconfont" :class="currentActive==item.id?item.active:item.icon"></i>
@@ -58,7 +59,7 @@
     </div>
 
     <template  v-else>
-      <div class="btn dl" v-if="!(showInfo.catalogRoot.length == 1 && scenes.length == 1 && showInfo.catalogs.length == 1)" @click="showList = !showList">
+      <div class="btn dl" :class="{deepbg:showList}" v-if="!(showInfo.catalogRoot.length == 1 && scenes.length == 1 && showInfo.catalogs.length == 1)" @click="showList = !showList">
         <i class="iconfont " :class="showList?'iconnav_scene_down':'iconnav_scene_up'"></i>场景导航
       </div>
     </template>
@@ -128,7 +129,8 @@ export default {
           // observeParents: true,
           centeredSlides : true,
           centerInsufficientSlides: true,
-          centeredSlidesBounds: true
+          centeredSlidesBounds: true,
+          freeMode:true
         };
       },
       selected(){
@@ -177,9 +179,37 @@ export default {
         this.delHandle()
       }
     },
-    handleVR(item){
+
+     fixPosit(ref,i,prenum,nexnum){
+         if (i!==null) {
+        let acidx = this.$refs[ref].swiper.activeIndex
+        console.log(this.$refs[ref].swiper.activeIndex);
+        if (i - acidx > nexnum ) {
+          this.$refs[ref].swiper.slideNext()
+        }
+
+        if (acidx - i > prenum ) {
+          this.$refs[ref].swiper.slidePrev()
+        }
+      }
+    },
+
+    handleTabtow(item,i=null){
+      this.tabtowActive = item
+      this.fixPosit('sw1',i,1,1)
+    },
+
+    handleTabone(item,i=null){
+      this.taboneActive = item
+      this.fixPosit('sw2',i,1,1)
+    },
+
+    handleVR(item,i=null){
       history.replaceState(null, null, "".concat(window.location.pathname, "?").concat(`id=${this.showInfo.id}&vr=${item.sceneCode}`));
       this.sceneNum = item.sceneCode
+
+      this.fixPosit('sw',i,1,1)
+
     }
   },
   watch:{
@@ -334,6 +364,9 @@ export default {
     }
   }
 
+  .deepbg{
+    background: rgba(0, 0, 0, 0.5);
+  }
   .menu{
     margin: 10px 0 12px;
     .menucon{

+ 2 - 1
src/framework/showMobile/popup/index.vue

@@ -35,6 +35,7 @@ export default {
 
 <style lang="less" scoped>
 .ui-message-confirm{
+  padding: 0;
   border-radius: 0;
   .icon_close{
     color: #909090;
@@ -43,7 +44,7 @@ export default {
 
   .ui-message-header{
     border-bottom: 1px solid #EBEBEB;
-    padding: 0 10px 0 30px;
+    padding: 12px 20px 12px 30px;
     >span{
       margin: 0;
     }

+ 4 - 3
src/framework/showMobile/popup/password.vue

@@ -22,7 +22,6 @@
             <i v-if="key" class="iconfont icon_close" @click="key=''"></i>
           </div>
         </div>
-        <div class="ma-line"></div>
         <div class="ui-message-footer">
           <div class="btn">
             <button @click="emitname" class="ui-button submit" :class="{disable:!key}" >
@@ -44,13 +43,15 @@ export default {
   },
   data(){
     return {
-      key:''
+      key:'',
+      isPassWordFocus:false
     }
   },
   methods:{
     emitname(){
+     
       if (!this.key.trim()) {
-        return this.$alert({ content: "请输入访问密码" });
+        return
       }
       this.$emit('submit',this.key)
     }

+ 3 - 3
src/framework/vr/index.vue

@@ -13,7 +13,7 @@ import { getSceneInfo } from "@/api";
 import config from "@/config";
 
 import browser from "@/utils/browser";
-import { $smallWaiting } from "@/components/shared/loading";
+import { $smallWaiting1 } from "@/components/shared/loading";
 
 let __krfn = krfn.default;
 window.__krfn = __krfn;
@@ -74,7 +74,7 @@ export default {
 
   mounted() {
     window.vrVrInitFn = () => {
-      $smallWaiting.hide();
+      $smallWaiting1.hide();
     };
     var settings = {
       "events[skin_events].onloadcomplete": "js(window.vrVrInitFn());",
@@ -83,7 +83,7 @@ export default {
     // this.getSceneInfo()
     $("#pano").empty();
     removepano("#pano");
-    $smallWaiting.show();
+    $smallWaiting1.show();
 
     embedpano({
       // xml: "%HTMLPATH%/static/template/tour.xml",

+ 3 - 2
src/utils/request.js

@@ -55,7 +55,7 @@ export const showLoginTips = () => {
 
   return $confirm({
     title: "提示",
-    content: "您没有登录,请登录后再编辑",
+    content: "登录态失效,请重新登录",
     okText: "去登录",
     noText: "登录完毕,继续",
     okLink: "/",
@@ -145,7 +145,8 @@ export function statusCodesHandler(result, callback) {
   }
 
   if (result.code == statusCode.FAILURE_CODE_5004) {
-    return $alert({ content: "密码错误" });
+          return vue.$msg.error("密码错误");
+          // return vue.({ content: "密码错误" });
   }
 
   if (result.code == statusCode.FAILURE_CODE_5001) {