<wxs module="_">
  module.exports.active = function (lastId, id) {
    return lastId === id;
  }
  module.exports.show = function (message, type) {
    return message && message.type === type
  }
   module.exports.returnBottomId = function (index) {
    return "bottom-" + index;
  }
</wxs>
<!--module/chats/components/questionnaire/questionnaire.wxml-->
<block wx:for="{{messages}}" wx:index="{{index}}" wx:key="id">
  <message-again wx:if="{{_.show(item,'again')}}" bind:nextType="nextType" workId="{{workId}}" bind:boxBottom="boxBottom" bind:scroll="scroll"/>
  <message-count wx:elif="{{_.show(item,'count')}}" payload="{{item.payload}}" id="{{item.id}}" active="{{_.active(lastId,item.id)}}" bind:next="handle" /> 
  <message-analysis wx:elif="{{_.show(item,'analysis')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}"
   payload="{{item.payload}}" 
  bind:next="handle"
   messageType="{{messageType}}" />
  <message-consult wx:elif="{{_.show(item,'consult')}}" id="{{item.id}}" active="{{_.active(lastId,item.id)}}" bind:boxBottom="boxBottom" bind:scroll="scroll" bind:consultEvent="handleConsultEvent" />
  <message-follow wx:elif="{{_.show(item,'follow')}}" bind:nextType="nextType" workId="{{workId}}" bind:boxBottom="boxBottom" />
  <message-select wx:elif="{{_.show(item,'select')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
  <message-text wx:elif="{{_.show(item,'text')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
  <message-report wx:elif="{{_.show(item,'report')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" bind:next="handle" />
  <message-system wx:elif="{{_.show(item,'system')}}" active="{{_.active(lastId,item.id)}}" id="{{item.id}}" payload="{{item.payload}}" />
  <view id="{{_.returnBottomId(index)}}" style="height: 10rpx;"></view>
  
</block>