gemercheung 2 年之前
父節點
當前提交
7f6e34d66e

+ 146 - 73
packages/qjkankan-editor/src/framework/play/pano/components/list.vue

@@ -1,58 +1,126 @@
 <template>
   <div class="bar-list" v-if="show" :class="{ disable: isEditing }">
-    <div class="top-con" v-show="currentScenesList.length > 0"
-    :style="`width:${(Math.max(scenesListW,secondaryW)>1150)?'100%':((Math.max(scenesListW,secondaryW) + 120)+'px')}`"
+    <div
+      class="top-con"
+      v-show="currentScenesList.length > 0"
+      :style="`width:${
+        Math.max(scenesListW, secondaryW) > 1150
+          ? '100%'
+          : Math.max(scenesListW, secondaryW) + 120 + 'px'
+      }`"
     >
-      <div class="swiper-container" 
-      :style="`width:${scenesListW>1150?'100%':(scenesListW+'px')}`"
-       id="swScenes" ref="sw"
-        v-swiper:mySwiper="swiperOptions" v-if="currentScenesList.length > 0">
+      <div
+        class="swiper-container"
+        :style="`width:${scenesListW > 1150 ? '100%' : scenesListW + 'px'}`"
+        id="swScenes"
+        ref="sw"
+        v-swiper:mySwiper="swiperOptions"
+        v-if="currentScenesList.length > 0"
+      >
         <ul class="swiper-wrapper">
           <li
-            v-tooltip="item.type === '4dkk' ? $i18n.t('navigation.scene_edit_tips') : ''" @click="tabCurrentScene(item)"
+            v-tooltip="
+              item.type === '4dkk' ? $i18n.t('navigation.scene_edit_tips') : ''
+            "
+            @click="tabCurrentScene(item)"
             class="swiper-slide"
             :class="{
               active: currentScene.id == item.id,
-              loopspan: item.sceneTitle.length > spanlength && currentScene.id == item.id,
+              loopspan:
+                item.sceneTitle.length > spanlength &&
+                currentScene.id == item.id,
             }"
-            :style="{ backgroundImage: `url(${item.icon})`,}"
-            v-for="(item, i) in currentScenesList" :key="item.id"
+            :style="{ backgroundImage: `url(${item.icon})` }"
+            v-for="(item, i) in currentScenesList"
+            :key="item.id"
           >
-            <i class="iconfont icon-edit_type_3d" :class="{ iconedit_type_panorama: item.type !== '4dkk' }"></i>
+            <i
+              class="iconfont icon-edit_type_3d"
+              :class="{ iconedit_type_panorama: item.type !== '4dkk' }"
+            ></i>
             <div>
-              <span v-if="currentScene.id == item.id">{{ item.sceneTitle }}</span>
-              <span v-else>{{ item.sceneTitle.length > spanlength ? item.sceneTitle.slice(0, spanlength) :
-                  item.sceneTitle
+              <span v-if="currentScene.id == item.id">{{
+                item.sceneTitle
+              }}</span>
+              <span v-else>{{
+                item.sceneTitle.length > spanlength
+                  ? item.sceneTitle.slice(0, spanlength)
+                  : item.sceneTitle
               }}</span>
             </div>
           </li>
         </ul>
       </div>
 
-      <div class="swiper-container" :style="`width:${secondaryW}px`" id="swSecondary" ref="sw1"
-        v-swiper:mySwipera="swiperOptions" v-if="!(secondaryList.length === 1 && (secondaryList[0].name === '默认二级分组'||secondaryList[0].name === $i18n.t('navigation.default_group_two')))">
+      <div
+        class="swiper-container"
+        :style="`width:${secondaryW}px`"
+        id="swSecondary"
+        ref="sw1"
+        v-swiper:mySwipera="swiperOptions"
+        v-if="
+          !(
+            secondaryList.length === 1 &&
+            (secondaryList[0].name === '默认二级分组' ||
+              secondaryList[0].name === $i18n.t('navigation.default_group_two'))
+          )
+        "
+      >
         <ul class="swiper-wrapper">
-          <li class="swiper-slide" @click="tabSecondary(item)" :class="{
-            active: currentSecondary.id == item.id,
-            loopspan: fixTitle(item.name).length > spanlength && currentSecondary.id == item.id,
-          }" v-for="(item, i) in secondaryList" :key="i">
-            <span v-if="currentSecondary.id == item.id">{{ fixTitle(item.name) }}</span>
-            <span v-else>{{ fixTitle(item.name).length > spanlength ? fixTitle(item.name).slice(0, spanlength) : fixTitle(item.name) }}</span>
+          <li
+            class="swiper-slide"
+            @click="tabSecondary(item)"
+            :class="{
+              active: currentSecondary.id == item.id,
+              loopspan:
+                fixTitle(item.name).length > spanlength &&
+                currentSecondary.id == item.id,
+            }"
+            v-for="(item, i) in secondaryList"
+            :key="i"
+          >
+            <span v-if="currentSecondary.id == item.id">{{
+              fixTitle(item.name)
+            }}</span>
+            <span v-else>{{
+              fixTitle(item.name).length > spanlength
+                ? fixTitle(item.name).slice(0, spanlength)
+                : fixTitle(item.name)
+            }}</span>
           </li>
         </ul>
       </div>
     </div>
 
-    <div class="swiper-container"
-    :style="`width:${catalogRootW>innerW?'100%':(catalogRootW+'px')}`" id="swcatalogRoot" ref="sw2"
-      v-swiper:mySwiperb="swiperOptions" v-if="metadata.catalogRoot.length > 0 && metadata.catalogs.length > 1">
+    <div
+      class="swiper-container"
+      :style="`width:${catalogRootW > innerW ? '100%' : catalogRootW + 'px'}`"
+      id="swcatalogRoot"
+      ref="sw2"
+      v-swiper:mySwiperb="swiperOptions"
+      v-if="metadata.catalogRoot.length > 0 && metadata.catalogs.length > 1"
+    >
       <ul class="swiper-wrapper" v-if="metadata.catalogRoot.length > 1">
-        <li class="swiper-slide" :class="{
-          active: currentCatalogRoot.id == item.id,
-          loopspan: fixTitle(item.name).length > spanlength && currentCatalogRoot.id == item.id,
-        }" @click="tabRoot(item)" v-for="(item, i) in metadata.catalogRoot" :key="i">
-          <span v-if="currentCatalogRoot.id == item.id">{{ fixTitle(item.name) }}</span>
-          <span v-else>{{ fixTitle(item.name).length > spanlength ? fixTitle(item.name).slice(0, spanlength) : fixTitle(item.name) }}</span>
+        <li
+          class="swiper-slide"
+          :class="{
+            active: currentCatalogRoot.id == item.id,
+            loopspan:
+              fixTitle(item.name).length > spanlength &&
+              currentCatalogRoot.id == item.id,
+          }"
+          @click="tabRoot(item)"
+          v-for="(item, i) in metadata.catalogRoot"
+          :key="i"
+        >
+          <span v-if="currentCatalogRoot.id == item.id">{{
+            fixTitle(item.name)
+          }}</span>
+          <span v-else>{{
+            fixTitle(item.name).length > spanlength
+              ? fixTitle(item.name).slice(0, spanlength)
+              : fixTitle(item.name)
+          }}</span>
         </li>
       </ul>
     </div>
@@ -66,18 +134,17 @@ import { directive } from "vue-awesome-swiper";
 // import style (<= Swiper 5.x)
 import "swiper/css/swiper.css";
 
-
 export default {
   data() {
     return {
       spanlength: 6,
       show: false,
-      innerW:1150,
+      innerW: 1150,
       swidth: {
-        "swcatalogRoot": 104,
-        "swSecondary": 84,
-        "swScenes": 72,
-      }
+        swcatalogRoot: 104,
+        swSecondary: 84,
+        swScenes: 72,
+      },
     };
   },
   directives: {
@@ -121,13 +188,15 @@ export default {
     }),
 
     scenesListW() {
-      return this.currentScenesList.length * (this.swidth['swScenes'] + 10)
+      return this.currentScenesList.length * (this.swidth["swScenes"] + 10);
     },
     secondaryW() {
-      return this.secondaryList.length * (this.swidth['swSecondary'] + 10)
+      return this.secondaryList.length * (this.swidth["swSecondary"] + 10);
     },
     catalogRootW() {
-      return this.metadata.catalogRoot.length * (this.swidth['swcatalogRoot'] + 10)
+      return (
+        this.metadata.catalogRoot.length * (this.swidth["swcatalogRoot"] + 10)
+      );
     },
     swiperOptions() {
       return {
@@ -135,20 +204,20 @@ export default {
         centeredSlides: true,
         centerInsufficientSlides: true,
         centeredSlidesBounds: true,
-        freeMode: true
+        freeMode: true,
       };
     },
   },
   methods: {
-    fixTitle(name){
-      if (name=='默认二级分组') {
-        name = this.$i18n.t('navigation.default_group_two')
-      } else if (name=='一级分组') {
-        name = this.$i18n.t('navigation.group_one')
-      } else{
-        name = name
+    fixTitle(name) {
+      if (name == "默认二级分组") {
+        name = this.$i18n.t("navigation.default_group_two");
+      } else if (name == "一级分组") {
+        name = this.$i18n.t("navigation.group_one");
+      } else {
+        name = name;
       }
-      return name
+      return name;
     },
     loadList() {
       this.$nextTick(() => {
@@ -204,31 +273,29 @@ export default {
     width: 100%;
     position: relative;
 
-    >ul {
+    > ul {
       margin: 0 auto;
-      >li {
+      > li {
         margin: 0 5px;
         white-space: nowrap;
 
-        >span,
-        >div>span {
+        > span,
+        > div > span {
           cursor: pointer;
           display: inline-block;
           color: rgba(255, 255, 255, 0.6);
         }
 
         &.loopspan {
-
-          >span,
-          >div>span {
+          > span,
+          > div > span {
             animation: 5s wordsLoop linear infinite normal;
           }
         }
 
         &.active {
-
-          >span,
-          >div>span {
+          > span,
+          > div > span {
             color: rgba(255, 255, 255, 1);
           }
         }
@@ -239,13 +306,18 @@ export default {
   .top-con {
     margin: 0 auto 10px;
     padding: 10px 0;
-    background: linear-gradient(268deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 25%, rgba(0, 0, 0, 0.4) 75%, rgba(0, 0, 0, 0) 100%);
-
+    background: linear-gradient(
+      268deg,
+      rgba(0, 0, 0, 0) 0%,
+      rgba(0, 0, 0, 0.4) 25%,
+      rgba(0, 0, 0, 0.4) 75%,
+      rgba(0, 0, 0, 0) 100%
+    );
   }
 
   #swcatalogRoot {
-    >ul {
-      >li {
+    > ul {
+      > li {
         width: 104px;
         background: rgba(0, 0, 0, 0.5);
         border-radius: 4px;
@@ -254,7 +326,7 @@ export default {
         box-sizing: border-box;
         overflow: hidden;
 
-        >span {
+        > span {
           width: 100%;
           word-break: keep-all;
         }
@@ -269,14 +341,14 @@ export default {
   #swSecondary {
     margin: 20px auto 10px;
 
-    >ul {
-      >li {
+    > ul {
+      > li {
         width: 84px;
         box-sizing: border-box;
         overflow: hidden;
         padding-bottom: 6px;
 
-        >span {
+        > span {
           width: 100%;
           word-break: keep-all;
         }
@@ -302,8 +374,8 @@ export default {
   }
 
   #swScenes {
-    >ul {
-      >li {
+    > ul {
+      > li {
         cursor: pointer;
         width: 72px;
         height: 72px;
@@ -334,7 +406,7 @@ export default {
           }
         }
 
-        >div {
+        > div {
           position: absolute;
           bottom: 0;
           left: 0;
@@ -343,7 +415,7 @@ export default {
           width: 100%;
           overflow: hidden;
 
-          >span {
+          > span {
             width: 100%;
             line-height: 20px;
             word-break: keep-all;
@@ -353,8 +425,9 @@ export default {
         &.active {
           border: 1px solid @color;
 
-          >div {
-            >span {}
+          > div {
+            > span {
+            }
           }
         }
       }

+ 123 - 56
packages/qjkankan-editor/src/framework/show/list.vue

@@ -1,22 +1,62 @@
 <template>
-  <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="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">
+        <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,i)" 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 icon-edit_type_3d" :class="{ iconedit_type_panorama: item.type !== '4dkk' }"></i>
-                <rollName :offset="20" :active="selected.sceneCode == item.sceneCode" class="pic-name" :myref="'subw' + item.id" :name="item.sceneTitle" />
+                <i
+                  class="iconfont icon-edit_type_3d"
+                  :class="{ iconedit_type_panorama: item.type !== '4dkk' }"
+                ></i>
+                <rollName
+                  :offset="20"
+                  :active="selected.sceneCode == item.sceneCode"
+                  class="pic-name"
+                  :myref="'subw' + item.id"
+                  :name="item.sceneTitle"
+                />
               </div>
             </li>
           </ul>
         </div>
 
-        <div class="clip-scroller"  ref="sw1"  v-swiper:mySwipera="swiperOptions" v-if="childTab.length > 1">
+        <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="handleTabtow(item,i)" 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 +71,20 @@
         </div>
       </div>
 
-      <div class="clip-scroller" ref="sw2" v-swiper:mySwiperb="swiperOptions" v-if="showInfo.catalogRoot.length > 0 && showInfo.catalogs.length > 1">
+      <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">
+          <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 +98,24 @@
         </ul>
       </div>
     </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
+      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>
 
@@ -60,7 +128,6 @@ import { directive } from "vue-awesome-swiper";
 // import style (<= Swiper 5.x)
 import "swiper/css/swiper.css";
 
-
 let isW = window.innerWidth > 1400;
 
 console.log(window.innerWidth);
@@ -83,7 +150,7 @@ export default {
       loadFirst: true,
       menuWidth: 0,
       sceneNum: config.sceneNum,
-      SlyArr:[]
+      SlyArr: [],
     };
   },
   computed: {
@@ -99,10 +166,10 @@ export default {
         // initialSlide:0,
         // observer:true,
         // observeParents: true,
-        centeredSlides : true,
+        centeredSlides: true,
         centerInsufficientSlides: true,
         centeredSlidesBounds: true,
-        freeMode:true
+        freeMode: true,
       };
     },
   },
@@ -114,56 +181,55 @@ export default {
       }
     },
 
-    fixPosit(ref,i,prenum,nexnum){
-         if (i!==null) {
-        let acidx = this.$refs[ref].swiper.activeIndex
+    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 (i - acidx > nexnum) {
+          this.$refs[ref].swiper.slideNext();
         }
 
-        if (acidx - i > prenum ) {
-          this.$refs[ref].swiper.slidePrev()
+        if (acidx - i > prenum) {
+          this.$refs[ref].swiper.slidePrev();
         }
       }
     },
 
-    handleTabtow(item,i=null){
-      this.tabtowActive = item
-      this.fixPosit('sw1',i,3,3)
+    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
-
+    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)
+      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}`));
+    handleVR(item, i = null) {
+      history.replaceState(
+        null,
+        null,
+        ""
+          .concat(window.location.pathname, "?")
+          .concat(`id=${this.showInfo.id}&vr=${item.sceneCode}`)
+      );
       this.sceneNum = item.sceneCode;
 
-      let pp = this.isW ? 7 : 5
-      let nn = this.isW ? 7 : 5
+      let pp = this.isW ? 7 : 5;
+      let nn = this.isW ? 7 : 5;
 
-
-      this.fixPosit('sw',i,pp,nn)
-     
+      this.fixPosit("sw", i, pp, nn);
     },
-   
   },
 
-  mounted() {
-    
-  },
+  mounted() {},
 
   watch: {
     taboneActive: {
-      handler: function(newVal) {
+      handler: function (newVal) {
         let temp = [];
         newVal.children &&
           newVal.children.forEach((item) => {
@@ -181,7 +247,7 @@ export default {
     },
     tabtowActive: {
       deep: true,
-      handler: function(newVal) {
+      handler: function (newVal) {
         if (!newVal) {
           this.tabtowActive = this.childTab[0];
         } else {
@@ -196,14 +262,16 @@ export default {
     sceneNum: {
       deep: true,
       immediate: true,
-      handler: function(newVal) {
+      handler: function (newVal) {
         if (!newVal) {
           let tmp = this.showInfo.firstScene || this.showInfo.scenes[0];
           this.handleVR(tmp);
           return;
         }
         let val = this.showInfo.scenes.find((item) => item.sceneCode == newVal);
-        let tmp = this.showInfo.catalogs.find((item) => item.id == val.category);
+        let tmp = this.showInfo.catalogs.find(
+          (item) => item.id == val.category
+        );
         let rootTmp = this.showInfo.catalogRoot.find((item) => {
           return item.children.indexOf(tmp.id) > -1;
         });
@@ -218,7 +286,7 @@ export default {
     },
 
     selected: {
-      handler: function(newVal) {
+      handler: function (newVal) {
         this.handleVR(newVal);
         if (newVal.type == "4dkk") {
           this.showList = false;
@@ -313,7 +381,7 @@ export default {
     }
   }
 
-  .deepbg{
+  .deepbg {
     background: rgba(0, 0, 0, 0.5);
   }
   .l-con {
@@ -329,7 +397,7 @@ export default {
       padding: 0 20px;
     }
 
-    .clip-scroller{
+    .clip-scroller {
       position: relative;
       border-radius: 4px;
     }
@@ -348,7 +416,6 @@ export default {
       > li {
         width: 84px;
         margin: 0 10px;
-
       }
     }
     .tap {
@@ -357,7 +424,7 @@ export default {
       > li {
         position: relative;
         width: 104px;
-        .btn{
+        .btn {
           width: 100%;
           padding: 0;
         }
@@ -401,7 +468,7 @@ export default {
             left: 0;
             bottom: 0;
             font-size: 0;
-            /deep/ span{
+            /deep/ span {
               font-size: 12px;
               padding: 2px 0;
             }
@@ -419,16 +486,16 @@ export default {
             top: 4px;
             z-index: 99;
 
-            &::after{
+            &::after {
               background: rgba(0, 0, 0, 0.3);
-              content: '';
+              content: "";
               width: 14px;
               height: 14px;
               display: inline-block;
               position: absolute;
               top: 50%;
               left: 50%;
-              transform: translate(-50%,-50%);
+              transform: translate(-50%, -50%);
               z-index: -1;
               filter: blur(4px);
             }

+ 164 - 135
packages/qjkankan-editor/src/views/navigation/groupSettings.vue

@@ -1,22 +1,24 @@
 <template>
   <div class="group-settings" app-border dir-right>
-    <div class="ui-title-big">{{$i18n.t("navigation.scene_navigation")}}
-      <i class="iconfont icon-help_i tool-tip-for-editor" v-tooltip="$i18n.t('navigation.scene_tips')">
+    <div class="ui-title-big">
+      {{ $i18n.t("navigation.scene_navigation") }}
+      <i
+        class="iconfont icon-help_i tool-tip-for-editor"
+        v-tooltip="$i18n.t('navigation.scene_tips')"
+      >
       </i>
     </div>
-    <button class="ui-button create-group-btn"
+    <button
+      class="ui-button create-group-btn"
       @click="onRequestForAddLevel1Group"
     >
       <i class="iconfont icon-editor_add"></i>
-      {{$i18n.t('navigation.add_group')}}
+      {{ $i18n.t("navigation.add_group") }}
     </button>
 
     <div class="scene-group-wrap">
       <InsertPositionTip position-debug="-1" :index="0"></InsertPositionTip>
-      <div
-        v-for="(item, index) of catalogTopology"
-        :key=item.id
-      >
+      <div v-for="(item, index) of catalogTopology" :key="item.id">
         <SceneGroupInEditor
           ref="scene-group"
           :groupNode="item"
@@ -27,7 +29,10 @@
           @renameGroup="onRenameGroup"
           @deleteGroup="onDeleteGroup"
         />
-        <InsertPositionTip position-debug="0" :index="index + 1"></InsertPositionTip>
+        <InsertPositionTip
+          position-debug="0"
+          :index="index + 1"
+        ></InsertPositionTip>
       </div>
     </div>
   </div>
@@ -47,99 +52,99 @@ export default {
   computed: {
     ...mapGetters({
       info: "info",
-      catalogTopology: 'catalogTopology',
+      catalogTopology: "catalogTopology",
     }),
   },
   data() {
-    return {
-    };
-  },
-  watch: {
+    return {};
   },
+  watch: {},
   methods: {
     onRequestForAddLevel1Group() {
-      const newGroupLevel1Id = 'r_' + this.$randomWord(true, 8, 8)
-      const newGroupLevel2Id = 'c_' + this.$randomWord(true, 8, 8)
+      const newGroupLevel1Id = "r_" + this.$randomWord(true, 8, 8);
+      const newGroupLevel2Id = "c_" + this.$randomWord(true, 8, 8);
 
       const newGroupLevel1 = {
         id: newGroupLevel1Id,
-        name: this.$i18n.t('navigation.group_one'),
+        name: this.$i18n.t("navigation.group_one"),
         children: [newGroupLevel2Id],
-      }
-      this.info.catalogRoot.push(newGroupLevel1)
+      };
+      this.info.catalogRoot.push(newGroupLevel1);
       this.info.catalogs.push({
         id: newGroupLevel2Id,
-        name: this.$i18n.t('navigation.default_group_two'),
-      })
+        name: this.$i18n.t("navigation.default_group_two"),
+      });
 
       this.$nextTick(() => {
-        const newGroupComp = this.$refs['scene-group'].find((item) => {
-          return item.groupNode.id === newGroupLevel1Id
-        })
-        newGroupComp.onClickForRename()
-      })
+        const newGroupComp = this.$refs["scene-group"].find((item) => {
+          return item.groupNode.id === newGroupLevel1Id;
+        });
+        newGroupComp.onClickForRename();
+      });
     },
     onRequestForAddGroupLevel2(parentGroupId) {
-      let id = 'c_' + this.$randomWord(true, 8, 8)
+      let id = "c_" + this.$randomWord(true, 8, 8);
       let parent = this.info.catalogRoot.find((item) => {
-        return item.id === parentGroupId
-      })
+        return item.id === parentGroupId;
+      });
       parent.children.push(id);
       const newGroupLevel2 = {
         id,
-        name: this.$i18n.t('navigation.group_two'),
-      }
+        name: this.$i18n.t("navigation.group_two"),
+      };
       this.info.catalogs.push(newGroupLevel2);
 
       this.$nextTick(() => {
-        const parentGroupComp = this.$refs['scene-group'].find((item) => {
-          return item.groupNode.id === parentGroupId
-        })
-        parentGroupComp.isExpanded = true
+        const parentGroupComp = this.$refs["scene-group"].find((item) => {
+          return item.groupNode.id === parentGroupId;
+        });
+        parentGroupComp.isExpanded = true;
         this.$nextTick(() => {
-          const newGroupComp = parentGroupComp.$refs['scene-group'].find((item) => {
-            return item.groupNode.id === id
-          })
-          newGroupComp.onClickForRename()
-        })
-      })
+          const newGroupComp = parentGroupComp.$refs["scene-group"].find(
+            (item) => {
+              return item.groupNode.id === id;
+            }
+          );
+          newGroupComp.onClickForRename();
+        });
+      });
     },
     onRenameScene(sceneId, newName) {
       const renameTarget = this.info.scenes.find((item) => {
-        return item.id === sceneId
-      })
-      renameTarget.sceneTitle = newName
+        return item.id === sceneId;
+      });
+      renameTarget.sceneTitle = newName;
     },
     onDeleteScene(sceneId) {
       if (this.info.scenes.length === 1) {
         this.$alert({
-          title: this.$i18n.t('navigation.delete_init_scene'),
-          content: this.$i18n.t('navigation.keep_one_scene'),
-        })
-        return
+          title: this.$i18n.t("navigation.delete_init_scene"),
+          content: this.$i18n.t("navigation.keep_one_scene"),
+        });
+        return;
       }
       const deleteTargetIdx = this.info.scenes.findIndex((item) => {
-        return item.id === sceneId
-      })
-      this.info.scenes.splice(deleteTargetIdx, 1)
-      this.delFirstScene()
-      this.$msg.success(this.$i18n.t('gather.delete_success'))
+        return item.id === sceneId;
+      });
+      this.info.scenes.splice(deleteTargetIdx, 1);
+      this.delFirstScene();
+      this.$msg.success(this.$i18n.t("gather.delete_success"));
     },
     onRenameGroup(groupId, level, newName) {
       if (level === 1) {
         const target = this.info.catalogRoot.find((item) => {
-          return item.id === groupId
-        })
-        target.name = newName
-        this.$msg.success(this.$i18n.t('gather.success'))
+          return item.id === groupId;
+        });
+        target.name = newName;
+        this.$msg.success(this.$i18n.t("gather.success"));
       } else if (level === 2) {
         const target = this.info.catalogs.find((item) => {
-          return item.id === groupId
-        })
-        target.name = newName
-        this.$msg.success(this.$i18n.t('gather.success'))
+          return item.id === groupId;
+        });
+        target.name = newName;
+        this.$msg.success(this.$i18n.t("gather.success"));
       } else {
-        console.error('invalid level!');
+        console.error("invalid level!");
       }
     },
     onDeleteGroup(groupId, groupLevel) {
@@ -149,150 +154,174 @@ export default {
           (groupLevel === 2 && this.info.catalogs.length === 1)
         ) {
           this.$alert({
-            content: this.$i18n.t('navigation.keep_one_group'),
-          })
-          return
+            content: this.$i18n.t("navigation.keep_one_group"),
+          });
+          return;
         }
 
         if (groupLevel === 1 && this.info.catalogRoot.length !== 1) {
-          const targetGroupIdx = this.info.catalogRoot.findIndex((groupLevel1) => {
-            return groupLevel1.id === groupId
-          })
+          const targetGroupIdx = this.info.catalogRoot.findIndex(
+            (groupLevel1) => {
+              return groupLevel1.id === groupId;
+            }
+          );
           if (targetGroupIdx < 0) {
-            throw('没有找到要删除的一级分组!')
+            throw "没有找到要删除的一级分组!";
           }
-          const groupLevel2List = this.info.catalogRoot[targetGroupIdx].children
+          const groupLevel2List =
+            this.info.catalogRoot[targetGroupIdx].children;
           // 检查是否所有场景都(间接)属于该一级分组
           if (
             this.info.scenes.every((scene) => {
-              return groupLevel2List.some(groupLevel2Id => {
-                return groupLevel2Id === scene.category
-              })
+              return groupLevel2List.some((groupLevel2Id) => {
+                return groupLevel2Id === scene.category;
+              });
             })
           ) {
             this.$alert({
-              content: this.$i18n.t('navigation.keep_one_scene'),
-            })
-            return
+              content: this.$i18n.t("navigation.keep_one_scene"),
+            });
+            return;
           }
         }
-         
+
         if (groupLevel === 2 && this.info.catalogs.length !== 1) {
           // 检查是否所有场景都属于该二级分组
-          if (this.info.scenes.every((scene) => {
-            return scene.category === groupId
-          })) {
-            this.$alert({
-              content: this.$i18n.t('navigation.keep_one_scene'),
+          if (
+            this.info.scenes.every((scene) => {
+              return scene.category === groupId;
             })
-            return
+          ) {
+            this.$alert({
+              content: this.$i18n.t("navigation.keep_one_scene"),
+            });
+            return;
           }
         }
-      } catch(e) {
+      } catch (e) {
         console.error(e);
-        this.$msg.error(this.$i18n.t('gather.delete_fail'))
-        return
+        this.$msg.error(this.$i18n.t("gather.delete_fail"));
+        return;
       }
 
       const deleteGroupLevel2 = (groupId) => {
         // 要删除的二级分组在catalogRoot[x].children中的索引
-        let targetGroupIdxLevel2 = null
+        let targetGroupIdxLevel2 = null;
         // 要删除的二级分组所属的一级分组在catalogRoot中的索引
-        let belongGroupIdxLevel1 = null
+        let belongGroupIdxLevel1 = null;
         // 确定上边两个变量的取值
-        for (const [groupIdxLevel1, groupLevel1] of this.info.catalogRoot.entries()) {
-          for (const [groupIdxLevel2, childId] of groupLevel1.children.entries()) {
+        for (const [
+          groupIdxLevel1,
+          groupLevel1,
+        ] of this.info.catalogRoot.entries()) {
+          for (const [
+            groupIdxLevel2,
+            childId,
+          ] of groupLevel1.children.entries()) {
             if (childId === groupId) {
-              targetGroupIdxLevel2 = groupIdxLevel2
-              break
+              targetGroupIdxLevel2 = groupIdxLevel2;
+              break;
             }
           }
           if (targetGroupIdxLevel2 !== null) {
-            belongGroupIdxLevel1 = groupIdxLevel1
-            break
+            belongGroupIdxLevel1 = groupIdxLevel1;
+            break;
           }
         }
         if (targetGroupIdxLevel2 === null || belongGroupIdxLevel1 === null) {
-          throw('一级分组列表中没有找到要删除的二级分组!')
+          throw "一级分组列表中没有找到要删除的二级分组!";
         }
 
         // 删除catalogRoot[x].children中那个二级分组条目
-        this.info.catalogRoot[belongGroupIdxLevel1].children.splice(targetGroupIdxLevel2, 1)
-        
+        this.info.catalogRoot[belongGroupIdxLevel1].children.splice(
+          targetGroupIdxLevel2,
+          1
+        );
+
         // 删除catalogs中那个二级分组条目
         const targetIdx = this.info.catalogs.findIndex((item) => {
-          return item.id === groupId
-        })
+          return item.id === groupId;
+        });
         if (targetIdx < 0) {
-          throw('二级分组列表中没有找到要删除的二级分组!')
+          throw "二级分组列表中没有找到要删除的二级分组!";
         }
-        this.info.catalogs.splice(targetIdx, 1)
+        this.info.catalogs.splice(targetIdx, 1);
 
         // 删除场景列表中属于要删除的二级分组的那些场景
         this.info.scenes = this.info.scenes.filter((item) => {
-          return item.category !== groupId
-        })
+          return item.category !== groupId;
+        });
 
         // 如果所属一级分组中没有任何二级分组了,则新增一个默认二级分组
         if (this.info.catalogRoot[belongGroupIdxLevel1].children.length === 0) {
-          let newGroupLevel2Id = 'c_' + this.$randomWord(true, 8, 8)
-          this.info.catalogRoot[belongGroupIdxLevel1].children.push(newGroupLevel2Id)
+          let newGroupLevel2Id = "c_" + this.$randomWord(true, 8, 8);
+          this.info.catalogRoot[belongGroupIdxLevel1].children.push(
+            newGroupLevel2Id
+          );
           this.info.catalogs.push({
             id: newGroupLevel2Id,
-            name: this.$i18n.t('navigation.default_group_two'),
-          })
+            name: this.$i18n.t("navigation.default_group_two"),
+          });
         }
 
-        return
-      }
+        return;
+      };
 
-      const backup = deepClone(this.info)
+      const backup = deepClone(this.info);
       try {
         if (groupLevel === 1) {
-          const targetGroupIdx = this.info.catalogRoot.findIndex((groupLevel1) => {
-            return groupLevel1.id === groupId
-          })
+          const targetGroupIdx = this.info.catalogRoot.findIndex(
+            (groupLevel1) => {
+              return groupLevel1.id === groupId;
+            }
+          );
           if (targetGroupIdx < 0) {
-            throw('没有找到要删除的一级分组!')
+            throw "没有找到要删除的一级分组!";
           }
           // 删除该一级分组下的所有二级分组及属于这些二级分组的场景
-          for (const childId of this.info.catalogRoot[targetGroupIdx].children) {
-            deleteGroupLevel2(childId)
+          for (const childId of this.info.catalogRoot[targetGroupIdx]
+            .children) {
+            deleteGroupLevel2(childId);
           }
           // 删除该一级分组
-          this.info.catalogRoot.splice(targetGroupIdx, 1)
+          this.info.catalogRoot.splice(targetGroupIdx, 1);
         } else if (groupLevel === 2) {
-          deleteGroupLevel2(groupId)
+          deleteGroupLevel2(groupId);
         } else {
-          throw('group level invalid!');
+          throw "group level invalid!";
         }
         // 酌情清空初始场景设置
-        this.delFirstScene()
-        this.$msg.success(this.$i18n.t('gather.delete_success'))
-      } catch(e) {
+        this.delFirstScene();
+        this.$msg.success(this.$i18n.t("gather.delete_success"));
+        //1.4.0 增加成功后成功后toggle一下默认的
+        const firstTab = this.info.catalogRoot[0];
+        setTimeout(() => {
+          this.$store.commit("scene/setCurrentCatalogRoot", firstTab);
+        }, 100);
+      } catch (e) {
         console.error(e);
-        this.$msg.error('删除失败')
-        this.$msg.error(this.$i18n.t('gather.delete_fail'))
-        this.$store.commit("SetInfo", backup)
+        this.$msg.error("删除失败");
+        this.$msg.error(this.$i18n.t("gather.delete_fail"));
+        this.$store.commit("SetInfo", backup);
       }
     },
-    delFirstScene(){
+    delFirstScene() {
       if (this.info.firstScene) {
-        let firIdx = this.info.scenes.find(item=>{
-          return item.sceneCode == this.info.firstScene.sceneCode
+        let firIdx = this.info.scenes.find((item) => {
+          return item.sceneCode == this.info.firstScene.sceneCode;
         });
-        !firIdx&&(this.info.firstScene='')
+        !firIdx && (this.info.firstScene = "");
       }
     },
   },
   mounted() {
-    this.$bus.on('getActive',data=>{
+    this.$bus.on("getActive", (data) => {
       if (data.type == 1) {
-        this.taboneActive = data.willActive
-      } else{
-        this.tabtowActive = data.willActive
+        this.taboneActive = data.willActive;
+      } else {
+        this.tabtowActive = data.willActive;
       }
-    })
+    });
   },
 };
 </script>
@@ -348,7 +377,7 @@ export default {
         letter-spacing: 1px;
         width: 100%;
         &:focus {
-          border-color: #0076F6;
+          border-color: #0076f6;
         }
       }
     }

+ 6 - 3
packages/qjkankan-kankan-view/public/smg.html

@@ -27,9 +27,12 @@
 
 
         <script src="<%= BASE_URL %><%= VUE_APP_STATIC_DIR %>/static/lib/jweixin-1.6.0.js"></script>
-        
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=4.8.4"></script>
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=4.8.4"></script>
+
+        <!-- <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=4.8.4"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=4.8.4"></script> -->
+
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js"></script>
 
         <!-- <script src="https://4dkk.4dage.com/v4/www/sdk/kankan-sdk-deps.js?v=4.0.0-alpha.44"></script>
         <script src="https://4dkk.4dage.com/v4/www/sdk/kankan-sdk.js?v=4.0.0-alpha.44"></script> -->

+ 4 - 3
packages/qjkankan-kankan-view/public/spg.html

@@ -16,9 +16,10 @@
             <strong>We're sorry but doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
         </noscript>
         <div id="app"></div>
-        
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=4.8.4"></script>
-        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=4.8.4"></script>
+        <!-- <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js?v=4.8.4"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?v=4.8.4"></script>    -->
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk-deps.js"></script>
+        <script src="<%= VUE_APP_SDK_DIR %>kankan-sdk.js?"></script>
 
         <!-- built files will be auto injected -->
     </body>

+ 2 - 1
packages/qjkankan-view/src/hooks/useAudio.js

@@ -168,7 +168,7 @@ class AudioPlayer {
             preload: true,
             src: [this._src],
             loop: this._loop || false,
-            html5: true,
+            html5: false,
             onplay: () => {
                 this._isPlaying = true
                 this.emit('play')
@@ -179,6 +179,7 @@ class AudioPlayer {
             },
             onend: () => {
                 this._isPlaying = false
+                this.audio.unload();
                 this.emit('end')
             },