<!--packageH/chitchat/components/chatListItem/chatListItem.wxml-->

<wxs module="tool">
  var unReadCount = function(num){
      if(num==0){
        return 0;
      }
      if(num>99){
        return "99+";
      }
      return num;
    }
  module.exports.unReadCount = unReadCount;
</wxs>

<view class="item-box" bindtap="chearRead">
    <view class="item-img">
      <image src="{{item.avatar}}" ></image>
    </view>
    <view class="item-cont">
      <view class="item-cont-top">
        <text class="item-nickname">{{item.nickname}}</text>
        <text class="item-time">{{item.updated_at}}</text>
      </view>
      <view class="item-footer">
        <view class="item-last-msg">{{item.last_chat_content}}</view>
        <view class="item-unread" wx:if="{{tool.unReadCount(item.un_read_num) > 0}}">{{tool.unReadCount(item.un_read_num)}}</view>
      </view>
    </view>
</view>



