信息流列表中,同样的地址放在for循环中,展示的却是不同的头像,如下图所示:
前提:上下有使用该错位头像的其他用户发帖。
开发版本信息如下:
dataList中的信息有很多,模拟数据出来
<block wx:for="{{dataList}}" wx:for-item="item" data-index="index" wx:if="{{index>=0 && !dataList[index].hide}}">
<view id="item-{{index}}" class="island" data-value="{{dataList[index]}}" data-index="{{dataList[index]}}">
<view class="list-layout">
<image class="island-avatar" bindtap="onTapCustomInfo" data-value="{{dataList[index]}}" src="{{item.avatar==null?'../../assets/gs_logo.png':item.avatar}}"></image>
<view class="list-content">
<view class="island-name" bindtap="onTapCustomInfo" data-value="{{dataList[index]}}">{{item.wxName==null?"火星用户":item.wxName}}</view>
<view class="island-identity" bindtap="onTapCustomInfo" data-value="{{dataList[index]}}" wx:if="{{item.memberIdentity!=null}}">{{item.memberIdentity==null?"":item.memberIdentity}}</view>
<view class="message-content"><text class="message" data-value="{{dataList[index]}}" bindtap="supportMultipleTap" bindlongtap="longTap" bindtouchstart="touchStart" bindtouchend="touchEnd" >{{dataList[index].message==""?"":dataList[index].message}}</text></view>
</view>
</view>
<view class="content-layout">
<block class="message-image" wx:if="{{item.image}}" wx:for="{{common.toStringArray(item.image)}}" wx:for-item="imgitem" data-index="id">
<video src="{{imgitem}}" data-image='{{common.toStringArray(item.image)}}' wx:if="{{common.isImageOrVideo(imgitem) &&common.toStringArray(item.image).length == 1}}" style="width:620rpx;max-height:1080rpx;height:650rpx;margin-left:110rpx;margin-right:10rpx;" show-mute-btn id="videoSs{{index}}" object-fit="aspectFill" direction="0" bindplay="play"></video>
<video src="{{imgitem}}" data-image='{{common.toStringArray(item.image)}}' wx:if="{{common.isImageOrVideo(imgitem) &&common.toStringArray(item.image).length != 1}}" style="width:240rpx;height:240rpx;margin-left:8rpx;" show-mute-btn id="videoSs{{index}}" object-fit="contain" direction="0" bindplay="play"></video>
<image src="{{imgitem}}" data-url='{{imgitem}}' data-image='{{common.toStringArray(item.image)}}' wx:if="{{!common.isImageOrVideo(imgitem) &&common.toStringArray(item.image).length != 1}}" style="width:200rpx;height:200rpx;margin-left:8rpx;{{index==0||index==3||index==6?'margin-left:110rpx;':''}}" catchtap="onShowImage" mode="aspectFill"></image>
<image src="{{imgitem}}" data-url='{{imgitem}}' data-image='{{common.toStringArray(item.image)}}' wx:if="{{!common.isImageOrVideo(imgitem) &&common.toStringArray(item.image).length == 1}}" style="margin-left:110rpx;margin-right:20rpx;min-height:220rpx;max-height: 350rpx;" catchtap="onShowImage" mode="heightFix"></image>
</block>
<view class="content-bottom">
<!-- <view class="delete" data-value="{{dataList[index]}}" catchtap="onDeleteMessage" wx:if="{{dataList[index].openid==openId}}">删除</view> -->
<view class="operator-layout">
<view class="delete" data-value="{{dataList[index]}}" catchtap="onDeleteMessage" wx:if="{{dataList[index].openid==openId}}">删除</view>
<view class="quanzi_tag"><text class="quanzi" data-value="{{dataList[index]}}" catchtap="onOpenQuanzi">{{dataList[index].quanzi == undefined?"广场":dataList[index].quanzi}}</text></view>
</view>
<view class="message-time">{{common.formatMsgTime(dataList[index].updateTime)}}</view>
<view class="quanquan-comment" catchtap="onComment" data-value="{{dataList[index]}}">
<image class="comment-image" wx:if="{{dataList[index].comment=='false'}}" src="/assets/comment.png" />
<image class="comment-image" wx:else src="/assets/comment.png" /><text style="margin-left:8rpx;line-height: 42rpx;">{{dataList[index].comment=='0'||dataList[index].comment==undefined?'评论':dataList[index].comment}}</text>
</view>
<view class="island-support" catchtap="onSupport" data-value="{{dataList[index]}}">
<image class="island-image" wx:if="{{dataList[index].supported=='false'}}" src="/assets/support.png" />
<image class="island-image" wx:if="{{dataList[index].supported!='false'}}" src="/assets/support_checked.png" /><text style="margin-left:8rpx;line-height: 42rpx;">{{dataList[index].support=='0'?'赞':dataList[index].support}}</text>
</view>
</view>
</view>
</view>
</block>