Bläddra i källkod

Merge branch 'master' of http://face3d.4dage.com:7005/chenzhiguang/guangdongVR_museum into master

shaogen1995 2 år sedan
förälder
incheckning
46d830a05e

+ 2 - 2
code/src/components/Audio.vue

@@ -20,10 +20,10 @@
       </div>
 
       <div class="bofang">
-        <img :src="require(`@/assets/images/icon/voice_back.png`)" alt="">
+        <!-- <img :src="require(`@/assets/images/icon/voice_back.png`)" alt=""> -->
         <img class="bf" @click="bofang" :src="require(`@/assets/images/icon/${isPlay ? 'voice_stop' : 'voice_play'}.png`)"
           alt="" />
-        <img :src="require(`@/assets/images/icon/voice_next.png`)" alt="">
+        <!-- <img :src="require(`@/assets/images/icon/voice_next.png`)" alt=""> -->
 
       </div>
 

+ 7 - 3
code/src/components/exItem/index.vue

@@ -52,7 +52,6 @@ let onClickExItem = (data) => {
   padding: 38px 0 56px;
   margin-bottom: 20px;
   cursor: pointer;
-
   .title {
     font-size: 30px;
     font-weight: 400;
@@ -60,8 +59,10 @@ let onClickExItem = (data) => {
     margin: 28px 0 16px;
   }
 
-  >img {
-    width: 100%;
+  > img {
+    max-height: 700px;
+    max-width: 1400px;
+    object-fit: contain;
   }
 
   .date {
@@ -72,12 +73,14 @@ let onClickExItem = (data) => {
   .heng{
     display: flex;
     .img{
+      flex: 0 0 auto;
       width: 300px;
       height: 150px;
       background-position: center;
       background-size: cover;
     }
     .info{
+      flex: 1 1 1px;
       margin-left: 30px;
       display: flex;
       flex-direction: column;
@@ -96,6 +99,7 @@ let onClickExItem = (data) => {
       }
     }
     .viewbtn{
+      flex: 0 0 auto;
       position: absolute;
       right: 0;
       top: 50%;

+ 15 - 11
code/src/views/exhibition/exhibition/guide.vue

@@ -19,7 +19,7 @@
         </li>
       </ul>
 
-      <div class="guidebtn">查看导览</div>
+      <div class="guidebtn" @click="onClickGuide">查看导览</div>
     </div>
   </div>
 </template>
@@ -29,24 +29,28 @@ import { defineProps, defineEmits, watch, onMounted, nextTick, ref } from "vue";
 
 const map = ref("");
 
-    const props = defineProps({
-      currentMuseumItem: {
-        type: Object,
-        default: () => {
-          return {}
-        },
-      },
-    });
+const props = defineProps({
+  currentMuseumItem: {
+    type: Object,
+    default: () => {
+      return {}
+    },
+  },
+});
+
+const onClickGuide = () => {
+  window.open(`https://uri.amap.com/marker?name=${props.currentMuseumItem.name}&position=${props.currentMuseumItem.lng},${props.currentMuseumItem.lat}&callnative=1`)
+}
 
 onMounted(() => {
   map.value = new global.AMap.Map("map", {
     mapStyle: "amap://styles/fresh",
     zoom: 13,
-    center: [113.524914, 22.230397],
+    center: [props.currentMuseumItem.lng, props.currentMuseumItem.lat],
   });
 
   var marker = new AMap.Marker({
-    position: new AMap.LngLat(113.524914, 22.230397), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+    position: new AMap.LngLat(props.currentMuseumItem.lng, props.currentMuseumItem.lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
     title: "广东",
   });
 

+ 8 - 3
code/src/views/exhibition/exhibition/mobile/guide.vue

@@ -19,7 +19,7 @@
         </li>
       </ul>
 
-      <div class="guidebtn">查看导览</div>
+      <div class="guidebtn" @click="onClickGuide">查看导览</div>
     </div>
   </div>
 </template>
@@ -28,6 +28,7 @@
 import { defineProps, defineEmits, watch, onMounted, nextTick, ref } from "vue";
 
 const map = ref("");
+
 const props = defineProps({
   currentMuseumItem: {
     type: Object,
@@ -37,15 +38,19 @@ const props = defineProps({
   },
 });
 
+const onClickGuide = () => {
+  window.open(`https://uri.amap.com/marker?name=${props.currentMuseumItem.name}&position=${props.currentMuseumItem.lng},${props.currentMuseumItem.lat}&callnative=1`)
+}
+
 onMounted(() => {
   map.value = new global.AMap.Map("map", {
     mapStyle: "amap://styles/fresh",
     zoom: 13,
-    center: [113.524914, 22.230397],
+    center: [props.currentMuseumItem.lng, props.currentMuseumItem.lat],
   });
 
   var marker = new AMap.Marker({
-    position: new AMap.LngLat(113.524914, 22.230397), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+    position: new AMap.LngLat(props.currentMuseumItem.lng, props.currentMuseumItem.lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
     title: "广东",
   });
 

+ 15 - 11
code/src/views/gdmuseum/exhibition/guide.vue

@@ -19,7 +19,7 @@
         </li>
       </ul>
 
-      <div class="guidebtn">查看导览</div>
+      <div class="guidebtn" @click="onClickGuide">查看导览</div>
     </div>
   </div>
 </template>
@@ -29,24 +29,28 @@ import { defineProps, defineEmits, watch, onMounted, nextTick, ref } from "vue";
 
 const map = ref("");
 
-    const props = defineProps({
-      currentMuseumItem: {
-        type: Object,
-        default: () => {
-          return {}
-        },
-      },
-    });
+const props = defineProps({
+  currentMuseumItem: {
+    type: Object,
+    default: () => {
+      return {}
+    },
+  },
+});
+
+const onClickGuide = () => {
+  window.open(`https://uri.amap.com/marker?name=${props.currentMuseumItem.name}&position=${props.currentMuseumItem.lng},${props.currentMuseumItem.lat}&callnative=1`)
+}
 
 onMounted(() => {
   map.value = new global.AMap.Map("map", {
     mapStyle: "amap://styles/fresh",
     zoom: 13,
-    center: [113.524914, 22.230397],
+    center: [props.currentMuseumItem.lng, props.currentMuseumItem.lat],
   });
 
   var marker = new AMap.Marker({
-    position: new AMap.LngLat(113.524914, 22.230397), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+    position: new AMap.LngLat(props.currentMuseumItem.lng, props.currentMuseumItem.lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
     title: "广东",
   });
 

+ 8 - 3
code/src/views/gdmuseum/exhibition/mobile/guide.vue

@@ -19,7 +19,7 @@
         </li>
       </ul>
 
-      <div class="guidebtn">查看导览</div>
+      <div class="guidebtn" @click="onClickGuide">查看导览</div>
     </div>
   </div>
 </template>
@@ -28,6 +28,7 @@
 import { defineProps, defineEmits, watch, onMounted, nextTick, ref } from "vue";
 
 const map = ref("");
+
 const props = defineProps({
   currentMuseumItem: {
     type: Object,
@@ -37,15 +38,19 @@ const props = defineProps({
   },
 });
 
+const onClickGuide = () => {
+  window.open(`https://uri.amap.com/marker?name=${props.currentMuseumItem.name}&position=${props.currentMuseumItem.lng},${props.currentMuseumItem.lat}&callnative=1`)
+}
+
 onMounted(() => {
   map.value = new global.AMap.Map("map", {
     mapStyle: "amap://styles/fresh",
     zoom: 13,
-    center: [113.524914, 22.230397],
+    center: [props.currentMuseumItem.lng, props.currentMuseumItem.lat],
   });
 
   var marker = new AMap.Marker({
-    position: new AMap.LngLat(113.524914, 22.230397), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
+    position: new AMap.LngLat(props.currentMuseumItem.lng, props.currentMuseumItem.lat), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
     title: "广东",
   });
 

+ 4 - 1
code/src/views/gdmuseum/index.vue

@@ -9,7 +9,10 @@
 
     <vtab @handleTab="handleTab" :list="menu" class="tabcon" />
 
-    <component :key="panelPage" class="limitwidth" :is="panelPage"></component>
+    <component
+      :key="panelPage" class="limitwidth" :is="panelPage"
+      :currentMuseumItem="currentMuseum"
+    ></component>
   </div>
 </template>
 

+ 4 - 1
code/src/views/gdmuseum/mobile.vue

@@ -6,7 +6,10 @@
         {{currentMuseum.description || '暂无简介'}}
       </p>
     </div>
-    <component :key="panelPage" class="limitwidth" :is="panelPage"></component>
+    <component
+      :key="panelPage" class="limitwidth" :is="panelPage"
+      :currentMuseumItem="currentMuseum"
+    ></component>
   </div>
 
   <teleport to='body' >

+ 11 - 4
code/src/views/home/aside.vue

@@ -17,7 +17,7 @@
       <section>
         <ul v-if="list.length > 0">
           <li v-for="(sub, idx) in list" :key="idx">
-            <p>{{ sub.type }}</p>
+            <p :id="'aside-list-sidebar-' + sub.type">{{ sub.type }}</p>
             <ul v-if="sub.arr.length > 0">
               <li @click="onClickItem(son)" v-for="(son, sonidx) in sub.arr" :key="sonidx">
                 {{ son.name }}
@@ -29,7 +29,7 @@
 
       <div class="sidebar">
         <ul>
-          <li v-for="(item, i) in charStrs" :key="i">
+          <li v-for="(item, i) in charStrs" :key="i" @click="onClickSidebarItem(item)">
             {{ item }}
           </li>
         </ul>
@@ -65,6 +65,12 @@ const onClickSelect = (data) => {
   isShow.value = true
   currentId.value = data.id
 }
+const onClickSidebarItem = (item) => {
+  const targetNode = document.getElementById('aside-list-sidebar-' + item)
+  if (targetNode) {
+    targetNode.scrollIntoView()
+  }
+}
 
 const searchkey = ref('')
 
@@ -195,7 +201,6 @@ onMounted(() => {
     text-align: left;
     position: relative;
     padding: 18px 10px;
-
     .gd {
       color: var(--main-color);
       font-size: 16px;
@@ -218,7 +223,9 @@ onMounted(() => {
     }
 
     >section {
-
+      height: 95%;
+      overflow-y: auto;
+      &::-webkit-scrollbar { display: none; } /*宽度是对垂直滚动条而言,高度是对水平滚动条而言*/
       >ul {
         padding-left: 16px;
 

+ 8 - 3
code/src/views/home/maside.vue

@@ -15,7 +15,7 @@
           <section>
             <ul v-if="list.length > 0">
               <li v-for="(sub, idx) in list" :key="idx">
-                <p>{{ sub.type }}</p>
+                <p :id="'aside-list-sidebar-' + sub.type">{{ sub.type }}</p>
                 <ul v-if="sub.arr.length > 0">
                   <li  @click="onClickItem(son)" v-for="(son, sonidx) in sub.arr" :key="sonidx">
                     {{ son.name }}
@@ -27,7 +27,7 @@
 
           <div class="sidebar">
             <ul>
-              <li v-for="(item, i) in charStrs" :key="i">
+              <li v-for="(item, i) in charStrs" :key="i" @click="onClickSidebarItem(item)">
                 {{ item }}
               </li>
             </ul>
@@ -74,7 +74,12 @@ const onClickSelect = (data) => {
   isShow.value = true
   currentId.value = data.id
 }
-
+const onClickSidebarItem = (item) => {
+  const targetNode = document.getElementById('aside-list-sidebar-' + item)
+  if (targetNode) {
+    targetNode.scrollIntoView()
+  }
+}
 
 const onClickItem = data => {
   if (currentId.value=='museum') {

+ 0 - 3
code/src/views/layout/header.vue

@@ -50,9 +50,6 @@ const menu = ref([
 const currentTab = computed(() => route.name)
 
 const onClick = data => {
-  if (data.id == 'home') {
-    Loading.show()
-  }
   setTimeout(() => {
     router.push({ name: data.id })
   });

+ 0 - 4
code/src/views/layout/mheader.vue

@@ -60,10 +60,6 @@ const menu = ref([
 const currentTab = computed(() => route.name)
 
 const onClick = data => {
-  if (data.id == 'home') {
-    console.log(1111);
-    Loading.show()
-  }
   setTimeout(() => {
     router.push({ name: data.id })
     showAside.value = false