qa.wxml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template name="qa">
  2. <view id="qa" class="clearfix">
  3. <scroll-view scroll-y="true">
  4. <view class="qa-content clearfix">
  5. <view wx:if="{{!qa.length}}" class="no-info">暂无问答</view>
  6. <view wx:for="{{qa}}" wx:key="{{index}}" class="qa-item clearfix">
  7. <view class="avatar">
  8. <image src="{{item.posts.userInfo.avatar}}"></image>
  9. </view>
  10. <view class="msg-wrapper clearfix">
  11. <view class="q-name-wrapper">
  12. <view wx:if="{{item.posts.userInfo.userId != teacherId}}" class="q-name">{{item.posts.userInfo.nickName}}</view>
  13. <view wx:if="{{item.posts.userInfo.userId == teacherId}}" class="q-name teacher">{{item.posts.userInfo.nickName}} 老师</view>
  14. <view class="time">{{item.posts.gmtModified}}</view>
  15. </view>
  16. <view class="question clearfix"><text>{{item.posts.title}}</text></view>
  17. <view class="features">
  18. <view class="praise-wrapper feature-item clearfix">
  19. <view class="{{item.like? 'praised-icon':'praise-icon'}}" bindtap="togglePraise" data-questions_id="{{item.posts.id}}" data-islike="{{item.like}}"></view>
  20. <text class="praise-num">{{item.likeCount}}</text>
  21. </view>
  22. <view class="answer-wrapper feature-item clearfix">
  23. <view class="answer-icon" data-questions_id="{{item.posts.id}}" bindtap="reply"></view>
  24. <text class="answer-num">{{item.posts.replyList? item.posts.replyList.length: 0}}</text>
  25. </view>
  26. <view class="share-wrapper feature-item clearfix" bindtap="share">
  27. <button class="share-icon" open-type="share" plain="true"></button>
  28. </view>
  29. </view>
  30. <view class="answer-wrapper clearfix" wx:for="{{item.posts.replyList}}" wx:for-item="answerItem" wx:key="{{index}}">
  31. <text wx:if="{{answerItem.userInfo.userId == teacherId}}" class="name teacher">{{answerItem.userInfo.nickName}} 老师</text>
  32. <text wx:if="{{answerItem.userInfo.userId != teacherId}}" class="name">{{answerItem.userInfo.nickName}}</text>
  33. <text>:{{answerItem.content}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </scroll-view>
  39. </view>
  40. </template>