|
|
@@ -1,16 +1,16 @@
|
|
|
<template>
|
|
|
- <div class="display-card">
|
|
|
+ <div class="display-card" v-if="cardShow">
|
|
|
<span @click="cardClose" v-if="cardShow" class="cardClose"><img src="/images/all/close.png"></span>
|
|
|
<div class="content" v-if="cardShow">
|
|
|
<div>
|
|
|
<ul class="list-unstyled">
|
|
|
- <li v-for="(item, index) in title" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
+ <li ref="pingdanListWrapper" v-for="(item, index) in title" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
<span>{{item}}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul class="list-unstyled">
|
|
|
- <li v-for="(c, index) in counts" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
- <count-item :value ="c" :index ="index"></count-item>
|
|
|
+ <li ref="pingdanListWrapper" v-for="(c, index) in counts" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
|
|
|
+ <count-item :value ="c.count" :logo ="c.logo"></count-item>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
@@ -28,6 +28,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import CountItem from './countItem.vue'
|
|
|
+ import {whichTransitionEvent} from '~utils/baseUtils.js'
|
|
|
export default {
|
|
|
name: 'display-card',
|
|
|
data () {
|
|
|
@@ -51,17 +52,24 @@
|
|
|
changeInterval: function (flag) {
|
|
|
if (flag) {
|
|
|
this.timer = setInterval(() => {
|
|
|
- this.timerIndex ++
|
|
|
-// let title = this.title.shift()
|
|
|
-// let count = this.counts.shift()
|
|
|
-// this.title.push(title)
|
|
|
-// this.counts.push(count)
|
|
|
-// this.timerIndex = 0
|
|
|
- this.isTop = (this.timerIndex === 4)
|
|
|
- if (this.isTop) {
|
|
|
- this.timerIndex = 0
|
|
|
- }
|
|
|
- }, 3000)
|
|
|
+ this.isTop = false
|
|
|
+ let isChange = true
|
|
|
+ this.timerIndex++
|
|
|
+ let _transitionEvent = whichTransitionEvent()
|
|
|
+ _transitionEvent && this.$refs.pingdanListWrapper[0].addEventListener(
|
|
|
+ _transitionEvent, () => {
|
|
|
+ console.log(isChange)
|
|
|
+ if (isChange) {
|
|
|
+ let title = this.title.shift()
|
|
|
+ let count = this.counts.shift()
|
|
|
+ this.title.push(title)
|
|
|
+ this.counts.push(count)
|
|
|
+ this.timerIndex = 0
|
|
|
+ isChange = false
|
|
|
+ this.isTop = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }, 4000)
|
|
|
} else {
|
|
|
clearInterval(this.timer)
|
|
|
}
|
|
|
@@ -164,10 +172,10 @@
|
|
|
let countM = this.$store.state.product.common.counts.data
|
|
|
if (countM) {
|
|
|
countM.forEach((value, key, $data) => {
|
|
|
- arr.push(value.count)
|
|
|
+ arr.push({count: value.count, logo: 1})
|
|
|
})
|
|
|
}
|
|
|
- arr.push(this.list.totalElements)
|
|
|
+ arr.push({count: this.list.totalElements, logo: 0})
|
|
|
return arr
|
|
|
},
|
|
|
enterprise () {
|
|
|
@@ -224,14 +232,14 @@
|
|
|
position: relative;
|
|
|
top: 0;
|
|
|
transition: top 1s;
|
|
|
- -moz-transition: top 1s; /* Firefox 4 */
|
|
|
- -webkit-transition: top 1s; /* Safari and Chrome */
|
|
|
- -o-transition: top 1s; /* Opera */
|
|
|
+ /*-moz-transition: top 1s; !* Firefox 4 *!*/
|
|
|
+ /*-webkit-transition: top 1s; !* Safari and Chrome *!*/
|
|
|
+ /*-o-transition: top 1s; !* Opera *!*/
|
|
|
&.top {
|
|
|
transition: top 0s;
|
|
|
- -moz-transition: top 0s; /* Firefox 4 */
|
|
|
- -webkit-transition: top 0s; /* Safari and Chrome */
|
|
|
- -o-transition: top 0s; /* Opera */
|
|
|
+ /*-moz-transition: top 0s; !* Firefox 4 *!*/
|
|
|
+ /*-webkit-transition: top 0s; !* Safari and Chrome *!*/
|
|
|
+ /*-o-transition: top 0s; !* Opera *!*/
|
|
|
}
|
|
|
}
|
|
|
}
|