提交 afdef3d6 编写于 作者: DCloud_JSON's avatar DCloud_JSON

更新 延迟渲染,避免页面卡顿

上级 e88830fd
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view v-if="!leave_group" class="members-list-container" :class="{'show-less':!showAllMember}"> <view v-if="!leave_group" class="members-list-container" :class="{'show-less':!showAllMember}">
<view class="invite-box item" v-if="isAdmin"> <view class="invite-box item" v-if="isAdmin">
<view class="invite"> <view class="invite">
<uni-icons @click="invite" color="#989898" size="20px" class="invite" type="plusempty"></uni-icons> <uni-icons @click="invite" color="#989898" size="20px" type="plusempty"></uni-icons>
</view> </view>
<text class="nickname">邀请</text> <text class="nickname">邀请</text>
</view> </view>
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
showAllMember: false, showAllMember: false,
// 鼠标在哪个用户id上 // 鼠标在哪个用户id上
hoverUserId: '', hoverUserId: '',
showMoreBtn: true showMoreBtn: true,
// 延迟渲染,避免页面卡顿
laterRenderIndex: 1
}; };
}, },
computed: { computed: {
...@@ -98,6 +100,11 @@ ...@@ -98,6 +100,11 @@
return 0 return 0
} }
}) })
// laterRenderIndex
.filter((item, index) => {
return index < this.laterRenderIndex * 50
})
const memberCount = memberList.length const memberCount = memberList.length
if(memberCount && memberCount < 10){ if(memberCount && memberCount < 10){
console.log('this.member_list.length',this.member_list.length); console.log('this.member_list.length',this.member_list.length);
...@@ -117,6 +124,9 @@ ...@@ -117,6 +124,9 @@
return this.uniIDHasRole('staff') || this.hoverUserId && this.conversation.group_member[this.hoverUserId].role.includes('admin') return this.uniIDHasRole('staff') || this.hoverUserId && this.conversation.group_member[this.hoverUserId].role.includes('admin')
} }
}, },
onReachBottom() {
this.laterRenderIndex++
},
watch: { watch: {
"conversation.group_info.user_id"(adminUserId) { "conversation.group_info.user_id"(adminUserId) {
// 当前用户是群的创建者或者管理员(在群成员中找到当前用户的角色包含admin) // 当前用户是群的创建者或者管理员(在群成员中找到当前用户的角色包含admin)
...@@ -797,7 +807,7 @@ ...@@ -797,7 +807,7 @@
.invite { .invite {
width: 100rpx; width: 100rpx;
height: 100rpx; height: 100rpx;
align-content: center; justify-content: center;
border-radius: 10px; border-radius: 10px;
border: #ccc dashed 1px; border: #ccc dashed 1px;
/* #ifdef H5 */ /* #ifdef H5 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册