浏览代码

初步完工

shaogen1995 4 年之前
父节点
当前提交
15cf6c596f
共有 5 个文件被更改,包括 384 次插入28 次删除
  1. 17 11
      src/components/AllWall.vue
  2. 335 0
      src/components/AllWallbut.vue
  3. 15 14
      src/components/GuideButton.vue
  4. 1 0
      src/components/RenCulture.vue
  5. 16 3
      src/view/Home.vue

+ 17 - 11
src/components/AllWall.vue

@@ -1,35 +1,42 @@
 <!--  -->
 <template>
   <div class="AllWall">
-
     <div class="size">
       <img src="../assets/images/AllWall/size.png" alt="" />
       <img src="../assets/images/AllWall/sizebac.png" alt="" />
     </div>
-    <!-- 万物墙 -->
-       <div id="iframe-container">
-            <iframe id="wanwuqiang" src="../dist/index.html"></iframe>
-        </div>
-            <GuideButton :titles="titles" :jumpUrl="jumpUrl" />
+    <AllWallbut :titles="titles" :jumpUrl="jumpUrl" />
   </div>
 </template>
 
 <script>
-import GuideButton from "./GuideButton.vue";
+import AllWallbut from "./AllWallbut.vue";
 
 export default {
   name: "AllWall",
   components: {
-    GuideButton,
+    AllWallbut,
   },
   data() {
     return {
-      titles: ["高淳博物馆", "德国博物馆", "南京博物馆","南通博物馆", "广东省博物馆"],
+      titles: [
+        "高淳博物馆",
+        "德国博物馆",
+        "南京博物馆",
+        "南通博物馆",
+        "广东省博物馆",
+      ],
       jumpUrl: [
-        "javascript:;","javascript:;","javascript:;",'javascript:;','javascript:;'
+        "javascript:;",
+        "javascript:;",
+        "javascript:;",
+        "javascript:;",
+        "javascript:;",
       ],
     };
   },
+  methods: {
+  },
 };
 </script>
 <style  scoped>
@@ -58,5 +65,4 @@ export default {
 }
 
 
-
 </style>

+ 335 - 0
src/components/AllWallbut.vue

@@ -0,0 +1,335 @@
+<template>
+  <div id="guide-button">
+    <template v-if="showButtonList">
+      <div id="old-exhibition1" v-if="titles[4]" @click="isShow(e)">
+        <img
+          class="exbutton"
+          :class="[btnIndex == 4 ? 'hit' : '']"
+          src="@/assets/images/exbutton.png"
+        />
+        <div class="button-text black-text">
+          <a :href="jumpUrl[4]" :class="[btnIndex == 4 ? 'hit' : '']">
+            {{ titles[e] }}</a
+          >
+        </div>
+      </div>
+
+      <div id="old-exhibition2" v-if="titles[3]" @click="isShow(d)">
+        <img
+          class="exbutton"
+          :class="[btnIndex == 3 ? 'hit' : '']"
+          src="@/assets/images/exbutton.png"
+        />
+        <div class="button-text black-text">
+          <a :href="jumpUrl[3]" :class="[btnIndex == 3 ? 'hit' : '']">
+            {{ titles[d] }}</a
+          >
+        </div>
+      </div>
+
+      <div id="old-exhibition" @click="isShow(c)">
+        <img
+          class="exbutton"
+          :class="[btnIndex == 2 ? 'hit' : '']"
+          src="@/assets/images/exbutton.png"
+        />
+        <div class="button-text black-text">
+          <a :href="jumpUrl[2]" :class="[btnIndex == 2 ? 'hit' : '']">
+            {{ titles[c] }}</a
+          >
+        </div>
+      </div>
+
+      <div id="cloud-exhibition" @click="isShow(b)">
+        <img
+          class="exbutton"
+          :class="[btnIndex == 1 ? 'hit' : '']"
+          src="@/assets/images/exbutton.png"
+        />
+        <div class="button-text black-text">
+          <a :href="jumpUrl[1]" :class="[btnIndex == 1 ? 'hit' : '']">
+            {{ titles[b] }}</a
+          >
+        </div>
+      </div>
+    </template>
+    <template v-else>
+      <div id="front"><img src="@/assets/images/front.png" /></div>
+      <div id="back"><img src="@/assets/images/back.png" /></div>
+    </template>
+
+    <div id="mainbutton">
+      <img
+        class="exbutton"
+        @touchstart="goStart"
+        @touchmove="goMove"
+        @touchend="goEnd"
+        src="@/assets/images/mainbutton.png"
+      />
+      <div class="button-text">
+        <a :href="jumpUrl[0]">{{ titles[a] }}</a>
+      </div>
+      <img
+        :class="[showButtonList ? '' : 'arrowDown', 'arrow']"
+        src="@/assets/images/arrow.png"
+        @click.self="buttonList"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    titles: {
+      type: Array,
+    },
+    jumpUrl: {
+      type: Array,
+    },
+  },
+  name: "GuideButton",
+  data() {
+    return {
+      a: 0,
+      b: 1,
+      c: 2,
+      d: 3,
+      e: 4,
+      showButtonList: false,
+      hit: false,
+      timeOutEvent: 0, // 长按事件定时器
+      startPageY: 0,
+      currentPageY: 0,
+      btnHeight: 40,
+      // titles:['点击看展','参加云展','往届博博会'],
+      // jumpUrl:['',
+      //   'http://www.expo-museums.com/Index/history/column/143',
+      //   'http://www.expo-museums.com/Index/column/id/162'],
+    };
+  },
+  methods: {
+    change(val) {
+      if (val===undefined) return;
+      console.log(val);
+      // if(val===1) val='德国博物馆'
+      // else if(val===2) val='南京博物馆'
+      // else if(val===3) val='南通博物馆'
+      // else if(val===4) val='广东省博物馆'
+      // else val='高淳博物馆'
+      if (val === 0) {
+        this.a = val;
+        this.b = val + 1;
+        this.c = val + 2;
+        this.d = val + 3;
+        this.e = val + 4;
+      }
+      if (val === 1) {
+        this.a = val;
+        this.b = val + 1;
+        this.c = val + 2;
+        this.d = val + 3;
+        this.e = val - 1;
+      }
+      if (val === 2) {
+        this.a = val;
+        this.b = val + 1;
+        this.c = val + 2;
+        this.d = val - 1;
+        this.e = val - 2;
+      }
+      if (val === 3) {
+        this.a = val;
+        this.b = val + 1;
+        this.c = val - 1;
+        this.d = val - 2;
+        this.e = val - 3;
+      }
+      if (val === 4) {
+        this.a = val;
+        this.b = val - 1;
+        this.c = val - 2;
+        this.d = val - 3;
+        this.e = val - 4;
+      }
+    },
+    isShow(val) {
+      this.buttonList();
+      this.change(val);
+    },
+    pageJump(url) {
+      window.location.href = url;
+      // console.log('jump');
+    },
+    buttonList() {
+      this.showButtonList = !this.showButtonList;
+      // console.log('buttonlist',this.showButtonList);
+    },
+    goStart(event) {
+      let _this = this;
+      event.preventDefault();
+      clearTimeout(_this.timeOutEvent);
+      let touch = event.targetTouches[0];
+      // console.log('起点',touch.pageY);
+      this.startPageY = touch.pageY;
+      // 开始触摸
+      _this.timeOutEvent = setTimeout(() => {
+        _this.timeOutEvent = 0;
+        // console.log('处理长按事件');
+        this.showButtonList = true;
+      }, 1000);
+    },
+    goMove(event) {
+      event.preventDefault();
+      let touch = event.targetTouches[0];
+    //   console.log('移动中',touch.pageY);
+      //1379-1440
+      this.currentPageY = touch.pageY;
+    },
+    goEnd() {
+      // 触发切换事件
+      let temp;
+      if (this.btnIndex === 4) temp = this.e;
+      if (this.btnIndex === 3) temp = this.d;
+      if (this.btnIndex === 2) temp = this.c;
+      if (this.btnIndex === 1) temp = this.b;
+      if (this.btnIndex === 0) temp = this.a;
+      this.change(temp);
+// 1228 1260
+    //   let _this = this;
+      clearTimeout(this.timeOutEvent);
+    //   _this.timeOutEvent !== 0
+
+        // console.log('处理长按结束事件');
+        if (this.btnIndex < this.titles.length && this.btnIndex >= 0) {
+          this.pageJump(this.jumpUrl[this.btnIndex]);
+        }
+        this.showButtonList = false;
+        this.startPageY = this.currentPageY = 0; //因为computed会缓存btnIndex,而需要在切换页面之后恢复原状,所以要改变
+      
+    },
+  },
+  computed: {
+    btnIndex: function () {
+      let index;
+      let relativeY = this.startPageY - this.currentPageY;
+      index = Math.floor(relativeY / this.btnHeight);
+      // console.log(index);
+      return index;
+    },
+  },
+  beforeUpdate() {
+    this.btnHeight = document.getElementById("mainbutton").clientHeight / 1.7;
+    // console.log('btnheight',this.btnHeight);
+  },
+};
+</script>
+
+
+<style scoped>
+/* #guide-button>div:henter .button-text{
+    color:#ffffff;
+} */
+.hit {
+  transform: scale(1.03);
+  color: #ffffff;
+  opacity: 1;
+  transition: all 1s ease;
+}
+#mainbutton {
+  position: absolute;
+  top: 5.6rem;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 18.9rem;
+  height: 4.3rem;
+  /* background: linear-gradient(180deg, #D16914, transparent);
+  border-radius: 6px;*/
+}
+.arrow {
+  position: inherit;
+  top: 30%;
+  right: 1.7rem;
+  width: 1.2rem;
+}
+.arrow.arrowDown {
+  transform-origin: center;
+  transform: rotate(180deg);
+}
+.exbutton {
+  width: 18.9rem;
+  opacity: 0.8;
+}
+div.button-text {
+  position: absolute;
+  top: 40%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  display: block;
+  text-align: center;
+  font-weight: normal;
+  color: #ffffff;
+  font-size: 1rem;
+  font-family: "Microsoft YaHei", "serif";
+  opacity: 1;
+}
+div.black-text {
+  color: #000000;
+}
+#cloud-exhibition {
+  position: absolute;
+  top: 2.8rem;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 18.9rem;
+  height: 4.3rem;
+  z-index: 999;
+}
+#old-exhibition {
+  position: absolute;
+  top: 0;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 18.9rem;
+  height: 4.3rem;
+  z-index: 999;
+}
+#old-exhibition1,
+#old-exhibition2 {
+  position: absolute;
+  top: -5.6rem;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 18.9rem;
+  height: 4.3rem;
+  z-index: 999;
+}
+#old-exhibition2 {
+  top: -2.8rem;
+}
+a {
+  text-decoration: none;
+  color: inherit;
+}
+
+#front {
+  position: absolute;
+  top: 4.9rem;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 18.1rem;
+}
+#front img {
+  width: 100%;
+}
+#back {
+  position: absolute;
+  top: 4.25rem;
+  left: 50%;
+  transform: translateX(-50%);
+  width: 16.2rem;
+}
+#back img {
+  width: 100%;
+}
+</style>

+ 15 - 14
src/components/GuideButton.vue

@@ -2,7 +2,7 @@
     <div id="guide-button">
         <template v-if="showButtonList">
 
-        <div id="old-exhibition1" v-if="titles[4]">
+        <div id="old-exhibition1" v-if="titles[4]" >
             <img class="exbutton" 
                 :class="[btnIndex == 4?'hit':'']"
                 src="@/assets/images/exbutton.png"/>
@@ -11,7 +11,7 @@
                     :class="[btnIndex == 4?'hit':'']">
                     {{titles[4]}}</a></div></div>
 
-        <div id="old-exhibition2" v-if="titles[3]">
+        <div id="old-exhibition2" v-if="titles[3]" >
             <img class="exbutton" 
                 :class="[btnIndex == 3?'hit':'']"
                 src="@/assets/images/exbutton.png"/>
@@ -21,7 +21,7 @@
                     {{titles[3]}}</a></div></div>
 
 
-        <div id="old-exhibition">
+        <div id="old-exhibition" >
             <img class="exbutton" 
                 :class="[btnIndex == 2?'hit':'']"
                 src="@/assets/images/exbutton.png"/>
@@ -30,7 +30,7 @@
                     :class="[btnIndex == 2?'hit':'']">
                     {{titles[2]}}</a></div></div>
 
-        <div id="cloud-exhibition">
+        <div id="cloud-exhibition" >
             <img class="exbutton" 
                 :class="[btnIndex == 1?'hit':'']"
                 src="@/assets/images/exbutton.png"/>
@@ -45,7 +45,7 @@
         </template>
 
         <div id="mainbutton">
-            <img class="exbutton" 
+                <img class="exbutton" 
                 @touchstart='goStart' 
                 @touchmove='goMove'
                 @touchend='goEnd'
@@ -86,40 +86,41 @@ export default {
     methods:{
         pageJump(url){
             window.location.href = url;
-            console.log('jump');
+            // console.log('jump');
         },
         buttonList(){
             this.showButtonList = !this.showButtonList;
-            console.log('buttonlist',this.showButtonList);
+            // console.log('buttonlist',this.showButtonList);
         },
         goStart(event) {
             let _this = this;
             event.preventDefault();
             clearTimeout(_this.timeOutEvent);
             let touch = event.targetTouches[0];
-            console.log('起点',touch.pageY);
+            // console.log('起点',touch.pageY);
             this.startPageY = touch.pageY;
             // 开始触摸
             _this.timeOutEvent = setTimeout(() => {
                 _this.timeOutEvent = 0
-                console.log('处理长按事件');
+                // console.log('处理长按事件');
                 this.showButtonList = true;
             },1000)
         },
         goMove(event) {
             event.preventDefault();
             let touch = event.targetTouches[0];
-            console.log('移动中',touch.pageY);
+            // console.log('移动中',touch.pageY);
+            //1379-1440
             this.currentPageY = touch.pageY;
         },
         goEnd(){
             let _this = this;
             clearTimeout(this.timeOutEvent)
             if(_this.timeOutEvent !== 0){
-                console.log('处理单击事件');
+                // console.log('处理单击事件');
                 // this.pageJump(this.jumpUrl[0]);
             }else{
-                console.log('处理长按结束事件');
+                // console.log('处理长按结束事件');
                 if(this.btnIndex < this.titles.length
                     && this.btnIndex >= 0){
                     this.pageJump(this.jumpUrl[this.btnIndex]);
@@ -134,13 +135,13 @@ export default {
             let index;
             let relativeY = this.startPageY - this.currentPageY;
             index = Math.floor(relativeY / this.btnHeight);
-            console.log(index);
+            // console.log(index);
             return index;
         },
     }, 
     beforeUpdate(){
         this.btnHeight = document.getElementById('mainbutton').clientHeight / 1.7;
-        console.log('btnheight',this.btnHeight);
+        // console.log('btnheight',this.btnHeight);
     },
 }
 </script>

+ 1 - 0
src/components/RenCulture.vue

@@ -13,6 +13,7 @@
           <img src="../assets/images/AllWall/hswh1.png" alt="" />
         </a>
         <a
+        style="width:94%"
           href="http://www.4dmodel.com/SuperTwo/index.html?m=794_f"
           class="tow"
         >

+ 16 - 3
src/view/Home.vue

@@ -1,6 +1,11 @@
 <template>
   <GuidePage />
-  <AllWall />
+  <!-- <AllWall /> -->
+      <!-- 万物墙 -->
+    <div id="iframe-container">
+      <iframe id="wanwuqiang" src="dist/index.html"></iframe>
+    </div>
+
   <div class="bigbac">
     <div id="posters">
       <div class="txt">
@@ -18,7 +23,7 @@
 <script>
 import Tradition from "@/components/Tradition.vue";
 import GuidePage from "@/components/GuidePage.vue";
-import AllWall from "@/components/AllWall.vue";
+// import AllWall from "@/components/AllWall.vue";
 import RenCulture from "@/components/RenCulture.vue";
 import International from "@/components/International.vue";
 import About from "@/components/About.vue";
@@ -27,7 +32,7 @@ export default {
   components: {
     GuidePage,
     Tradition,
-    AllWall,
+    // AllWall,
     RenCulture,
     International,
     About,
@@ -48,4 +53,12 @@ export default {
   background: url("../assets/images/bigbac.jpg") no-repeat;
   background-size: 100% 100%;
 }
+#iframe-container {
+  width: 100vw;
+  height: 100vh;
+}
+#wanwuqiang {
+  width: 100%;
+  height: 100%;
+}
 </style>