shaogen1995 2 роки тому
батько
коміт
dc0357b2f3

Різницю між файлами не показано, бо вона завелика
+ 2664 - 0
文物展示系统/vueapp/package-lock.json


BIN
文物展示系统/vueapp/src/assets/images/toHeng.png


+ 6 - 0
文物展示系统/vueapp/src/assets/style/reset.css

@@ -44,4 +44,10 @@ q:before, q:after {
 table {
 	border-collapse: collapse;
 	border-spacing: 0;
+}
+
+@media screen and (max-width: 1000px) {
+  *{
+		box-sizing: border-box;
+	}
 }

+ 60 - 26
文物展示系统/vueapp/src/components/CollectionSwiper.vue

@@ -1,16 +1,29 @@
 <template>
-  <swiper :modules="modules" :space-between="38" :scrollbar="{ draggable: true }" :freeMode="true" :observer="true"
-    :mousewheel="true" :grid="{
+  <swiper
+    :modules="modules"
+    :space-between="38"
+    :scrollbar="{ draggable: true }"
+    :freeMode="true"
+    :observer="true"
+    :mousewheel="true"
+    :grid="{
       rows: 2,
-    }" :slidesPerView="'auto'" @swiper="onSwiper" @slideChange="onSlideChange">
-    <swiper-slide class='slide-item' v-for="item in list" :key="item">
-      <img @click="current = item" :src="`${$config.CDNPERFIX}/images/three/${item.name}.png`" alt="">
-      <span :title="item.name" class='i-name'>{{ item.name }}</span>
+    }"
+    :slidesPerView="'auto'"
+    @swiper="onSwiper"
+    @slideChange="onSlideChange"
+  >
+    <swiper-slide class="slide-item" v-for="item in list" :key="item">
+      <img
+        @click="current = item"
+        :src="`${$config.CDNPERFIX}/images/three/${item.name}.png`"
+        alt=""
+      />
+      <span :title="item.name" class="i-name">{{ item.name }}</span>
     </swiper-slide>
   </swiper>
 
-
-  <teleport to='body'>
+  <teleport to="body">
     <Transition>
       <ThreeDetail :data="current" @close="current = ''" v-if="current" />
     </Transition>
@@ -18,34 +31,31 @@
 </template>
 
 <script setup>
-import { Grid, FreeMode, Mousewheel } from 'swiper';
+import { Grid, FreeMode, Mousewheel } from "swiper";
 // Import Swiper Vue.js components
-import { Swiper, SwiperSlide } from 'swiper/vue';
-import { ref } from 'vue';
+import { Swiper, SwiperSlide } from "swiper/vue";
+import { ref } from "vue";
 import ThreeDetail from "@/components/detail/ThreeDetail.vue";
 import { three } from "@/data/category";
 
 // Import Swiper styles
-import 'swiper/css';
-import 'swiper/css/grid';
-import 'swiper/css/free-mode';
-import 'swiper/css/mousewheel';
-
+import "swiper/css";
+import "swiper/css/grid";
+import "swiper/css/free-mode";
+import "swiper/css/mousewheel";
 
 const onSwiper = (swiper) => {
   console.log(swiper);
 };
 const onSlideChange = () => {
-  console.log('slide change');
+  console.log("slide change");
 };
 
-const list = ref(three.data)
-
-const current = ref('')
+const list = ref(three.data);
 
+const current = ref("");
 
-const modules = [Grid, FreeMode, Mousewheel]
-
+const modules = [Grid, FreeMode, Mousewheel];
 </script>
 
 
@@ -67,10 +77,10 @@ const modules = [Grid, FreeMode, Mousewheel]
     position: relative;
     overflow: hidden;
     box-sizing: border-box;
-    background-image: linear-gradient(180deg, #75736E 0%, #BCBBB8 100%);
+    background-image: linear-gradient(180deg, #75736e 0%, #bcbbb8 100%);
     cursor: pointer;
 
-    >img {
+    > img {
       width: 100%;
       height: 100%;
       object-fit: cover;
@@ -85,7 +95,7 @@ const modules = [Grid, FreeMode, Mousewheel]
       height: 100%;
       line-height: 1.5;
       padding: 0 10px;
-      color: #EAE7DA;
+      color: #eae7da;
       box-sizing: border-box;
       background: rgba(145, 25, 39, 0.8);
       font-size: 24px;
@@ -93,7 +103,7 @@ const modules = [Grid, FreeMode, Mousewheel]
       flex-wrap: wrap;
       justify-content: center;
       align-items: center;
-      transition: transform .3s ease;
+      transition: transform 0.3s ease;
       pointer-events: none;
     }
 
@@ -104,4 +114,28 @@ const modules = [Grid, FreeMode, Mousewheel]
     }
   }
 }
+@media screen and (max-width: 1000px) {
+  .swiper {
+    .swiper-slide {
+      width: 200px;
+      height: 42%;
+      background-size: cover;
+      border-radius: 10px;
+      display: inline-block;
+      position: relative;
+      overflow: hidden;
+      box-sizing: border-box;
+      background-image: linear-gradient(180deg, #75736e 0%, #bcbbb8 100%);
+      > img {
+        width: 100%;
+        height: 100%;
+        object-fit: cover;
+      }
+
+      .i-name {
+        display: none;
+      }
+    }
+  }
+}
 </style>

+ 5 - 0
文物展示系统/vueapp/src/components/Directory.vue

@@ -213,4 +213,9 @@ onMounted(() => {
 
   }
 }
+@media screen and (max-width: 1000px) {
+  .i-name {
+    display: none !important;
+  }
+}
 </style>

+ 133 - 43
文物展示系统/vueapp/src/components/detail/ThreeDetail.vue

@@ -1,69 +1,87 @@
 <template>
   <div class="two-hp">
     <div class="content">
-      <img class="bg" :src="popImg" alt="">
+      <img class="bg" :src="popImg" alt="" />
       <div class="inner">
         <div class="left">
-          <video ref="video$" controls muted autoplay class="initial-video" playsinline="true"
-            x5-playsinline="true" webkit-playsinline="true"
-            :src="`${$config.CDNPERFIX}/videos/${data.video}`" @mousedown.passive.stop
-            @touchstart.passive.stop @wheel.passive.stop />
+          <video
+            ref="video$"
+            controls
+            muted
+            autoplay
+            class="initial-video"
+            playsinline="true"
+            x5-playsinline="true"
+            webkit-playsinline="true"
+            :src="`${$config.CDNPERFIX}/videos/${data.video}`"
+            @mousedown.passive.stop
+            @touchstart.passive.stop
+            @wheel.passive.stop
+          />
         </div>
         <div class="right">
           <h2>{{ data.name }}</h2>
           <div class="desc">
             <p v-for="item in data.desc" :key="item">{{ item }}</p>
           </div>
-          <swiper class="dir-body" :modules="modules" :space-between="10" :scrollbar="{ draggable: true }"
-            :freeMode="true" :slides-per-view="'auto'" :observer="true" :mousewheel="true">
+          <swiper
+            class="dir-body"
+            :modules="modules"
+            :space-between="10"
+            :scrollbar="{ draggable: true }"
+            :freeMode="true"
+            :slides-per-view="'auto'"
+            :observer="true"
+            :mousewheel="true"
+          >
             <swiper-slide v-for="item in data.imgs" :key="item.id">
               <div class="db-slide" @click="currentIfr = item">
-                <img :src="`${$config.CDNPERFIX}/images/three/${item.name}.png`" alt="">
-                <span :title="item.name" class='i-name'>{{ item.name }}</span>
+                <img
+                  :src="`${$config.CDNPERFIX}/images/three/${item.name}.png`"
+                  alt=""
+                />
+                <span :title="item.name" class="i-name">{{ item.name }}</span>
               </div>
             </swiper-slide>
           </swiper>
         </div>
       </div>
-      <img class="close" @click="$emit('close')" :src="closeImg" alt="">
+      <img class="close" @click="$emit('close')" :src="closeImg" alt="" />
     </div>
 
     <Transition>
       <div class="ifrcontent" v-if="currentIfr">
-        <div class="title">{{currentIfr.name}}</div>
+        <div class="title">{{ currentIfr.name }}</div>
         <iframe :src="currentIfr.url" frameborder="0"></iframe>
-        <img class="close" @click="currentIfr = ''" :src="close_thin" alt="">
+        <img class="close" @click="currentIfr = ''" :src="close_thin" alt="" />
       </div>
     </Transition>
-
   </div>
 </template>
 
 <script setup>
-import { ref } from "vue"
-import { Grid, FreeMode, Mousewheel } from 'swiper';
-import { Swiper, SwiperSlide } from 'swiper/vue';
-
-import 'swiper/css';
-import 'swiper/css/grid';
-import 'swiper/css/free-mode';
-import 'swiper/css/mousewheel';
+import { ref } from "vue";
+import { Grid, FreeMode, Mousewheel } from "swiper";
+import { Swiper, SwiperSlide } from "swiper/vue";
 
+import "swiper/css";
+import "swiper/css/grid";
+import "swiper/css/free-mode";
+import "swiper/css/mousewheel";
 
-const popImg = utils.getImageUrl(`hp_bg.jpg`)
-const closeImg = utils.getImageUrl(`close.png`)
-const close_thin = utils.getImageUrl(`close_thin.png`)
-const currentIfr = ref('')
+const popImg = utils.getImageUrl(`hp_bg.jpg`);
+const closeImg = utils.getImageUrl(`close.png`);
+const close_thin = utils.getImageUrl(`close_thin.png`);
+const currentIfr = ref("");
 
 const props = defineProps({
   data: {
     default: {},
-    type: Object
-  }
-})
-
-const modules = [Grid, FreeMode, Mousewheel]
+    type: Object,
+  },
+});
 
+const modules = [Grid, FreeMode, Mousewheel];
 </script>
 
 <style lang="less" scoped>
@@ -106,9 +124,9 @@ const modules = [Grid, FreeMode, Mousewheel]
         width: 60%;
         flex-shrink: 0;
         padding: 10px;
-        border: 3px solid #83796F;
+        border: 3px solid #83796f;
 
-        >video {
+        > video {
           width: 100%;
           background-color: #000;
         }
@@ -119,7 +137,7 @@ const modules = [Grid, FreeMode, Mousewheel]
         width: 33%;
         box-sizing: border-box;
 
-        >h2 {
+        > h2 {
           color: #911927;
           font-size: 30px;
           line-height: 1.5;
@@ -129,17 +147,16 @@ const modules = [Grid, FreeMode, Mousewheel]
         .desc {
           @fsize: 16px;
           font-size: @fsize;
-          color: #7A6553;
+          color: #7a6553;
           text-indent: @fsize * 2;
           max-height: 25vh;
           overflow-y: auto;
 
-          >p {
+          > p {
             line-height: 1.5;
           }
         }
 
-
         .dir-body {
           position: relative;
           margin-top: 14%;
@@ -155,16 +172,20 @@ const modules = [Grid, FreeMode, Mousewheel]
               .db-slide {
                 width: 100%;
                 cursor: pointer;
-                background-image: linear-gradient(180deg, #75736E 0%, #BCBBB8 100%);
+                background-image: linear-gradient(
+                  180deg,
+                  #75736e 0%,
+                  #bcbbb8 100%
+                );
 
-                >img {
+                > img {
                   width: 100%;
                   height: 100%;
                   object-fit: cover;
                 }
 
                 .i-name {
-                  content: '';
+                  content: "";
                   position: absolute;
                   transform: translateY(-100%);
                   left: 0;
@@ -173,7 +194,7 @@ const modules = [Grid, FreeMode, Mousewheel]
                   height: 100%;
                   line-height: 1.5;
                   padding: 0 10px;
-                  color: #EAE7DA;
+                  color: #eae7da;
                   box-sizing: border-box;
                   background: rgba(145, 25, 39, 0.8);
                   font-size: 18px;
@@ -182,7 +203,7 @@ const modules = [Grid, FreeMode, Mousewheel]
                   justify-content: center;
                   align-items: center;
                   pointer-events: none;
-                  transition: transform .3s ease;
+                  transition: transform 0.3s ease;
                 }
 
                 &:hover {
@@ -193,7 +214,6 @@ const modules = [Grid, FreeMode, Mousewheel]
               }
             }
           }
-
         }
       }
     }
@@ -230,7 +250,7 @@ const modules = [Grid, FreeMode, Mousewheel]
       background-image: linear-gradient(90deg, #911927, rgba(145, 25, 39, 0));
     }
 
-    >iframe {
+    > iframe {
       width: 100%;
       height: 100%;
     }
@@ -240,4 +260,74 @@ const modules = [Grid, FreeMode, Mousewheel]
     }
   }
 }
+
+@media screen and (max-width: 1000px) {
+  .two-hp {
+    .content {
+      width: 96%;
+      height: 96%;
+      .bg {
+        width: 100%;
+        height: 100%;
+      }
+      .inner {
+        padding: 10px;
+        .left {
+          height: 100%;
+          width: 40%;
+          padding: 0;
+          video {
+            height: 100%;
+          }
+        }
+        .right {
+          padding-left: 10px;
+          height: 100%;
+          width: 60%;
+          & > h2 {
+            font-size: 18px;
+          }
+          .desc {
+            font-size: 12px;
+            height: calc(100% - 180px);
+            max-height: 100%;
+            overflow-y: auto;
+          }
+          .dir-body {
+            margin: 0;
+            margin-top: 15px;
+            height: 127px;
+            .db-slide {
+              height: 100%;
+              .i-name {
+                display: none !important;
+              }
+            }
+          }
+        }
+      }
+      .close {
+        width: 30px;
+        right: 5px;
+        top: 5px;
+      }
+    }
+    .ifrcontent {
+      width: 100%;
+      height: 100%;
+      .title {
+        height: 30px;
+        line-height: 30px;
+        top: 5px;
+        left: 5px;
+        font-size: 12px;
+      }
+      .close {
+        width: 30px;
+        top: 5px;
+        right: 5px;
+      }
+    }
+  }
+}
 </style>

+ 129 - 45
文物展示系统/vueapp/src/components/detail/TwoDetail.vue

@@ -1,12 +1,23 @@
 <template>
   <div class="two-hp">
     <div class="content">
-      <img class="bg" :src="popImg" alt="">
+      <img class="bg" :src="popImg" alt="" />
       <div class="inner">
         <div class="left">
-          <video ref="video$" controls muted autoplay class="initial-video" playsinline="true" x5-playsinline="true"
-            webkit-playsinline="true" :src="`${$config.CDNPERFIX}/videos/${data.video}`" @mousedown.passive.stop
-            @touchstart.passive.stop @wheel.passive.stop />
+          <video
+            ref="video$"
+            controls
+            muted
+            autoplay
+            class="initial-video"
+            playsinline="true"
+            x5-playsinline="true"
+            webkit-playsinline="true"
+            :src="`${$config.CDNPERFIX}/videos/${data.video}`"
+            @mousedown.passive.stop
+            @touchstart.passive.stop
+            @wheel.passive.stop
+          />
         </div>
         <div class="right">
           <h2>{{ data.name }}</h2>
@@ -14,61 +25,71 @@
             <p v-for="item in data.desc" :key="item">{{ item }}</p>
           </div>
           <ul>
-            <li @click="currentIfr = item" v-for="item in data.imgs" :key="item">
-              <img :src="`${$config.CDNPERFIX}/images/two/缩略图/${data.name}/${item.name}.png`" alt="">
-              <span :title="item.name" class='i-name'>{{ item.name }}</span>
+            <li
+              @click="currentIfr = item"
+              v-for="item in data.imgs"
+              :key="item"
+            >
+              <img
+                :src="`${$config.CDNPERFIX}/images/two/缩略图/${data.name}/${item.name}.png`"
+                alt=""
+              />
+              <span :title="item.name" class="i-name">{{ item.name }}</span>
             </li>
           </ul>
         </div>
       </div>
-      <img class="close" @click="$emit('close')" :src="closeImg" alt="">
+      <img class="close" @click="$emit('close')" :src="closeImg" alt="" />
     </div>
 
     <Transition>
       <div class="ifrcontent" v-if="currentIfr">
         <div class="title">{{ currentIfr.name }}</div>
-        <img class="imgcon" id="imgcon" :src="`${$config.CDNPERFIX}/images/two/大图/${data.name}/${currentIfr.name}.jpg`"
-          alt="">
-        <img class="close" @click="currentIfr = ''" :src="close_thin" alt="">
+        <img
+          class="imgcon"
+          id="imgcon"
+          :src="`${$config.CDNPERFIX}/images/two/大图/${data.name}/${currentIfr.name}.jpg`"
+          alt=""
+        />
+        <img class="close" @click="currentIfr = ''" :src="close_thin" alt="" />
       </div>
     </Transition>
-
   </div>
 </template>
 
 <script setup>
-import { ref, watch, onMounted, nextTick } from "vue"
+import { ref, watch, onMounted, nextTick } from "vue";
 import Panzoom from "@panzoom/panzoom";
 
-const popImg = utils.getImageUrl(`hp_bg.jpg`)
-const closeImg = utils.getImageUrl(`close.png`)
-const close_thin = utils.getImageUrl(`close_thin.png`)
-const currentIfr = ref('')
+const popImg = utils.getImageUrl(`hp_bg.jpg`);
+const closeImg = utils.getImageUrl(`close.png`);
+const close_thin = utils.getImageUrl(`close_thin.png`);
+const currentIfr = ref("");
 
 const props = defineProps({
   data: {
     default: {},
-    type: Object
-  }
-})
+    type: Object,
+  },
+});
 
-const panzoom = ref('')
+const panzoom = ref("");
 
 const reset = () => {
   panzoom.value.pan(0, 0);
   panzoom.value.zoom(1);
-}
+};
 
 watch(currentIfr, () => {
-  panzoom.value && panzoom.value.destroy()
+  panzoom.value && panzoom.value.destroy();
   nextTick(() => {
     if (currentIfr.value) {
       let elem = document.getElementById("imgcon");
       panzoom.value = Panzoom(elem, {
         maxScale: 10,
-        startScale: 1
+        startScale: 1,
       });
-      let parent = elem.parentElement
+      let parent = elem.parentElement;
       parent.addEventListener("wheel", panzoom.value.zoomWithWheel);
       parent.addEventListener("load", () => {
         reset();
@@ -80,11 +101,8 @@ watch(currentIfr, () => {
         reset();
       });
     }
-  })
-
-})
-
-
+  });
+});
 </script>
 
 <style lang="less" scoped>
@@ -127,10 +145,10 @@ watch(currentIfr, () => {
         width: 60%;
         flex-shrink: 0;
         padding: 10px;
-        border: 3px solid #83796F;
+        border: 3px solid #83796f;
         height: 73%;
 
-        >video {
+        > video {
           width: 100%;
           height: 100%;
         }
@@ -143,7 +161,7 @@ watch(currentIfr, () => {
         height: 73%;
         overflow-y: auto;
 
-        >h2 {
+        > h2 {
           color: #911927;
           font-size: 26px;
           line-height: 1.5;
@@ -153,37 +171,37 @@ watch(currentIfr, () => {
         .desc {
           @fsize: 16px;
           font-size: @fsize;
-          color: #7A6553;
+          color: #7a6553;
           text-indent: @fsize * 2;
           margin-bottom: 20px;
-          >p {
+          > p {
             line-height: 1.5;
           }
         }
 
-        >ul {
+        > ul {
           width: 100%;
           display: flex;
           flex-wrap: wrap;
-          >li {
+          > li {
             width: 49%;
             border-radius: 4px;
             overflow: hidden;
             margin-bottom: 4px;
             position: relative;
             cursor: pointer;
-            background-image: linear-gradient(180deg, #75736E 0%, #BCBBB8 100%);
+            background-image: linear-gradient(180deg, #75736e 0%, #bcbbb8 100%);
 
             &:nth-of-type(2n) {
               margin-left: 1%;
             }
 
-            >img {
+            > img {
               width: 100%;
             }
 
             .i-name {
-              content: '';
+              content: "";
               position: absolute;
               transform: translateY(-110%);
               left: 0;
@@ -192,16 +210,16 @@ watch(currentIfr, () => {
               height: 100%;
               line-height: 1.5;
               padding: 0 10px;
-              color: #EAE7DA;
+              color: #eae7da;
               box-sizing: border-box;
-              background: rgba(145, 25, 39,0.8);
+              background: rgba(145, 25, 39, 0.8);
               font-size: 18px;
               display: flex;
               flex-wrap: wrap;
               justify-content: center;
               align-items: center;
               pointer-events: none;
-              transition: transform .3s ease;
+              transition: transform 0.3s ease;
             }
 
             &:hover {
@@ -211,7 +229,6 @@ watch(currentIfr, () => {
             }
           }
         }
-
       }
     }
 
@@ -233,7 +250,7 @@ watch(currentIfr, () => {
     z-index: 1;
     width: 80%;
     height: 80%;
-    background: linear-gradient(180deg, #75736E 0%, #BCBBB8 100%);
+    background: linear-gradient(180deg, #75736e 0%, #bcbbb8 100%);
     display: flex;
     justify-content: center;
     align-items: center;
@@ -263,4 +280,71 @@ watch(currentIfr, () => {
     }
   }
 }
+@media screen and (max-width: 1000px) {
+  .two-hp {
+    .i-name {
+      display: none !important;
+    }
+    .content {
+      width: 96%;
+      height: 96%;
+      .bg {
+        width: 100%;
+        height: 100%;
+      }
+      .inner {
+        padding: 10px;
+        .left {
+          height: 100%;
+          width: 40%;
+          padding: 0;
+          background-color: black;
+          video {
+            height: 100%;
+          }
+        }
+        .right {
+          padding-left: 10px;
+          height: 100%;
+          width: 60%;
+          & > h2 {
+            font-size: 18px;
+          }
+          .desc {
+            font-size: 12px;
+          }
+          .dir-body {
+            margin: 0;
+            margin-top: 15px;
+            height: 127px;
+            .db-slide {
+              height: 100%;
+            }
+          }
+        }
+      }
+      .close {
+        width: 30px;
+        right: 5px;
+        top: 5px;
+      }
+    }
+    .ifrcontent {
+      width: 100%;
+      height: 100%;
+      .title {
+        height: 30px;
+        line-height: 30px;
+        top: 5px;
+        left: 5px;
+        font-size: 12px;
+      }
+      .close {
+        width: 30px;
+        top: 5px;
+        right: 5px;
+      }
+    }
+  }
+}
 </style>

+ 89 - 25
文物展示系统/vueapp/src/views/cultural-relic.vue

@@ -1,45 +1,75 @@
 <template>
   <div class="collection">
     <div class="c-header">
-      <img draggable="false" class="logo" :src="$getImageUrl('logo.png')" alt="">
-      <img @click="$emit('close')" draggable="false" class="close" :src="$getImageUrl('close.png')" alt="">
+      <img
+        draggable="false"
+        class="logo"
+        :src="$getImageUrl('logo.png')"
+        alt=""
+      />
+      <img
+        @click="$emit('close')"
+        draggable="false"
+        class="close"
+        :src="$getImageUrl('close.png')"
+        alt=""
+      />
     </div>
     <div class="c-con">
       <ul class="ccheader">
-        <li @click="activeIdx='three'" :class="{active:activeIdx==='three'}">
-          <img draggable="false" :src="$getImageUrl(`${activeIdx==='three'?'txt_active.png':'txt_default.png'}`)" alt="">
+        <li
+          @click="activeIdx = 'three'"
+          :class="{ active: activeIdx === 'three' }"
+        >
+          <img
+            draggable="false"
+            :src="
+              $getImageUrl(
+                `${
+                  activeIdx === 'three' ? 'txt_active.png' : 'txt_default.png'
+                }`
+              )
+            "
+            alt=""
+          />
           <span>三维文物</span>
         </li>
-        
-        <li @click="activeIdx='two'" :class="{active:activeIdx==='two'}">
-          <img draggable="false" :src="$getImageUrl(`${activeIdx==='two'?'txt_active.png':'txt_default.png'}`)" alt="">
+
+        <li @click="activeIdx = 'two'" :class="{ active: activeIdx === 'two' }">
+          <img
+            draggable="false"
+            :src="
+              $getImageUrl(
+                `${activeIdx === 'two' ? 'txt_active.png' : 'txt_default.png'}`
+              )
+            "
+            alt=""
+          />
           <span>二维文物</span>
         </li>
       </ul>
 
       <div class="cclist">
-        <CollectionSwiper v-if="activeIdx==='three'" />
-        <Directory v-else/>
+        <CollectionSwiper v-if="activeIdx === 'three'" />
+        <Directory v-else />
       </div>
     </div>
   </div>
 </template>
 
 <script setup>
-import { ref } from 'vue';
-import CollectionSwiper from '@/components/CollectionSwiper.vue';
-import Directory from '@/components/Directory.vue';
-
-
-const activeIdx = ref('three')
+import { ref } from "vue";
+import CollectionSwiper from "@/components/CollectionSwiper.vue";
+import Directory from "@/components/Directory.vue";
 
+const activeIdx = ref("three");
 </script>
 
 <style lang="less">
 .collection {
   width: 100%;
   height: 100%;
-  background-image: url('@/assets/images/c-bg.jpg');
+  background-image: url("@/assets/images/c-bg.jpg");
   background-size: cover;
   background-repeat: no-repeat;
   display: flex;
@@ -64,7 +94,6 @@ const activeIdx = ref('three')
       width: 3%;
       cursor: pointer;
     }
-
   }
 
   .c-con {
@@ -79,25 +108,25 @@ const activeIdx = ref('three')
       display: flex;
       width: 100%;
       justify-content: center;
-      >li{
+      > li {
         position: relative;
         font-size: 0;
         margin: 0 1rem;
         cursor: pointer;
-        >span{
+        > span {
           font-size: 1rem;
           position: absolute;
           top: 50%;
           left: 50%;
-          transform: translate(-50%,-50%);
-          color: #7A6553;
+          transform: translate(-50%, -50%);
+          color: #7a6553;
         }
-        >img{
+        > img {
           max-width: 100%;
         }
-        &.active{
-          >span{
-            color: #EAE7DA;
+        &.active {
+          > span {
+            color: #eae7da;
           }
         }
       }
@@ -110,4 +139,39 @@ const activeIdx = ref('three')
     }
   }
 }
+@media screen and (max-width: 1000px) {
+  .collection {
+    .c-header {
+      z-index: 100;
+      .logo {
+        min-width: 80px;
+        top: 10px;
+        left: 10px;
+      }
+      .close {
+        top: 12px;
+        right: 5px;
+        min-width: 30px;
+      }
+    }
+    .c-con {
+      width: 100%;
+      height: 100%;
+      padding: 0;
+      .ccheader {
+        margin-top: 10px;
+        & > li {
+          width: 120px;
+          & > span {
+            font-size: 14px;
+          }
+        }
+      }
+      .cclist {
+        margin-top: 30px;
+        height: calc(100% - 80px);
+      }
+    }
+  }
+}
 </style>

+ 211 - 126
文物展示系统/vueapp/src/views/home.vue

@@ -1,63 +1,103 @@
 <template>
-  <div class="home" @mousedown="onMouseDown" @mousemove="onMouseMove" @mouseup="onMouseUp" @mouseleave="onMouseLeave"
-    @touchstart.passive="onTouchStart" @touchmove.prevent="onTouchMove" @touchend="onTouchEnd"
-    @touchcancel="onTouchCancel" @wheel.passive="onWheel">
-
-    <div ref="hcon$" class="h-con" :style="{
-      left: `-${translateLength}px`,
-    }">
+  <div
+    class="home"
+    @mousedown="onMouseDown"
+    @mousemove="onMouseMove"
+    @mouseup="onMouseUp"
+    @mouseleave="onMouseLeave"
+    @touchstart.passive="onTouchStart"
+    @touchmove.prevent="onTouchMove"
+    @touchend="onTouchEnd"
+    @touchcancel="onTouchCancel"
+    @wheel.passive="onWheel"
+  >
+    <div
+      ref="hcon$"
+      class="h-con"
+      :style="{
+        left: `-${translateLength}px`,
+      }"
+    >
       <div class="h-left">
-        <img draggable="false" :src="$getImageUrl('h-left.jpg')" alt="">
+        <img draggable="false" :src="$getImageUrl('h-left.jpg')" alt="" />
         <div class="l-con">
-          <img draggable="false" class="title" :src="$getImageUrl('title.png')" alt="">
+          <img class="logo" :src="$getImageUrl('logo.png')" alt="" />
+          <img
+            draggable="false"
+            class="title"
+            :src="$getImageUrl('title.png')"
+            alt=""
+          />
         </div>
       </div>
 
       <div class="h-right">
         <ul>
           <li v-for="(item, idx) in list" :key="item.id">
-            <img @click="onClickItem(item)" draggable="false" class="title" :src="$getImageUrl(`home-img/${idx + 1}.png`)"
-              alt="">
+            <img
+              @click="onClickItem(item)"
+              draggable="false"
+              class="title"
+              :src="$getImageUrl(`home-img/${idx + 1}.png`)"
+              alt=""
+            />
           </li>
         </ul>
       </div>
-      <img @click="isShowCR = true" draggable="false" class="menu" :src="$getImageUrl('menu.png')" alt="">
-
+      <img
+        @click="isShowCR = true"
+        draggable="false"
+        class="menu"
+        :src="$getImageUrl('menu.png')"
+        alt=""
+      />
     </div>
 
-    <teleport to='body'>
+    <teleport to="body">
       <Transition>
         <CulturalRelic @close="isShowCR = ''" v-if="isShowCR" />
       </Transition>
 
       <Transition>
-        <TwoDetail :data="current" @close="current = ''" v-if="current && current.isTwo" />
+        <TwoDetail
+          :data="current"
+          @close="current = ''"
+          v-if="current && current.isTwo"
+        />
       </Transition>
-        
+
       <Transition>
-        <ThreeDetail :data="current" @close="current = ''" v-if="current  && !current.isTwo" />
+        <ThreeDetail
+          :data="current"
+          @close="current = ''"
+          v-if="current && !current.isTwo"
+        />
       </Transition>
-
-
     </teleport>
   </div>
+  <!-- 请横屏浏览 -->
+  <div class="toHengBox">
+    <img src="../assets/images/toHeng.png" alt="" />
+    <p>请横屏浏览</p>
+  </div>
 </template>
 
 <script setup>
-import { onBeforeUnmount, onMounted, ref } from "vue"
+import { onBeforeUnmount, onMounted, ref } from "vue";
 
 import TwoDetail from "@/components/detail/TwoDetail.vue";
 import ThreeDetail from "@/components/detail/ThreeDetail.vue";
 
-import CulturalRelic from "@/views/cultural-relic.vue"
+import CulturalRelic from "@/views/cultural-relic.vue";
 import { two, three } from "@/data/category";
 
+let list = three.data.concat(
+  two.data.map((item) => {
+    return { ...item, isTwo: true };
+  })
+);
 
-let list = three.data.concat(two.data.map(item => {
-  return { ...item, isTwo: true }
-}))
-
-console.log('result:', list);
+console.log("result:", list);
 
 const isMouseDown = ref(false);
 const lastMoveEventTimeStamp = ref(0);
@@ -69,167 +109,163 @@ const maxTranslateLength = ref(0);
 const lastAnimationTimeStamp = ref(0);
 const animationFrameId = ref(0);
 
-const isShowCR = ref('');
-const current = ref('')
-
-const isMove = ref(false)
-
+const isShowCR = ref("");
+const current = ref("");
 
+const isMove = ref(false);
 
 // 镜头平移相关
 const translateLength = ref(0);
 
-
-const hcon$ = ref(null)
+const hcon$ = ref(null);
 
 const onClickItem = (item) => {
   if (!isMove.value) {
-    current.value = item
+    current.value = item;
   }
-}
+};
 
 const animationFrameTask = () => {
-  const timeStamp = Date.now()
-  const timeElapsed = timeStamp - lastAnimationTimeStamp.value
+  const timeStamp = Date.now();
+  const timeElapsed = timeStamp - lastAnimationTimeStamp.value;
 
   // 速度减慢
   if (moveSpeed.value > 0) {
-    moveSpeed.value -= 0.003 * timeElapsed
+    moveSpeed.value -= 0.003 * timeElapsed;
     if (moveSpeed.value < 0) {
-      moveSpeed.value = 0
+      moveSpeed.value = 0;
     }
   } else if (moveSpeed.value < 0) {
-    moveSpeed.value += 0.003 * timeElapsed
+    moveSpeed.value += 0.003 * timeElapsed;
     if (moveSpeed.value > 0) {
-      moveSpeed.value = 0
+      moveSpeed.value = 0;
     }
   }
 
   // 根据速度更新距离
-  translateLength.value += moveSpeed.value * timeElapsed
+  translateLength.value += moveSpeed.value * timeElapsed;
   if (translateLength.value < 0) {
-    translateLength.value = 0
+    translateLength.value = 0;
   } else if (translateLength.value > maxTranslateLength.value) {
-    translateLength.value = maxTranslateLength.value
-    moveSpeed.value = 0
+    translateLength.value = maxTranslateLength.value;
+    moveSpeed.value = 0;
   }
 
-  lastAnimationTimeStamp.value = timeStamp
-  animationFrameId.value = requestAnimationFrame(animationFrameTask)
-}
+  lastAnimationTimeStamp.value = timeStamp;
+  animationFrameId.value = requestAnimationFrame(animationFrameTask);
+};
 
 const calcTranslateLimit = () => {
-  maxTranslateLength.value = hcon$.value.clientWidth - window.innerWidth
-}
+  maxTranslateLength.value = hcon$.value.clientWidth - window.innerWidth;
+};
 
 const onMouseDown = () => {
-  isMouseDown.value = true
-  moveSpeed.value = 0
-  lastMoveEventTimeStamp.value = 0
-  lastAnimationTimeStamp.value = Date.now()
-}
-
+  isMouseDown.value = true;
+  moveSpeed.value = 0;
+  lastMoveEventTimeStamp.value = 0;
+  lastAnimationTimeStamp.value = Date.now();
+};
 
 const onMouseMove = (e) => {
   if (isMouseDown.value) {
     // 有些pc端浏览器比如firefox会有两次事件时间戳相同的情况发生。
-    if (lastMoveEventTimeStamp.value && (e.timeStamp - lastMoveEventTimeStamp.value > 1)) {
-      isMove.value = true
+    if (
+      lastMoveEventTimeStamp.value &&
+      e.timeStamp - lastMoveEventTimeStamp.value > 1
+    ) {
+      isMove.value = true;
       // 更新speed
-      const currentMoveSpeed = - e.movementX / (e.timeStamp - lastMoveEventTimeStamp.value)
-      moveSpeed.value = moveSpeed.value * 0.9 + currentMoveSpeed * 0.1
+      const currentMoveSpeed =
+        -e.movementX / (e.timeStamp - lastMoveEventTimeStamp.value);
+      moveSpeed.value = moveSpeed.value * 0.9 + currentMoveSpeed * 0.1;
     }
-    lastMoveEventTimeStamp.value = e.timeStamp
+    lastMoveEventTimeStamp.value = e.timeStamp;
   }
-}
+};
 
 const onMouseUp = () => {
-  isMouseDown.value = false
+  isMouseDown.value = false;
   setTimeout(() => {
-    isMove.value = false
+    isMove.value = false;
   });
-}
+};
 
 const onMouseLeave = () => {
-  isMouseDown.value = false
+  isMouseDown.value = false;
   setTimeout(() => {
-    isMove.value = false
+    isMove.value = false;
   });
-}
+};
 
 const onTouchStart = (e) => {
-  isMouseDown.value = true
-  moveSpeed.value = 0
-  lastMoveEventTimeStamp.value = 0
-  lastAnimationTimeStamp.value = Date.now()
-  lastTouchPos.value = e.changedTouches[0].clientX
-}
-
+  isMouseDown.value = true;
+  moveSpeed.value = 0;
+  lastMoveEventTimeStamp.value = 0;
+  lastAnimationTimeStamp.value = Date.now();
+  lastTouchPos.value = e.changedTouches[0].clientX;
+};
 
 const onTouchMove = (e) => {
   if (isMouseDown.value && e.changedTouches.length === 1) {
     // 疯狂操作的极端情况下两个时间戳之间的时差会不合理,甚至为0
-    if (lastMoveEventTimeStamp.value && (e.timeStamp - lastMoveEventTimeStamp.value > 1)) {
+    if (
+      lastMoveEventTimeStamp.value &&
+      e.timeStamp - lastMoveEventTimeStamp.value > 1
+    ) {
       // 更新speed
-      isMove.value = true
-      const currentMoveSpeed = - (e.changedTouches[0].clientX - lastTouchPos.value) / (e.timeStamp - lastMoveEventTimeStamp.value) * 1.5
-      moveSpeed.value = moveSpeed.value * 0.9 + currentMoveSpeed * 0.1
-      lastTouchPos.value = e.changedTouches[0].clientX
+      isMove.value = true;
+      const currentMoveSpeed =
+        (-(e.changedTouches[0].clientX - lastTouchPos.value) /
+          (e.timeStamp - lastMoveEventTimeStamp.value)) *
+        1.5;
+      moveSpeed.value = moveSpeed.value * 0.9 + currentMoveSpeed * 0.1;
+      lastTouchPos.value = e.changedTouches[0].clientX;
     }
-    lastMoveEventTimeStamp.value = e.timeStamp
+    lastMoveEventTimeStamp.value = e.timeStamp;
   }
-}
-
+};
 
 const onTouchEnd = () => {
-  isMouseDown.value = false
+  isMouseDown.value = false;
   setTimeout(() => {
-    isMove.value = false
+    isMove.value = false;
   });
-}
-
+};
 
 const onTouchCancel = () => {
-  isMouseDown.value = false
+  isMouseDown.value = false;
   setTimeout(() => {
-    isMove.value = false
+    isMove.value = false;
   });
-}
-
+};
 
 const onWheel = (e) => {
-  translateLength.value += e.deltaY
+  translateLength.value += e.deltaY;
   if (translateLength.value < 0) {
-    translateLength.value = 0
+    translateLength.value = 0;
   } else if (translateLength.value > maxTranslateLength.value) {
-    translateLength.value = maxTranslateLength.value
-    moveSpeed.value = 0
+    translateLength.value = maxTranslateLength.value;
+    moveSpeed.value = 0;
   }
-}
-
-
+};
 
 onMounted(() => {
-  animationFrameId.value = requestAnimationFrame(animationFrameTask)
-  window.addEventListener('resize', calcTranslateLimit)
-  calcTranslateLimit()
+  animationFrameId.value = requestAnimationFrame(animationFrameTask);
+  window.addEventListener("resize", calcTranslateLimit);
+  calcTranslateLimit();
   document.onreadystatechange = () => {
-    if (document.readyState === 'complete') {
+    if (document.readyState === "complete") {
       // 页面上所有资源加载完成后执行的逻辑
-      console.log('所有资源加载完成');
-      calcTranslateLimit()
+      console.log("所有资源加载完成");
+      calcTranslateLimit();
     }
   };
-})
+});
 
 onBeforeUnmount(() => {
-  document.onreadystatechange = null
-  window.removeEventListener('resize', calcTranslateLimit)
-})
-
-
-
-
+  document.onreadystatechange = null;
+  window.removeEventListener("resize", calcTranslateLimit);
+});
 </script>
 
 <style lang="less" scoped>
@@ -249,17 +285,17 @@ onBeforeUnmount(() => {
       position: relative;
       width: max-content;
 
-      >img {
+      > img {
         height: 100%;
       }
 
       .l-con {
-
         .logo {
           position: absolute;
-          left: 1rem;
-          top: 1rem;
-          width: 16%;
+          width: 160px;
+          top: 26%;
+          left: 50%;
+          transform: translateX(-50%);
         }
 
         .title {
@@ -267,13 +303,13 @@ onBeforeUnmount(() => {
           left: 50%;
           top: 50%;
           width: 70%;
-          transform: translate(-50%, -50%);
+          transform: translateX(-50%);
         }
       }
     }
 
     .h-right {
-      background-image: url('@/assets/images/bg-top.jpg');
+      background-image: url("@/assets/images/bg-top.jpg");
       background-repeat: no-repeat;
       background-size: auto 80%;
       background-color: #dddad1;
@@ -287,15 +323,15 @@ onBeforeUnmount(() => {
         width: 100%;
         position: absolute;
         bottom: 0;
-        content: '';
+        content: "";
         display: inline-block;
         height: 20%;
         box-sizing: border-box;
-        border-top: 2rem solid #8B8980;
-        background-image: linear-gradient(180deg, #93918A 0%, #AAA89F 63%);
+        border-top: 2rem solid #8b8980;
+        background-image: linear-gradient(180deg, #93918a 0%, #aaa89f 63%);
       }
 
-      >ul {
+      > ul {
         height: 100%;
         position: relative;
         z-index: 999;
@@ -304,11 +340,11 @@ onBeforeUnmount(() => {
         padding-left: 10rem;
         margin-bottom: 10rem;
 
-        >li {
+        > li {
           list-style: none;
           margin: 0 6rem;
 
-          >img {
+          > img {
             max-width: 80%;
             cursor: pointer;
           }
@@ -318,12 +354,61 @@ onBeforeUnmount(() => {
   }
 }
 
-.menu{
+.menu {
   position: fixed;
   right: 2rem;
   top: 2rem;
   width: 3%;
+  min-width: 40px;
   cursor: pointer;
   z-index: 999;
 }
+.toHengBox {
+  display: none;
+}
+
+@media screen and (max-width: 1000px) {
+  .l-con {
+    .logo {
+      width: 100px !important;
+    }
+  }
+  .home .h-con .h-right > ul > li {
+    margin: 0 20px;
+    & > img {
+      max-height: 90vh;
+    }
+  }
+  .toHengBox {
+    opacity: 0;
+    pointer-events: none;
+    transition: all 0.2s;
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 9999;
+    background-color: rgba(0, 0, 0, 0.8);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    flex-direction: column;
+    & > img {
+      width: 80%;
+    }
+    & > p {
+      margin-top: 10px;
+      color: #fff;
+      font-size: 14px;
+    }
+  }
+}
+/*竖屏*/
+@media screen and (orientation: portrait) {
+  .toHengBox {
+    opacity: 1;
+    pointer-events: auto;
+  }
+}
 </style>

Різницю між файлами не показано, бо вона завелика
+ 549 - 659
文物展示系统/vueapp/yarn.lock