Explorar el Código

Merge branch 'aly_dev' of git.sagacloud.cn:web/wanda-bm-guide into aly_dev

guoxiaohuan hace 4 años
padre
commit
f03ed4c964
Se han modificado 1 ficheros con 13 adiciones y 21 borrados
  1. 13 21
      src/components/floorList.vue

+ 13 - 21
src/components/floorList.vue

@@ -8,11 +8,8 @@
         <div class='floor-list'>
             <div class='icon-top' v-if='floorsArr.length>showNumber'>
                 <!-- @click='changeFloor(1,currIndex)' -->
-                <!-- @mousedown='mousedown' -->
-                <!-- @mouseup='mouseup' -->
-                <!-- v-repeat-click='increase' -->
-                <img v-if='parseInt(marginTop) !== 0' v-repeat-click='increase' src='@/assets/imgs/iconBlackTop.png' alt />
-                <img class='disabled' v-else src='@/assets/imgs/iconLightTop.png' alt />
+                <img v-show='parseInt(marginTop) !== 0' v-repeat-click='increase' src='@/assets/imgs/iconBlackTop.png' alt />
+                <img class='disabled' v-show='parseInt(marginTop) === 0' src='@/assets/imgs/iconLightTop.png' alt />
             </div>
             <div class='floor-out'>
                 <!--  放开marginTop样式  -->
@@ -28,8 +25,8 @@
             </div>
             <div class='icon-bottom' v-if='floorsArr.length>showNumber'>
                 <!-- v-repeat-click='decrease' -->
-                <img v-if='parseInt(marginTop) !== marginTopMax' v-repeat-click='decrease' src='@/assets/imgs/iconBlackBottom.png' alt />
-                <img class='disabled' v-else src='@/assets/imgs/iconLightBottom.png' alt />
+                <img v-show='parseInt(marginTop) !== marginTopMax' v-repeat-click='decrease' src='@/assets/imgs/iconBlackBottom.png' alt />
+                <img class='disabled' v-show='parseInt(marginTop) === marginTopMax' src='@/assets/imgs/iconLightBottom.png' alt />
             </div>
         </div>
     </div>
@@ -83,24 +80,19 @@ export default {
         this.init()
     },
     methods: {
-        mousedown() {
-            this.startTime = new Date()
-        },
-        mouseup() {
-            this.endTime = new Date()
-            if (this.endTime - this.startTime < 200) {
-                console.log(11111111)
-                this.changeFloor(1, this.currIndex)
-                return false
-            }
-        },
+        /**
+         * @description 点击上箭头,marginTop<0时执行楼层滚动
+         */
         increase() {
-            console.log('increase')
+            // console.log('increase')
             let marginTop = parseInt(this.marginTop)
             marginTop < 0 && this.changeFloor(1, this.currIndex)
         },
+        /**
+         * @description 点击下箭头,marginTop小于最大值marginTopMax时,执行楼层滚动
+         */
         decrease() {
-            console.log('decrease')
+            // console.log('decrease')
             let marginTop = Math.abs(parseInt(this.marginTop)),
                 marginTopMax = Math.abs(parseInt(this.marginTopMax))
             marginTop < marginTopMax && this.changeFloor(-1, this.currIndex)
@@ -130,7 +122,7 @@ export default {
          * @description 点击图例下方的,上下切换按钮
          */
         changeFloor(flag, index) {
-            console.log('changeFloor')
+            // console.log('changeFloor')
             const len = this.floorIdArr.length
             // let index = this.floorIdArr.findIndex(item => item === this.currentFloorId)
             this.currIndex = index