Commit 33183695 by 李伟康

修复人数滚动不会动BUG

1 parent 096388a2
<template>
<div class="group-list" ref="groupBox">
<div
class="group-list"
ref="groupBox"
>
<div class="mask"></div>
<template v-if="list.length">
<div class="move" ref="move">
<div
class="move"
ref="move"
>
<template v-for="(i, index) in list">
<div :class="['item flex', { 'group-item': index == 0 }]" :key="index">
<div
:class="['item flex', { 'group-item': index == 0 }]"
:key="index"
>
<img :src="i.imageUrl" />
<div class="text">{{ i.name }}刚刚参加了活动</div>
</div>
......@@ -17,10 +26,20 @@
<script type="text/ecmascript-6">
export default {
name: 'MoveGroup',
props: ['groupInfo'],
props: {
groupInfo: {
type: Object,
default: () => { }
},
show: {
type: Boolean,
default: false
}
},
watch: {
'groupInfo' (n) {
if (n && n.groupList && n.groupList.length) this.setList(n.groupList)
'show' (n) {
let { groupInfo } = this
if (n && groupInfo.groupList && groupInfo.groupList.length) this.setList(groupInfo.groupList)
}
},
data () {
......@@ -30,11 +49,13 @@ export default {
}
},
mounted () {
this.$refs.groupBox.style.display = 'none'
},
methods: {
setList (list) {
this.list = list
this.$nextTick(() => {
this.$refs.groupBox.style.display = 'block'
let boxHeight = this.$refs.groupBox.offsetHeight
let [item] = document.getElementsByClassName('group-item')
let itemHeight = item.offsetHeight / 7 + item.offsetHeight
......@@ -56,6 +77,7 @@ export default {
<style scoped lang="scss">
.group-list {
// visibility: hidden;
position: absolute;
left: 8px;
top: 5%;
......@@ -111,4 +133,7 @@ export default {
}
}
}
.show {
visibility: visible;
}
</style>
......@@ -51,9 +51,7 @@
</div>
</template>
<!--👇 参团人数滚动显示 -->
<template v-if="detail.activityStatus != 1">
<move-group v-show="detail.showAvatarNicknameFlag == 2" :groupInfo="groupInfo" />
</template>
<move-group :show="detail.showAvatarNicknameFlag == 2" :groupInfo="groupInfo" />
</div>
<template v-if="viewFlag">
<div class="activity">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!