|
@@ -158,13 +158,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="plate05">
|
|
|
+ <div class="plate05" ref="numcount">
|
|
|
<img src="@/assets/images/index_img_record_bg.png" class="bg">
|
|
|
<div class="info">
|
|
|
<h2 class="b-title">每个空间,都值得被记录</h2>
|
|
|
<div class="count-group">
|
|
|
<div v-for="(item, i) in countGroup" :key="i">
|
|
|
- <span>{{item.count}}</span>
|
|
|
+ <number after="%" :count="item.count" :start="startNumCount"></number>
|
|
|
<p v-html="item.text"></p>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -207,14 +207,16 @@ import vcenter from '@/components/vcenter'
|
|
|
import lselect from '@/components/lselect'
|
|
|
import tabs from '@/components/tabs'
|
|
|
import wave from '@/components/wave'
|
|
|
+import number from '@/components/number'
|
|
|
+import { getPosition } from '@/util'
|
|
|
|
|
|
export default {
|
|
|
data () {
|
|
|
let countGroup = [
|
|
|
- {text: '详情页浏览<br>提升', count: '75%'},
|
|
|
- {text: '人均停留<br>增长', count: '318%'},
|
|
|
- {text: '人均浏览<br>增长', count: '180%'},
|
|
|
- {text: '房源约看<br>增长', count: '138%'}
|
|
|
+ {text: '详情页浏览<br>提升', count: 75},
|
|
|
+ {text: '人均停留<br>增长', count: 318},
|
|
|
+ {text: '人均浏览<br>增长', count: 180},
|
|
|
+ {text: '房源约看<br>增长', count: 138}
|
|
|
]
|
|
|
let reports = [
|
|
|
{
|
|
@@ -264,10 +266,25 @@ export default {
|
|
|
return {
|
|
|
countGroup,
|
|
|
reports,
|
|
|
- items
|
|
|
+ items,
|
|
|
+ startNumCount: false
|
|
|
}
|
|
|
},
|
|
|
- components: {lselect, tabs, vcenter, slide, wave}
|
|
|
+ mounted () {
|
|
|
+ this.sizeHandle = () => {
|
|
|
+ let y = getPosition(this.$refs.numcount).y + this.$refs.numcount.offsetHeight
|
|
|
+ if (window.innerHeight + window.scrollY > y) {
|
|
|
+ this.startNumCount = true
|
|
|
+ window.removeEventListener('scroll', this.sizeHandle)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ window.addEventListener('scroll', this.sizeHandle)
|
|
|
+ },
|
|
|
+ destroyed () {
|
|
|
+ window.removeEventListener('scroll', this.sizeHandle)
|
|
|
+ },
|
|
|
+ components: {lselect, tabs, vcenter, slide, wave, number}
|
|
|
}
|
|
|
</script>
|
|
|
|