comment.wxml 2.5 KB

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