comment.wxml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <!-- component/comment.wxml -->
  2. <scroll-view class="comment_container" scroll-y="{{isScroll}}">
  3. <view class="comment_number">评论 {{commentNum}}
  4. </view>
  5. <view class="comment_item" wx:for="{{commentList}}" data-commentid="{{item.id}}" wx:key="id">
  6. <view class="comment_box">
  7. <view class="avatar_box">
  8. <image src="{{item.avatar}}" />
  9. </view>
  10. <view class="comment_info">
  11. <text class="nickname">{{item.nickName}}</text>
  12. <text class="comment_text" space="false">{{item.text}}</text>
  13. <view class="comment_reply_wrapper" wx:if="{{item.replyCount > 0}}">
  14. <view class="comment_reply_item" wx:for="{{item.replyList}}" wx:for-item="inner" wx:if="{{index <= item.showControl}}" wx:key="id">
  15. <text class="reply_nickname">{{inner.user.nickName}}:</text>
  16. <text class="reply_text">{{inner.content}}</text>
  17. </view>
  18. <view wx:if="{{item.replyCount > 1 && item.showControl == 0}}" catchtap="showMore" data-index="{{index}}" class="more_btn">
  19. 更多>
  20. </view>
  21. </view>
  22. <view class="time_info">
  23. <view class="time">{{item.time}}</view>
  24. <view class="info">
  25. <view class="like" bindtap="{{item.isLike? null:'likeComment'}}" data-index="{{index}}" data-likes="{{item.likes}}" data-id="{{item.id}}">
  26. <image src="{{item.isLike? '../../static/index/like_reply.png' : '../../static/index/like_reply_grey.png'}}" />
  27. <text>{{item.likes}}</text>
  28. </view>
  29. <view class="comment" bindtap="catchComment" data-index="{{index}}" data-id="{{item.id}}">
  30. <image src="../../static/index/reply_icon.png" />
  31. <text>{{item.replyCount}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </scroll-view>
  39. <view class="comment_input">
  40. <input name="send_input" adjust-position="{{adjustPosition}}" bindfocus="bindfocus" bindblur="closeblur" class="send_input" confirm-type="hold" focus="{{ifGetFocus}}" value="{{inputValue}}" bindinput="textInput" bindconfirm="sendReply" placeholder="留下你的赞美,鼓励一下。" />
  41. <view class="send_btn" bindtap="sendReply">发送</view>
  42. </view>