Skip to content

在uniapp中使用nvue页面的recycle-list组件写聊天页面,展示五百多条数据,频繁出现app闪退问题,上下滑动渲染的时候部分内容消失(实际上在),点击跳转页面,会影响其他项的头像背景色 #1

@dyf-yifan

Description

@dyf-yifan

https://weexapp.com/zh/docs/components/recycle-list.html#%E7%A4%BA%E4%BE%8B
WechatIMG137
WechatIMG138
Snipaste_2024-08-21_11-17-09

`



<div class="r-realname-box" :style="{backgroundColor:i.tag999?'#'+i.tag999:{orange}}"
@longpress="onLongPress" @touchstart="touchStart(i,index)">

{{i.realname}}




{{i.num}}


<view class="r-box-right" @touchend="navChat(i,index)"
:style="{width:i.rightWidth?i.rightWidth+'px':{}}" @appear="onappear(i,index)">


{{i.title}}


{{i.time}}



置顶
{{i.tag1.planStr}}

							<text class="r-content-tag r-color-grey r-padd-left" v-if="i.tags[0]">
								{{i.tags[0]}}
							</text>
							<text class="r-content-tag r-color-grey r-padd-left" v-if="i.tags[1]">
								{{i.tags[1]}}
							</text>
							<text class="r-content-tag r-color-grey r-padd-left" v-if="i.tags[2]">
								{{i.tags[2]}}
							</text>
							<text class="r-content-tag r-color-grey r-padd-left" v-if="i.tags[3]">
								{{i.tags[3]}}
							</text>
							<text class="r-content-tag r-color-grey" v-if="i.tags[4]">
								...
							</text>
							<text class="r-content-tag r-color-red r-padd-left"
								v-if="i.inspectDay">{{i.inspectDay}}无指标</text>
						</view>
						<view class="n-just-bet">
							<view class="" v-if="i.lastMsgTimeStr"
								:style="{width:i.rightContentWidth?i.rightContentWidth+'px':{}}">
								<text class="r-content-tag r-padd r-color-grey n-omit"
									v-if="i.nickname||i.desc">{{i.nickname}}:{{i.desc}}</text>
							</view>
							<view class="" :style="{width:i.rightWidth?i.rightWidth+'px':{}}" v-else>
								<text class="r-content-tag r-padd r-color-grey n-omit"
									v-if="i.nickname||i.desc">{{i.nickname}}:{{i.desc}}</text>
							</view>
							<view class=" flex-row flex-ali-center">
								<text class="r-content-tag r-color-grey"
									v-if="i.lastMsgTimeStr">回复:{{i.lastMsgTimeStr}}</text>
							</view>
						</view>
					</view>
				</view>
			</transition>
		</cell-slot>
	</recycle-list>`

navChat(item, index) { let that = this; var dialogId = item.dialogId; var extend = getApp().G.getExtend(); if (item.num > 0) { that.$set(that.dbClick, dialogId, 0); that.noReadNum = that.noReadNum - item.num; that.chatListType[that.currentIndex].num = that.chatListType[that.currentIndex].num - item.num; if (that.noReadNum < 1) { that.noReadNum = 0; uni.removeTabBarBadge({ index: 1 }); } else { uni.setTabBarBadge({ index: 1, text: that.noReadNum + "" }) } } if (extend.p === 'win') { uni.$emit('showChat', { dialogId: dialogId }); } else { uni.navigateTo({ url: '/pages/im/dialog/chat?dialogId=' + dialogId + '&status=' + item.status }) that.closeShade(); } },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions