shaogen1995 2 năm trước cách đây
mục cha
commit
4ce63e062a

+ 1 - 0
QJKK/package.json

@@ -17,6 +17,7 @@
     "element-ui": "^2.15.10",
     "html2canvas": "^1.4.1",
     "js-base64": "^3.7.2",
+    "lodash": "^4.17.21",
     "mars3d": "3.4.1",
     "photoswipe": "^4.1.3",
     "swiper": "^5.3.8",

+ 0 - 1
QJKK/public/show.html

@@ -41,7 +41,6 @@
   </head>
 
   <body>
-    <script src="./hls.js"></script>
     <div id="app"></div>
     <!-- built files will be auto injected -->
     <script src="<%= VUE_APP_STATIC_DIR %>/lib/jquery-2.1.1.min.js"></script>

+ 3 - 19
QJKK/src/framework/show/index.vue

@@ -44,6 +44,7 @@
         ref="myListRef"
         :MapShow='MapShow'
         @mapClose='MapShow=false'
+        @openMapShpw='MapShow=true'
       />
       <password
         :bg="showInfo.icon"
@@ -73,11 +74,7 @@
     <!-- 倾斜摄影 -->
     <MapPage v-show="MapShow" @mapCutVr="mapCutVr" />
 
-    <!-- 左侧返回 -->
-    <div class="backMap" @click="MapShow = true">
-      <img src="@/assets/img/Goods/back.png" alt="" />
-      <p>返回</p>
-    </div>
+
   </div>
 </template>
 
@@ -308,7 +305,6 @@ export default {
     activeItem: {
       handler(newVal, oldVal) {
         if (oldVal) this.MapShow = false;
-        console.log("切换了vr", newVal);
         this.currentHotspot = "";
         $("#pano").empty();
         window.vrInitFn = () => {
@@ -387,19 +383,7 @@ export default {
 </script>
 
 <style lang="less" scoped>
-.backMap {
-  color: #333333;
-  position: absolute;
-  z-index: 97;
-  top: 35px;
-  left: 30px;
-  cursor: pointer;
-  width: 50px;
-  text-align: center;
-  & > img {
-    width: 50px;
-  }
-}
+
 .panocon {
   width: 100%;
   height: 100%;

+ 53 - 2
QJKK/src/framework/show/list.vue

@@ -105,6 +105,12 @@
       />
       <p :class="{ acFull: isFullscreen }">全屏</p>
     </div>
+
+    <!-- 左侧返回 -->
+    <div class="backMap" v-show="!MapShow" @click="handleVrFuToSon">
+      <img src="@/assets/img/Goods/back.png" alt="" />
+      <p>返回</p>
+    </div>
   </div>
 </template>
 
@@ -141,6 +147,9 @@ export default {
       menuWidth: 0,
       sceneNum: config.sceneNum,
       SlyArr: [],
+
+      goBackArr: [],
+      goBackInd: null,
     };
   },
   computed: {
@@ -243,7 +252,36 @@ export default {
       this.$refs.sw2.swiper.slideTo(i);
     },
 
+    handleVrFuToSon() {
+      if (!this.goBackArr[0].ind) {
+        // 返回地图页面
+        this.$emit("openMapShpw");
+        this.goBackInd=null
+      } else {
+        let code = this.goBackArr[0].code;
+        let ind = this.goBackArr[0].ind;
+
+        this.$refs.sw.swiper.slideTo(ind);
+        history.replaceState(
+          null,
+          null,
+          ""
+            .concat(window.location.pathname, "?")
+            .concat(`id=${this.showInfo.id}&vr=${code}`)
+        );
+        this.sceneNum = code;
+        this.goBackArr = this.goBackArr.filter((v, i) => i !== 0);
+      }
+    },
+
     handleVR(item, i = null) {
+      this.goBackArr = this.goBackArr.filter((v) => v.ind !== this.goBackInd);
+      this.goBackArr.unshift({ code: this.sceneNum, ind: this.goBackInd });
+
+      console.log("--------111", this.goBackArr);
+
+      this.goBackInd = i;
+
       if (i !== null) {
         this.$refs.sw.swiper.slideTo(i);
         this.$emit("mapClose");
@@ -316,7 +354,7 @@ export default {
       handler: function (newVal) {
         if (!newVal) {
           let tmp = this.showInfo.firstScene || this.showInfo.scenes[0];
-          this.handleVR(tmp);
+          // this.handleVR(tmp);
           return;
         }
         let val = this.showInfo.scenes.find((item) => item.sceneCode == newVal);
@@ -338,7 +376,7 @@ export default {
 
     selected: {
       handler: function (newVal) {
-        this.handleVR(newVal);
+        // this.handleVR(newVal);
         if (newVal.type == "4dkk") {
           this.showList = false;
         }
@@ -350,6 +388,19 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.backMap {
+  color: #333333;
+  position: fixed;
+  z-index: 97;
+  top: 35px;
+  left: 30px;
+  cursor: pointer;
+  width: 50px;
+  text-align: center;
+  & > img {
+    width: 50px;
+  }
+}
 .txtShowBtn2 {
   position: fixed;
   z-index: 15;

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

@@ -47,7 +47,7 @@ export default {
       window.location.replace("/YHT/Swkk/index.html#/1");
     },
     toQjkk() {
-      window.location.replace("/YHT/Qjkk/show.html?id=WK1578926366500417536");
+      window.location.replace("/YHT/Qjkk/show.html?id=WK1578926366500417536&vr=fd720_915Qclsvv");
     },
     toGoods() {
       let dom = document.querySelector("#bacMusic");