|
@@ -8,11 +8,8 @@
|
|
<div class='floor-list'>
|
|
<div class='floor-list'>
|
|
<div class='icon-top' v-if='floorsArr.length>showNumber'>
|
|
<div class='icon-top' v-if='floorsArr.length>showNumber'>
|
|
<!-- @click='changeFloor(1,currIndex)' -->
|
|
<!-- @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>
|
|
<div class='floor-out'>
|
|
<div class='floor-out'>
|
|
<!-- 放开marginTop样式 -->
|
|
<!-- 放开marginTop样式 -->
|
|
@@ -28,8 +25,8 @@
|
|
</div>
|
|
</div>
|
|
<div class='icon-bottom' v-if='floorsArr.length>showNumber'>
|
|
<div class='icon-bottom' v-if='floorsArr.length>showNumber'>
|
|
<!-- v-repeat-click='decrease' -->
|
|
<!-- 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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -83,24 +80,19 @@ export default {
|
|
this.init()
|
|
this.init()
|
|
},
|
|
},
|
|
methods: {
|
|
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() {
|
|
increase() {
|
|
- console.log('increase')
|
|
|
|
|
|
+ // console.log('increase')
|
|
let marginTop = parseInt(this.marginTop)
|
|
let marginTop = parseInt(this.marginTop)
|
|
marginTop < 0 && this.changeFloor(1, this.currIndex)
|
|
marginTop < 0 && this.changeFloor(1, this.currIndex)
|
|
},
|
|
},
|
|
|
|
+ /**
|
|
|
|
+ * @description 点击下箭头,marginTop小于最大值marginTopMax时,执行楼层滚动
|
|
|
|
+ */
|
|
decrease() {
|
|
decrease() {
|
|
- console.log('decrease')
|
|
|
|
|
|
+ // console.log('decrease')
|
|
let marginTop = Math.abs(parseInt(this.marginTop)),
|
|
let marginTop = Math.abs(parseInt(this.marginTop)),
|
|
marginTopMax = Math.abs(parseInt(this.marginTopMax))
|
|
marginTopMax = Math.abs(parseInt(this.marginTopMax))
|
|
marginTop < marginTopMax && this.changeFloor(-1, this.currIndex)
|
|
marginTop < marginTopMax && this.changeFloor(-1, this.currIndex)
|
|
@@ -130,7 +122,7 @@ export default {
|
|
* @description 点击图例下方的,上下切换按钮
|
|
* @description 点击图例下方的,上下切换按钮
|
|
*/
|
|
*/
|
|
changeFloor(flag, index) {
|
|
changeFloor(flag, index) {
|
|
- console.log('changeFloor')
|
|
|
|
|
|
+ // console.log('changeFloor')
|
|
const len = this.floorIdArr.length
|
|
const len = this.floorIdArr.length
|
|
// let index = this.floorIdArr.findIndex(item => item === this.currentFloorId)
|
|
// let index = this.floorIdArr.findIndex(item => item === this.currentFloorId)
|
|
this.currIndex = index
|
|
this.currIndex = index
|