chat-room.wxml 1.9 KB

1234567891011121314151617181920212223242526272829303132
  1. <!--pages/chat-room/chat-room.wxml-->
  2. <scroll-view scroll-y="true" class="chat-room">
  3. <view class="otherItem" bindtap="into_groups">
  4. <image src="{{imgPath}}/chat-group.png"></image>
  5. <text>群组</text>
  6. </view>
  7. <view class="chat" wx:for="{{arr}}" wx:key="i" data-item="{{item}}" catchtap="into_chatRoom" bindlongtap="del_chat">
  8. <image class="photo" src="{{ (item.chatType == 'groupchat' || item.chatType == 'chatRoom') ? imgPath + '/chat-group2.png' : (item.info.from == item.username ? item.info.fromInfo.avatarurl : item.info.toInfo.avatarurl) || imgPath + '/chat-user.png'}}" mode="cover"></image>
  9. <view class="item-row">
  10. <text class="chat-name">{{(item.chatType == 'groupchat' || item.chatType == 'chatRoom' || item.groupName) ? item.groupName : (item.info.from == item.username ? item.info.fromInfo.nickname : item.info.toInfo.nickname || item.username)}}</text>
  11. <text class="chat-time">{{item.time}}</text>
  12. <text class="chat-content" wx:if="{{item.msg.data[0].data}}">{{item.msg.data[0].data}}</text>
  13. <text class="chat-content" wx:if="{{item.msg.type == 'img'}}">[图片]</text>
  14. <text class="chat-content" wx:if="{{item.msg.type == 'audio'}}">[语音]</text>
  15. <text class="chat-content" wx:if="{{item.msg.type == 'video'}}">[视频]</text>
  16. <text class="unread-num" wx:if="{{item.unReadCount > 0 || item.unReadCount == '99+'}}">{{item.unReadCount}}</text>
  17. </view>
  18. </view>
  19. <view wx:if="{{arr.length == 0}}" class="chat_noChat">
  20. 当前没有历史聊天,添加一个好友开始聊天吧
  21. </view>
  22. </scroll-view>
  23. <!-- bug: margin-bottom 不生效 需要加一个空标签-->
  24. <view style="height: 1px;"></view>
  25. <view class="mask" bindtap="close_mask" wx:if="{{show_mask}}"></view>
  26. <view class="scan-jion-group" bindtap="scanJoinGroup">
  27. <text>扫一扫</text>
  28. <text>加入群聊</text>
  29. </view>