소스 검색

Revert "树生长页支持鼠标拖动"

This reverts commit a1f5b2b534677387b12fc35ebc3c053c56189b64.
任一存 3 년 전
부모
커밋
84705abe9d
1개의 변경된 파일2개의 추가작업 그리고 66개의 파일을 삭제
  1. 2 66
      src/views/TreeAnimation.vue

+ 2 - 66
src/views/TreeAnimation.vue

@@ -9,18 +9,12 @@
       class="img-wrapper"
       @scroll="onImgWrapperScroll"
     >
-      <div
-        class="img-wrapper-tall"
-        @mousedown="onMouseDown"
-        @mousemove="onMouseMove"
-        @mouseup="onMouseUp"
-      >
+      <div class="img-wrapper-tall">
         <img
           ref="tree-image"
           class="tree-image"
           src="@/assets/image/tall-tree-no-fruit.png"
           alt=""
-          draggable="false"
           @load="onTreeImgLoad"
         >
         <!-- 各标签(果子)的代码顺序与显示顺序上下相反 -->
@@ -28,7 +22,6 @@
           src="@/assets/image/fruits/金色中国.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 2.5rem;
             height: calc(10.16rem + 0.78rem);
@@ -41,7 +34,6 @@
           src="@/assets/image/fruits/在此.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.89rem + 0.78rem);
@@ -54,7 +46,6 @@
           src="@/assets/image/fruits/藏品架起沟通的桥梁.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.28rem + 0.78rem);
@@ -67,7 +58,6 @@
           src="@/assets/image/fruits/温婉.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 2.5rem;
             height: calc(10.28rem + 0.78rem);
@@ -80,7 +70,6 @@
           src="@/assets/image/fruits/和合.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.92rem + 0.78rem);
@@ -93,7 +82,6 @@
           src="@/assets/image/fruits/南腔北调.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(9.31rem + 0.78rem);
@@ -106,7 +94,6 @@
           src="@/assets/image/fruits/呼吸.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(9.89rem + 0.78rem);
@@ -119,7 +106,6 @@
           src="@/assets/image/fruits/法老王.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.75rem;
             height: calc(10.47rem + 0.78rem);
@@ -132,7 +118,6 @@
           src="@/assets/image/fruits/缀白裘.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.59rem + 0.78rem);
@@ -145,7 +130,6 @@
           src="@/assets/image/fruits/帝国盛世.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.59rem + 0.78rem);
@@ -158,7 +142,6 @@
           src="@/assets/image/fruits/青藤.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.75rem;
             height: calc(8.59rem + 0.78rem);
@@ -171,7 +154,6 @@
           src="@/assets/image/fruits/走进.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(10.11rem + 0.78rem);
@@ -184,7 +166,6 @@
           src="@/assets/image/fruits/回家过年.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.2rem + 0.78rem);
@@ -197,7 +178,6 @@
           src="@/assets/image/fruits/穆夏.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(9.22rem + 0.78rem);
@@ -210,7 +190,6 @@
           src="@/assets/image/fruits/称霸侏罗纪.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(9.38rem + 0.78rem);
@@ -223,7 +202,6 @@
           src="@/assets/image/fruits/世界巨匠.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(10.67rem + 0.78rem);
@@ -236,7 +214,6 @@
           src="@/assets/image/fruits/暑期.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(7.19rem + 0.78rem);
@@ -249,7 +226,6 @@
           src="@/assets/image/fruits/金色阿富汗.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(11.34rem + 0.78rem);
@@ -262,7 +238,6 @@
           src="@/assets/image/fruits/从毕加索.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.98rem + 0.78rem);
@@ -275,7 +250,6 @@
           src="@/assets/image/fruits/兄弟王.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(10.92rem + 0.78rem);
@@ -288,7 +262,6 @@
           src="@/assets/image/fruits/仰之弥高.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.44rem + 0.78rem);
@@ -301,7 +274,6 @@
           src="@/assets/image/fruits/融合.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.75rem;
             height: calc(9.13rem + 0.78rem);
@@ -314,7 +286,6 @@
           src="@/assets/image/fruits/晶华.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 2.5rem;
             height: calc(7.81rem + 0.78rem);
@@ -327,7 +298,6 @@
           src="@/assets/image/fruits/百花呈瑞.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.56rem + 0.78rem);
@@ -340,7 +310,6 @@
           src="@/assets/image/fruits/考古江苏.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(7.81rem + 0.78rem);
@@ -353,7 +322,6 @@
           src="@/assets/image/fruits/浮世绘.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 2.5rem;
             height: calc(5rem + 0.78rem);
@@ -366,7 +334,6 @@
           src="@/assets/image/fruits/宋韵.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(8.28rem + 0.78rem);
@@ -379,7 +346,6 @@
           src="@/assets/image/fruits/万水千山.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(12.23rem + 0.78rem);
@@ -392,7 +358,6 @@
           src="@/assets/image/fruits/家国.png"
           class="fruit"
           alt=""
-          draggable="false"
           style="
             width: 3.13rem;
             height: calc(10.31rem + 0.78rem);
@@ -439,19 +404,12 @@ export default {
       showSlideTip: false,
       visMonitorList: [],
       scrollTop: 0,
-
-      /**
-       * 为了PC端也能拖动树木
-       */
-      isMouseDown: false,
-      isTreeDragged: false,
     }
   },
   computed: {
 
   },
   created() {
-
   },
   mounted() {
     const fruitNodeList = document.getElementsByClassName('fruit')
@@ -490,7 +448,7 @@ export default {
       mc.get('pan').set({ direction: Hammer.DIRECTION_ALL })
       const that = this
       mc.on("pandown", function me() {
-        if (that.$refs['img-wrapper'].scrollTop === 0 && !that.isTreeDragged) {
+        if (that.$refs['img-wrapper'].scrollTop === 0) {
           that.$router.push({ name: 'TreeSelection' })
           // 因为本组件用keep-alive来避免销毁了,所以可能会多次用到下滑翻页功能,所以此处不能off。
           // mc.off('pandown', me)
@@ -509,29 +467,7 @@ export default {
       }
     },
     onClickFruit(exhibitionType, exhibitionId) {
-      if (this.isTreeDragged) {
-        return
-      }
       this.$router.push(`/ExhibitionDetailAnimation?exhibitionType=${exhibitionType}&exhibitionId=${exhibitionId}`)
-    },
-    onMouseDown() {
-      this.isMouseDown = true
-      this.isTreeDragged = false
-    },
-    onMouseUp() {
-      this.isMouseDown = false
-    },
-    onMouseMove(e) {
-      if (
-        this.isMouseDown &&
-        !(
-          this.$refs['img-wrapper'].scrollTop == 0 &&
-          e.movementY > 0
-        )
-      ) {
-        this.$refs['img-wrapper'].scrollTop -= e.movementY
-        this.isTreeDragged = true
-      }
     }
   }
 }