chenlei 1 dzień temu
rodzic
commit
42295382e2
2 zmienionych plików z 20 dodań i 5 usunięć
  1. 3 3
      src/components/Title.vue
  2. 17 2
      src/views/Home.vue

+ 3 - 3
src/components/Title.vue

@@ -113,7 +113,7 @@
         {
           label: '4-2号楼4层 双人自理间',
           sceneCode: 'KJ-SfNcYJffCof',
-          href: '/?pose=pano:16,qua:-0.0382,-0.0274,-0.001,0.9989',
+          href: '?pose=pano:16,qua:-0.0382,-0.0274,-0.001,0.9989',
           params:
             '&firstView=pano:16,qua:-0.07389770295455884,-0.022001805388514675,-0.001630739657061169,0.9970217626634693',
         },
@@ -254,7 +254,7 @@
           sceneCode: 'KJ-SfNcYJffCof',
           params:
             '&firstView=pano:136,qua:-0.04730401416249904,-0.6225940589150876,-0.03774820655556335,0.7802012747957571',
-          href: '/'
+          href: ''
         },
         {
           label: '光大4-2号楼-5F',
@@ -281,7 +281,7 @@
     },
     methods: {
       changeScene(item) {
-        location.href = item.href ? item.href : `https://scene.4dage.com/zgrs.html?m=${item.sceneCode}${item.params ? item.params : ''}`;
+        location.href = typeof item.href === 'string' ? `${location.origin}${location.pathname}${item.href}` : `https://scene.4dage.com/zgrs.html?m=${item.sceneCode}${item.params ? item.params : ''}`;
       }
     }
   }

+ 17 - 2
src/views/Home.vue

@@ -330,9 +330,9 @@ export default {
           let flag = false;
           if (arrTitle[2] || !data.title.includes("&")) flag = true;
 
-          let title = data.title.split("&")[0];
+          let title = data.title.split("&")[0].replace('(link)', '');
 
-          return `<div class="cus-hotspot"></div>`;
+          return `<div class="cus-hotspot"><div class="cus-hotspot__content">${title}</div></div>`;
         },
       })
       .then((TagView) => {
@@ -445,11 +445,26 @@ export default {
 </script>
 <style lang="less">
 .cus-hotspot {
+  position: relative;
   width: 80px;
   height: 80px;
   background: url('../assets/img/Hot/point.png') no-repeat center / contain;
   cursor: pointer;
   animation: hotspotAni .6s ease-in-out alternate infinite;
+
+  &__content {
+    position: absolute;
+    top: 50%;
+    left: 100%;
+    padding: 8px 10px;
+    border-radius: 4px;
+    color: white;
+    font-size: 14px;
+    text-align: center;
+    white-space: nowrap;
+    background: rgba(0, 0, 0, .6);
+    transform: translateY(-50%);
+  }
 }
 @keyframes hotspotAni {
   100% {