|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="statistics">
|
|
|
- <ul class="list-inline pull-left" ref="pingdanListWrapper" :style="'top: -' + 1 * timerIndexL + 'rem'" :class="{'topL': isTopL}">
|
|
|
+ <ul class="list-inline pull-left" ref="pingdanListWrapperL" :style="'top: -' + 1 * timerIndexL + 'rem'" :class="{'topL': isTopL}">
|
|
|
<li v-for="(item, index) in itemLeft">
|
|
|
<span class="number">
|
|
|
<span class="name" v-html="nameLeft[index]"></span>
|
|
|
@@ -63,19 +63,21 @@
|
|
|
this.isTopL = false
|
|
|
let isChange = true
|
|
|
this.timerIndexL++
|
|
|
- let _transitionEvent = whichTransitionEvent()
|
|
|
- _transitionEvent && this.$refs.pingdanListWrapper.addEventListener(
|
|
|
- _transitionEvent, () => {
|
|
|
- if (isChange) {
|
|
|
- let title = this.itemLeft.shift()
|
|
|
- let name = this.nameLeft.shift()
|
|
|
- this.itemLeft.push(title)
|
|
|
- this.nameLeft.push(name)
|
|
|
- this.timerIndexL = 0
|
|
|
- isChange = false
|
|
|
- this.isTopL = true
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.$refs.pingdanListWrapperL) {
|
|
|
+ let _transitionEvent = whichTransitionEvent()
|
|
|
+ _transitionEvent && this.$refs.pingdanListWrapperL.addEventListener(
|
|
|
+ _transitionEvent, () => {
|
|
|
+ if (isChange) {
|
|
|
+ let title = this.itemLeft.shift()
|
|
|
+ let name = this.nameLeft.shift()
|
|
|
+ this.itemLeft.push(title)
|
|
|
+ this.nameLeft.push(name)
|
|
|
+ this.timerIndexL = 0
|
|
|
+ isChange = false
|
|
|
+ this.isTopL = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}, 2400)
|
|
|
} else {
|
|
|
clearInterval(this.timerL)
|
|
|
@@ -87,19 +89,21 @@
|
|
|
this.isTopR = false
|
|
|
let isChange = true
|
|
|
this.timerIndexR++
|
|
|
- let _transitionEvent = whichTransitionEvent()
|
|
|
- _transitionEvent && this.$refs.pingdanListWrapperR.addEventListener(
|
|
|
- _transitionEvent, () => {
|
|
|
- if (isChange) {
|
|
|
- let title = this.itemRight.shift()
|
|
|
- let name = this.nameRight.shift()
|
|
|
- this.itemRight.push(title)
|
|
|
- this.nameRight.push(name)
|
|
|
- this.timerIndexR = 0
|
|
|
- isChange = false
|
|
|
- this.isTopR = true
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.$refs.pingdanListWrapperR) {
|
|
|
+ let _transitionEvent = whichTransitionEvent()
|
|
|
+ _transitionEvent && this.$refs.pingdanListWrapperR.addEventListener(
|
|
|
+ _transitionEvent, () => {
|
|
|
+ if (isChange) {
|
|
|
+ let title = this.itemRight.shift()
|
|
|
+ let name = this.nameRight.shift()
|
|
|
+ this.itemRight.push(title)
|
|
|
+ this.nameRight.push(name)
|
|
|
+ this.timerIndexR = 0
|
|
|
+ isChange = false
|
|
|
+ this.isTopR = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}, 3000)
|
|
|
} else {
|
|
|
clearInterval(this.timerR)
|